mysql2date

Definition:
function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {}

Converts MySQL DATETIME field to user specified date format.
If $dateformatstring has ‘G’ value, then gmmktime() function will be used to make the time. If $dateformatstring is set to ‘U’, then mktime() function will be used to make the time.

Parameters

  • string $dateformatstring: Either ‘G’, ‘U’, or php date format.
  • string $mysqlstring: Time from mysql DATETIME field.
  • bool $translate: Optional. Default is true. Will switch format to locale.

Return values

returns:Date formatted by $dateformatstring or locale (if available).

Source code

function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {

	$m = $mysqlstring;

	if ( empty( $m ) )

		return false;



	if ( 'G' == $dateformatstring )

		return strtotime( $m . ' +0000' );



	$i = strtotime( $m );



	if ( 'U' == $dateformatstring )

		return $i;



	if ( $translate )

		return date_i18n( $dateformatstring, $i );

	else

		return date( $dateformatstring, $i );

}

2419

mu_options

Definition:
function mu_options( $options ) {}

Parameters

  • $options

Source code

function mu_options( $options ) {

	_deprecated_function(__FUNCTION__, '3.0' );

	return $options;

}

2417

mu_dropdown_languages

Definition:
function mu_dropdown_languages( $lang_files = array() {}

Parameters

  • $lang_files
  • $current

Defined filters

  • mu_dropdown_languages
    apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current )

Source code

function mu_dropdown_languages( $lang_files = array(), $current = '' ) {

	$flag = false;

	$output = array();



	foreach ( (array) $lang_files as $val ) {

		$code_lang = basename( $val, '.mo' );



		if ( $code_lang == 'en_US' ) { // American English

			$flag = true;

			$ae = __( 'American English' );

			$output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';

		} elseif ( $code_lang == 'en_GB' ) { // British English

			$flag = true;

			$be = __( 'British English' );

			$output[$be] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>';

		} else {

			$translated = format_code_lang( $code_lang );

			$output[$translated] =  '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . esc_html ( $translated ) . '</option>';

		}



	}



	if ( $flag === false ) // WordPress english

		$output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . "</option>";



	// Order by name

	uksort( $output, 'strnatcasecmp' );



	$output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current );

	echo implode( "\n\t", $output );

}

2415

ms_upload_constants

Definition:
function ms_upload_constants( ) {}

Defines Multisite upload constants.

Source code

function ms_upload_constants(  ) {

	global $wpdb;



	/** @since 3.0.0 */

	// Base uploads dir relative to ABSPATH

	if ( !defined( 'UPLOADBLOGSDIR' ) )

		define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );



	/** @since 3.0.0 */

	if ( !defined( 'UPLOADS' ) ) {

		// Uploads dir relative to ABSPATH

		define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );

		if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR )

			define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );

2413

ms_subdomain_constants

Definition:
function ms_subdomain_constants() {}

Defines Multisite subdomain constants and handles warnings and notices.
VHOST is deprecated in favor of SUBDOMAIN_INSTALL, which is a bool.

Source code

function ms_subdomain_constants() {

	static $error = null;

	static $error_warn = false;



	if ( false === $error )

		return;



	if ( $error ) {

		$vhost_deprecated = __( 'The constant <code>VHOST</code> <strong>is deprecated</strong>. Use the boolean constant <code>SUBDOMAIN_INSTALL</code> in wp-config.php to enable a subdomain configuration. Use is_subdomain_install() to check whether a subdomain configuration is enabled.' );

		if ( $error_warn ) {

			trigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING );

		} else {

	 		_deprecated_argument( 'define()', '3.0', $vhost_deprecated );

		}

		return;

	}



	if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) {

		if ( SUBDOMAIN_INSTALL == ( 'yes' == VHOST ) ) {

			$error = true;

		} else {

			$error = $error_warn = true;

		}

	} elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) {

		define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' );

	} elseif ( defined( 'VHOST' ) ) {

		$error = true;

		define( 'SUBDOMAIN_INSTALL', 'yes' == VHOST );

	} else {

		define( 'SUBDOMAIN_INSTALL', false );

		define( 'VHOST', 'no' );

	}

}

2411