Last active
March 27, 2017 09:27
-
-
Save BhargavBhandari90/293b5d4268874c30150f3ff0653ad05e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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