Automattic\WooCommerce\Admin\API

Marketing::get_knowledge_base_posts()publicWC 1.0

Return installed marketing extensions data.

Метод класса: Marketing{}

Хуков нет.

Возвращает

\WP_Error|\WP_REST_Response.

Использование

$Marketing = new Marketing();
$Marketing->get_knowledge_base_posts( $request );
$request(\WP_REST_Request) (обязательный)
Request data.

Код Marketing::get_knowledge_base_posts() WC 8.9.0

public function get_knowledge_base_posts( $request ) {
	/**
	 * MarketingSpecs class.
	 *
	 * @var MarketingSpecs $marketing_specs
	 */
	$marketing_specs = wc_get_container()->get( MarketingSpecs::class );

	$category = $request->get_param( 'category' );
	return rest_ensure_response( $marketing_specs->get_knowledge_base_posts( $category ) );
}