[Plugin: Category Order and Taxonomy Terms Order] Unauthorized Viewing
-
Noticed while locking down the admin that the Taxonomy Order menu item for pages and posts was visible and unregulated. Fixed by editing lines 108 – 112 of taxonomy-terms-order.php.
Old code:
if ($post_type == 'post') add_submenu_page('edit.php', 'Taxonomy Order', 'Taxonomy Order', 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' ); else add_submenu_page('edit.php?post_type='.$post_type, 'Taxonomy Order', 'Taxonomy Order', 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );New Code:
if ($post_type == 'post'){ if(current_user_can('administrator')){ add_submenu_page('edit.php', 'Taxonomy Order', 'Taxonomy Order', 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );} }else{ if(current_user_can('administrator')){ add_submenu_page('edit.php?post_type='.$post_type, 'Taxonomy Order', 'Taxonomy Order', 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );} }Note that this could easily be adapted for a custom capability and managed with User Role Editor.
Cheers!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘[Plugin: Category Order and Taxonomy Terms Order] Unauthorized Viewing’ is closed to new replies.