Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • rubybot

    (@rubybot)

    oops forgot to mention. If you have access to your themes functions.php file the above code will go in there. ??

    rubybot

    (@rubybot)

    I came across this upon install too, I use Advanced Custom Fields and it too has a native ‘Duplicate’ action. I was able to exclude the Post Duplicator buttons/link by doing the following.

    
    function excludeDuplicatorAction($actions, $post){
    	
    	$postType = get_post_type();
    	if(in_array($postType , array('acf-field-group'))):
    		if(isset($actions['duplicate_post'])):
    			unset($actions['duplicate_post']);
    		endif;
    	endif;
    
    	return $actions;
    }
    add_filter( 'post_row_actions', 'excludeDuplicatorAction', 11, 2 );
    add_filter( 'page_row_actions', 'excludeDuplicatorAction', 11, 2 );	
    
    add_action('pre_get_posts' , function(){
    	global $post;
    	$postType = get_post_type($post);
    	if(in_array($postType , array('acf-field-group'))):
    		remove_action('post_submitbox_misc_actions' , 'mtphr_post_duplicator_submitbox');
    	endif;
    
    },10);
    
    
Viewing 2 replies - 1 through 2 (of 2 total)