Skip to content

Instantly share code, notes, and snippets.

@danielck
Created March 23, 2013 01:23
Show Gist options
  • Select an option

  • Save danielck/5225955 to your computer and use it in GitHub Desktop.

Select an option

Save danielck/5225955 to your computer and use it in GitHub Desktop.

Revisions

  1. danielck created this gist Mar 23, 2013.
    11 changes: 11 additions & 0 deletions register-endpoint.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php
    /**
    * Add a new /part/ endpoint. Access the value of part by
    * using get_query_var( 'part' ) in a theme template.
    */
    add_filter( 'init', 'h1ep_add_rules' );
    function h1ep_add_rules() {
    // this will register the endpoint for all WordPress URLs
    add_rewrite_endpoint( 'part', EP_ALL );
    }
    ?>