Support » Plugin: BNE Testimonials » Filter bne_testimonials_cpt_args no longer working

  • Resolved franciscus

    (@franciscus)


    I used the ‘bne_testimonials_cpt_args’ filter to define a custom slug, etc.
    That doesn’t seem to be supported in version 2.0.
    Is there a workaround?

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

    (@bluenotes)

    Ah, you’re right. That did get cut when I re-wrote it. Sorry about that. You can do the same thing using the built-in WP filter, register_post_type_args

    add_filter( 'register_post_type_args', function( $args, $post_type ) {
    	if( 'bne_testimonials' === $post_type ) {
    		$args['public'] = true;
    		$args['publicly_queryable'] = true;
    		$args['rewrite']['slug'] = 'name_of_slug';
    	}
    
    	return $args;	
    }, 10, 2 );
    

    Thanks! I was already in the process of trying that, but couldn’t get it to work because I hadn’t included
    $args[‘publicly_queryable’] = true;
    (which was not required before).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter bne_testimonials_cpt_args no longer working’ is closed to new replies.