quick_edit_enabled_for_post_type
Filters whether Quick Edit should be enabled for the given post type.
Использование
add_filter( 'quick_edit_enabled_for_post_type', 'wp_kama_quick_edit_enabled_for_post_type_filter', 10, 2 ); /** * Function for `quick_edit_enabled_for_post_type` filter-hook. * * @param bool $enable Whether to enable the Quick Edit functionality. * @param string $post_type Post type name. * * @return bool */ function wp_kama_quick_edit_enabled_for_post_type_filter( $enable, $post_type ){ // filter... return $enable; }
- $enable(true|false)
- Whether to enable the Quick Edit functionality.
По умолчанию: true - $post_type(строка)
- Post type name.
Список изменений
С версии 6.4.0 | Введена. |
Где вызывается хук
quick_edit_enabled_for_post_type
wp-admin/includes/class-wp-posts-list-table.php 1491
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type );
wp-admin/includes/class-wp-posts-list-table.php 1172
$quick_edit_enabled = apply_filters( 'quick_edit_enabled_for_post_type', true, $post->post_type );