Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-250: Fixes Retranscode Page [Develop] #267

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions admin/rt-retranscode-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' <p>' . sprintf( esc_html__( "Unable to find any media. Are you sure <a href='%s'>some exist</a>?", 'transcoder' ), esc_url( admin_url( 'upload.php' ) ) ) . '</p></div>';
echo sprintf(
'<p>' .
wp_kses(
// Translators: %s is a link to media page.
__( 'Unable to find media. Are you sure <a href="%s">some exists</a>?', 'transcoder' ),
array(
'a' => array( 'href' => array() ),
)
)
. '</p>',
esc_url( admin_url( 'upload.php' ) )
);

return;
}

Expand Down