media_upload_tabs
Filter HookDescription
Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. } / function wp_enqueue_media( $args = array() ) { // Enqueue me just once per page, please. if ( did_action( 'wp_enqueue_media' ) ) { return; } global $content_width, $wpdb, $wp_locale; $defaults = array( 'post' => null, ); $args = wp_parse_args( $args, $defaults ); /* We're going to pass the old thickbox media tabs to `media_upload_tabs` to ensure plugins will work. We will then unset those tabs.Hook Information
File Location |
wp-includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4782 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$args
|
{ Arguments for enqueuing media scripts. |
Usage Examples
Basic Usage
<?php
// Hook into media_upload_tabs
add_filter('media_upload_tabs', 'my_custom_filter', 10, 1);
function my_custom_filter($args) {
// Your custom filtering logic here
return $args;
}
Source Code Context
wp-includes/media.php:4782
- How this hook is used in WordPress core
<?php
4777 'gallery' => '',
4778 'library' => '',
4779 );
4780
4781 /** This filter is documented in wp-admin/includes/media.php */
4782 $tabs = apply_filters( 'media_upload_tabs', $tabs );
4783 unset( $tabs['type'], $tabs['type_url'], $tabs['gallery'], $tabs['library'] );
4784
4785 $props = array(
4786 'link' => get_option( 'image_default_link_type' ), // DB default is 'file'.
4787 'align' => get_option( 'image_default_align' ), // Empty default.
PHP Documentation
<?php
/**
* Enqueues all scripts, styles, settings, and templates necessary to use
* all media JS APIs.
*
* @since 3.5.0
*
* @global int $content_width
* @global wpdb $wpdb WordPress database abstraction object.
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @param array $args {
* Arguments for enqueuing media scripts.
*
* @type int|WP_Post $post Post ID or post object.
* }
*/
function wp_enqueue_media( $args = array() ) {
// Enqueue me just once per page, please.
if ( did_action( 'wp_enqueue_media' ) ) {
return;
}
global $content_width, $wpdb, $wp_locale;
$defaults = array(
'post' => null,
);
$args = wp_parse_args( $args, $defaults );
/*
* We're going to pass the old thickbox media tabs to `media_upload_tabs`
* to ensure plugins will work. We will then unset those tabs.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.