Ticket #13418: 13418.2.diff
File 13418.2.diff, 2.0 KB (added by , 8 years ago) |
---|
-
wp-admin/includes/media.php
1924 1924 * 1925 1925 * @param array $errors 1926 1926 */ 1927 function media_upload_library_form( $errors) {1927 function media_upload_library_form( $errors ) { 1928 1928 global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types; 1929 1929 1930 1930 media_upload_header(); 1931 1931 1932 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; 1932 if( isset( $_REQUEST['post_id'] ) ) { 1933 $post_id = ( int ) $_REQUEST['post_id']; 1934 } else { 1935 $post_id = 0; 1936 } 1933 1937 1934 $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id");1935 $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type);1938 $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" ); 1939 $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); 1936 1940 $form_class = 'media-upload-form validate'; 1937 1941 1938 if ( get_user_setting( 'uploader') )1942 if ( get_user_setting( 'uploader' ) ) 1939 1943 $form_class .= ' html-uploader'; 1940 1944 1941 $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; 1945 if( isset( $_GET['paged'] ) ){ 1946 $_GET['paged'] = ( int ) $_GET['paged']; 1947 } else { 1948 $_GET['paged'] = 0; 1949 } 1950 1942 1951 if ( $_GET['paged'] < 1 ) 1943 1952 $_GET['paged'] = 1; 1944 1953 $start = ( $_GET['paged'] - 1 ) * 10; … … 1953 1962 <form id="filter" action="" method="get"> 1954 1963 <input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" /> 1955 1964 <input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" /> 1956 <input type="hidden" name="post_id" value="<?php echo (int)$post_id; ?>" />1965 <input type="hidden" name="post_id" value="<?php echo $post_id; ?>" /> 1957 1966 <input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" /> 1958 1967 <input type="hidden" name="context" value="<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>" /> 1959 1968