Add a ACTIVITYPUB_DISABLE_REWRITES
constant (#490)
This commit is contained in:
parent
9907585570
commit
e05176cea5
2 changed files with 7 additions and 0 deletions
|
@ -31,6 +31,7 @@ function define_constants() {
|
||||||
\defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' );
|
\defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' );
|
||||||
\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]" );
|
\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]" );
|
||||||
\defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false );
|
\defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false );
|
||||||
|
\defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false );
|
||||||
|
|
||||||
\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||||
\define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
\define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
||||||
|
|
|
@ -227,6 +227,12 @@ class Activitypub {
|
||||||
* Add rewrite rules
|
* Add rewrite rules
|
||||||
*/
|
*/
|
||||||
public static function add_rewrite_rules() {
|
public static function add_rewrite_rules() {
|
||||||
|
// If another system needs to take precedence over the ActivityPub rewrite rules,
|
||||||
|
// they can define their own and will manually call the appropriate functions as required.
|
||||||
|
if ( ACTIVITYPUB_DISABLE_REWRITES ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! \class_exists( 'Webfinger' ) ) {
|
if ( ! \class_exists( 'Webfinger' ) ) {
|
||||||
\add_rewrite_rule(
|
\add_rewrite_rule(
|
||||||
'^.well-known/webfinger',
|
'^.well-known/webfinger',
|
||||||
|
|
Loading…
Reference in a new issue