Skip to:
Content

BuddyPress.org

Changeset 11780


Ignore:
Timestamp:
01/02/2018 01:04:42 PM (7 years ago)
Author:
djpaul
Message:

Groups: reinstate functions bp_is_group_forums_active(), bp_group_new_topic_button(), bp_get_group_new_topic_button().

The first function has been reinstated for compatibility with third-party plugins, "BuddyPress for Sensei" and "BuddyPress for LearnDash".

The latter two functions rendered a "new topic" button on a Group screen.
Current proposal is that bbPress is updated to add this back, because otherwise we have to make assumptions about bbPress' permalinks, or rely on calling a bbPress function (which feels conceptually wrong from an integration perspective).

Also fix a PHP Notice caused by an incomplete prior removal of bp_group_new_topic_button() (see bp-legacy/buddypress-functions.php).

See #5351

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-options.php

    r11764 r11780  
    690690
    691691/**
     692 * Check whether bbPress plugin-powered Group Forums are enabled.
     693 *
     694 * @since 1.6.0
     695 * @since 3.0.0 $default argument's default value changed from true to false.
     696 * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
     697 *
     698 * @param bool $default Optional. Fallback value if not found in the database.
     699 *                      Default: false.
     700 * @return bool True if group forums are active, otherwise false.
     701 */
     702function bp_is_group_forums_active( $default = false ) {
     703    $is_active = function_exists( 'bbp_is_group_forums_active' ) ? bbp_is_group_forums_active( $default ) : $default;
     704
     705    /**
     706     * Filters whether or not bbPress plugin-powered Group Forums are enabled.
     707     *
     708     * @since 1.6.0
     709     * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
     710     *
     711     * @param bool $value Whether or not bbPress plugin-powered Group Forums are enabled.
     712     */
     713    return (bool) apply_filters( 'bp_is_group_forums_active', $is_active );
     714}
     715
     716/**
    692717 * Check whether Akismet is enabled.
    693718 *
  • trunk/src/bp-groups/bp-groups-template.php

    r11776 r11780  
    31903190
    31913191/**
     3192 * Output a 'New Topic' button for a group.
     3193 *
     3194 * @since 1.2.7
     3195 * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
     3196 *
     3197 * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
     3198 */
     3199function bp_group_new_topic_button( $group = false ) {
     3200}
     3201
     3202    /**
     3203     * Return a 'New Topic' button for a group.
     3204     *
     3205     * @since 1.2.7
     3206     * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
     3207     *
     3208     * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
     3209     *
     3210     * @return false
     3211     */
     3212    function bp_get_group_new_topic_button( $group = false ) {
     3213        return false;
     3214    }
     3215
     3216/**
    31923217 * Output button to join a group.
    31933218 *
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r11776 r11780  
    107107            if ( bp_is_active( 'groups' ) ) {
    108108                add_action( 'bp_group_header_actions',          'bp_group_join_button',               5           );
    109                 add_action( 'bp_group_header_actions',          'bp_group_new_topic_button',         20           );
    110109                add_action( 'bp_directory_groups_actions',      'bp_group_join_button'                            );
    111110                add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999           );
Note: See TracChangeset for help on using the changeset viewer.