Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress plugin public page

public function mypage_rewrite_ext() {
    global $wp_rewrite;
    $plugin_url = plugins_url( 'mypage.php', __FILE__ );
    $plugin_url = substr( $plugin_url, strlen( home_url() ) + 1 );
    // The pattern is prefixed with '^'
    // The substitution is prefixed with the "home root", at least a '/'
    // This is equivalent to appending it to `non_wp_rules`
    $wp_rewrite->add_external_rule( 'mypage$', $plugin_url );
}
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #wordpress #plugin #public #page
ADD COMMENT
Topic
Name
2+6 =