option_page_capability_(option_page) хук-фильтрWP 3.2.0

Filters the capability required when using the Settings API.

By default, the options groups for all registered settings require the manage_options capability. This filter is required to change the capability required for a certain options page.

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

add_filter( 'option_page_capability_(option_page)', 'wp_kama_option_page_capability_filter' );

/**
 * Function for `option_page_capability_(option_page)` filter-hook.
 * 
 * @param string $capability The capability used for the page, which is manage_options by default.
 *
 * @return string
 */
function wp_kama_option_page_capability_filter( $capability ){

	// filter...
	return $capability;
}
$capability(строка)
The capability used for the page, which is manage_options by default.

Список изменений

С версии 3.2.0 Введена.

Где вызывается хук

В файле: /wp-admin/options.php
option_page_capability_(option_page)
wp-admin/options.php 46
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );

Где используется хук в WordPress

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