Yoast\WP\SEO\Routes

Workouts_Route::set_workouts()publicYoast 1.0

Sets the workout configuration.

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

Хуки из метода

Возвращает

WP_REST_Response. the configuration of the workouts.

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

$Workouts_Route = new Workouts_Route();
$Workouts_Route->set_workouts( $request );
$request(WP_REST_Request) (обязательный)
The request object.

Код Workouts_Route::set_workouts() Yoast 19.11

public function set_workouts( $request ) {
	$workouts_data = $request->get_json_params();

	/**
	 * Filter: 'Yoast\WP\SEO\workouts_route_save' - Allows the add-ons to save the options data in their own options.
	 *
	 * @api mixed|null $result The result of the previous saving operation.
	 *
	 * @param array $workouts_data The full set of workouts option data to save.
	 */
	$result = \apply_filters( 'Yoast\WP\SEO\workouts_route_save', null, $workouts_data );

	return new WP_REST_Response(
		[ 'json' => $result ]
	);
}