Answer the question
In order to leave comments, you need to log in
How to add a "Select All" checkbox to the admin area of your Wordpress plugin?
Hello!
In WP, as in all CMS, it is possible to select all records in the table by highlighting the checkbox. In the code of one of the plugins, it looks like this:
<th scope="col" class="manage-column column-cb check-column">
<input type="checkbox" />
</th>
<td>
<input class="icl_st_row_cb" type="checkbox" value="<?php echo $string_id ?>" />
</td>
Answer the question
In order to leave comments, you need to log in
More than 100% sure that such functionality is implemented by more than one php. It was not without
a piece of js like this stackoverflow.com/questions/2228382/select-all-che....
In order for you to implement support for your js script in the admin part of WordPress, you should read this codex.wordpress.org/Plugin_API/Action_Reference/ad...
The idea is this:
1. Create an input type=checkbox in the form (as it already is) , give it a unique id (useful in step 2)
2. Create a js file for the administrative part of your plugin
3. Write in this script a code similar to the one in my first link, only for the id of your checkbox
4. Include this js file for the admin part of your plugin using the knowledge from my second link
...
5 ???
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question