Support » Plugin: Lana Downloads Manager » Prevent lana_download post type from being altered by Permalink settings

  • Resolved Cat

    (@stitchyrocks)


    Hello,

    When I customized my permalink settings (to something like http://www.mysite.com/blog/post-name) I noticed that the lana_download post type also gets the /blog/ in front of its usual structure. I only want the permalink change to happen for blog posts, not my downloads.

    I read that you have to add 'rewrite' => array( 'with_front' => false ) when you register the custom post type to prevent this from happening. How would I go about making this change?

    Thank you!

Viewing 1 replies (of 1 total)
  • Plugin Author Lana Codes

    (@lanacodes)

    Hi,

    Please update plugin to 1.2.1 version because this version includes the post type args filter.

    After update, add this code to the active theme functions.php:

    /**
     * Lana Downloads Manager
     * change rewrite
     * 
     * @param $lana_download_post_type_args
     *
     * @return mixed
     */
    function lana_downloads_manager_change_rewrite_lana_download_post_type_args( $lana_download_post_type_args ) {
    
    	$lana_download_post_type_args['rewrite']['with_front'] = false;
    
    	return $lana_download_post_type_args;
    }
    
    add_filter( 'lana_downloads_manager_lana_download_post_type_args', 'lana_downloads_manager_change_rewrite_lana_download_post_type_args' );
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent lana_download post type from being altered by Permalink settings’ is closed to new replies.