• Resolved walid91

    (@walid91)


    Hi,

    I use your plugin to generate a “%post_id%” instead of the title.

    The problem I have is when I want to create a new list and then edit the list before continuing (send the list to the admin)

    With the Permalink Manager plugin enabled, when I want to edit the list before sending it, the form is empty and I have to rewrite the whole list again.

    When the plugin is disabled, I can edit the list without rewriting the whole form.

    See here: https://ibb.co/55w88WS

    I hope I have made myself clear.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @walid91,

    As for now there is no 100% reliable solution that would allow Permalink Manager to recognize Directorist front-end pages. You can try however to use the below code snippet to make Permalink Manager ignore the Directorist pages:

    function pm_fix_directorist_endpoints($query, $old_query, $uri_parts, $pm_query, $content_type) {
    	if(class_exists('Directorist_Base') && !empty($old_query['atbdp_action'])) {
    		$query['do_not_redirect'] = 1;
    	}
    
    	return $query;
    }
    add_action('permalink_manager_filter_query', 'pm_fix_directorist_endpoints', 5, 5);
    
    function pm_exclude_directorist_pages( $excluded_ids ) {
    	if ( class_exists( 'Directorist_Base' ) ) {
    		$directorist_options = get_option( 'atbdp_option' );
    
    		if ( is_array( $directorist_options ) ) {
    			$directorist_pages = array( 'search_listing', 'search_result_page', 'add_listing_page', 'all_listing_page', 'single_category_page', 'single_location_page', 'single_tag_page', 'author_profile_page', 'user_dashboard', 'custom_registration', 'user_login' );
    
    			foreach ( $directorist_pages as $pagename ) {
    				if ( ! empty( $directorist_options[ $pagename ] ) && is_numeric( $directorist_options[ $pagename ] ) ) {
    					$excluded_ids[] = $directorist_options[ $pagename ];
    				}
    			}
    		}
    	}
    
    	return $excluded_ids;
    }
    add_filter( 'permalink_manager_excluded_post_ids', 'pm_exclude_directorist_pages' );

    Best regards,
    Maciej

    Thread Starter walid91

    (@walid91)

    Hi,

    I included the code you sent me and it works great.

    But I didn’t understand your sentence that says:

    You can try however to use the below code snippet to make Permalink Manager ignore the Directorist pages

    I use your plugin to generate a “%post_id%” and it works perfectly with the directorist plugin.

    Plugin Author Maciej Bis

    (@mbis)

    Hi @walid91,

    I briefly analyzed the backend code of Directorist plugin and it uses a set of additional rewrite rules that by default are not recognizable by Permalink Manager. In order to make them working correctly the snippet I sent you makes Permalink Manager ignore the custom pages used by Directorist (eg. “Add listing”, “Dashboard”, “All listings”, etc.).

    Thread Starter walid91

    (@walid91)

    Okay, I got it, for now the problem I’m having is on the “Add listing” page only.

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem / conflict with the Directorist plugin’ is closed to new replies.