_e

Definition:
function _e( $text, $domain = 'default' ) {}

Displays the returned translated text from translate().

Parameters

  • string $text: Text to translate
  • string $domain: Optional. Domain to retrieve the translated text

Source code

function _e( $text, $domain = 'default' ) {

	echo translate( $text, $domain );

}

4309

_draft_or_post_title

Definition:
function _draft_or_post_title( $post_id = 0 ) {}

Get the post title.
The post title is fetched and if it is blank then a default string is returned.

Parameters

  • int $post_id: The post id. If not supplied the global $post is used.

Return values

returns:The post title if set

Source code

function _draft_or_post_title( $post_id = 0 ) {

	$title = get_the_title($post_id);

	if ( empty($title) )

		$title = __('(no title)');

	return $title;

}

4307

_custom_background_cb

Definition:
function _custom_background_cb() {}

Default custom background callback.

Source code

function _custom_background_cb() {

	$background = get_background_image();

	$color = get_background_color();

	if ( ! $background && ! $color )

		return;



	$style = $color ? "background-color: #$color;" : '';



	if ( $background ) {

		$image = " background-image: url('$background');";



		$repeat = get_theme_mod( 'background_repeat', 'repeat' );

		if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) )

			$repeat = 'repeat';

		$repeat = " background-repeat: $repeat;";



		$position = get_theme_mod( 'background_position_x', 'left' );

		if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) )

			$position = 'left';

		$position = " background-position: top $position;";



		$attachment = get_theme_mod( 'background_attachment', 'scroll' );

		if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )

			$attachment = 'scroll';

		$attachment = " background-attachment: $attachment;";



		$style .= $image . $repeat . $position . $attachment;

	}

?>

<style type="text/css">

body.custom-background { <?php echo trim( $style ); ?> }

</style>

<?php

}

4305

_crop_image_resource

Definition:
function _crop_image_resource($img, $x, $y, $w, $h) {}

Parameters

  • $img
  • $x
  • $y
  • $w
  • $h

Source code

function _crop_image_resource($img, $x, $y, $w, $h) {

	$dst = wp_imagecreatetruecolor($w, $h);

	if ( is_resource($dst) ) {

		if ( imagecopy($dst, $img, 0, 0, $x, $y, $w, $h) ) {

			imagedestroy($img);

			$img = $dst;

		}

	}

	return $img;

}

4303

_cleanup_header_comment

Definition:
function _cleanup_header_comment($str) {}

Strip close comment and close php tags from file headers used by WP.

Parameters

  • string $str

Source code

function _cleanup_header_comment($str) {

	return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str));

}

4301