• Resolved tezalsec

    (@tezalsec)


    Hi, thanks for a great plugin.

    I am aware of the filter ‘vczapi_cpt_slug’, helping to change the slug. But I also wish to change the second parameter of the rewrite aspect, which is the “with_front” value. I have the default post slug before the ‘zoom’ slug now, and I want it gone, so only /zoom/ remains.

    The ‘with_front’ value defaults to true, and I want to set it to false, but there is no filter to do this in your plugin. Is there any solution without hacking the plugin, or could you add this filter, please?

    The result would be then:
    “rewrite” => array( “slug” => “zoom”, “with_front” => false ),

    Thank you. Cheers.

    • This topic was modified 2 years, 9 months ago by tezalsec.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi @tezalsec,

    There aren’t any filters from the zoom plugin itself to change.
    But you can do this with the filter “register_post_type_args”

    register_post_type_args

    function cm_20220527_modify_zoom_post_type_args( $args, $post_type ) {
    	if ( $post_type == 'zoom-meetings' ) {
     		if ( isset( $args['rewrite'] ) ) {
    			$args['rewrite']['with_front'] = false;  
    		}
    	}
    
    	return $args;
    }
    
    add_filter( 'register_post_type_args', 'cm_20220527_modify_zoom_post_type_args', 10, 2 );

    The filter allows you to change post_type argruments. Once the above code is added, you will need to flush the permalinks.

    I hope this helps.

    Thread Starter tezalsec

    (@tezalsec)

    That worked perfectly, thanks! ??

    Did not realize WP offered this solution itself, good to know.

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Glad everything’s worked out.
    Happy coding.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing slug with_front parameter’ is closed to new replies.