Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('display_post_states', 'wpsites_custom_post_states');
- function wpsites_custom_post_states($states) {
- global $post;
- if( ('page' == get_post_type($post->ID) )
- && ( '/themes/Lef-en-Liefde/woningoverzicht.php' == get_page_template_slug( $post->ID ) ) ) {
- $states[] = __('Custom state');
- }
- }
- add_filter('display_post_states', 'wpse240081_custom_post_states');
- function wpse240081_custom_post_states( $states, $post ) {
- if ( ( 'page' == get_post_type( $post->ID ) )
- && ( 'woningoverzicht.php' == get_page_template_slug( $post->ID ) ) ) {
- $states[] = __('Custom state');
- }
- return $states;
- }
- <?php
- add_filter( 'display_post_states', 'add_display_post_states', 10, 2 );
- /**
- * Add a post display state for special WC pages in the page list table.
- *
- * @param array $post_states An array of post display states.
- * @param WP_Post $post The current post object.
- */
- function add_display_post_states( $post_states, $post ) {
- if ( wc_get_page_id( 'shop' ) === $post->ID ) {
- $post_states['wc_page_for_shop'] = __( 'Shop Page', 'woocommerce' );
- }
- if ( wc_get_page_id( 'cart' ) === $post->ID ) {
- $post_states['wc_page_for_cart'] = __( 'Cart Page', 'woocommerce' );
- }
- if ( wc_get_page_id( 'checkout' ) === $post->ID ) {
- $post_states['wc_page_for_checkout'] = __( 'Checkout Page', 'woocommerce' );
- }
- if ( wc_get_page_id( 'myaccount' ) === $post->ID ) {
- $post_states['wc_page_for_myaccount'] = __( 'My Account Page', 'woocommerce' );
- }
- if ( wc_get_page_id( 'terms' ) === $post->ID ) {
- $post_states['wc_page_for_terms'] = __( 'Terms and Conditions Page', 'woocommerce' );
- }
- return $post_states;
- }
Add Comment
Please, Sign In to add comment