Your code works fine for me as-is, assuming you actually have a video
post type, however there are a couple of things you can correct-
-
shortcodes should
return
their value, otherwise you will see shortcode content appear before any post content, not where you actually placed the shortcode. -
do_action('wp_insert_post', 'wp_insert_post');
is unnecessary,wp_insert_post
already does that action within the function, so you’re invoking it twice.
Related Posts:
- Is there a way to get N number of WYSIWYG editors in a custom post type?
- Change “Enter Title Here” help text on a custom post type
- Multiple custom post types under one admin menu
- CPT Template Not Showing – Getting 404
- Random post, once per day
- Prevent Google from indexing custom post types?
- How to throw error to user when saving post
- Remove Trash / Delete option for Custom Post Type / Taxonomy
- Display text if current user has written 1 or more posts in a custom post type
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- Count post that have specific meta value
- Remove date and category filters when editing custom post types
- Display all custom post types in archives.php
- Compare 3 custom fields and sort by oldest
- How to select one major category (or custom taxonomy) for a custom post type?
- Custom taxonomy & post slug permalink
- how to use two permalinks for one custom post type
- sort events based on event date custom field
- How to add page attribute “Template” to custom post
- Child and grandchild taxonomy listings – 404
- Filters post in admin with dropdown select, custom post type
- Display posts if a custom field value is equal to another custom field value
- Remove default post types on all sites except primary blog. WPMU
- Relationship between two taxonomies and a custom post type [closed]
- Why is archive.php used for my page
- next_post_link on custom taxonomy
- Why is my Custom Post Type not showing up after adding capabilities?
- Create Template for Custom Post Type same like for Page
- Remove single page for custom post type
- Custom fields vs. Custom post types for a Portfolio Website
- How to check post type (to include custom css)
- wp_insert_term in a multisite installation
- register_post_type name character limit
- Custom loop with multiple taxonomy queries
- AJAX load more for different custom post type loops
- Add custom ID to CPT posts only create not update
- How to do WP_Query with two meta fields with orderby clause
- WP CPT template not found when another CPT is active/public = true
- Custom query at top of archive search page, arguments are overridden
- Cannot save CPT meta box
- How to make permalink structure %category%/%postname%/ work for custom post type?
- Display custom post function ONLY if it has a value [closed]
- Set templates for custom post types
- Main query not querying any posts in custom taxonomy template
- Tags not working in my custom post type
- wp_trash_post action hook with custom post type
- Return the name of the post type
- After creating Custom post type by user delete old one
- How to show my post type TEAM in dynamic way?
- Set parent for custom post type archive rewrite url
- How to rewrite the beginning and end of the permalink structure in a custom post type?
- Custom sidebar for custom post type
- Custom wordpress loop
- page template with custom post type loop case page duplication
- ACF Relationship Posts how to show additional content
- Display next 3 posts based on custom taxonomy
- Change Post Meta via AJAX from the posts list table
- WordPress custom posts and permalinks
- How to create Custom image post?
- Weird issue where form field loses focus to previous form field even with JS disabled
- Display latest post of taxonomy
- Translate website without duplicate custom post
- posts_per_page in custom WP_Query does not override “Reading” settings?
- How To Read Read Custom Post Type Data in Headless CMS Mode
- Set Post Private if no linked Post Objects (ACF)
- Show in an entry a Custom Post Type associated to a post
- WordPress shows after migration
- How to display custom field in product description?
- Show code dependant on CPT & category
- Add custom template ‘sub-page’ to Custom Post type?
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- SEARCH QUERIES – REVERSE OUTPUT
- How can I check the rewrite slug of current post type listing page
- Subset of Custom Post Type From Admin Menu Based on Meta Data
- Media is not showing on post page
- How to save post_status using action save_post?
- How to get the posts that my following users are liked?
- How to insert post 6 times after user register like ask.fm
- Not Able to List CPT Based on Taxonomy Term
- Edit custom post type page with ACF repeater fields throws ‘Service Unavailable’ error
- Redirect sub-page URLs to parent without changing URL
- Filter Term By Parent Term – Custom Post Type
- Storing data in a multidimensional array from dynamically generated foreach loop
- How to decouple custom post types components from template?
- Custom post type cannot access child page
- Insert custom post type via XML-RPC?
- CPT or Custom Table for Repository of Serial Numbers
- Changing custom post_type when publishing
- erase post excerpt limitation [×]
- Using $seed on a custom post type for randomly displayed posts
- Pop up showing same content on all posts display.
- Collection of fields in a single post
- Display and Allow users to edit their own profiles
- Get result from Custom Field in Custom Post type
- Building a List of Posts grouped by custom taxonomy as the section header only to be displayed if at least one post is in that tax
- Problem with a query in custom posts
- Custom post-type’s pagination not working in category.php
- Are custom posts included when getting a categories’ posts?
- How to get lowest price from custom fields of posts
- 404 Error On Custom Taxonomy Pages 2, 3, etc