Inventory_Presser_Additional_Listings_Pages::change_page_title( mixed $post_type_name, mixed $post_type )
change_page_title
Contents
Parameters Parameters
- $post_type_name
-
(mixed) (Required)
- $post_type
-
(mixed) (Required)
Return Return
(string)
Source Source
File: includes/class-additional-listings-pages.php
public function change_page_title( $post_type_name, $post_type ) { if ( ! class_exists( 'INVP' ) || INVP::POST_TYPE !== $post_type ) { return $post_type_name; } global $wp; foreach ( self::additional_listings_pages_array() as $additional_listing ) { // is this rule valid? if ( ! self::is_valid_rule( $additional_listing ) ) { continue; } // our URL path will match the beginning of the rewrite rule. if ( substr( $wp->matched_rule, 0, strlen( $additional_listing['url_path'] ) ) === $additional_listing['url_path'] && ! empty( $additional_listing['title'] ) ) { return $additional_listing['title']; } } return $post_type_name; }
Expand full source code Collapse full source code View on Github