load_template

Definition:
function load_template( $_template_file, $require_once = true ) {}

Require the template file with WordPress environment.
The globals are set up for the template file to ensure that the WordPress environment is available from within the function. The query variables are also available.

Parameters

  • string $_template_file: Path to template file.
  • bool $require_once: Whether to require_once or require. Default true.

Source code

function load_template( $_template_file, $require_once = true ) {

	global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;



	if ( is_array( $wp_query->query_vars ) )

		extract( $wp_query->query_vars, EXTR_SKIP );



	if ( $require_once )

		require_once( $_template_file );

	else

		require( $_template_file );

}

2289

load_plugin_textdomain

Definition:
function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) {}

Loads the plugin’s translated strings.
If the path is not given then it will be the root of the plugin directory. The .mo file should be named based on the domain with a dash, and then the locale exactly.

Parameters

  • string $domain: Unique identifier for retrieving translated strings
  • string $abs_rel_path: Optional. Relative path to ABSPATH of a folder, where the .mo file resides. Deprecated, but still functional until 2.7
  • string $plugin_rel_path: Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precedence over $abs_rel_path

Defined filters

  • plugin_locale
    apply_filters( 'plugin_locale', get_locale()

Source code

function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) {

	$locale = apply_filters( 'plugin_locale', get_locale(), $domain );



	if ( false !== $plugin_rel_path	) {

		$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );

	} else if ( false !== $abs_rel_path ) {

		_deprecated_argument( __FUNCTION__, '2.7' );

		$path = ABSPATH . trim( $abs_rel_path, '/' );

	} else {

		$path = WP_PLUGIN_DIR;

	}



	$mofile = $path . '/'. $domain . '-' . $locale . '.mo';

	return load_textdomain( $domain, $mofile );

}

2287

load_muplugin_textdomain

Definition:
function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {}

Load the translated strings for a plugin residing in the mu-plugins dir.

Parameters

  • string $domain: Unique identifier for retrieving translated strings
  • string $mu_plugin_rel_path: Relative to WPMU_PLUGIN_DIR directory in which the MO file resides. Defaults to empty string.

Defined filters

  • plugin_locale
    apply_filters( 'plugin_locale', get_locale()

Source code

function load_muplugin_textdomain( $domain, $mu_plugin_rel_path = '' ) {

	$locale = apply_filters( 'plugin_locale', get_locale(), $domain );

	$path = WPMU_PLUGIN_DIR . '/' . ltrim( $mu_plugin_rel_path, '/' );

	load_textdomain( $domain, trailingslashit( $path ) . "$domain-$locale.mo" );

}

2285

load_image_to_edit

Definition:
function load_image_to_edit($post_id, $mime_type, $size = 'full') {}

Parameters

  • $post_id
  • $mime_type
  • $size

Defined filters

  • load_image_to_edit_filesystempath
    apply_filters('load_image_to_edit_filesystempath', path_join( dirname($filepath)
  • load_image_to_edit_attachmenturl
    apply_filters('load_image_to_edit_attachmenturl', wp_get_attachment_url($post_id)
  • load_image_to_edit_path
    apply_filters('load_image_to_edit_path', $filepath, $post_id, $size)
  • load_image_to_edit
    apply_filters('load_image_to_edit', $image, $post_id, $size)

Source code

function load_image_to_edit($post_id, $mime_type, $size = 'full') {

	$filepath = get_attached_file($post_id);



	if ( $filepath && file_exists($filepath) ) {

		if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) {

			$filepath = apply_filters('load_image_to_edit_filesystempath', path_join( dirname($filepath), $data['file'] ), $post_id, $size);

		}

	} elseif ( function_exists('fopen') && function_exists('ini_get') && true == ini_get('allow_url_fopen') ) {

		$filepath = apply_filters('load_image_to_edit_attachmenturl', wp_get_attachment_url($post_id) , $post_id, $size);

	}



	$filepath = apply_filters('load_image_to_edit_path', $filepath, $post_id, $size);

	if ( empty($filepath) )

		return false;



	switch ( $mime_type ) {

		case 'image/jpeg':

			$image = imagecreatefromjpeg($filepath);

			break;

		case 'image/png':

			$image = imagecreatefrompng($filepath);

			break;

		case 'image/gif':

			$image = imagecreatefromgif($filepath);

			break;

		default:

			$image = false;

			break;

	}

	if ( is_resource($image) ) {

		$image = apply_filters('load_image_to_edit', $image, $post_id, $size);

		if ( function_exists('imagealphablending') && function_exists('imagesavealpha') ) {

			imagealphablending($image, false);

			imagesavealpha($image, true);

		}

	}

	return $image;

}

2283

load_default_textdomain

Definition:
function load_default_textdomain() {}

Loads default translated strings based on locale.
Loads the .mo file in WP_LANG_DIR constant path from WordPress root. The translated (.mo) file is named based on the locale.

Source code

function load_default_textdomain() {

	$locale = get_locale();



	load_textdomain( 'default', WP_LANG_DIR . "/$locale.mo" );



	if ( is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) ) {

		load_textdomain( 'default', WP_LANG_DIR . "/ms-$locale.mo" );

	}

}

2281