Changeset 7276 for trunk/src/includes/common/template.php
- Timestamp:
- 07/02/2024 04:11:29 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/common/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/template.php
r7231 r7276 2845 2845 return apply_filters( 'bbp_title', $new_title, $sep, $seplocation ); 2846 2846 } 2847 2848 /** 2849 * Removes Protected/Private post title hints. 2850 * 2851 * This function is hooked to 2 WordPress filters that are responsible for 2852 * prepending hints to the beginning of Protected & Private post titles. 2853 * 2854 * These hints are a bit unsightly when used in functions like 2855 * bbp_get_breadcrumb(), so we strip them back out for bbPress post types. 2856 * 2857 * @since 2.7.0 2858 * 2859 * @param string $prepend Text displayed before a post title. 2860 * @param int|WP_Post $post Current post object. 2861 * 2862 * @return string 2863 */ 2864 function bbp_no_title_status_hints( $prepend = '', $post = 0 ) { 2865 2866 // Bail if empty 2867 if ( empty( $prepend ) || empty( $post ) ) { 2868 return $prepend; 2869 } 2870 2871 // Get post type 2872 $post_type = get_post_type( $post ); 2873 2874 // Maybe override return value 2875 $retval = in_array( $post_type, bbp_get_post_types(), true ) 2876 ? '%s' 2877 : $prepend; 2878 2879 // Filter & return 2880 return (string) apply_filters( 'bbp_no_special_title_formatting', $retval, $prepend, $post ); 2881 }
Note: See TracChangeset
for help on using the changeset viewer.