Ticket #21092: 21092.3.diff
| File 21092.3.diff, 3.6 KB (added by , 13 years ago) |
|---|
-
wp-admin/includes/media.php
1152 1152 'extra_rows' => array(), 1153 1153 ); 1154 1154 1155 if ( $send ) 1156 $send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false ); 1155 if ( $send ) { 1156 if ( isset( $_POST ) && isset( $_POST['attachment_id'] ) ) 1157 $parent_type = get_post_type( wp_get_post_parent_id( $_POST['attachment_id'] ) ); 1158 elseif ( isset( $_GET ) && isset( $_GET['post_id'] ) ) 1159 $parent_type = get_post_type( $_GET['post_id'] ); 1160 else 1161 $parent_type = 'post'; 1162 1163 $parent_type_obj = get_post_type_object( $parent_type ); 1164 $send = get_submit_button( $parent_type_obj->labels->insert_into_post, 'button', "send[$attachment_id]", false ); 1165 } 1157 1166 if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { 1158 1167 if ( !EMPTY_TRASH_DAYS ) { 1159 1168 $delete = "<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-attachment_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Delete Permanently' ) . '</a>'; … … 1929 1938 * @return unknown 1930 1939 */ 1931 1940 function wp_media_insert_url_form( $default_view = 'image' ) { 1941 if( isset( $_GET ) && isset( $_GET['post_id'] ) ) 1942 $parent_type = get_post_type( $_GET['post_id'] ); 1943 else 1944 $parent_type = 'post'; 1945 1946 $parent_type_obj = get_post_type_object( $parent_type ); 1947 1932 1948 if ( !apply_filters( 'disable_captions', '' ) ) { 1933 1949 $caption = ' 1934 1950 <tr class="image-only"> … … 2009 2025 <tr class="image-only"> 2010 2026 <td></td> 2011 2027 <td> 2012 <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__( 'Insert into Post') . '" />2028 <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__( $parent_type_obj->labels->insert_into_post ) . '" /> 2013 2029 </td> 2014 2030 </tr> 2015 2031 <tr class="not-image"> 2016 2032 <td></td> 2017 2033 <td> 2018 ' . get_submit_button( __( 'Insert into Post' ), 'button', 'insertonlybutton', false ) . '2034 ' . get_submit_button( $parent_type_obj->labels->insert_into_post, 'button', 'insertonlybutton', false ) . ' 2019 2035 </td> 2020 2036 </tr> 2021 2037 </tbody></table> -
wp-includes/post.php
1222 1222 * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page: 1223 1223 * - all_items - String for the submenu. Default is All Posts/All Pages 1224 1224 * - menu_name - Default is the same as <code>name</code> 1225 * - insert_into_post - String for the media uploader screen. Default is Insert Into Post (non-hier) or Insert Into Page (hier) 1225 1226 * 1226 1227 * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages). 1227 1228 * … … 1242 1243 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1243 1244 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1244 1245 'parent_item_colon' => array( null, __('Parent Page:') ), 1245 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1246 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 1247 'insert_into_post' => array( __( 'Insert Into Post' ), __( 'Insert Into Page' ) ), 1246 1248 ); 1247 1249 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1248 1250 return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );