wordpress-activitypub/includes/base/class-transformer-base.php
2023-11-18 13:42:56 +01:00

49 lines
No EOL
1.2 KiB
PHP

<?php
/**
* Inspired by the PHP ActivityPub Library by @Landrok
*
* @link https://github.com/landrok/activitypub
*/
namespace Activitypub\Activity;
use WP_Error;
use ReflectionClass;
use function Activitypub\camel_to_snake_case;
use function Activitypub\snake_to_camel_case;
/**
* Base class to implement WordPress to ActivityPub transformers.
*/
abstract class Transformer_Base {
/**
* Get the supported WP post_types that the transformer can use as an input.
*
* By default all post types are supported.
*
* @since version_number_transformer_management_placeholder
* @return string[] An array containing all the supported post types.
*/
public function get_supported_post_types() {
return \get_post_types( array(), 'names');
}
/**
* 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_title();
}