_get_widget_id_base

Definition:
function _get_widget_id_base($id) {}

Private

Parameters

  • $id

Source code

function _get_widget_id_base($id) {

	return preg_replace( '/-[0-9]+$/', '', $id );

}

4329

_get_plugin_data_markup_translate

Definition:
function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup = true, $translate = true) {}

Parameters

  • $plugin_file
  • $plugin_data
  • $markup
  • $translate

Source code

function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup = true, $translate = true) {



	//Translate fields

	if ( $translate && ! empty($plugin_data['TextDomain']) ) {

		if ( ! empty( $plugin_data['DomainPath'] ) )

			load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']);

		else

			load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file));



		foreach ( array('Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version') as $field )

			$plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);

	}



	$plugins_allowedtags = array(

		'a'       => array( 'href' => array(), 'title' => array() ),

		'abbr'    => array( 'title' => array() ),

		'acronym' => array( 'title' => array() ),

		'code'    => array(),

		'em'      => array(),

		'strong'  => array(),

	);



	$plugin_data['AuthorName'] = $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $plugins_allowedtags );



	//Apply Markup

	if ( $markup ) {

		if ( ! empty($plugin_data['PluginURI']) && ! empty($plugin_data['Name']) )

			$plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin homepage' ) . '">' . $plugin_data['Name'] . '</a>';

		else

			$plugin_data['Title'] = $plugin_data['Name'];



		if ( ! empty($plugin_data['AuthorURI']) && ! empty($plugin_data['Author']) )

			$plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . esc_attr__( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';



		$plugin_data['Description'] = wptexturize( $plugin_data['Description'] );

		if ( ! empty($plugin_data['Author']) )

			$plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';

	}



	// Sanitize all displayed data. Author and AuthorName sanitized above.

	$plugin_data['Title']       = wp_kses( $plugin_data['Title'],       $plugins_allowedtags );

	$plugin_data['Version']     = wp_kses( $plugin_data['Version'],     $plugins_allowedtags );

	$plugin_data['Description'] = wp_kses( $plugin_data['Description'], $plugins_allowedtags );

	$plugin_data['Name']        = wp_kses( $plugin_data['Name'],        $plugins_allowedtags );



	return $plugin_data;

}

4327

_get_meta_table

Definition:
function _get_meta_table($type) {}

Retrieve the name of the metadata table for the specified object type.

Parameters

  • string $type: Type of object to get metadata table for (e.g., comment, post, or user)

Return values

returns:Metadata table name, or false if no metadata table exists

Source code

function _get_meta_table($type) {

	global $wpdb;



	$table_name = $type . 'meta';



	if ( empty($wpdb->$table_name) )

		return false;



	return $wpdb->$table_name;

}

4325

_get_dropins

Definition:
function _get_dropins() {}

Returns drop-ins that WordPress uses.
Includes Multisite drop-ins only when is_multisite()

Return values

returns:Key is file name. The value is an array, with the first value the purpose of the drop-in and the second value the name of the constant that must be true for the drop-in to be used, or true if no constant is required.

Source code

function _get_dropins() {

	$dropins = array(

		'advanced-cache.php' => array( __( 'Advanced caching plugin.'       ), 'WP_CACHE' ), // WP_CACHE

		'db.php'             => array( __( 'Custom database class.'         ), true ), // auto on load

		'db-error.php'       => array( __( 'Custom database error message.' ), true ), // auto on error

		'install.php'        => array( __( 'Custom install script.'         ), true ), // auto on install

		'maintenance.php'    => array( __( 'Custom maintenance message.'    ), true ), // auto on maintenance

		'object-cache.php'   => array( __( 'External object cache.'         ), true ), // auto on load

	);



	if ( is_multisite() ) {

		$dropins['sunrise.php'       ] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE

		$dropins['blog-deleted.php'  ] = array( __( 'Custom site deleted message.'   ), true ); // auto on deleted blog

		$dropins['blog-inactive.php' ] = array( __( 'Custom site inactive message.'  ), true ); // auto on inactive blog

		$dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog

	}



	return $dropins;

}

4323

_flip_image_resource

Definition:
function _flip_image_resource($img, $horz, $vert) {}

Parameters

  • $img
  • $horz
  • $vert

Source code

function _flip_image_resource($img, $horz, $vert) {

	$w = imagesx($img);

	$h = imagesy($img);

	$dst = wp_imagecreatetruecolor($w, $h);

	if ( is_resource($dst) ) {

		$sx = $vert ? ($w - 1) : 0;

		$sy = $horz ? ($h - 1) : 0;

		$sw = $vert ? -$w : $w;

		$sh = $horz ? -$h : $h;



		if ( imagecopyresampled($dst, $img, 0, 0, $sx, $sy, $w, $h, $sw, $sh) ) {

			imagedestroy($img);

			$img = $dst;

		}

	}

	return $img;

}

4321