Changeset 9291 for trunk/src/bp-blogs/bp-blogs-template.php
- Timestamp:
- 12/31/2014 01:57:38 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-template.php
r9260 r9291 1469 1469 'link_text' => __( 'Create a Site', 'buddypress' ), 1470 1470 'link_title' => __( 'Create a Site', 'buddypress' ), 1471 'link_class' => 'b utton blog-create bp-title-button',1471 'link_class' => 'blog-create no-ajax', 1472 1472 'link_href' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . trailingslashit( 'create' ), 1473 1473 'wrapper' => false, … … 1483 1483 return bp_get_button( apply_filters( 'bp_get_blog_create_button', $button_args ) ); 1484 1484 } 1485 1486 /** 1487 * Output the Create a Site nav item. 1488 * 1489 * @since BuddyPress (2.2.0) 1490 */ 1491 function bp_blog_create_nav_item() { 1492 echo bp_get_blog_create_nav_item(); 1493 } 1494 1495 /** 1496 * Get the Create a Site nav item. 1497 * 1498 * @since BuddyPress (2.2.0) 1499 * 1500 * @return string 1501 */ 1502 function bp_get_blog_create_nav_item() { 1503 // Get the create a site button 1504 $create_blog_button = bp_get_blog_create_button(); 1505 1506 // Make sure the button is available 1507 if ( empty( $create_blog_button ) ) { 1508 return; 1509 } 1510 1511 $output = '<li id="blog-create-nav">' . $create_blog_button . '</li>'; 1512 1513 return apply_filters( 'bp_get_blog_create_nav_item', $output ); 1514 } 1515 1516 /** 1517 * Checks if a specific theme is still filtering the Blogs directory title 1518 * if so, transform the title button into a Blogs directory nav item. 1519 * 1520 * @since BuddyPress (2.2.0) 1521 * 1522 * @uses bp_blog_create_nav_item() to output the Create a Site nav item 1523 * @return string HTML Output 1524 */ 1525 function bp_blog_backcompat_create_nav_item() { 1526 // Bail if Blogs nav item is already used by bp-legacy 1527 if ( has_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_nav', 999 ) ) { 1528 return; 1529 } 1530 1531 // Bail if the theme is not filtering the Blogs directory title 1532 if ( ! has_filter( 'bp_blogs_directory_header' ) ) { 1533 return; 1534 } 1535 1536 bp_blog_create_nav_item(); 1537 } 1538 add_action( 'bp_blogs_directory_blog_types', 'bp_blog_backcompat_create_nav_item', 1000 ); 1485 1539 1486 1540 /**
Note: See TracChangeset
for help on using the changeset viewer.