Introduction

  Edit This Page

Filter name : rtmedia_gallery_sort_actions

You can use this filter in your theme and can modify the default sorting actions.

rtmedia-sorting-actions

For example display these sorting options only to administrator role.

Add the following code in your theme's functions.php file:

function hide_rtmedia_gallery_sort_actions( $option ){
  $current_user = wp_get_current_user();
  if( $current_user->roles[0] != 'administrator' ){
    $option = null;
  }
  return $option;
}
add_filter('rtmedia_gallery_sort_actions', 'hide_rtmedia_gallery_sort_actions', 10, 1);