Powered By Blogger

Monday, January 9, 2017

When change permalink get notify OR hook for get notification when permalink update in wordpress

https://codex.wordpress.org/Plugin_API/Action_Reference/generate_rewrite_rules



function codex_custom_endpoint( $wp_rewrite ) {
    $feed_rules = array(
   'my-account/?$' => 'index.php?account-page=true',
   'my-account/edit-profile/?$' => 'index.php?account-edit-profile=true',
    );

    $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
    return $wp_rewrite->rules;
}

add_filter( 'generate_rewrite_rules', 'codex_custom_endpoint' );

No comments:

Post a Comment