Changeset 7942 for trunk/bp-groups/bp-groups-template.php
- Timestamp:
- 02/20/2014 09:02:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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).
Note: See TracChangeset
for help on using the changeset viewer.