2023-11-18 13:40:27 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Inspired by the PHP ActivityPub Library by @Landrok
|
|
|
|
*
|
|
|
|
* @link https://github.com/landrok/activitypub
|
|
|
|
*/
|
|
|
|
|
2023-11-18 15:00:28 +01:00
|
|
|
namespace Activitypub;
|
2023-11-18 13:40:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
2023-11-18 13:42:56 +01:00
|
|
|
* @return string[] An array containing all the supported post types.
|
2023-11-18 13:40:27 +01:00
|
|
|
*/
|
|
|
|
public function get_supported_post_types() {
|
2023-11-18 15:00:28 +01:00
|
|
|
return \get_post_types( ['public' => true], 'names' );
|
2023-11-18 13:40:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name used for registering the transformer with the ActivityPub plugin.
|
|
|
|
*
|
|
|
|
* @since version_number_transformer_management_placeholder
|
2023-11-18 13:42:56 +01:00
|
|
|
*
|
|
|
|
* @return string name
|
2023-11-18 13:40:27 +01:00
|
|
|
*/
|
|
|
|
abstract public function get_name();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the display name for the ActivityPub transformer.
|
|
|
|
*
|
|
|
|
* @since version_number_transformer_management_placeholder
|
2023-11-18 13:42:56 +01:00
|
|
|
*
|
|
|
|
* @return string display name
|
2023-11-18 13:40:27 +01:00
|
|
|
*/
|
|
|
|
abstract public function get_title();
|
|
|
|
}
|