ActionScheduler_Abstract_ListTable::process_row_actions()protectedWC 1.0

Process the bulk actions.

Method of the class: ActionScheduler_Abstract_ListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->process_row_actions();

ActionScheduler_Abstract_ListTable::process_row_actions() code WC 9.3.1

protected function process_row_actions() {
	$parameters = array( 'row_action', 'row_id', 'nonce' );
	foreach ( $parameters as $parameter ) {
		if ( empty( $_REQUEST[ $parameter ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
			return;
		}
	}

	$action = sanitize_text_field( wp_unslash( $_REQUEST['row_action'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
	$row_id = sanitize_text_field( wp_unslash( $_REQUEST['row_id'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
	$nonce  = sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
	$method = 'row_action_' . $action; // phpcs:ignore WordPress.Security.NonceVerification.Recommended

	if ( wp_verify_nonce( $nonce, $action . '::' . $row_id ) && method_exists( $this, $method ) ) {
		$this->$method( sanitize_text_field( wp_unslash( $row_id ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	}

	if ( isset( $_SERVER['REQUEST_URI'] ) ) {
		wp_safe_redirect(
			remove_query_arg(
				array( 'row_id', 'row_action', 'nonce' ),
				esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) )
			)
		);
		exit;
	}
}