| 1 |
/** |
| 2 |
* Bulk Edit |
| 3 |
* |
| 4 |
* @author ConvertKit |
| 5 |
*/ |
| 6 |
|
| 7 |
/** |
| 8 |
* Copies Bulk Edit fields into WordPress' #bulk-edit table row on load. |
| 9 |
* |
| 10 |
* WordPress' built in Bulk Edit functionality does not do this automatically |
| 11 |
* for Plugins that register settings, which is why we have this code here. |
| 12 |
* |
| 13 |
* @since 1.9.8.0 |
| 14 |
*/ |
| 15 |
document.addEventListener('DOMContentLoaded', function () { |
| 16 |
const convertKitBulkEditWrapper = document.querySelector( |
| 17 |
'tr#bulk-edit .inline-edit-wrapper fieldset.inline-edit-col-right' |
| 18 |
), |
| 19 |
convertKitBulkEdit = document.querySelector('#convertkit-bulk-edit'); |
| 20 |
|
| 21 |
if (convertKitBulkEditWrapper) { |
| 22 |
// Move Bulk Edit fields from footer into the hidden bulk-edit table row, |
| 23 |
// if a bulk-edit table row exists (it won't exist if searching returns no pages). |
| 24 |
convertKitBulkEditWrapper.appendChild(convertKitBulkEdit); |
| 25 |
|
| 26 |
// Show the Bulk Edit fields, as they are now contained in the inline-edit row which WordPress will show/hide as necessary. |
| 27 |
convertKitBulkEdit.style.display = 'block'; |
| 28 |
} |
| 29 |
}); |
| 30 |
|