wp_check_filetype

Definition:
function wp_check_filetype( $filename, $mimes = null ) {}

Retrieve the file type from the file name.
You can optionally define the mime array, if needed.

Parameters

  • string $filename: File name or path.
  • array $mimes: Optional. Key is the file extension with value as the mime type.

Return values

returns:Values with extension first and mime type.

Source code

function wp_check_filetype( $filename, $mimes = null ) {

	if ( empty($mimes) )

		$mimes = get_allowed_mime_types();

	$type = false;

	$ext = false;



	foreach ( $mimes as $ext_preg => $mime_match ) {

		$ext_preg = '!\.(' . $ext_preg . ')$!i';

		if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {

			$type = $mime_match;

			$ext = $ext_matches[1];

			break;

		}

	}



	return compact( 'ext', 'type' );

}

3459

wp_category_checklist

Definition:
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {}

Parameters

  • unknown_type $post_id
  • unknown_type $descendants_and_self
  • unknown_type $selected_cats
  • unknown_type $popular_cats
  • $walker
  • $checked_ontop

Source code

function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {

	wp_terms_checklist($post_id,

	 	array(

			'taxonomy' => 'category',

			'descendants_and_self' => $descendants_and_self,

			'selected_cats' => $selected_cats,

			'popular_cats' => $popular_cats,

			'walker' => $walker,

			'checked_ontop' => $checked_ontop

  ));

}

3457

wp_cache_set

Definition:
function wp_cache_set($key, $data, $group = '', $expire = 0) {}

Saves the data to the cache.

Parameters

  • int|string $key: What to call the contents in the cache
  • mixed $data: The contents to store in the cache
  • string $group: Where to group the cache contents
  • int $expire: When to expire the cache contents

Return values

returns:False if cache key and group already exist, true on success

Source code

function wp_cache_set($key, $data, $group = '', $expire = 0) {

	global $wp_object_cache;



	return $wp_object_cache->set($key, $data, $group, $expire);

}

3455

wp_cache_reset

Definition:
function wp_cache_reset() {}

Reset internal cache keys and structures. If the cache backend uses global blog or site IDs as part of its cache keys, this function instructs the backend to reset those keys and perform any cleanup since blog or site IDs have changed since cache init.

Source code

function wp_cache_reset() {

	global $wp_object_cache;



	return $wp_object_cache->reset();

}

3453

wp_cache_replace

Definition:
function wp_cache_replace($key, $data, $group = '', $expire = 0) {}

Replaces the contents of the cache with new data.

Parameters

  • int|string $key: What to call the contents in the cache
  • mixed $data: The contents to store in the cache
  • string $group: Where to group the cache contents
  • int $expire: When to expire the cache contents

Return values

returns:False if cache key and group already exist, true on success

Source code

function wp_cache_replace($key, $data, $group = '', $expire = 0) {

	global $wp_object_cache;



	return $wp_object_cache->replace($key, $data, $group, $expire);

}

3451