media_view_strings
Filters the media view strings.
Usage
add_filter( 'media_view_strings', 'wp_kama_media_view_strings_filter', 10, 2 );
/**
* Function for `media_view_strings` filter-hook.
*
* @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.
* @param WP_Post $post Post object.
*
* @return string[]
*/
function wp_kama_media_view_strings_filter( $strings, $post ){
// filter...
return $strings;
}
- $strings(string[])
- Array of media view strings keyed by the name they'll be referenced by in JavaScript.
- $post(WP_Post)
- Post object.
Changelog
| Since 3.5.0 | Introduced. |
Where the hook is called
media_view_strings
wp-includes/media.php 5124
$strings = apply_filters( 'media_view_strings', $strings, $post );