do_action_ref_array( 'generate_rewrite_rules', WP_Rewrite $this )

Fires after the rewrite rules are generated.


Parameters Parameters

$this

(WP_Rewrite) Current WP_Rewrite instance (passed by reference).


Top ↑

More Information More Information

Triggers after all rewrite rules have been created. The rewrite object is passed as argument by reference.


Top ↑

Source Source

File: wp-includes/class-wp-rewrite.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by stevenlinx

    Example migrated from Codex:

    An example of adding new endpoint to Rewrite Rules.

    function site_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', 'site_custom_endpoint' );
    

Top ↑

You must log in before being able to contribute a note or feedback.