you can check what post type is calling the ‘save_post’ action
try:
public function save() {
global $post;
if (!$post->post_type="video"){
$my_child = array(
'post_title' => $this->_child_type,
'post_content' => "test content",
'post_status' => 'publish',
'post_type' => "video",
'post_parent'=> 55
);
$nindex = wp_insert_post($my_child);
}
}
add_action('save_post', array(&$this, 'save'));
Related Posts:
- Row actions not showing? Why?
- How to append element after thumbnail
- Dynamic Custom Post Type Plugin
- Get rewrite slug of custom post type in template
- Admin notice not displaying
- How to customize a permalink (URL) structure?
- Use custom metabox to update automatically a post after a given date
- Show current custom taxonomy
- How exclude or skip post type with get_next_post_link
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- How do I add custom HTML to the content of an archive page’s posts?
- Validate Custom Post Type fields
- Custom post type page with parameter
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- How to show the post which checkbox is not selected
- Is it possible to get the specific content on the search page?
- Plugin Development using classes – Public & Private Callbacks
- Having issue on Loading Meta Data From CSV to CPT
- How to dynamically register custom post type
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Search that will look in custom field, post title and post content
- Date archives for custom post type
- If featured image doesn’t exist, show post content
- Is flush_rewrite_rules necessary when creating a custom post type? Why?
- How do I redirect all 404 errors of a specific post type to another URL?
- How to save the checked boxes?
- Error after deleting Custom Post Type with a function (no trash used)
- Using posts and postmeta table to store custom Address Book Plugin data
- template_redirect not working, apparently for no reason
- Append taxonomy terms as class names in markup?
- Change message given when deleting post from custom post type
- Using WPAlchemy metabox values in another metabox
- Custom Post Type | Fatal Error on register_post_type()
- GravityForm: Populate Dropdown with custom post type [closed]
- How to output wordpress custom tags separated by comma?
- Custom Post Type rewrite
- Dynamic page outside WordPress
- Custom query to filter posts that have current post as a taxonomy [closed]
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Custom Post Type Loop throws 500 error when used in widget
- custom post type not showing in menu
- Received nothing after executing AJAX post function
- Adding a custom post type taxonomy template in plugin
- Plugin: register custom post types, child ready and performance best practices
- I need to add endpoint for wordpress categories
- Getting meta in editor plugin, and event triggering issue
- Categorize custom post type
- Hide a widget inside a div on specific type of post
- How to use TinyMCE Editor for one of my custom post meta field?
- How to import a custom MySQL DB table into a WordPress custom post type
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Foreach inside shortcode not working as planned
- Displaying custom field according to date
- how to echo meta tag in header using php
- PHP question: how to combine syntax?
- How to add and clear custom post types and taxonomies in a plugin? Considerations for existing data
- post_parent in custom post type
- Dynamically insert code to custom post type loop
- widget_posts_args not using the number of posts in widget
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Undefined $post in wp_query
- How to add query args to links to CPT admin submenu
- Importing JSON feed giving Notice: Array to string conversion error
- How to add and display custom content that is not a post
- List latest post out of 2 custom post types
- Problem with adding custom post type meta to header by plugin
- Creating alternate meta box context locations
- Fetch data from two custom post types and create multidimensional array for output to html table
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- How to get the custom post data using post id in WordPress?
- See if the email exists or not
- On saving Post My permalink is updated and category is removed automatically which cause the 404
- Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?
- How can i display a taxonomy? i have created a plugin and then a custom type. and a taxonomy , also i have register it
- How to add specific terms in a custom post type?
- WordPress Custom Post Loop
- Limit custom post type to the authors only on front-end!
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- programmatically generated custom post type is created more than once
- ‘Simple’ Reservation System
- Create posts inside CPT post
- Taxonomies are not showing in the category dropdown
- Combine multiple separate lists into one
- Show Post columns to specific users on condition
- Custom Taxonomy – fields
- Custom Post type plugin is using theme single.php and style.css
- Print post category name from a custom post type wordpress
- CPT post doesnt shows tags and category on backend admin page
- How to make sure, that only the selected post is changing?
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Registering an optional custom post type from a plugin
- Get month and day from a Date Picker custom field
- Generate custom RSS from a plugin
- Select Menu for Custom post Type does not save
- is_singular won’t call my functions?
- Inserting two categories
- Comments are not working on Custom Post Type
- Custom post type is_singular condtional not working when managing sidebar display
- How to consume external API from WordPress post editor and display the response data in the custom field?