wp_just_in_time_script_localization

Definition:
function wp_just_in_time_script_localization() {}

Load localized data on print rather than initialization.
These localizations require information that may not be loaded even by init.

Source code

function wp_just_in_time_script_localization() {



	wp_localize_script( 'autosave', 'autosaveL10n', array(

		'autosaveInterval' => AUTOSAVE_INTERVAL,

		'savingText' => __('Saving Draft…'),

		'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')

	) );



}

3809

wp_is_post_revision

Definition:
function wp_is_post_revision( $post ) {}

Determines if the specified post is a revision.

Parameters

  • int|object $post: Post ID or post object.

Return values

returns:False if not a revision, ID of revision’s parent otherwise.

Source code

function wp_is_post_revision( $post ) {

	if ( !$post = wp_get_post_revision( $post ) )

		return false;

	return (int) $post->post_parent;

}

3807

wp_is_post_autosave

Definition:
function wp_is_post_autosave( $post ) {}

Determines if the specified post is an autosave.

Parameters

  • int|object $post: Post ID or post object.

Return values

returns:False if not a revision, ID of autosave’s parent otherwise

Source code

function wp_is_post_autosave( $post ) {

	if ( !$post = wp_get_post_revision( $post ) )

		return false;

	if ( "{$post->post_parent}-autosave" !== $post->post_name )

3805

wp_iso_descrambler

Definition:
function wp_iso_descrambler($string) {}

Convert to ASCII from email subjects.

Parameters

  • string $string: Subject line

Return values

returns:Converted string to ASCII

Source code

function wp_iso_descrambler($string) {

	/* this may only work with iso-8859-1, I'm afraid */

	if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {

		return $string;

	} else {

		$subject = str_replace('_', ' ', $matches[2]);

		$subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);

		return $subject;

	}

}

3803

wp_install_defaults

Definition:
function wp_install_defaults($user_id) {}

Parameters

  • int $user_id: User ID.

Source code

function wp_install_defaults($user_id) {

	global $wpdb, $wp_rewrite, $current_site, $table_prefix;



	// Default category

	$cat_name = __('Uncategorized');

	/* translators: Default category slug */

	$cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug'));



	if ( global_terms_enabled() ) {

		$cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );

		if ( $cat_id == null ) {

			$wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) );

			$cat_id = $wpdb->insert_id;

		}

		update_option('default_category', $cat_id);

	} else {

3801