Making WordPress.org


Ignore:
Timestamp:
11/05/2020 02:21:34 AM (4 years ago)
Author:
dd32
Message:

Support Forums: Redirect the defunct ask-question plugin forum to the how to / troubleshooting forum temporarily, as it's a better user experience when landing there from Google.

See #5238.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r10299 r10428  
    2020        add_action( 'template_redirect',               array( $this, 'redirect_update_php_page' ) );
    2121        add_action( 'template_redirect',               array( $this, 'redirect_legacy_user_structure' ) );
     22        add_action( 'template_redirect',               array( $this, 'redirect_ask_question_plugin_forum' ) );
    2223        add_filter( 'wp_insert_post_data',             array( $this, 'set_post_date_gmt_for_pending_posts' ) );
    2324        add_action( 'wp_print_footer_scripts',         array( $this, 'replace_quicktags_blockquote_button' ) );
     
    311312                exit;
    312313            }
     314        }
     315    }
     316
     317    /**
     318     * Redirect the defunct plugin 'ask-question' to the how to / troubleshooting forum
     319     * as it's a better destination for the users reaching the plugin forum from search engines.
     320     */
     321    public function redirect_ask_question_plugin_forum() {
     322        if (
     323            'plugin' === get_query_var( 'bbp_view' ) &&
     324            'ask-question' === get_query_var( 'wporg_plugin' )
     325        ) {
     326            wp_safe_redirect( home_url( '/forum/how-to-and-troubleshooting/' ) );
     327            exit;
    313328        }
    314329    }
Note: See TracChangeset for help on using the changeset viewer.