wp_post ); switch ( $post_type ) { case 'post': $post_format = \get_post_format( $this->wp_post ); switch ( $post_format ) { case 'aside': case 'status': case 'quote': case 'note': $object_type = 'Note'; break; case 'gallery': case 'image': $object_type = 'Image'; break; case 'video': $object_type = 'Video'; break; case 'audio': $object_type = 'Audio'; break; default: $object_type = 'Article'; break; } break; case 'page': $object_type = 'Page'; break; case 'attachment': $mime_type = \get_post_mime_type(); $media_type = \preg_replace( '/(\/[a-zA-Z]+)/i', '', $mime_type ); switch ( $media_type ) { case 'audio': $object_type = 'Audio'; break; case 'video': $object_type = 'Video'; break; case 'image': $object_type = 'Image'; break; } break; default: $object_type = 'Article'; break; } return $object_type; } /** * 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 ); } }