index_rel_link

Definition:
function index_rel_link() {}

Display relational link for the site index.

Source code

function index_rel_link() {

	echo get_index_rel_link();

}

2009

includes_url

Definition:
function includes_url($path = '') {}

Retrieve the url to the includes directory.

Parameters

  • string $path: Optional. Path relative to the includes url.

Return values

returns:Includes url link with optional path appended.

Defined filters

  • includes_url
    apply_filters('includes_url', $url, $path)

Source code

function includes_url($path = '') {

	$url = site_url() . '/' . WPINC . '/';



	if ( !empty($path) && is_string($path) && strpos($path, '..') === false )

		$url .= ltrim($path, '/');



	return apply_filters('includes_url', $url, $path);

}

2007

img_caption_shortcode

Definition:
function img_caption_shortcode($attr, $content = null) {}

The Caption shortcode.
Allows a plugin to replace the content that would otherwise be returned. The filter is ‘img_caption_shortcode’ and passes an empty string, the attr parameter and the content parameter values.

Parameters

  • array $attr: Attributes attributed to the shortcode.
  • string $content: Optional. Shortcode content.

Defined filters

  • img_caption_shortcode
    apply_filters('img_caption_shortcode', '', $attr, $content)

Source code

function img_caption_shortcode($attr, $content = null) {



	// Allow plugins/themes to override the default caption template.

	$output = apply_filters('img_caption_shortcode', '', $attr, $content);

	if ( $output != '' )

		return $output;



	extract(shortcode_atts(array(

		'id'	=> '',

		'align'	=> 'alignnone',

		'width'	=> '',

		'caption' => ''

	), $attr));



	if ( 1 > (int) $width || empty($caption) )

		return $content;



	if ( $id ) $id = 'id="' . esc_attr($id) . '" ';



	return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">'

	. do_shortcode( $content ) . '<p class="wp-caption-text">' . $caption . '</p></div>';

}

2005

image_size_input_fields

Definition:
function image_size_input_fields( $post, $check = '' ) {}

Retrieve HTML for the size radio buttons with the specified one checked.

Parameters

  • unknown_type $post
  • unknown_type $check

Source code

function image_size_input_fields( $post, $check = '' ) {



		// get a list of the actual pixel dimensions of each possible intermediate version of this image

		$size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size'));



		if ( empty($check) )

			$check = get_user_setting('imgsize', 'medium');



		foreach ( $size_names as $size => $label ) {

			$downsize = image_downsize($post->ID, $size);

			$checked = '';



			// is this size selectable?

			$enabled = ( $downsize[3] || 'full' == $size );

			$css_id = "image-size-{$size}-{$post->ID}";

2003

image_resize_dimensions

Definition:
function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = false) {}

Retrieve calculated resized dimensions for use in imagecopyresampled().
Calculate dimensions and coordinates for a resized image that fits within a specified width and height. If $crop is true, the largest matching central portion of the image will be cropped out and resized to the required size.

Parameters

  • int $orig_w: Original width.
  • int $orig_h: Original height.
  • int $dest_w: New width.
  • int $dest_h: New height.
  • bool $crop: Optional, default is false. Whether to crop image or resize.

Return values

returns:False on failure. Returned array matches parameters for imagecopyresampled() PHP function.

Source code

function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = false) {



	if ($orig_w <= 0 || $orig_h <= 0)

		return false;

	// at least one of dest_w or dest_h must be specific

	if ($dest_w <= 0 && $dest_h <= 0)

		return false;



	if ( $crop ) {

		// crop the largest possible portion of the original image that we can size to $dest_w x $dest_h

		$aspect_ratio = $orig_w / $orig_h;

		$new_w = min($dest_w, $orig_w);

		$new_h = min($dest_h, $orig_h);



		if ( !$new_w ) {

			$new_w = intval($new_h * $aspect_ratio);

		}



		if ( !$new_h ) {

			$new_h = intval($new_w / $aspect_ratio);

		}



		$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);



		$crop_w = round($new_w / $size_ratio);

		$crop_h = round($new_h / $size_ratio);



		$s_x = floor( ($orig_w - $crop_w) / 2 );

		$s_y = floor( ($orig_h - $crop_h) / 2 );

	} else {

		// don't crop, just resize using $dest_w x $dest_h as a maximum bounding box

		$crop_w = $orig_w;

		$crop_h = $orig_h;



		$s_x = 0;

		$s_y = 0;



		list( $new_w, $new_h ) = wp_constrain_dimensions( $orig_w, $orig_h, $dest_w, $dest_h );

	}



	// if the resulting image would be the same size or larger we don't want to resize it

	if ( $new_w >= $orig_w && $new_h >= $orig_h )

		return false;



	// the return array matches the parameters to imagecopyresampled()

	// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h

	return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );



}

2001