Applying a different capability for Administrator when using Advanced Post Types Order
By default the Advanced Post Types Order plugin use the ‘switch_themes’ capability for Administrator role. There are situations when this capability is not available or is been removed or relocated for another role, meaning administrators are not able to see or change a sort.
The following code show how to change the ‘switch_themes’ to ‘activate_plugins’ capability.
//capability to see the re-order menu interface add_filter('apto_reorder_capability', 'custom_apto_reorder_capability'); //capability to allow a new sort to be created add_filter('apto/wp-admin/reorder-interface/view-settings-capability', 'custom_apto_reorder_capability'); //individual tabs view. This overwrite the default capability set through sort setting add_filter('apto/wp-admin/reorder-interface/sort-view-required-capability', 'custom_apto_reorder_capability'); function custom_apto_reorder_capability($capability) { $capability = 'activate_plugins'; return $capability; }
Subscribe
Login
0 Comments
Oldest
Newest
Most Voted
Inline Feedbacks
View all comments