media_upload_tabs(): string[]

Defines the default media upload tabs.

Return

string[] Default tabs.

Source

function media_upload_tabs() {
	$_default_tabs = array(
		'type'     => __( 'From Computer' ), // Handler action suffix => tab text.
		'type_url' => __( 'From URL' ),
		'gallery'  => __( 'Gallery' ),
		'library'  => __( 'Media Library' ),
	);

	/**
	 * Filters the available tabs in the legacy (pre-3.5.0) media popup.
	 *
	 * @since 2.5.0
	 *
	 * @param string[] $_default_tabs An array of media tabs.
	 */
	return apply_filters( 'media_upload_tabs', $_default_tabs );
}

Hooks

apply_filters( ‘media_upload_tabs’, string[] $_default_tabs )

Filters the available tabs in the legacy (pre-3.5.0) media popup.

Changelog

VersionDescription
2.5.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    This is a 2.5.0 filter. You can also use a newer filter (3.5.0) to achieve the same:
    https://developer.wordpress.org/reference/hooks/media_view_settings/

    So for example use:

    add_filter('media_view_settings', 'addTab');
    
    function addTab($settings) {
      $settings['tabs'] = array('photogrid' => 'Photogrid');
      return $settings;
    }

You must log in before being able to contribute a note or feedback.