Skip to:
Content

BuddyPress.org

Changeset 11782


Ignore:
Timestamp:
01/02/2018 03:12:41 PM (9 years ago)
Author:
djpaul
Message:

Groups: reinstate functions bp_group_forum_permalink(), bp_get_group_forum_permalink().

These functions have not been used directly in core since v1.1.3, but are reinstated for the
"Buddypress Groups Directory Extras" and "BuddyPress Courseware" plugins, and by popular demand.

See #5351

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r11780 r11782  
    20252025
    20262026/**
     2027 * Output the URL of the Forum page of the current group in the loop.
     2028 *
     2029 * @since 1.0.0
     2030 */
     2031function bp_group_forum_permalink() {
     2032        echo bp_get_group_forum_permalink();
     2033}
     2034        /**
     2035         * Generate the URL of the Forum page of a group.
     2036         *
     2037         * @since 1.0.0
     2038         *
     2039         * @param object|bool $group Optional. Group object.
     2040         *                           Default: current group in loop.
     2041         * @return string
     2042         */
     2043        function bp_get_group_forum_permalink( $group = false ) {
     2044                global $groups_template;
     2045
     2046                if ( empty( $group ) ) {
     2047                        $group =& $groups_template->group;
     2048                }
     2049
     2050                /**
     2051                 * Filters the URL of the Forum page of a group.
     2052                 *
     2053                 * @since 1.0.0
     2054                 * @since 2.5.0 Added the `$group` parameter.
     2055                 *
     2056                 * @param string $value URL permalink for the Forum Page.
     2057                 * @param object $group Group object.
     2058                 */
     2059                return apply_filters( 'bp_get_group_forum_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'forum' ), $group );
     2060        }
     2061
     2062/**
    20272063 * Determine whether forums are enabled for a group.
    20282064 *
Note: See TracChangeset for help on using the changeset viewer.