WordPress.org

Forums

Business Directory Plugin
[resolved] wp_title() rewriting issue (3 posts)

  1. julie92500
    Member
    Posted 2 years ago #

    I had an issue. The plugin was rewriting the wp_title, especially for the tags pages

    I made one modification in _handle_action

    public function _handle_action($query) {
            // workaround WP issue #16373
            if ( (get_query_var('page_id') == wpbdp_get_page_id('main')) &&
                 (wpbdp_get_page_id('main') == get_option('page_on_front')) )
                $action = wpbdp_getv($_GET, 'action', 'main');
            else
                $action = get_query_var('action');
    
            if (get_query_var('page_id') == wpbdp_get_page_id('main')) {
             if (get_query_var('category_id') || get_query_var('category')) $action = 'browsecategory';
             if (get_query_var('tag')) $action = 'browsetag';
             if (get_query_var('id') || get_query_var('listing')) $action = 'showlisting';
    
             if (!$action) $action = 'main';
            }
            $this->action = $action;
       }

    by setting $action only current page is a business directory one. Especially to avoid 'tagbrowse' action on regular tag page.

    Rgds,

    http://wordpress.org/extend/plugins/business-directory-plugin/

  2. businessdirectoryplugin
    Member
    Plugin Author

    Posted 2 years ago #

    This may explain a bug/conflict we've been having with our sister plugin AWPCP. I'll make sure my developer is aware of it. Thanks for the report!

  3. julie92500
    Member
    Posted 2 years ago #

    not sure this workaround will work for everybody and in any case.

    especially i'm not sure about the "$action = get_query_var('action');" purpose which can setup some value in the $action variable and then trigger also some title rewriting later.

    and i'm not sure that my test condition "if (get_query_var('page_id') == wpbdp_get_page_id('main'))" will cover all the cases.

    my only advise is that you have to manage your plugin behaviour only on the plugin pages. so you have to check such title rewriting is triggered only on WPBDP pages.

    Rgds,

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Business Directory Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.