Merge pull request #256 from toolstack/fix-rewrite-rules
Move the activitypub endpoint rule to the main rewrite addition function
This commit is contained in:
commit
0498433ce7
2 changed files with 2 additions and 8 deletions
|
@ -116,6 +116,8 @@ function add_rewrite_rules() {
|
|||
\add_rewrite_rule( '^.well-known/nodeinfo', 'index.php?rest_route=/activitypub/1.0/nodeinfo/discovery', 'top' );
|
||||
\add_rewrite_rule( '^.well-known/x-nodeinfo2', 'index.php?rest_route=/activitypub/1.0/nodeinfo2', 'top' );
|
||||
}
|
||||
|
||||
\add_rewrite_endpoint( 'activitypub', EP_AUTHORS | EP_PERMALINK | EP_PAGES );
|
||||
}
|
||||
\add_action( 'init', '\Activitypub\add_rewrite_rules', 1 );
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ class Activitypub {
|
|||
public static function init() {
|
||||
\add_filter( 'template_include', array( '\Activitypub\Activitypub', 'render_json_template' ), 99 );
|
||||
\add_filter( 'query_vars', array( '\Activitypub\Activitypub', 'add_query_vars' ) );
|
||||
\add_action( 'init', array( '\Activitypub\Activitypub', 'add_rewrite_endpoint' ) );
|
||||
\add_filter( 'pre_get_avatar_data', array( '\Activitypub\Activitypub', 'pre_get_avatar_data' ), 11, 2 );
|
||||
|
||||
// Add support for ActivityPub to custom post types
|
||||
|
@ -96,13 +95,6 @@ class Activitypub {
|
|||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add our rewrite endpoint to permalinks and pages.
|
||||
*/
|
||||
public static function add_rewrite_endpoint() {
|
||||
\add_rewrite_endpoint( 'activitypub', EP_AUTHORS | EP_PERMALINK | EP_PAGES );
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule Activities.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue