media_view_strings
Filter HookDescription
Filters the media view strings.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 5112 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$strings
|
Array of media view strings keyed by the name they'll be referenced by in JavaScript. |
WP_Post
|
$post
|
Post object. |
Usage Examples
Basic Usage
<?php
// Hook into media_view_strings
add_filter('media_view_strings', 'my_custom_filter', 10, 2);
function my_custom_filter($strings, $post) {
// Your custom filtering logic here
return $strings;
}
Source Code Context
wp-includes/media.php:5112
- How this hook is used in WordPress core
<?php
5107 * @since 3.5.0
5108 *
5109 * @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.
5110 * @param WP_Post $post Post object.
5111 */
5112 $strings = apply_filters( 'media_view_strings', $strings, $post );
5113
5114 $strings['settings'] = $settings;
5115
5116 /*
5117 * Ensure we enqueue media-editor first, that way media-views
PHP Documentation
<?php
/**
* Filters the media view strings.
*
* @since 3.5.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.