--- a/wp/wp-admin/upload.php Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-admin/upload.php Wed Sep 21 18:19:35 2022 +0200
@@ -87,8 +87,8 @@
<?php
if ( current_user_can( 'upload_files' ) ) {
?>
- <a href="<?php echo admin_url( 'media-new.php' ); ?>" class="page-title-action aria-button-if-js"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
- <?php
+ <a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action aria-button-if-js"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
+ <?php
}
?>
@@ -120,6 +120,8 @@
if ( $doaction ) {
check_admin_referer( 'bulk-media' );
+ $post_ids = array();
+
if ( 'delete_all' === $doaction ) {
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
$doaction = 'delete';
@@ -147,7 +149,7 @@
break;
case 'trash':
- if ( ! isset( $post_ids ) ) {
+ if ( empty( $post_ids ) ) {
break;
}
foreach ( (array) $post_ids as $post_id ) {
@@ -162,13 +164,13 @@
$location = add_query_arg(
array(
'trashed' => count( $post_ids ),
- 'ids' => join( ',', $post_ids ),
+ 'ids' => implode( ',', $post_ids ),
),
$location
);
break;
case 'untrash':
- if ( ! isset( $post_ids ) ) {
+ if ( empty( $post_ids ) ) {
break;
}
foreach ( (array) $post_ids as $post_id ) {
@@ -183,7 +185,7 @@
$location = add_query_arg( 'untrashed', count( $post_ids ), $location );
break;
case 'delete':
- if ( ! isset( $post_ids ) ) {
+ if ( empty( $post_ids ) ) {
break;
}
foreach ( (array) $post_ids as $post_id_del ) {
@@ -270,13 +272,18 @@
<?php
if ( current_user_can( 'upload_files' ) ) {
?>
- <a href="<?php echo admin_url( 'media-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
+ <a href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
<?php
}
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
- /* translators: %s: Search query. */
- printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', get_search_query() );
+ echo '<span class="subtitle">';
+ printf(
+ /* translators: %s: Search query. */
+ __( 'Search results for: %s' ),
+ '<strong>' . get_search_query() . '</strong>'
+ );
+ echo '</span>';
}
?>