Support » Plugin: WP eCommerce » Other plugins blocked from loading on product pages

  • In the hook add_action('template_redirect', 'wpsc_all_products_on_page'); (theme.functions.php line 1146), the function wpsc_all_products_on_page calls exit if a product page is being viewed.

    This call to exit causes some hooks at the same priority (10), and all hooks at priorities greater than 10 to not run.

    template_redirect is a very common hook to use for setting up front-end methods, so this may effect a lot of other plugins. But, in my case, I received a support request for Menu Social Icons.

    See .org support request menu-with-e-commerce.

    In that case, filters on WordPress menus were not running because the parent front-end plugin hooks to template_redirect.

    I worked around the issue in my own plugin by setting my template_redirect priority to 5. To avoid conflicting with more plugins, I recommend this change to the link in WPEC:

    // Modify the priority of this hook to be as high as possible, avoiding conflicts with other plugins
    add_action('template_redirect', 'wpsc_all_products_on_page', PHP_INT_MAX );

  • The topic ‘Other plugins blocked from loading on product pages’ is closed to new replies.