From 0de15fa7d91ba56c1d5e30a7dce0625e04bddc55 Mon Sep 17 00:00:00 2001 From: Amaan Khan Date: Fri, 10 Mar 2023 14:49:36 +0530 Subject: [PATCH] refactor: updates query & error message --- admin/rt-retranscode-admin.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/admin/rt-retranscode-admin.php b/admin/rt-retranscode-admin.php index 461b844..461e3dc 100644 --- a/admin/rt-retranscode-admin.php +++ b/admin/rt-retranscode-admin.php @@ -317,13 +317,29 @@ public function retranscode_interface() { } } else { add_filter( 'posts_where', array( $this, 'add_search_mime_types' ) ); - $query = new WP_Query( array( 'post_type' => 'attachments' ) ); + $query = new WP_Query( + array( + 'post_type' => 'attachment', + 'post_status' => 'any', + ) + ); $media = $query->get_posts(); remove_filter( 'posts_where', array( $this, 'add_search_mime_types' ) ); if ( empty( $media ) || is_wp_error( $media ) ) { - // translators: Link to the media page. - echo '

' . sprintf( esc_html__( "Unable to find any media. Are you sure some exist?", 'transcoder' ), esc_url( admin_url( 'upload.php' ) ) ) . '

'; + echo sprintf( + '

' . + wp_kses( + // Translators: %s is a link to media page. + __( 'Unable to find media. Are you sure some exists?', 'transcoder' ), + array( + 'a' => array( 'href' => array() ), + ) + ) + . '

', + esc_url( admin_url( 'upload.php' ) ) + ); + return; }