Making WordPress.org


Ignore:
Timestamp:
07/30/2021 03:52:36 PM (3 years ago)
Author:
ryelle
Message:

Pattern Directory: Sync with git WordPress/pattern-directory@fa8cba8d36fa073e0a6c4434440bc526a1655e3c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-patterns/functions.php

    r11159 r11164  
    8686                rawurlencode( wp_json_encode( array(
    8787                    'userId' => get_current_user_id(),
     88                    'currentAuthorName' => esc_html( get_the_author_meta( 'display_name' ) ),
    8889                ) ) ),
    8990            ),
     
    202203
    203204/**
    204  * Add the "My Patterns" status rewrites.
    205  * This will redirect `my-patterns/draft`, `my-patterns/pending` etc to use the My Patterns page.
     205 * Add rewrites needed for nested page navigation.
     206 * - `my-patterns/<status>` will render the My Patterns page.
     207 * - `favorites/categories/<cat>` will render the Favorites page.
     208 * - `author/<username>/categories/<cat>` will render the author archive.
    206209 */
    207210function add_rewrite() {
    208211    add_rewrite_rule( '^my-patterns/[^/]+/?$', 'index.php?pagename=my-patterns', 'top' );
    209212    add_rewrite_rule( '^favorites/.+/?$', 'index.php?pagename=favorites', 'top' );
     213    add_rewrite_endpoint( 'categories', EP_AUTHORS );
    210214}
    211215
Note: See TracChangeset for help on using the changeset viewer.