Make WordPress Core

Ticket #21092: 21092.3.diff

File 21092.3.diff, 3.6 KB (added by evansolomon, 13 years ago)

In which I'm bested by the demands of localization

  • wp-admin/includes/media.php

     
    11521152                'extra_rows' => array(),
    11531153        );
    11541154
    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        }
    11571166        if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
    11581167                if ( !EMPTY_TRASH_DAYS ) {
    11591168                        $delete = "<a href='" . wp_nonce_url( "post.php?action=delete&amp;post=$attachment_id", 'delete-attachment_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Delete Permanently' ) . '</a>';
     
    19291938 * @return unknown
    19301939 */
    19311940function 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
    19321948        if ( !apply_filters( 'disable_captions', '' ) ) {
    19331949                $caption = '
    19341950                <tr class="image-only">
     
    20092025                <tr class="image-only">
    20102026                        <td></td>
    20112027                        <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 ) . '" />
    20132029                        </td>
    20142030                </tr>
    20152031                <tr class="not-image">
    20162032                        <td></td>
    20172033                        <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 ) . '
    20192035                        </td>
    20202036                </tr>
    20212037        </tbody></table>
  • wp-includes/post.php

     
    12221222 * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
    12231223 * - all_items - String for the submenu. Default is All Posts/All Pages
    12241224 * - 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)
    12251226 *
    12261227 * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages).
    12271228 *
     
    12421243                'not_found' => array( __('No posts found.'), __('No pages found.') ),
    12431244                'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
    12441245                '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' ) ),
    12461248        );
    12471249        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    12481250        return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );