X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0459461f9ea42e0b090759ff6fe5f48360bef750..refs/tags/wordpress-4.5:/wp-admin/includes/media.php
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 9990b9fd..194e8273 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -111,24 +111,28 @@ function the_media_upload_tabs() {
* @param string $title Image title attribute.
* @param string $align Image CSS alignment property.
* @param string $url Optional. Image src URL. Default empty.
- * @param string $rel Optional. Image rel attribute. Default empty.
+ * @param bool|string $rel Optional. Value for rel attribute or whether to add a dafault value. Default false.
* @param string|array $size Optional. Image size. Accepts any valid image size, or an array of width
* and height values in pixels (in that order). Default 'medium'.
* @param string $alt Optional. Image alt attribute. Default empty.
* @return string The HTML output to insert into the editor.
*/
-function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $rel = '', $size = 'medium', $alt = '' ) {
+function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $rel = false, $size = 'medium', $alt = '' ) {
- $html = get_image_tag($id, $alt, '', $align, $size);
+ $html = get_image_tag( $id, $alt, '', $align, $size );
- if ( ! $rel ) {
- $rel = ' rel="attachment wp-att-' . esc_attr( $id ) . '"';
+ if ( $rel ) {
+ if ( is_string( $rel ) ) {
+ $rel = ' rel="' . esc_attr( $rel ) . '"';
+ } else {
+ $rel = ' rel="attachment wp-att-' . intval( $id ) . '"';
+ }
} else {
- $rel = ' rel="' . esc_attr( $rel ) . '"';
+ $rel = '';
}
if ( $url )
- $html = '$html";
+ $html = '' . $html . '';
/**
* Filter the image HTML markup to send to the editor.
@@ -158,11 +162,11 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re
* @param string $html
* @param integer $id
* @param string $caption image caption
- * @param string $alt image alt attribute
* @param string $title image title attribute
* @param string $align image css alignment property
* @param string $url image src url
* @param string $size image size (thumbnail, medium, large, full or added with add_image_size() )
+ * @param string $alt image alt attribute
* @return string
*/
function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $alt = '' ) {
@@ -455,7 +459,7 @@ wp_enqueue_style( 'colors' );
// Check callback name for 'media'
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
|| ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) )
- wp_enqueue_style( 'media' );
+ wp_enqueue_style( 'deprecated-media' );
wp_enqueue_style( 'ie' );
?>