Changeset 9157
- Timestamp:
- 11/21/2014 06:24:16 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-screens.php
r8682 r9157 142 142 public function directory_dummy_post() { 143 143 144 $title = apply_filters( 'bp_blogs_directory_header', __( 'Sites', 'buddypress' ) ); 144 bp_theme_compat_reset_post( array( 145 'ID' => 0, 146 'post_title' => __( 'Sites', 'buddypress' ), 147 'post_author' => 0, 148 'post_date' => 0, 149 'post_content' => '', 150 'post_type' => 'page', 151 'post_status' => 'publish', 152 'is_page' => true, 153 'comment_status' => 'closed' 154 ) ); 155 } 156 157 /** 158 * Filter the_content with the groups index template part. 159 * 160 * @since BuddyPress (1.7.0) 161 */ 162 public function directory_content() { 163 return bp_buffer_template_part( 'blogs/index', null, false ); 164 } 165 166 /** Create ****************************************************************/ 167 168 /** 169 * Add custom template hierarchy to theme compat for the blog create page. 170 * 171 * This is to mirror how WordPress has 172 * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. 173 * 174 * @since BuddyPress (1.8.0) 175 * 176 * @param string $templates The templates from 177 * bp_get_theme_compat_templates(). 178 * @return array $templates Array of custom templates to look for. 179 */ 180 public function create_template_hierarchy( $templates ) { 181 // Setup our templates based on priority 182 $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array( 183 'blogs/index-create.php' 184 ) ); 185 186 // Merge new templates with existing stack 187 // @see bp_get_theme_compat_templates() 188 $templates = array_merge( (array) $new_templates, $templates ); 189 190 return $templates; 191 } 192 193 /** 194 * Update the global $post with create screen data. 195 * 196 * @since BuddyPress (1.7.0) 197 */ 198 public function create_dummy_post() { 199 200 // Title based on ability to create blogs 201 if ( is_user_logged_in() && bp_blog_signup_enabled() ) { 202 $title = __( 'Create a Site', 'buddypress' ); 203 } else { 204 $title = __( 'Sites', 'buddypress' ); 205 } 145 206 146 207 bp_theme_compat_reset_post( array( … … 158 219 159 220 /** 160 * Filter the_content with the groups index template part.161 *162 * @since BuddyPress (1.7.0)163 */164 public function directory_content() {165 return bp_buffer_template_part( 'blogs/index', null, false );166 }167 168 /** Create ****************************************************************/169 170 /**171 * Add custom template hierarchy to theme compat for the blog create page.172 *173 * This is to mirror how WordPress has174 * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.175 *176 * @since BuddyPress (1.8.0)177 *178 * @param string $templates The templates from179 * bp_get_theme_compat_templates().180 * @return array $templates Array of custom templates to look for.181 */182 public function create_template_hierarchy( $templates ) {183 // Setup our templates based on priority184 $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(185 'blogs/index-create.php'186 ) );187 188 // Merge new templates with existing stack189 // @see bp_get_theme_compat_templates()190 $templates = array_merge( (array) $new_templates, $templates );191 192 return $templates;193 }194 195 /**196 * Update the global $post with create screen data.197 *198 * @since BuddyPress (1.7.0)199 */200 public function create_dummy_post() {201 202 // Title based on ability to create blogs203 if ( is_user_logged_in() && bp_blog_signup_enabled() ) {204 $title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Sites', 'buddypress' ) . '</a> ' . __( 'Create a Site', 'buddypress' );205 } else {206 $title = __( 'Sites', 'buddypress' );207 }208 209 bp_theme_compat_reset_post( array(210 'ID' => 0,211 'post_title' => $title,212 'post_author' => 0,213 'post_date' => 0,214 'post_content' => '',215 'post_type' => 'page',216 'post_status' => 'publish',217 'is_page' => true,218 'comment_status' => 'closed'219 ) );220 }221 222 /**223 221 * Filter the_content with the create screen template part. 224 222 * -
trunk/src/bp-groups/bp-groups-screens.php
r9027 r9157 1100 1100 */ 1101 1101 public function directory_dummy_post() { 1102 1103 $title = apply_filters( 'bp_groups_directory_header', bp_get_directory_title( 'groups' ) ); 1102 bp_theme_compat_reset_post( array( 1103 'ID' => 0, 1104 'post_title' => bp_get_directory_title( 'groups' ), 1105 'post_author' => 0, 1106 'post_date' => 0, 1107 'post_content' => '', 1108 'post_type' => 'page', 1109 'post_status' => 'publish', 1110 'is_page' => true, 1111 'comment_status' => 'closed' 1112 ) ); 1113 } 1114 1115 /** 1116 * Filter the_content with the groups index template part. 1117 * 1118 * @since BuddyPress (1.7.0) 1119 */ 1120 public function directory_content() { 1121 return bp_buffer_template_part( 'groups/index', null, false ); 1122 } 1123 1124 /** Create ************************************************************/ 1125 1126 /** 1127 * Add custom template hierarchy to theme compat for the group create page. 1128 * 1129 * This is to mirror how WordPress has 1130 * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. 1131 * 1132 * @since BuddyPress (1.8.0) 1133 * 1134 * @param string $templates The templates from bp_get_theme_compat_templates(). 1135 * @return array $templates Array of custom templates to look for. 1136 */ 1137 public function create_template_hierarchy( $templates ) { 1138 // Setup our templates based on priority 1139 $new_templates = apply_filters( 'bp_template_hierarchy_groups_create', array( 1140 'groups/index-create.php' 1141 ) ); 1142 1143 // Merge new templates with existing stack 1144 // @see bp_get_theme_compat_templates() 1145 $templates = array_merge( $new_templates, $templates ); 1146 1147 return $templates; 1148 } 1149 1150 /** 1151 * Update the global $post with create screen data. 1152 * 1153 * @since BuddyPress (1.7.0) 1154 */ 1155 public function create_dummy_post() { 1156 1157 $title = _x( 'Groups', 'Group creation page', 'buddypress' ); 1104 1158 1105 1159 bp_theme_compat_reset_post( array( … … 1117 1171 1118 1172 /** 1119 * Filter the_content with the groups indextemplate part.1173 * Filter the_content with the create screen template part. 1120 1174 * 1121 1175 * @since BuddyPress (1.7.0) 1122 1176 */ 1123 public function directory_content() {1124 return bp_buffer_template_part( 'groups/ index', null, false );1125 } 1126 1127 /** Create ************************************************************/1177 public function create_content() { 1178 return bp_buffer_template_part( 'groups/create', null, false ); 1179 } 1180 1181 /** Single ************************************************************/ 1128 1182 1129 1183 /** 1130 * Add custom template hierarchy to theme compat for the group create page.1184 * Add custom template hierarchy to theme compat for group pages. 1131 1185 * 1132 1186 * This is to mirror how WordPress has … … 1138 1192 * @return array $templates Array of custom templates to look for. 1139 1193 */ 1140 public function create_template_hierarchy( $templates ) { 1194 public function single_template_hierarchy( $templates ) { 1195 // Setup some variables we're going to reference in our custom templates 1196 $group = groups_get_current_group(); 1197 1141 1198 // Setup our templates based on priority 1142 $new_templates = apply_filters( 'bp_template_hierarchy_groups_create', array( 1143 'groups/index-create.php' 1199 $new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array( 1200 'groups/single/index-id-' . sanitize_file_name( bp_get_current_group_id() ) . '.php', 1201 'groups/single/index-slug-' . sanitize_file_name( bp_get_current_group_slug() ) . '.php', 1202 'groups/single/index-action-' . sanitize_file_name( bp_current_action() ) . '.php', 1203 'groups/single/index-status-' . sanitize_file_name( $group->status ) . '.php', 1204 'groups/single/index.php' 1144 1205 ) ); 1145 1206 1146 1207 // Merge new templates with existing stack 1147 1208 // @see bp_get_theme_compat_templates() 1148 $templates = array_merge( $new_templates, $templates );1209 $templates = array_merge( (array) $new_templates, $templates ); 1149 1210 1150 1211 return $templates; … … 1152 1213 1153 1214 /** 1154 * Update the global $post with create screendata.1215 * Update the global $post with single group data. 1155 1216 * 1156 1217 * @since BuddyPress (1.7.0) 1157 1218 */ 1158 public function create_dummy_post() { 1159 1160 $title = _x( 'Groups', 'Group creation page', 'buddypress' ); 1161 1219 public function single_dummy_post() { 1162 1220 bp_theme_compat_reset_post( array( 1163 1221 'ID' => 0, 1164 'post_title' => $title,1222 'post_title' => bp_get_current_group_name(), 1165 1223 'post_author' => 0, 1166 1224 'post_date' => 0, … … 1174 1232 1175 1233 /** 1176 * Filter the_content with the create screen template part.1177 *1178 * @since BuddyPress (1.7.0)1179 */1180 public function create_content() {1181 return bp_buffer_template_part( 'groups/create', null, false );1182 }1183 1184 /** Single ************************************************************/1185 1186 /**1187 * Add custom template hierarchy to theme compat for group pages.1188 *1189 * This is to mirror how WordPress has1190 * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.1191 *1192 * @since BuddyPress (1.8.0)1193 *1194 * @param string $templates The templates from bp_get_theme_compat_templates().1195 * @return array $templates Array of custom templates to look for.1196 */1197 public function single_template_hierarchy( $templates ) {1198 // Setup some variables we're going to reference in our custom templates1199 $group = groups_get_current_group();1200 1201 // Setup our templates based on priority1202 $new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array(1203 'groups/single/index-id-' . sanitize_file_name( bp_get_current_group_id() ) . '.php',1204 'groups/single/index-slug-' . sanitize_file_name( bp_get_current_group_slug() ) . '.php',1205 'groups/single/index-action-' . sanitize_file_name( bp_current_action() ) . '.php',1206 'groups/single/index-status-' . sanitize_file_name( $group->status ) . '.php',1207 'groups/single/index.php'1208 ) );1209 1210 // Merge new templates with existing stack1211 // @see bp_get_theme_compat_templates()1212 $templates = array_merge( (array) $new_templates, $templates );1213 1214 return $templates;1215 }1216 1217 /**1218 * Update the global $post with single group data.1219 *1220 * @since BuddyPress (1.7.0)1221 */1222 public function single_dummy_post() {1223 bp_theme_compat_reset_post( array(1224 'ID' => 0,1225 'post_title' => '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . bp_get_current_group_name() . '</a>',1226 'post_author' => 0,1227 'post_date' => 0,1228 'post_content' => '',1229 'post_type' => 'page',1230 'post_status' => 'publish',1231 'is_page' => true,1232 'comment_status' => 'closed'1233 ) );1234 }1235 1236 /**1237 1234 * Filter the_content with the single group template part. 1238 1235 * -
trunk/src/bp-members/bp-members-screens.php
r9109 r9157 236 236 // grab the key (the old way) 237 237 $key = isset( $_GET['key'] ) ? $_GET['key'] : ''; 238 238 239 239 // grab the key (the new way) 240 240 if ( empty( $key ) ) { … … 246 246 return; 247 247 } 248 248 249 249 // Activate the signup 250 250 $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) ); … … 426 426 bp_theme_compat_reset_post( array( 427 427 'ID' => 0, 428 'post_title' => '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>',428 'post_title' => bp_get_displayed_user_fullname(), 429 429 'post_author' => 0, 430 430 'post_date' => 0,
Note: See TracChangeset
for help on using the changeset viewer.