Changeset 10157
- Timestamp:
- 09/29/2015 11:02:46 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r10149 r10157 1480 1480 } 1481 1481 1482 /** Cover image ***************************************************************/ 1483 1484 /** 1485 * Should we use the cover image header 1486 * 1487 * @since 2.4.0 1488 * 1489 * @return bool True if the displayed user has a cover image, 1490 * False otherwise 1491 */ 1492 function bp_displayed_user_use_cover_image_header() { 1493 return (bool) bp_is_active( 'xprofile', 'cover_image' ) && ! bp_disable_cover_image_uploads() && bp_attachments_is_wp_version_supported(); 1494 } 1495 1482 1496 /** Avatars *******************************************************************/ 1483 1497 -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/home.php
r10150 r10157 12 12 <div id="item-header" role="complementary"> 13 13 14 <?php bp_get_template_part( 'members/single/member-header' ) ?> 14 <?php 15 /** 16 * If the cover image feature is enabled, use a specific header 17 */ 18 if ( bp_displayed_user_use_cover_image_header() ) : 19 bp_get_template_part( 'members/single/cover-image-header' ); 20 else : 21 bp_get_template_part( 'members/single/member-header' ); 22 endif; 23 ?> 15 24 16 25 </div><!-- #item-header --> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/profile.php
r10150 r10157 38 38 break; 39 39 40 // Change Cover Image 41 case 'change-cover-image' : 42 bp_get_template_part( 'members/single/profile/change-cover-image' ); 43 break; 44 40 45 // Compose 41 46 case 'public' : -
trunk/src/bp-xprofile/bp-xprofile-loader.php
r10140 r10157 228 228 } 229 229 230 // Change Cover image 231 if ( bp_displayed_user_use_cover_image_header() ) { 232 $sub_nav[] = array( 233 'name' => _x( 'Change Cover Image', 'Profile header sub menu', 'buddypress' ), 234 'slug' => 'change-cover-image', 235 'parent_url' => $profile_link, 236 'parent_slug' => $slug, 237 'screen_function' => 'xprofile_screen_change_cover_image', 238 'position' => 40, 239 'user_has_access' => $access 240 ); 241 } 242 230 243 // The Settings > Profile nav item can only be set up after 231 244 // the Settings component has run its own nav routine … … 316 329 } 317 330 331 if ( bp_displayed_user_use_cover_image_header() ) { 332 $wp_admin_nav[] = array( 333 'parent' => 'my-account-' . $this->id, 334 'id' => 'my-account-' . $this->id . '-change-cover-image', 335 'title' => _x( 'Change Cover Image', 'My Account Profile sub nav', 'buddypress' ), 336 'href' => trailingslashit( $profile_link . 'change-cover-image' ) 337 ); 338 } 318 339 } 319 340 -
trunk/src/bp-xprofile/bp-xprofile-screens.php
r10140 r10157 297 297 298 298 /** 299 * Displays the change cover image page. 300 * 301 * @package BuddyPress XProfile 302 * 303 * @since 2.4.0 304 */ 305 function xprofile_screen_change_cover_image() { 306 307 // Bail if not the correct screen 308 if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { 309 return false; 310 } 311 312 /** 313 * Fires right before the loading of the XProfile change cover image screen template file. 314 * 315 * @since 2.4.0 316 */ 317 do_action( 'xprofile_screen_change_cover_image' ); 318 319 /** 320 * Filters the template to load for the XProfile cover image screen. 321 * 322 * @since 2.4.0 323 * 324 * @param string $template Path to the XProfile cover image template to load. 325 */ 326 bp_core_load_template( apply_filters( 'xprofile_template_cover_image', 'members/single/home' ) ); 327 } 328 329 /** 299 330 * Show the xprofile settings template 300 331 *
Note: See TracChangeset
for help on using the changeset viewer.