WC_Admin_Post_Types::show_cpt_archive_notice()publicWC 1.0

Show a notice above the CPT archive.

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

Хуков нет.

Возвращает

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

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

$WC_Admin_Post_Types = new WC_Admin_Post_Types();
$WC_Admin_Post_Types->show_cpt_archive_notice( $post );
$post(WP_Post) (обязательный)
The current post object.

Код WC_Admin_Post_Types::show_cpt_archive_notice() WC 8.7.0

public function show_cpt_archive_notice( $post ) {
	$shop_page_id = wc_get_page_id( 'shop' );

	if ( $post && absint( $post->ID ) === $shop_page_id ) {
		echo '<div class="notice notice-info">';
		/* translators: %s: URL to read more about the shop page. */
		echo '<p>' . sprintf( wp_kses_post( __( 'This is the WooCommerce shop page. The shop page is a special archive that lists your products. <a href="%s">You can read more about this here</a>.', 'woocommerce' ) ), 'https://woo.com/document/woocommerce-pages/#section-4' ) . '</p>';
		echo '</div>';
	}
}