woocommerce_create_pages хук-фильтрWC 2.1.0

Determines which pages are created during install.

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

add_filter( 'woocommerce_create_pages', 'wp_kama_woocommerce_create_pages_filter' );

/**
 * Function for `woocommerce_create_pages` filter-hook.
 * 
 * @param  $array 
 *
 * @return 
 */
function wp_kama_woocommerce_create_pages_filter( $array ){

	// filter...
	return $array;
}
$array
-

Список изменений

С версии 2.1.0 Введена.

Где вызывается хук

WC_Install::create_pages()
woocommerce_create_pages
woocommerce/includes/class-wc-install.php 832-862
$pages = apply_filters(
	'woocommerce_create_pages',
	array(
		'shop'           => array(
			'name'    => _x( 'shop', 'Page slug', 'woocommerce' ),
			'title'   => _x( 'Shop', 'Page title', 'woocommerce' ),
			'content' => '',
		),
		'cart'           => array(
			'name'    => _x( 'cart', 'Page slug', 'woocommerce' ),
			'title'   => _x( 'Cart', 'Page title', 'woocommerce' ),
			'content' => $cart_page_content,
		),
		'checkout'       => array(
			'name'    => _x( 'checkout', 'Page slug', 'woocommerce' ),
			'title'   => _x( 'Checkout', 'Page title', 'woocommerce' ),
			'content' => $checkout_page_content,
		),
		'myaccount'      => array(
			'name'    => _x( 'my-account', 'Page slug', 'woocommerce' ),
			'title'   => _x( 'My account', 'Page title', 'woocommerce' ),
			'content' => '<!-- wp:shortcode -->[' . $my_account_shortcode . ']<!-- /wp:shortcode -->',
		),
		'refund_returns' => array(
			'name'        => _x( 'refund_returns', 'Page slug', 'woocommerce' ),
			'title'       => _x( 'Refund and Returns Policy', 'Page title', 'woocommerce' ),
			'content'     => self::get_refunds_return_policy_page_content(),
			'post_status' => 'draft',
		),
	)
);

Где используется хук в WooCommerce

woocommerce/src/Blocks/Installer.php 16
add_filter( 'woocommerce_create_pages', array( $this, 'create_pages' ) );