WC_Email::admin_actions()
Admin actions.
Description Description
Source Source
File: includes/emails/class-wc-email.php
protected function admin_actions() { // Handle any actions. if ( ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) && ( ! empty( $_GET['move_template'] ) || ! empty( $_GET['delete_template'] ) ) && 'GET' === $_SERVER['REQUEST_METHOD'] // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated ) { if ( empty( $_GET['_wc_email_nonce'] ) || ! wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wc_email_nonce'] ) ), 'woocommerce_email_template_nonce' ) ) { wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! current_user_can( 'edit_themes' ) ) { wp_die( esc_html__( 'You don’t have permission to do this.', 'woocommerce' ) ); } if ( ! empty( $_GET['move_template'] ) ) { $this->move_template_action( wc_clean( wp_unslash( $_GET['move_template'] ) ) ); } if ( ! empty( $_GET['delete_template'] ) ) { $this->delete_template_action( wc_clean( wp_unslash( $_GET['delete_template'] ) ) ); } } }