wp_tempnam

Definition:
function wp_tempnam($filename = '', $dir = '') {}

Returns a filename of a Temporary unique file.
Please note that the calling function must unlink() this itself.

Parameters

  • string $filename: (optional) Filename to base the Unique file off
  • string $dir: (optional) Directory to store the file in

Return values

returns:a writable filename

Source code

function wp_tempnam($filename = '', $dir = '') {

	if ( empty($dir) )

		$dir = get_temp_dir();

	$filename = basename($filename);

	if ( empty($filename) )

		$filename = time();



	$filename = preg_replace('|\..*$|', '.tmp', $filename);

	$filename = $dir . wp_unique_filename($dir, $filename);

	touch($filename);

	return $filename;

}

4159

wp_templating_constants

Definition:
function wp_templating_constants( ) {}

Defines templating related WordPress constants

Source code

function wp_templating_constants( ) {

	/**

	 * Filesystem path to the current active template directory

	 * @since 1.5.0

	 */

	define('TEMPLATEPATH', get_template_directory());



	/**

	 * Filesystem path to the current active template stylesheet directory

	 * @since 2.1.0

	 */

	define('STYLESHEETPATH', get_stylesheet_directory());



	/**

	 * Slug of the default theme for this install.

	 * Used as the default theme when installing new sites.

	 * Will be used as the fallback if the current theme doesn't exist.

	 * @since 3.0.0

	 */

	if ( !defined('WP_DEFAULT_THEME') )

		define( 'WP_DEFAULT_THEME', 'twentyeleven' );



}

4157

wp_tag_cloud

Definition:
function wp_tag_cloud( $args = '' ) {}

Display tag cloud.
The text size is set by the ‘smallest’ and ‘largest’ arguments, which will use the ‘unit’ argument value for the CSS text size unit. The ‘format’ argument can be ‘flat’ (default), ‘list’, or ‘array’. The flat value for the ‘format’ argument will separate tags with spaces. The list value for the ‘format’ argument will format the tags in a UL HTML list. The array value for the ‘format’ argument will return in PHP array type format.

Parameters

  • array|string $args: Optional. Override default arguments.

Return values

returns:Generated tag cloud, only if no failures and ‘array’ is set for the ‘format’ argument.

Defined filters

  • wp_tag_cloud
    apply_filters( 'wp_tag_cloud', $return, $args )

Source code

function wp_tag_cloud( $args = '' ) {

	$defaults = array(

		'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,

		'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',

		'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true

	);

	$args = wp_parse_args( $args, $defaults );



	$tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags



	if ( empty( $tags ) || is_wp_error( $tags ) )

		return;



	foreach ( $tags as $key => $tag ) {

		if ( 'edit' == $args['link'] )

			$link = get_edit_tag_link( $tag->term_id, $tag->taxonomy );

		else

			$link = get_term_link( intval($tag->term_id), $tag->taxonomy );

		if ( is_wp_error( $link ) )

			return false;



		$tags[ $key ]->link = $link;

		$tags[ $key ]->id = $tag->term_id;

	}



	$return = wp_generate_tag_cloud( $tags, $args ); // Here's where those top tags get sorted according to $args



	$return = apply_filters( 'wp_tag_cloud', $return, $args );



	if ( 'array' == $args['format'] || empty($args['echo']) )

		return $return;



	echo $return;

}

4155

wp_suspend_cache_invalidation

Definition:
function wp_suspend_cache_invalidation($suspend = true) {}

Suspend cache invalidation.
Turns cache invalidation on and off. Useful during imports where you don’t wont to do invalidations every time a post is inserted. Callers must be sure that what they are doing won’t lead to an inconsistent cache when invalidation is suspended.

Parameters

  • bool $suspend: Whether to suspend or enable cache invalidation

Return values

returns:The current suspend setting

Source code

function wp_suspend_cache_invalidation($suspend = true) {

	global $_wp_suspend_cache_invalidation;



	$current_suspend = $_wp_suspend_cache_invalidation;

	$_wp_suspend_cache_invalidation = $suspend;

	return $current_suspend;

}

4153

wp_style_loader_src

Definition:
function wp_style_loader_src( $src, $handle ) {}

Administration Screen CSS for changing the styles.
If installing the ‘wp-admin/’ directory will be replaced with ‘./’.

Parameters

  • string $src: Source URL.
  • string $handle: Either ‘colors’ or ‘colors-rtl’.

Return values

returns:URL path to CSS stylesheet for Administration Screens.

Source code

function wp_style_loader_src( $src, $handle ) {

	if ( defined('WP_INSTALLING') )

		return preg_replace( '#^wp-admin/#', './', $src );



	if ( 'colors' == $handle || 'colors-rtl' == $handle ) {

		global $_wp_admin_css_colors;

		$color = get_user_option('admin_color');



		if ( empty($color) || !isset($_wp_admin_css_colors[$color]) )

			$color = 'fresh';



		$color = $_wp_admin_css_colors[$color];

		$parsed = parse_url( $src );

		$url = $color->url;



		if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG )

			$url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url);



		if ( isset($parsed['query']) && $parsed['query'] ) {

			wp_parse_str( $parsed['query'], $qv );

			$url = add_query_arg( $qv, $url );

		}



		return $url;

	}



	return $src;

}

4151