true ), 'names' ); } /** * Get the name of the plugin that registered the transformer. * * @see Forked from the WordPress elementor plugin. * * @since version_number_transformer_management_placeholder * @return string Plugin name */ private function get_plugin_name_from_transformer_instance( $transformer ) { $class_reflection = new \ReflectionClass( $transformer ); $plugin_basename = plugin_basename( $class_reflection->getFileName() ); $plugin_directory = strtok( $plugin_basename, '/' ); $plugins_data = get_plugins( '/' . $plugin_directory ); $plugin_data = array_shift( $plugins_data ); return $plugin_data['Name'] ?? esc_html__( 'Unknown', 'activitypub' ); } /** * Return whether the transformer supports a post type. * * @since version_number_transformer_management_placeholder * * @return string post_type Post type name. */ final public function supports_post_type( $post_type ) { return in_array( $post_type, $this->get_supported_post_types() ); } /** * Get the name used for registering the transformer with the ActivityPub plugin. * * @since version_number_transformer_management_placeholder * * @return string name */ abstract public function get_name(); /** * Get the display name for the ActivityPub transformer. * * @since version_number_transformer_management_placeholder * * @return string display name */ abstract public function get_label(); }