mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
Media: In get_image_send_to_editor()
, allow a custom value for $rel
.
Props tychay. Fixes #32074. Built from https://develop.svn.wordpress.org/trunk@34259 git-svn-id: http://core.svn.wordpress.org/trunk@34223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ad0eb9c442
commit
63efd92b11
@ -106,21 +106,24 @@ function the_media_upload_tabs() {
|
|||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*
|
*
|
||||||
* @param integer $id image attachment id
|
* @param int $id image attachment id
|
||||||
* @param string $caption image caption
|
* @param string $caption image caption
|
||||||
* @param string $alt image alt attribute
|
* @param string $title image title attribute
|
||||||
* @param string $title image title attribute
|
* @param string $align image css alignment property
|
||||||
* @param string $align image css alignment property
|
* @param string $url image src url
|
||||||
* @param string $url image src url
|
* @param string $rel image rel attribute
|
||||||
* @param string|bool $rel image rel attribute
|
* @param string $size image size (thumbnail, medium, large, full or added with add_image_size() )
|
||||||
* @param string $size image size (thumbnail, medium, large, full or added with add_image_size() )
|
|
||||||
* @return string the html to insert into editor
|
* @return string the html to insert into editor
|
||||||
*/
|
*/
|
||||||
function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') {
|
function get_image_send_to_editor( $id, $caption, $title, $align, $url='', $rel = '', $size='medium', $alt = '' ) {
|
||||||
|
|
||||||
$html = get_image_tag($id, $alt, '', $align, $size);
|
$html = get_image_tag($id, $alt, '', $align, $size);
|
||||||
|
|
||||||
$rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : '';
|
if ( ! $rel ) {
|
||||||
|
$rel = ' rel="attachment wp-att-' . esc_attr( $id ) . '"';
|
||||||
|
} else {
|
||||||
|
$rel = ' rel="' . esc_attr( $rel ) . '"';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $url )
|
if ( $url )
|
||||||
$html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
|
$html = '<a href="' . esc_attr($url) . "\"$rel>$html</a>";
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-alpha-34258';
|
$wp_version = '4.4-alpha-34259';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user