wpseo_bulk_editor_post_context
Filter: wpseo_bulk_editor_post_context Allows add-ons to supply extra context shown alongside a post in the bulk editor table (e.g. a product short description for WooCommerce products).
Использование
add_filter( 'wpseo_bulk_editor_post_context', 'wp_kama_wpseo_bulk_editor_post_context_filter', 10, 3 ); /** * Function for `wpseo_bulk_editor_post_context` filter-hook. * * @param array$context The context data, empty by default. * @param int $post_id The post ID. * @param string $content_type The post type. * * @return array */ function wp_kama_wpseo_bulk_editor_post_context_filter( $context, $post_id, $content_type ){ // filter... return $context; }
- $context(array<string, string>)
- The context data, empty by default.
- $post_id(int)
- The post ID.
- $content_type(строка)
- The post type.
Где вызывается хук
wpseo_bulk_editor_post_context
yoast/src/bulk-editor/infrastructure/posts/post-context-trait.php 32
$context = \apply_filters( 'wpseo_bulk_editor_post_context', [], $post_id, $content_type );