Check if the current post type supports ActivityPub. (#570)
* Check if the current post type supports ActivityPub. * Update includes/functions.php Co-authored-by: Jeremy Herve <jeremy@jeremy.hu> * Update functions.php --------- Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
This commit is contained in:
parent
ba44ac701b
commit
8849e7b446
1 changed files with 10 additions and 0 deletions
|
@ -279,6 +279,16 @@ function is_activitypub_request() {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Check if the current post type supports ActivityPub.
|
||||
if ( \is_singular() ) {
|
||||
$queried_object = \get_queried_object();
|
||||
$post_type = \get_post_type( $queried_object );
|
||||
|
||||
if ( ! \post_type_supports( $post_type, 'activitypub' ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// One can trigger an ActivityPub request by adding ?activitypub to the URL.
|
||||
// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration
|
||||
global $wp_query;
|
||||
|
|
Loading…
Reference in a new issue