Feature request / suggestions
-
Hi there!
Useful little plugin (:
However, it’s a royal pain to tick off hundreds of checkboxes, one by one.
I’ve come up with a bit of javascript to toggle the entire column by clicking on the column header. There where a few css selector issues that made this really awkward to implement. Your containers for the options are all using the same ‘poststuff’ id. This is a nono, css ids must be unique. I would recommend generating the ids based on the options area, so for Dashboard options, the id would be poststuff-dashboard-options, Menu Options id becomes poststuff-menu-options, etc… perhaps use something less generic for the prefix… adminimize-menu-options?
The other issue is that for some custom user roles, such as the ones created by plugins, don’t always match up with the name of the checkboxes. For the built in roles, it’s pretty easy to select the checkboxes based on the column header… for example, the ‘Deactivate for Administrator’ column, I can grab the administrator role by removing ‘Deactivate for’ and the break tag, convert to lower case and replace spaces with underscores, be left with just the ‘adminitrator‘ role and match all the mw_adminimize_disabled_admin_bar_administrator_items[] checkboxes. If you’re using, for example, BackWPup, you get a column ‘Deactivate for BackWPup jobs helper’, and the checkboxes are named mw_adminimize_disabled_admin_bar_backwpup_helper_items[]. The ‘backwpup_helper‘ part of the name doesn’t line up with ‘backwpup_jobs_helper‘.
I’ve posted the necessary js (mod-adminimize.js) here: https://wordpress.pastebin.ca/2370833
In my functions.php I’m loading the js like this:
function my_enqueue($hook) { if( 'settings_page_adminimize/adminimize' == $hook ) wp_enqueue_script( 'my_custom_script', CHILDURI . '/js/mod-adminimize.js', array( 'jquery' ) ); } add_action( 'admin_enqueue_scripts', 'my_enqueue' );
With the above tweaks to css selectors, the js could be condensed to about half a dozen lines.
I would love to see something like this implemented in a future release of Adminimize.
Hope this helps (:
-m
- The topic ‘Feature request / suggestions’ is closed to new replies.