fatal

Parameters

  • $msg

Source code

function fatal($msg) {

	$args = func_get_args();



	$log = getLogger();

	$log->fatal(implode(', ', $args));

}

1048

extract_from_markers

Definition:
function extract_from_markers( $filename, $marker ) {}

Parameters

  • unknown_type $filename
  • unknown_type $marker

Return values

returns:An array of strings from a file (.htaccess ) from between BEGIN and END markers.

Source code

function extract_from_markers( $filename, $marker ) {

	$result = array ();



	if (!file_exists( $filename ) ) {

		return $result;

	}



	if ( $markerdata = explode( "\n", implode( '', file( $filename ) ) ));

	{

		$state = false;

		foreach ( $markerdata as $markerline ) {

			if (strpos($markerline, '# END ' . $marker) !== false)

				$state = false;

			if ( $state )

				$result[] = $markerline;

			if (strpos($markerline, '# BEGIN ' . $marker) !== false)

				$state = true;

		}

	}



	return $result;

}

1046

export_wp

Definition:
function export_wp( $args = array() {}

Generates the WXR export file for download

Parameters

  • array $args: Filters defining what should be included in the export

Defined actions

  • export_wp
    do_action( 'export_wp' );

Source code

function export_wp( $args = array() ) {

	global $wpdb, $post;



	$defaults = array( 'content' => 'all', 'author' => false, 'category' => false,

		'start_date' => false, 'end_date' => false, 'status' => false,

	);

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



	do_action( 'export_wp' );



	$sitename = sanitize_key( get_bloginfo( 'name' ) );

	if ( ! empty($sitename) ) $sitename .= '.';

	$filename = $sitename . 'wordpress.' . date( 'Y-m-d' ) . '.xml';



	header( 'Content-Description: File Transfer' );

	header( 'Content-Disposition: attachment; filename=' . $filename );

	header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );



	if ( 'all' != $args['content'] && post_type_exists( $args['content'] ) ) {

		$ptype = get_post_type_object( $args['content'] );

		if ( ! $ptype->can_export )

			$args['content'] = 'post';



		$where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", $args['content'] );

	} else {

1044

esc_url_raw

Definition:
function esc_url_raw( $url, $protocols = null ) {}

Performs esc_url() for database usage.

Parameters

  • string $url: The URL to be cleaned.
  • array $protocols: An array of acceptable protocols.

Return values

returns:The cleaned URL.

Source code

function esc_url_raw( $url, $protocols = null ) {

	return esc_url( $url, $protocols, 'db' );

}

1042

esc_url

Definition:
function esc_url( $url, $protocols = null, $_context = 'display' ) {}

Checks and cleans a URL.
A number of characters are removed from the URL. If the URL is for displaying (the default behaviour) ampersands are also replaced. The ‘clean_url’ filter is applied to the returned cleaned URL.

Parameters

  • string $url: The URL to be cleaned.
  • array $protocols: Optional. An array of acceptable protocols. Defaults to ‘http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’, ‘mms’, ‘rtsp’, ‘svn’ if not set.
  • string $_context: Private. Use esc_url_raw() for database usage.

Return values

returns:The cleaned $url after the ‘clean_url’ filter is applied.

Defined filters

  • clean_url
    apply_filters('clean_url', $url, $original_url, $_context)

Source code

function esc_url( $url, $protocols = null, $_context = 'display' ) {

	$original_url = $url;



	if ( '' == $url )

		return $url;

	$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);

	$strip = array('%0d', '%0a', '%0D', '%0A');

	$url = _deep_replace($strip, $url);

	$url = str_replace(';//', '://', $url);

	/* If the URL doesn't appear to contain a scheme, we

	 * presume it needs http:// appended (unless a relative

	 * link starting with /, # or ? or a php file).

	 */

	if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&

		! preg_match('/^[a-z0-9-]+?\.php/i', $url) )

		$url = 'http://' . $url;



	// Replace ampersands and single quotes only when displaying.

	if ( 'display' == $_context ) {

		$url = wp_kses_normalize_entities( $url );

		$url = str_replace( '&', '&', $url );

		$url = str_replace( "'", ''', $url );

	}



	if ( ! is_array( $protocols ) )

		$protocols = wp_allowed_protocols();

	if ( wp_kses_bad_protocol( $url, $protocols ) != $url )

		return '';



	return apply_filters('clean_url', $url, $original_url, $_context);

}

1040