|
true ), 'objects' );
$transformer_mapping = \get_option( 'activitypub_transformer_mapping', array( 'default' => 'note' ) );
// DUMMY CODE for developing:
class Transformer {
protected $name;
protected $supported_post_types;
protected $label;
public function __construct(string $name, $label, array $supported_post_types) {
$this->name = $name;
$this->label = $label;
$this->supported_post_types = $supported_post_types;
}
public function get_name() {
return $this->name;
}
public function get_label() {
return $this->label;
}
public function get_settings_page() {
return 'https://event-federation.eu';
}
public function get_info_text() {
return 'this is some generic info';
}
public function supports_post_type($post_type) {
return in_array($post_type, $this->supported_post_types);
}
}
$all_public_post_type_names = array_map(function ($object) {
return $object->name;
}, $all_public_post_types);
$transformer1 = new Transformer('default', 'Built-In', $all_public_post_type_names);
$transformer2 = new Transformer('tribe', 'The Events Calendar', array('tribe_events'));
$transformer3 = new Transformer('generic_event', 'Event', array('tribe_events', 'custom_event'));
$transformers = array($transformer1, $transformer2, $transformer3);
// END OF DUMMY CODE
?>
|