Changeset 7942
- Timestamp:
- 02/20/2014 09:02:33 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-screens.php
r7926 r7942 142 142 public function directory_dummy_post() { 143 143 144 // Title based on ability to create blogs 145 if ( is_user_logged_in() && bp_blog_signup_enabled() ) { 146 $title = __( 'Sites', 'buddypress' ) . ' <a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create' ) . '">' . __( 'Create a Sites', 'buddypress' ) . '</a>'; 147 } else { 148 $title = __( 'Sites', 'buddypress' ); 149 } 144 $title = apply_filters( 'bp_blogs_directory_title', __( 'Sites', 'buddypress' ) ); 150 145 151 146 bp_theme_compat_reset_post( array( -
trunk/bp-blogs/bp-blogs-template.php
r7919 r7942 1150 1150 1151 1151 /** 1152 * Output the Create a Site button. 1153 * 1154 * @since BuddyPress (2.0.0) 1155 */ 1156 function bp_blog_create_button() { 1157 echo bp_get_blog_create_button(); 1158 } 1159 /** 1160 * Get the Create a Site button. 1161 * 1162 * @since BuddyPress (2.0.0) 1163 * 1164 * @return string 1165 */ 1166 function bp_get_blog_create_button() { 1167 if ( ! is_user_logged_in() ) { 1168 return false; 1169 } 1170 1171 if ( ! bp_blog_signup_enabled() ) { 1172 return false; 1173 } 1174 1175 $button_args = array( 1176 'id' => 'create_blog', 1177 'component' => 'blogs', 1178 'link_text' => __( 'Create a Site', 'buddypress' ), 1179 'link_title' => __( 'Create a Site', 'buddypress' ), 1180 'link_class' => 'button blog-create bp-title-button', 1181 'link_href' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . trailingslashit( 'create' ), 1182 'wrapper' => false, 1183 ); 1184 1185 return bp_get_button( $button_args ); 1186 } 1187 1188 /** 1152 1189 * Output button for visiting a blog in a loop. 1153 1190 * -
trunk/bp-groups/bp-groups-screens.php
r7926 r7942 1022 1022 public function directory_dummy_post() { 1023 1023 1024 // Title based on ability to create groups 1025 if ( is_user_logged_in() && bp_user_can_create_groups() ) { 1026 $title = __( 'Groups', 'buddypress' ) . ' <a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ) . '">' . __( 'Create a Group', 'buddypress' ) . '</a>'; 1027 } else { 1028 $title = __( 'Groups', 'buddypress' ); 1029 } 1024 $title = apply_filters( 'bp_groups_directory_title', __( 'Groups', 'buddypress' ) ); 1030 1025 1031 1026 bp_theme_compat_reset_post( array( -
trunk/bp-groups/bp-groups-template.php
r7931 r7942 1855 1855 1856 1856 /** 1857 * Output the Create a Group button. 1858 * 1859 * @since BuddyPress (2.0.0) 1860 */ 1861 function bp_group_create_button() { 1862 echo bp_get_group_create_button(); 1863 } 1864 /** 1865 * Get the Create a Group button. 1866 * 1867 * @since BuddyPress (2.0.0) 1868 * 1869 * @return string 1870 */ 1871 function bp_get_group_create_button() { 1872 if ( ! is_user_logged_in() ) { 1873 return false; 1874 } 1875 1876 if ( ! bp_user_can_create_groups() ) { 1877 return false; 1878 } 1879 1880 $button_args = array( 1881 'id' => 'create_group', 1882 'component' => 'groups', 1883 'link_text' => __( 'Create a Group', 'buddypress' ), 1884 'link_title' => __( 'Create a Group', 'buddypress' ), 1885 'link_class' => 'button group-create bp-title-button', 1886 'link_href' => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_groups_root_slug() ) . trailingslashit( 'create' ), 1887 'wrapper' => false, 1888 ); 1889 1890 return bp_get_button( $button_args ); 1891 } 1892 1893 /** 1857 1894 * Prints a message if the group is not visible to the current user (it is a 1858 1895 * hidden or private group, and the user does not have access). -
trunk/bp-templates/bp-legacy/buddypress-functions.php
r7570 r7942 112 112 add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); 113 113 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); 114 add_filter( 'bp_groups_directory_title', 'bp_legacy_theme_group_create_button' ); 115 add_filter( 'bp_blogs_directory_title', 'bp_legacy_theme_blog_create_button' ); 114 116 } 115 117 … … 421 423 422 424 /** 425 * Add the Create a Group button to the Groups directory title. 426 * 427 * bp-legacy puts the Create a Group button into the page title, to mimic 428 * the behavior of bp-default. 429 * 430 * @since BuddyPress (2.0.0) 431 * 432 * @param string $title Groups directory title. 433 * @return string 434 */ 435 function bp_legacy_theme_group_create_button( $title ) { 436 return $title . ' ' . bp_get_group_create_button(); 437 } 438 439 /** 440 * Add the Create a Site button to the Sites directory title. 441 * 442 * bp-legacy puts the Create a Site button into the page title, to mimic 443 * the behavior of bp-default. 444 * 445 * @since BuddyPress (2.0.0) 446 * 447 * @param string $title Sites directory title. 448 * @return string 449 */ 450 function bp_legacy_theme_blog_create_button( $title ) { 451 return $title . ' ' . bp_get_blog_create_button(); 452 } 453 /** 423 454 * This function looks scarier than it actually is. :) 424 455 * Each object loop (activity/members/groups/blogs/forums) contains default
Note: See TracChangeset
for help on using the changeset viewer.