private_title_format
Filters the text prepended to the post title of private posts.
The filter is only applied on the front end.
Использование
add_filter( 'private_title_format', 'wp_kama_private_title_format_filter', 10, 2 ); /** * Function for `private_title_format` filter-hook. * * @param string $prepend Text displayed before the post title. * @param WP_Post $post Current post object. * * @return string */ function wp_kama_private_title_format_filter( $prepend, $post ){ // filter... return $prepend; }
- $prepend(строка)
- Text displayed before the post title.
По умолчанию: 'Private: %s' - $post(WP_Post)
- Current post object.
Список изменений
С версии 2.8.0 | Введена. |
Где вызывается хук
wp-includes/post-template.php 160
$private_title_format = apply_filters( 'private_title_format', $prepend, $post );
Где используется хук в WordPress
wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php 330
add_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php 335
remove_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php 528
add_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php 536
remove_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1935
add_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 1940
remove_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/search/class-wp-rest-post-search-handler.php 135
add_filter( 'private_title_format', array( $this, 'protected_title_format' ) );
wp-includes/rest-api/search/class-wp-rest-post-search-handler.php 138
remove_filter( 'private_title_format', array( $this, 'protected_title_format' ) );