Changeset 9291
- Timestamp:
- 12/31/2014 01:57:38 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 4 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 /** -
trunk/src/bp-groups/bp-groups-template.php
r9283 r9291 2855 2855 'link_text' => __( 'Create a Group', 'buddypress' ), 2856 2856 'link_title' => __( 'Create a Group', 'buddypress' ), 2857 'link_class' => ' button group-create bp-title-button',2857 'link_class' => 'group-create no-ajax', 2858 2858 'link_href' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_groups_root_slug() ) . trailingslashit( 'create' ), 2859 2859 'wrapper' => false, … … 2862 2862 return bp_get_button( apply_filters( 'bp_get_group_create_button', $button_args ) ); 2863 2863 } 2864 2865 /** 2866 * Output the Create a Group nav item. 2867 * 2868 * @since BuddyPress (2.2.0) 2869 */ 2870 function bp_group_create_nav_item() { 2871 echo bp_get_group_create_nav_item(); 2872 } 2873 2874 /** 2875 * Get the Create a Group nav item. 2876 * 2877 * @since BuddyPress (2.2.0) 2878 * 2879 * @return string 2880 */ 2881 function bp_get_group_create_nav_item() { 2882 // Get the create a group button 2883 $create_group_button = bp_get_group_create_button(); 2884 2885 // Make sure the button is available 2886 if ( empty( $create_group_button ) ) { 2887 return; 2888 } 2889 2890 $output = '<li id="group-create-nav">' . $create_group_button . '</li>'; 2891 2892 return apply_filters( 'bp_get_group_create_nav_item', $output ); 2893 } 2894 2895 /** 2896 * Checks if a specific theme is still filtering the Groups directory title 2897 * if so, transform the title button into a Groups directory nav item. 2898 * 2899 * @since BuddyPress (2.2.0) 2900 * 2901 * @uses bp_group_create_nav_item() to output the create a Group nav item 2902 * @return string HTML Output 2903 */ 2904 function bp_group_backcompat_create_nav_item() { 2905 // Bail if the Groups nav item is already used by bp-legacy 2906 if ( has_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 ) ) { 2907 return; 2908 } 2909 2910 // Bail if the theme is not filtering the Groups directory title 2911 if ( ! has_filter( 'bp_groups_directory_header' ) ) { 2912 return; 2913 } 2914 2915 bp_group_create_nav_item(); 2916 } 2917 add_action( 'bp_groups_directory_group_filter', 'bp_group_backcompat_create_nav_item', 1000 ); 2864 2918 2865 2919 /** -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r9190 r9291 109 109 // Group buttons 110 110 if ( bp_is_active( 'groups' ) ) { 111 add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); 112 add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); 113 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); 114 add_filter( 'bp_groups_directory_header', 'bp_legacy_theme_group_create_button' ); 115 add_filter( 'bp_blogs_directory_header', 'bp_legacy_theme_blog_create_button' ); 111 add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); 112 add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); 113 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); 114 add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 ); 116 115 } 117 116 118 117 // Blog button 119 if ( bp_is_active( 'blogs' ) ) 120 add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); 118 if ( bp_is_active( 'blogs' ) ) { 119 add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); 120 add_action( 'bp_blogs_directory_blog_types', 'bp_legacy_theme_blog_create_nav', 999 ); 121 } 122 121 123 122 124 } … … 450 452 * 451 453 * @since BuddyPress (2.0.0) 454 * @todo Deprecate 452 455 * 453 456 * @param string $title Groups directory title. … … 459 462 460 463 /** 464 * Add the Create a Group nav to the Groups directory navigation. 465 * 466 * bp-legacy puts the Create a Group nav at the last position of 467 * the Groups directory navigation. 468 * 469 * @since BuddyPress (2.2.0) 470 * 471 * @uses bp_group_create_nav_item() to output the create a Group nav item 472 * @return string 473 */ 474 function bp_legacy_theme_group_create_nav() { 475 bp_group_create_nav_item(); 476 } 477 478 /** 461 479 * Add the Create a Site button to the Sites directory title. 462 480 * … … 465 483 * 466 484 * @since BuddyPress (2.0.0) 485 * @todo Deprecate 467 486 * 468 487 * @param string $title Sites directory title. … … 472 491 return $title . ' ' . bp_get_blog_create_button(); 473 492 } 493 494 /** 495 * Add the Create a Site nav to the Sites directory navigation. 496 * 497 * bp-legacy puts the Create a Site nav at the last position of 498 * the Sites directory navigation. 499 * 500 * @since BuddyPress (2.2.0) 501 * 502 * @uses bp_blog_create_nav_item() to output the Create a Site nav item 503 * @return string 504 */ 505 function bp_legacy_theme_blog_create_nav() { 506 bp_blog_create_nav_item(); 507 } 508 474 509 /** 475 510 * This function looks scarier than it actually is. :) -
trunk/src/bp-templates/bp-legacy/js/buddypress.js
r9277 r9291 836 836 /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */ 837 837 jq('div.item-list-tabs').on( 'click', function(event) { 838 if ( jq(this).hasClass('no-ajax') ) {838 if ( jq(this).hasClass('no-ajax') || jq( event.target ).hasClass('no-ajax') ) { 839 839 return; 840 840 }
Note: See TracChangeset
for help on using the changeset viewer.