Support » Plugin: Front-end Editor » [Plugin: Front-end Editor] edit only custom post types

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author scribu

    (@scribu)

    Yes, by adding this code in your functions.php file:

    function fee_restrict_post_types( $allow, $data ) {
    	$allowed_post_types = array( 'page', 'foo' );
    
    	$current_post_type = get_post_type( $data['post_id'] );
    
    	return $allow && in_array( $current_post_type, $allowed_post_types );
    }
    add_filter( 'front_end_editor_allow_post', 'fee_restrict_post_types', 10, 2 );

    Obviously, change $allowed_post_types to what you need.

    Thanks Scribu – works great of course…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Front-end Editor] edit only custom post types’ is closed to new replies.