File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ function define_constants() {
3131 \defined ( 'ACTIVITYPUB_USERNAME_REGEXP ' ) || \define ( 'ACTIVITYPUB_USERNAME_REGEXP ' , '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+)) ' );
3232 \defined ( 'ACTIVITYPUB_CUSTOM_POST_CONTENT ' ) || \define ( 'ACTIVITYPUB_CUSTOM_POST_CONTENT ' , "<strong>[ap_title]</strong> \n\n[ap_content] \n\n[ap_hashtags] \n\n[ap_shortlink] " );
3333 \defined ( 'ACTIVITYPUB_AUTHORIZED_FETCH ' ) || \define ( 'ACTIVITYPUB_AUTHORIZED_FETCH ' , false );
34+ \defined ( 'ACTIVITYPUB_DISABLE_REWRITES ' ) || \define ( 'ACTIVITYPUB_DISABLE_REWRITES ' , false );
3435
3536 \define ( 'ACTIVITYPUB_PLUGIN_DIR ' , plugin_dir_path ( __FILE__ ) );
3637 \define ( 'ACTIVITYPUB_PLUGIN_BASENAME ' , plugin_basename ( __FILE__ ) );
Original file line number Diff line number Diff line change @@ -227,6 +227,12 @@ public static function untrash_post( $post_id ) {
227227 * Add rewrite rules
228228 */
229229 public static function add_rewrite_rules () {
230+ // If another system needs to take precedence over the ActivityPub rewrite rules,
231+ // they can define their own and will manually call the appropriate functions as required.
232+ if ( ACTIVITYPUB_DISABLE_REWRITES ) {
233+ return ;
234+ }
235+
230236 if ( ! \class_exists ( 'Webfinger ' ) ) {
231237 \add_rewrite_rule (
232238 '^.well-known/webfinger ' ,
You can’t perform that action at this time.
0 commit comments