Changeset 12304 for trunk/wp-admin/includes/media.php
- Timestamp:
- 12/01/2009 09:22:48 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/media.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r12297 r12304 483 483 if ( !empty($_POST['insertonlybutton']) ) { 484 484 $alt = $align = ''; 485 if ( !empty($_POST['insertonly']['embed-src']) ) { 486 $src = $_POST['insertonly']['embed-src']; 487 if ( !strpos($src, '://') ) 488 $src = "http://$src"; 489 $html = '[embed]' . esc_url($src) . '[/embed]'; 490 } else { 491 $src = $_POST['insertonly']['src']; 492 if ( !empty($src) && !strpos($src, '://') ) 493 $src = "http://$src"; 494 $alt = esc_attr($_POST['insertonly']['alt']); 495 if ( isset($_POST['insertonly']['align']) ) { 496 $align = esc_attr($_POST['insertonly']['align']); 497 $class = " class='align$align'"; 498 } 499 if ( !empty($src) ) 500 $html = "<img src='" . esc_url($src) . "' alt='$alt'$class />"; 485 486 $src = $_POST['insertonly']['src']; 487 if ( !empty($src) && !strpos($src, '://') ) 488 $src = "http://$src"; 489 $alt = esc_attr($_POST['insertonly']['alt']); 490 if ( isset($_POST['insertonly']['align']) ) { 491 $align = esc_attr($_POST['insertonly']['align']); 492 $class = " class='align$align'"; 501 493 } 494 if ( !empty($src) ) 495 $html = "<img src='" . esc_url($src) . "' alt='$alt'$class />"; 502 496 503 497 $html = apply_filters('image_send_to_editor_url', $html, esc_url_raw($src), $alt, $align); … … 597 591 $href = "http://$href"; 598 592 599 $html = '[embed]' . esc_url($href) . '[/embed]'; 600 $html = apply_filters('audio_send_to_editor_url', $html, esc_url_raw($href)); 593 $title = esc_attr($_POST['insertonly']['title']); 594 if ( empty($title) ) 595 $title = esc_attr( basename($href) ); 596 597 if ( !empty($title) && !empty($href) ) 598 $html = "<a href='" . esc_url($href) . "' >$title</a>"; 599 600 $html = apply_filters('audio_send_to_editor_url', $html, $href, $title); 601 601 602 return media_send_to_editor($html); 602 603 } … … 648 649 $href = "http://$href"; 649 650 650 $html = '[embed]' . esc_url($href) . '[/embed]'; 651 $html = apply_filters('video_send_to_editor_url', $html, esc_url_raw($href)); 651 $title = esc_attr($_POST['insertonly']['title']); 652 if ( empty($title) ) 653 $title = esc_attr( basename($href) ); 654 655 if ( !empty($title) && !empty($href) ) 656 $html = "<a href='" . esc_url($href) . "' >$title</a>"; 657 658 $html = apply_filters('video_send_to_editor_url', $html, $href, $title); 659 652 660 return media_send_to_editor($html); 653 661 } … … 1540 1548 var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = ''; 1541 1549 1542 if ( '' != document.getElementById('embed-src').value )1543 return true;1544 1545 1550 if ( '' == f.src.value || '' == t.width ) 1546 1551 return false; … … 1952 1957 1953 1958 return ' 1954 <h4 class="media-sub-title">' . __('Embed a picture from a web site that supports oEmbed') . '</h4>1955 <table class="describe"><tbody>1956 <tr>1957 <th valign="top" scope="row" class="label" style="width:130px;">1958 <span class="alignleft"><label for="embed-src">' . __('Embed image') . '</label></span>1959 <span class="alignright"><abbr title="required" class="required">*</abbr></span>1960 </th>1961 <td class="field"><input id="embed-src" name="insertonly[embed-src]" value="" type="text" /></td>1962 </tr>1963 1964 <tr>1965 <td></td>1966 <td>1967 <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Embed') . '" />1968 </td>1969 </tr>1970 </tbody></table>1971 1972 1959 <h4 class="media-sub-title">' . __('Insert an image from another web site') . '</h4> 1973 1960 <table class="describe"><tbody> … … 2049 2036 <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td> 2050 2037 </tr> 2051 2038 <tr> 2039 <th valign="top" scope="row" class="label"> 2040 <span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span> 2041 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 2042 </th> 2043 <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td> 2044 </tr> 2045 <tr><td></td><td class="help">' . __('Link text, e.g. “Still Alive by Jonathan Coulton”') . '</td></tr> 2052 2046 <tr> 2053 2047 <td></td> … … 2077 2071 <td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td> 2078 2072 </tr> 2079 2073 <tr> 2074 <th valign="top" scope="row" class="label"> 2075 <span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span> 2076 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 2077 </th> 2078 <td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td> 2079 </tr> 2080 <tr><td></td><td class="help">' . __('Link text, e.g. “Lucy on YouTube“') . '</td></tr> 2080 2081 <tr> 2081 2082 <td></td>
Note: See TracChangeset
for help on using the changeset viewer.