WC_Email::move_template_action()protectedWC 1.0

Move template action.

Метод класса: WC_Email{}

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->move_template_action( $template_type );
$template_type(строка) (обязательный)
Template type.

Код WC_Email::move_template_action() WC 8.7.0

<?php
protected function move_template_action( $template_type ) {
	$template = $this->get_template( $template_type );
	if ( ! empty( $template ) ) {
		$theme_file = $this->get_theme_template_file( $template );

		if ( wp_mkdir_p( dirname( $theme_file ) ) && ! file_exists( $theme_file ) ) {

			// Locate template file.
			$core_file     = $this->template_base . $template;
			$template_file = apply_filters( 'woocommerce_locate_core_template', $core_file, $template, $this->template_base, $this->id );

			// Copy template file.
			copy( $template_file, $theme_file );

			/**
			 * Action hook fired after copying email template file.
			 *
			 * @param string $template_type The copied template type
			 * @param string $email The email object
			 */
			do_action( 'woocommerce_copy_email_template', $template_type, $this );

			?>
			<div class="updated">
				<p><?php echo esc_html__( 'Template file copied to theme.', 'woocommerce' ); ?></p>
			</div>
			<?php
		}
	}
}