Support » Plugin: The SEO Framework » Disable Quick Edit

  • Resolved thekendog

    (@thekendog)


    How do I disable the quick edit functionality? Ideally I want to remove it from certain post types.

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    The filter below will do the trick, and it’ll also remove the bulk-editing features.

    Just be sure to set your excluded post types:

    add_action( 'current_screen', function( $screen ) {
    
    	if ( empty( $screen->id ) ) return;
    
    	$exluded_post_types = [ 'product', 'my_post_type' ];
    	$post_type          = isset( $screen->post_type ) ? $screen->post_type : '';
    
    	// Stop when the post type isn't excluded.
    	if ( ! in_array( $post_type, $exluded_post_types, true ) ) return;
    
    	add_filter( 'manage_' . $screen->id . '_columns', function( $columns ) {
    		unset( $columns['tsf-quick-edit'] );
    		return $columns;
    	}, 11 );
    } );

    Please note that this doesn’t stop the processing of the data, so users may still send custom values via POST. Therefore, this exclusion shouldn’t be considered a security feature; it merely hides the fields from the display.

    Cheers 🙂

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.