• Resolved Chriris

    (@chriris)


    Thanks for your plugin, it’s great !

    Do you know if it’s possible to exclude duplicate functionnality for specfic post_type?

    If yes, it exists a hook to add in functions file.

    For next release, should be possible to add checkbox options post_type inside back-office?
    /wp-admin/tools.php?page=mtphr_post_duplicator_settings_menu

    https://wordpress.org/plugins/post-duplicator/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author metaphorcreations

    (@metaphorcreations)

    You should be able to add this to your functions.php file:

    function my_custom_action_row( $actions, $post ){
    
    	// Get the post type object
    	$post_type = get_post_type_object( $post->post_type );
    
    	if( $post_type == 'my_post_type' && isset($actions['duplicate_post']) ) {
    		unset( $actions['duplicate_post'] );
    	}
    	return $actions;
    }
    add_filter( 'post_row_actions', 'my_custom_action_row', 20, 2 );
    add_filter( 'page_row_actions', 'my_custom_action_row', 20, 2 );
    Thread Starter Chriris

    (@chriris)

    Thanks for all! it works properly ^^

    I change a little thing using an array to list easily several post_type.

    $hide_for_posttype = array('post_type_A','post_type_B','post_type_C');
    	if( (in_array($post->post_type, $hide_for_posttype)) && isset($actions['duplicate_post']) ) {
    		unset( $actions['duplicate_post'] );
    	}
    Plugin Author metaphorcreations

    (@metaphorcreations)

    You’re welcome! Glad it’s workout out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate functionnality limited by post_type’ is closed to new replies.