Powered By Blogger
Showing posts with label permalink. Show all posts
Showing posts with label permalink. Show all posts

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' );

Get permalink structure

get_option('permalink_structure')