Enabled product bundles
This commit is contained in:
29
backend/wordpress/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-webhooks.php
Normal file → Executable file
29
backend/wordpress/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-webhooks.php
Normal file → Executable file
@@ -150,7 +150,7 @@ class WC_Admin_Webhooks {
|
||||
*
|
||||
* @param array $webhooks List of webhooks IDs.
|
||||
*/
|
||||
private function bulk_delete( $webhooks ) {
|
||||
public static function bulk_delete( $webhooks ) {
|
||||
foreach ( $webhooks as $webhook_id ) {
|
||||
$webhook = new WC_Webhook( (int) $webhook_id );
|
||||
$webhook->delete( true );
|
||||
@@ -179,27 +179,6 @@ class WC_Admin_Webhooks {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bulk actions.
|
||||
*/
|
||||
private function bulk_actions() {
|
||||
check_admin_referer( 'woocommerce-settings' );
|
||||
|
||||
if ( ! current_user_can( 'manage_woocommerce' ) ) {
|
||||
wp_die( esc_html__( 'You do not have permission to edit Webhooks', 'woocommerce' ) );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['action'] ) ) { // WPCS: input var okay, CSRF ok.
|
||||
$webhooks = isset( $_REQUEST['webhook'] ) ? array_map( 'absint', (array) $_REQUEST['webhook'] ) : array(); // WPCS: input var okay, CSRF ok.
|
||||
|
||||
$action = sanitize_text_field( wp_unslash( $_REQUEST['action'] ) ); // WPCS: input var okay, CSRF ok.
|
||||
|
||||
if ( 'delete' === $action ) {
|
||||
$this->bulk_delete( $webhooks );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Webhooks admin actions.
|
||||
*/
|
||||
@@ -210,11 +189,6 @@ class WC_Admin_Webhooks {
|
||||
$this->save();
|
||||
}
|
||||
|
||||
// Bulk actions.
|
||||
if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['webhook'] ) ) { // WPCS: input var okay, CSRF ok.
|
||||
$this->bulk_actions();
|
||||
}
|
||||
|
||||
// Delete webhook.
|
||||
if ( isset( $_GET['delete'] ) ) { // WPCS: input var okay, CSRF ok.
|
||||
$this->delete();
|
||||
@@ -299,6 +273,7 @@ class WC_Admin_Webhooks {
|
||||
$count = count( $data_store->get_webhooks_ids() );
|
||||
|
||||
if ( 0 < $count ) {
|
||||
$webhooks_table_list->process_bulk_action();
|
||||
$webhooks_table_list->prepare_items();
|
||||
|
||||
echo '<input type="hidden" name="page" value="wc-settings" />';
|
||||
|
||||
Reference in New Issue
Block a user