Skip to content

Function

Add rewrite rules for TML.

tml_add_rewrite_rules( )

Source

function tml_add_rewrite_rules() {
    if ( ! tml_use_permalinks() ) {
        return;
    }
    foreach ( tml_get_actions() as $action ) {
        $url  = 'index.php?action=' . $action->get_name();
        $page = tml_action_has_page( $action );
        if ( $page ) {
            $url .= '&pagename=' . get_page_uri( $page );
        }
        add_rewrite_rule( tml_get_action_slug( $action ) . '/?$', $url, 'top' );
    }
}

Uses

Changelog

VersionDescription
7.0 Introduced.