Skip to content

Instantly share code, notes, and snippets.

@BhargavBhandari90
Last active March 27, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BhargavBhandari90/293b5d4268874c30150f3ff0653ad05e to your computer and use it in GitHub Desktop.
Save BhargavBhandari90/293b5d4268874c30150f3ff0653ad05e to your computer and use it in GitHub Desktop.
<?php
/**
* rtmedia_enable_tabular_view Show medias in tabular format.
* @param bool $status Status of function.
* @return bool Returns true tabular format is enabled from rtMedia settings.
*/
function rtmedia_enable_tabular_view( $status ) {
global $rtmedia_query;
if ( function_exists( 'rtm_is_document_table_view_enabled' ) && rtm_is_document_table_view_enabled() && isset( $rtmedia_query->action_query->action ) && 'edit' !== $rtmedia_query->action_query->action ) {
if ( ( function_exists( 'is_rtmedia_album' ) && is_rtmedia_album() ) || ( function_exists( 'is_rtmedia_gallery' ) && is_rtmedia_gallery() ) ) {
$status = true;
}
}
return $status;
}
add_filter( 'rtmedia_other_files_is_document_tab', 'rtmedia_enable_tabular_view', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment