fix: make in_array comparison strict

This commit is contained in:
André Menrath 2023-11-25 10:27:11 +01:00
parent 81f971b477
commit 8338ea4570

View file

@ -93,7 +93,7 @@ abstract class Base {
* @return string post_type Post type name. * @return string post_type Post type name.
*/ */
final public function supports_post_type( $post_type ) { final public function supports_post_type( $post_type ) {
return in_array( $post_type, $this->get_supported_post_types() ); return in_array( $post_type, $this->get_supported_post_types(), true );
} }
/** /**
@ -163,6 +163,26 @@ abstract class Base {
return $content; return $content;
} }
/**
* Gets the template to use to generate the content of the activitypub item.
*
* @return string The Template.
*/
protected function get_post_content_template() {
if ( 'excerpt' === \get_option( 'activitypub_post_content_type', 'content' ) ) {
return "[ap_excerpt]\n\n[ap_permalink type=\"html\"]";
}
if ( 'title' === \get_option( 'activitypub_post_content_type', 'content' ) ) {
return "[ap_title]\n\n[ap_permalink type=\"html\"]";
}
if ( 'content' === \get_option( 'activitypub_post_content_type', 'content' ) ) {
return "[ap_content]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]";
}
return \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT );
}
/** /**
* Returns the ID of the Post. * Returns the ID of the Post.