Changeset 2788
- Timestamp:
- 01/09/2011 09:19:26 PM (14 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-template.php
r2787 r2788 145 145 * @param string $filter Optional Sanitation filter. See {@link sanitize_post()} 146 146 * @uses get_post() To get the forum 147 * @uses apply_filters() Calls 'bbp_get_forum' with the forum, output type and 148 * sanitation filter 147 149 * @return mixed Null if error or forum (in specified form) if success 148 150 */ … … 172 174 } 173 175 174 return apply_filters( 'bbp_get_forum', $forum );176 return apply_filters( 'bbp_get_forum', $forum, $output, $filter ); 175 177 } 176 178 … … 352 354 */ 353 355 function bbp_get_forum_ancestors( $forum_id = 0 ) { 354 $forum_id = bbp_get_forum_id( $forum_id ); 356 $forum_id = bbp_get_forum_id( $forum_id ); 357 $ancestors = array(); 355 358 356 359 if ( $forum = bbp_get_forum( $forum_id ) ) { 357 $ancestors = array();358 360 while ( 0 !== $forum->post_parent ) { 359 361 $ancestors[] = $forum->post_parent; -
branches/plugin/bbp-includes/bbp-functions.php
r2787 r2788 1988 1988 1989 1989 /** 1990 * Custom page title for bbPress User Profile Pages1991 * 1992 * @since bbPress (r2 688)1990 * Custom page title for bbPress pages 1991 * 1992 * @since bbPress (r2788) 1993 1993 * 1994 1994 * @param string $title Optional. The title (not used). 1995 * @param string $sep Optional, default is '»'. How to separate the various items within the page title. 1995 * @param string $sep Optional, default is '»'. How to separate the 1996 * various items within the page title. 1996 1997 * @param string $seplocation Optional. Direction to display title, 'right'. 1997 1998 * @uses bbp_is_user_profile_page() To check if it's a user profile page … … 1999 2000 * @uses get_query_var() To get the user id 2000 2001 * @uses get_userdata() To get the user data 2001 * @uses apply_filters() Calls 'bbp_profile_page_wp_raw_title' with the user's 2002 * display name, separator and separator location 2002 * @uses apply_filters() Calls 'bbp_raw_title' with the title 2003 2003 * @uses apply_filters() Calls 'bbp_profile_page_wp_title' with the title, 2004 2004 * separator and separator location 2005 2005 * @return string The tite 2006 2006 */ 2007 function bbp_profile_page_title( $title = '', $sep = '»', $seplocation = '' ) { 2008 if ( !bbp_is_user_profile_page() && !bbp_is_user_profile_edit() ) 2009 return; 2010 2011 $userdata = get_userdata( get_query_var( 'bbp_user_id' ) ); 2012 $title = apply_filters( 'bbp_profile_page_wp_raw_title', $userdata->display_name, $sep, $seplocation ); 2013 $t_sep = '%WP_TITILE_SEP%'; // Temporary separator, for accurate flipping, if necessary 2014 2007 function bbp_title( $title = '', $sep = '»', $seplocation = '' ) { 2008 global $bbp; 2009 2010 $_title = $title; 2011 2012 // Profile page 2013 if ( bbp_is_user_profile_page() ) { 2014 2015 if ( bbp_is_user_home() ) { 2016 $title = __( 'Your Profile', 'bbpress' ); 2017 } else { 2018 $userdata = get_userdata( get_query_var( 'bbp_user_id' ) ); 2019 $title = sprintf( __( '%s\'s Profile', 'bbpress' ), $userdata->display_name ); 2020 } 2021 2022 // Profile edit page 2023 } elseif ( bbp_is_user_profile_edit() ) { 2024 2025 if ( bbp_is_user_home() ) { 2026 $title = __( 'Edit Your Profile', 'bbpress' ); 2027 } else { 2028 $userdata = get_userdata( get_query_var( 'bbp_user_id' ) ); 2029 $title = sprintf( __( 'Edit %s\'s Profile', 'bbpress' ), $userdata->display_name ); 2030 } 2031 2032 // Forum page 2033 } elseif ( bbp_is_forum() ) { 2034 2035 $title = sprintf( __( 'Forum: %s', 'bbpress' ), bbp_get_forum_title() ); 2036 2037 // Topic page 2038 } elseif ( bbp_is_topic() ) { 2039 2040 $title = sprintf( __( 'Topic: %s', 'bbpress' ), bbp_get_topic_title() ); 2041 2042 // Replies 2043 } elseif ( bbp_is_reply() ) { 2044 2045 // Normal reply titles already have "Reply To: ", so we shouldn't add our own 2046 $title = bbp_get_reply_title(); 2047 2048 } elseif ( is_tax( $bbp->topic_tag_id ) ) { 2049 2050 $term = get_queried_object(); 2051 $title = sprintf( __( 'Topic Tag: %s', 'bbpress' ), $term->name ); 2052 2053 } 2054 2055 $title = apply_filters( 'bbp_raw_title', $title, $sep, $seplocation ); 2056 2057 if ( $title == $_title ) 2058 return $title; 2059 2060 // Temporary separator, for accurate flipping, if necessary 2061 $t_sep = '%WP_TITILE_SEP%'; 2015 2062 $prefix = ''; 2063 2016 2064 if ( !empty( $title ) ) 2017 2065 $prefix = " $sep "; … … 2027 2075 } 2028 2076 2029 $title = apply_filters( 'bbp_ profile_page_wp_title', $title, $sep, $seplocation );2077 $title = apply_filters( 'bbp_title', $title, $sep, $seplocation ); 2030 2078 2031 2079 return $title; -
branches/plugin/bbp-includes/bbp-hooks.php
r2786 r2788 73 73 74 74 // Template - Head, foot, errors and notices 75 add_action( 'wp_head', 'bbp_head' ); 76 add_action( 'wp_footer', 'bbp_footer' ); 77 add_action( 'bbp_template_notices', 'bbp_error_messages' ); 78 add_action( 'bbp_template_notices', 'bbp_topic_notices' ); 75 add_action( 'wp_head', 'bbp_head' ); 76 add_filter( 'wp_title', 'bbp_title', 10, 3 ); 77 add_action( 'wp_footer', 'bbp_footer' ); 78 add_action( 'bbp_template_notices', 'bbp_error_messages' ); 79 add_action( 'bbp_template_notices', 'bbp_topic_notices' ); 79 80 80 81 // Caps & Roles … … 92 93 93 94 // Profile Page 94 add_filter( 'wp_title', 'bbp_profile_page_title', 10, 3 ); 95 add_action( 'pre_get_posts', 'bbp_pre_get_posts', 1 ); 96 add_action( 'template_redirect', 'bbp_edit_user_handler', 1 ); 95 add_action( 'pre_get_posts', 'bbp_pre_get_posts', 1 ); 96 add_action( 'template_redirect', 'bbp_edit_user_handler', 1 ); 97 97 98 98 // Profile Page Messages -
branches/plugin/bbp-includes/bbp-reply-template.php
r2787 r2788 185 185 * @param string $filter Optional Sanitation filter. See {@link sanitize_post()} 186 186 * @uses get_post() To get the reply 187 * @uses apply_filters() Calls 'bbp_get_reply' with the reply, output type and 188 * sanitation filter 187 189 * @return mixed Null if error or reply (in specified form) if success 188 190 */ … … 212 214 } 213 215 214 return $reply;216 return apply_filters( 'bbp_get_reply', $reply, $output, $filter ); 215 217 } 216 218 -
branches/plugin/bbp-includes/bbp-topic-template.php
r2787 r2788 285 285 * @param string $filter Optional Sanitation filter. See {@link sanitize_post()} 286 286 * @uses get_post() To get the topic 287 * @uses apply_filters() Calls 'bbp_get_topic' with the topic, output type and 288 * sanitation filter 287 289 * @return mixed Null if error or topic (in specified form) if success 288 290 */ … … 312 314 } 313 315 314 return $topic;316 return apply_filters( 'bbp_get_topic', $topic, $output, $filter ); 315 317 } 316 318
Note: See TracChangeset
for help on using the changeset viewer.