Yoast\WP\SEO\Routes

First_Time_Configuration_Route::register_routes()publicYoast 1.0

Registers routes with WordPress.

{} Это метод класса: First_Time_Configuration_Route{}

Хуков нет.

Возвращает

null. Ничего.

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

$First_Time_Configuration_Route = new First_Time_Configuration_Route();
$First_Time_Configuration_Route->register_routes();

Код First_Time_Configuration_Route::register_routes() Yoast 19.2

public function register_routes() {
	$site_representation_route = [
		'methods'             => 'POST',
		'callback'            => [ $this, 'set_site_representation' ],
		'permission_callback' => [ $this, 'can_manage_options' ],
		'args'                => [
			'company_or_person' => [
				'type'     => 'string',
				'enum'     => [
					'company',
					'person',
				],
				'required' => true,
			],
			'company_name' => [
				'type'     => 'string',
			],
			'company_logo' => [
				'type'     => 'string',
			],
			'company_logo_id' => [
				'type'     => 'integer',
			],
			'person_logo' => [
				'type'     => 'string',
			],
			'person_logo_id' => [
				'type'     => 'integer',
			],
			'company_or_person_user_id' => [
				'type'     => 'integer',
			],
			'description' => [
				'type'     => 'string',
			],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::SITE_REPRESENTATION_ROUTE, $site_representation_route );

	$social_profiles_route = [
		'methods'             => 'POST',
		'callback'            => [ $this, 'set_social_profiles' ],
		'permission_callback' => [ $this, 'can_manage_options' ],
		'args'                => [
			'facebook_site' => [
				'type'     => 'string',
			],
			'twitter_site' => [
				'type'     => 'string',
			],
			'other_social_urls' => [
				'type'     => 'array',
			],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::SOCIAL_PROFILES_ROUTE, $social_profiles_route );

	$person_social_profiles_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_person_social_profiles' ],
			'permission_callback' => [ $this, 'can_manage_options' ],
			'args'                => [
				'user_id' => [
					'required' => true,
				],
			],
		],
		[
			'methods'             => 'POST',
			'callback'            => [ $this, 'set_person_social_profiles' ],
			'permission_callback' => [ $this, 'can_edit_user' ],
			'args'                => [
				'user_id' => [
					'type'     => 'integer',
				],
				'facebook' => [
					'type'     => 'string',
				],
				'instagram' => [
					'type'     => 'string',
				],
				'linkedin' => [
					'type'     => 'string',
				],
				'myspace' => [
					'type'     => 'string',
				],
				'pinterest' => [
					'type'     => 'string',
				],
				'soundcloud' => [
					'type'     => 'string',
				],
				'tumblr' => [
					'type'     => 'string',
				],
				'twitter' => [
					'type'     => 'string',
				],
				'youtube' => [
					'type'     => 'string',
				],
				'wikipedia' => [
					'type'     => 'string',
				],
			],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::PERSON_SOCIAL_PROFILES_ROUTE, $person_social_profiles_route );

	$check_capability_route = [
		'methods'             => 'GET',
		'callback'            => [ $this, 'check_capability' ],
		'permission_callback' => [ $this, 'can_manage_options' ],
		'args'                => [
			'user_id' => [
				'required' => true,
			],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::CHECK_CAPABILITY_ROUTE, $check_capability_route );

	$enable_tracking_route = [
		'methods'             => 'POST',
		'callback'            => [ $this, 'set_enable_tracking' ],
		'permission_callback' => [ $this, 'can_manage_options' ],
		'args'                => [
			'tracking' => [
				'type'     => 'boolean',
				'required' => true,
			],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::ENABLE_TRACKING_ROUTE, $enable_tracking_route );

	$save_configuration_state_route = [
		'methods'             => 'POST',
		'callback'            => [ $this, 'save_configuration_state' ],
		'permission_callback' => [ $this, 'can_manage_options' ],
		'args'                => [
			'finishedSteps' => [
				'type'     => 'array',
				'required' => true,
			],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::SAVE_CONFIGURATION_STATE_ROUTE, $save_configuration_state_route );

	$get_configuration_state_route = [
		[
			'methods'             => 'GET',
			'callback'            => [ $this, 'get_configuration_state' ],
			'permission_callback' => [ $this, 'can_manage_options' ],
		],
	];
	\register_rest_route( Main::API_V1_NAMESPACE, self::CONFIGURATION_ROUTE . self::GET_CONFIGURATION_STATE_ROUTE, $get_configuration_state_route );
}