wp_maybe_load_widgets

Definition:
function wp_maybe_load_widgets() {}

Determines if Widgets library should be loaded.
Checks to make sure that the widgets library hasn’t already been loaded. If it hasn’t, then it will load the widgets library and run an action hook.

Defined filters

  • load_default_widgets
    apply_filters('load_default_widgets', true)

Source code

function wp_maybe_load_widgets() {

	if ( ! apply_filters('load_default_widgets', true) )

		return;

	require_once( ABSPATH . WPINC . '/default-widgets.php' );

	add_action( '_admin_menu', 'wp_widgets_add_menu' );

}

3909

wp_maybe_load_embeds

Definition:
function wp_maybe_load_embeds() {}

Determines if default embed handlers should be loaded.
Checks to make sure that the embeds library hasn’t already been loaded. If it hasn’t, then it will load the embeds library.

Defined filters

  • load_default_embeds
    apply_filters('load_default_embeds', true)

Source code

function wp_maybe_load_embeds() {

	if ( ! apply_filters('load_default_embeds', true) )

		return;

	require_once( ABSPATH . WPINC . '/default-embeds.php' );

}

3907

wp_max_upload_size

Definition:
function wp_max_upload_size() {}

Defined filters

  • upload_size_limit
    apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes)

Source code

function wp_max_upload_size() {

	$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );

	$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );

	$bytes = apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes );

	return $bytes;

}

3905

wp_match_mime_types

Definition:
function wp_match_mime_types($wildcard_mime_types, $real_mime_types) {}

Check a MIME-Type against a list.
If the wildcard_mime_types parameter is a string, it must be comma separated list. If the real_mime_types is a string, it is also comma separated to create the list.

Parameters

  • string|array $wildcard_mime_types: e.g. audio/mpeg or image (same as image/*) or flash (same as *flash*).
  • string|array $real_mime_types: post_mime_type values

Return values

returns:array(wildcard=>array(real types))

Source code

function wp_match_mime_types($wildcard_mime_types, $real_mime_types) {

	$matches = array();

	if ( is_string($wildcard_mime_types) )

		$wildcard_mime_types = array_map('trim', explode(',', $wildcard_mime_types));

	if ( is_string($real_mime_types) )

		$real_mime_types = array_map('trim', explode(',', $real_mime_types));

	$wild = '[-._a-z0-9]*';

	foreach ( (array) $wildcard_mime_types as $type ) {

		$type = str_replace('*', $wild, $type);

		$patternses[1][$type] = "^$type$";

		if ( false === strpos($type, '/') ) {

			$patternses[2][$type] = "^$type/";

			$patternses[3][$type] = $type;

		}

	}

	asort($patternses);

	foreach ( $patternses as $patterns )

		foreach ( $patterns as $type => $pattern )

			foreach ( (array) $real_mime_types as $real )

				if ( preg_match("#$pattern#", $real) && ( empty($matches[$type]) || false === array_search($real, $matches[$type]) ) )

					$matches[$type][] = $real;

	return $matches;

}

3903

wp_manage_posts_columns

Definition:
function wp_manage_posts_columns( $screen = '') {}

Parameters

  • $screen

Defined filters

  • manage_pages_columns
    apply_filters( 'manage_pages_columns', $posts_columns )
  • manage_posts_columns
    apply_filters( 'manage_posts_columns', $posts_columns, $post_type )
  • manage_{$post_type}_posts_columns
    apply_filters( "manage_{$post_type}_posts_columns", $posts_columns )

Source code

function wp_manage_posts_columns( $screen = '') {

	if ( empty($screen) )

		$post_type = 'post';

	else

		$post_type = $screen->post_type;



	$posts_columns = array();

	$posts_columns['cb'] = '<input type="checkbox" />';

	/* translators: manage posts column name */

	$posts_columns['title'] = _x('Title', 'column name');

	$posts_columns['author'] = __('Author');

	if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') )

		$posts_columns['categories'] = __('Categories');

	if ( empty($post_type) || is_object_in_taxonomy($post_type, 'post_tag') )

		$posts_columns['tags'] = __('Tags');

	$post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all';

	if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) )

		$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';

	$posts_columns['date'] = __('Date');



	if ( 'page' == $post_type )

		$posts_columns = apply_filters( 'manage_pages_columns', $posts_columns );

	else

		$posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type );

	$posts_columns = apply_filters( "manage_{$post_type}_posts_columns", $posts_columns );

3901