https://github.com/PressForward/pressforward
Raw File
Tip revision: b1a70484967c92313e214ddcbd9578f9dcac19b0 authored by Boone B Gorges on 19 January 2023, 01:45:41 UTC
AllowDynamicProperties in Readability.
Tip revision: b1a7048
FeedEndpoint.php
<?php
namespace PressForward\Core\API;

use Intraxia\Jaxion\Contract\Core\HasActions;
use Intraxia\Jaxion\Contract\Core\HasFilters;

use PressForward\Controllers\Metas;
use PressForward\Core\API\APIWithMetaEndpoints;

use WP_Ajax_Response;

class FeedEndpoint extends APIWithMetaEndpoints implements HasActions, HasFilters {

	protected $basename;
	public $metas;
	public $post_type;
	public $level;

	function __construct( Metas $metas ) {
		$this->metas     = $metas;
		$this->post_type = pressforward( 'schema.feeds' )->post_type;
		$this->level     = 'feed';
	}


	public function action_hooks() {
		$actions = array(
			array(
				'hook'   => 'rest_api_init',
				'method' => 'register_rest_post_read_meta_fields',
			),
		);
		return $actions;
	}

	public function filter_hooks() {
		$filter = array(
			array(
				'hook'     => 'rest_prepare_' . $this->post_type,
				'method'   => 'filter_wp_to_pf_in_terms',
				'priority' => 10,
				'args'     => 3,
			),
		);
		return $filter;
	}

	public function filter_in_nomination_count( $data, $post, $request ) {
		return $data;
	}


}
back to top