wp_sidebar_description

Definition:
function wp_sidebar_description( $id ) {}

Retrieve description for a sidebar.
When registering sidebars a ‘description’ parameter can be included that describes the sidebar for display on the widget administration panel.

Parameters

  • int|string $id: sidebar ID.

Return values

returns:Sidebar description, if available. Null on failure to retrieve description.

Source code

function wp_sidebar_description( $id ) {

	if ( !is_scalar($id) )

		return;



	global $wp_registered_sidebars;



	if ( isset($wp_registered_sidebars[$id]['description']) )

		return esc_html( $wp_registered_sidebars[$id]['description'] );

}

4129

wp_shrink_dimensions

Definition:
function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {}

Calculates the new dimensions for a downsampled image.

Parameters

  • int $width: Current width of the image
  • int $height: Current height of the image
  • int $wmax: Maximum wanted width
  • int $hmax: Maximum wanted height

Return values

returns:Array(height,width) of shrunk dimensions.

Source code

function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {

	_deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' );

	return wp_constrain_dimensions( $width, $height, $wmax, $hmax );

}

4127

wp_shortlink_wp_head

Definition:
function wp_shortlink_wp_head() {}

Inject rel=shortlink into head if a shortlink is defined for the current page.
Attached to the wp_head action.

Source code

function wp_shortlink_wp_head() {

	$shortlink = wp_get_shortlink( 0, 'query' );



	if ( empty( $shortlink ) )

		return;



	echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";

}

4125

wp_shortlink_header

Definition:
function wp_shortlink_header() {}

Send a Link: rel=shortlink header if a shortlink is defined for the current page.
Attached to the wp action.

Source code

function wp_shortlink_header() {

	if ( headers_sent() )

		return;



	$shortlink = wp_get_shortlink(0, 'query');



	if ( empty($shortlink) )

		return;



	header('Link: <' . $shortlink . '>; rel=shortlink', false);

}

4123