WC_Email::admin_actions
Admin actions.
Метод класса: WC_Email{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->admin_actions();
Код WC_Email::admin_actions() WC Email::admin actions WC 10.5.2
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'] ) ) );
}
}
}