get_sidebar

Definition:
function get_sidebar( $name = null ) {}

Load sidebar template.
Includes the sidebar template for a theme or if a name is specified then a specialised sidebar will be included.

Parameters

  • string $name: The name of the specialised sidebar.

Defined actions

  • get_sidebar
    do_action( 'get_sidebar', $name );

Source code

function get_sidebar( $name = null ) {

	do_action( 'get_sidebar', $name );



	$templates = array();

	if ( isset($name) )

		$templates[] = "sidebar-{$name}.php";

1689

get_shortcut_link

Definition:
function get_shortcut_link() {}

Retrieve shortcut link.
Use this in ‘a’ element ‘href’ attribute.

Defined filters

  • shortcut_link
    apply_filters('shortcut_link', $link)

Source code

function get_shortcut_link() {

	$link = "javascript:

			var d=document,

			w=window,

			e=w.getSelection,

			k=d.getSelection,

			x=d.selection,

			s=(e?e():(k)?k():(x?x.createRange().text:0)),

			f='" . admin_url('press-this.php') . "',

			l=d.location,

			e=encodeURIComponent,

			u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';

			a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))l.href=u;};

			if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();

			void(0)";



	$link = str_replace(array("\r", "\n", "\t"),  '', $link);



	return apply_filters('shortcut_link', $link);

}

1687

get_shortcode_regex

Definition:
function get_shortcode_regex() {}

Retrieve the shortcode regular expression for searching.
The regular expression combines the shortcode tags in the regular expression in a regex class.

Return values

returns:The shortcode search regular expression

Source code

function get_shortcode_regex() {

	global $shortcode_tags;

	$tagnames = array_keys($shortcode_tags);

	$tagregexp = join( '|', array_map('preg_quote', $tagnames) );



	// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()

	return

		  '\\['                              // Opening bracket

		. '(\\[?)'                           // 1: Optional second opening bracket for escaping shortcodes: [[tag]]

		. "($tagregexp)"                     // 2: Shortcode name

		. '\\b'                              // Word boundary

		. '('                                // 3: Unroll the loop: Inside the opening shortcode tag

		.     '[^\\]\\/]*'                   // Not a closing bracket or forward slash

		.     '(?:'

		.         '\\/(?!\\])'               // A forward slash not followed by a closing bracket

		.         '[^\\]\\/]*'               // Not a closing bracket or forward slash

		.     ')*?'

		. ')'

		. '(?:'

		.     '(\\/)'                        // 4: Self closing tag ...

		.     '\\]'                          // ... and closing bracket

		. '|'

		.     '\\]'                          // Closing bracket

		.     '(?:'

		.         '('                        // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags

		.             '[^\\[]*+'             // Not an opening bracket

		.             '(?:'

		.                 '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag

		.                 '[^\\[]*+'         // Not an opening bracket

		.             ')*+'

		.         ')'

		.         '\\[\\/\\2\\]'             // Closing shortcode tag

		.     ')?'

		. ')'

		. '(\\]?)';                          // 6: Optional second closing brocket for escaping shortcodes: [[tag]]

}

1685

get_settings_errors

Definition:
function get_settings_errors( $setting = '', $sanitize = FALSE ) {}

Fetch settings errors registered by add_settings_error()
Checks the $wp_settings_errors array for any errors declared during the current pageload and returns them.

Parameters

  • string $setting: Optional slug title of a specific setting who’s errors you want.
  • boolean $sanitize: Whether to re-sanitize the setting value before returning errors.

Return values

returns:Array of settings errors

Source code

function get_settings_errors( $setting = '', $sanitize = FALSE ) {

	global $wp_settings_errors;



	// If $sanitize is true, manually re-run the sanitizisation for this option

	// This allows the $sanitize_callback from register_setting() to run, adding

	// any settings errors you want to show by default.

	if ( $sanitize )

		sanitize_option( $setting, get_option($setting));



	// If settings were passed back from options.php then use them

	// Ignore transients if $sanitize is true, we dont' want the old values anyway

	if ( isset($_GET['settings-updated']) && $_GET['settings-updated'] && get_transient('settings_errors') ) {

		$settings_errors = get_transient('settings_errors');

		delete_transient('settings_errors');

	// Otherwise check global in case validation has been run on this pageload

	} elseif ( count( $wp_settings_errors ) ) {

		$settings_errors = $wp_settings_errors;

	} else {

		return;

	}



	// Filter the results to those of a specific setting if one was set

	if ( $setting ) {

		foreach ( (array) $settings_errors as $key => $details )

			if ( $setting != $details['setting'] )

				unset( $settings_errors[$key] );

	}

	return $settings_errors;

}

1683

get_settings

Definition:
function get_settings($option) {}

Get value based on option.

Parameters

  • string $option

Source code

function get_settings($option) {

	_deprecated_function( __FUNCTION__, '2.1', 'get_option()' );



	return get_option($option);

}

1681