dismissed_updates

Definition:
function dismissed_updates() {}

Source code

function dismissed_updates() {

	$dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false ) );

	if ( $dismissed ) {



		$show_text = esc_js(__('Show hidden updates'));

		$hide_text = esc_js(__('Hide hidden updates'));

	?>

	<script type="text/javascript">



		jQuery(function($) {

			$('dismissed-updates').show();

			$('#show-dismissed').toggle(function(){$(this).text('<?php echo $hide_text; ?>');}, function() {$(this).text('<?php echo $show_text; ?>')});

			$('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});

		});

	</script>

	<?php

		echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">'.__('Show hidden updates').'</a></p>';

		echo '<ul id="dismissed-updates" class="core-updates dismissed">';

		foreach( (array) $dismissed as $update) {

			echo '<li>';

			list_core_update( $update );

			echo '</li>';

		}

		echo '</ul>';

	}

}

916

discover_pingback_server_uri

Definition:
function discover_pingback_server_uri( $url, $deprecated = '' ) {}

Finds a pingback server URI based on the given URL.
Checks the HTML for the rel="pingback" link and x-pingback headers. It does a check for the x-pingback headers first and returns that, if available. The check for the rel="pingback" has more overhead than just the header.

Parameters

  • string $url: URL to ping.
  • int $deprecated: Not Used.

Return values

returns:False on failure, string containing URI on success.

Source code

function discover_pingback_server_uri( $url, $deprecated = '' ) {

	if ( !empty( $deprecated ) )

		_deprecated_argument( __FUNCTION__, '2.7' );



	$pingback_str_dquote = 'rel="pingback"';

	$pingback_str_squote = 'rel=\'pingback\'';



	/** @todo Should use Filter Extension or custom preg_match instead. */

	$parsed_url = parse_url($url);



	if ( ! isset( $parsed_url['host'] ) ) // Not an URL. This should never happen.

		return false;



	//Do not search for a pingback server on our own uploads

	$uploads_dir = wp_upload_dir();

	if ( 0 === strpos($url, $uploads_dir['baseurl']) )

		return false;



	$response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );



	if ( is_wp_error( $response ) )

		return false;



	if ( wp_remote_retrieve_header( $response, 'x-pingback' ) )

		return wp_remote_retrieve_header( $response, 'x-pingback' );



	// Not an (x)html, sgml, or xml page, no use going further.

	if ( preg_match('#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' )) )

		return false;



	// Now do a GET since we're going to look in the html headers (and we're sure its not a binary file)

	$response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );



	if ( is_wp_error( $response ) )

		return false;



	$contents = wp_remote_retrieve_body( $response );



	$pingback_link_offset_dquote = strpos($contents, $pingback_str_dquote);

	$pingback_link_offset_squote = strpos($contents, $pingback_str_squote);

	if ( $pingback_link_offset_dquote || $pingback_link_offset_squote ) {

		$quote = ($pingback_link_offset_dquote) ? '"' : '\'';

		$pingback_link_offset = ($quote=='"') ? $pingback_link_offset_dquote : $pingback_link_offset_squote;

		$pingback_href_pos = @strpos($contents, 'href=', $pingback_link_offset);

		$pingback_href_start = $pingback_href_pos+6;

		$pingback_href_end = @strpos($contents, $quote, $pingback_href_start);

		$pingback_server_url_len = $pingback_href_end - $pingback_href_start;

		$pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len);



		// We may find rel="pingback" but an incomplete pingback URL

		if ( $pingback_server_url_len > 0 ) { // We got it!

			return $pingback_server_url;

		}

	}



	return false;

}

882

disabled

Definition:
function disabled( $disabled, $current = true, $echo = true ) {}

Outputs the html disabled attribute.
Compares the first two arguments and if identical marks as disabled

Parameters

  • mixed $disabled: One of the values to compare
  • mixed $current: (true) The other value to compare if not just true
  • bool $echo: Whether to echo or just return the string

Return values

returns:html attribute or empty string

Source code

function disabled( $disabled, $current = true, $echo = true ) {

	return __checked_selected_helper( $disabled, $current, $echo, 'disabled' );

}

880

did_action

Definition:
function did_action($tag) {}

Retrieve the number of times an action is fired.

Parameters

  • string $tag: The name of the action hook.

Return values

returns:The number of times action hook &lt;tt&gt;$tag&lt;/tt&gt; is fired

Source code

function did_action($tag) {

	global $wp_actions;



	if ( ! isset( $wp_actions ) || ! isset( $wp_actions[$tag] ) )

		return 0;



	return $wp_actions[$tag];

}

828

deslash

Definition:
function deslash($content) {}

Parameters

  • string $content

Source code

function deslash($content) {

	// Note: \\\ inside a regex denotes a single backslash.



	// Replace one or more backslashes followed by a single quote with

	// a single quote.

	$content = preg_replace("/\\\+'/", "'", $content);



	// Replace one or more backslashes followed by a double quote with

	// a double quote.

	$content = preg_replace('/\\\+"/', '"', $content);



	// Replace one or more backslashes with one backslash.

	$content = preg_replace("/\\\+/", "\\", $content);



	return $content;

}

826