Skip to:
Content

BuddyPress.org

Changeset 13633


Ignore:
Timestamp:
11/05/2023 08:01:46 AM (19 months ago)
Author:
imath
Message:

Disable the Activity the "Post Comments" option by default

The value of this option only has an effect when the WordPress post's post type supports BuddyPress activities. BuddyPress adds this support only when the Site Tracking component is active (which is not the case, by default, for new installs).

Props dcavins

Fixes #9016
Closes https://github.com/buddypress/buddypress/pull/185

File:
1 edited

Legend:

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

    r13630 r13633  
    149149 */
    150150function bp_admin_setting_callback_blogforum_comments() {
    151 ?>
    152 
    153     <input id="bp-disable-blogforum-comments" name="bp-disable-blogforum-comments" type="checkbox" value="1" <?php checked( !bp_disable_blogforum_comments( false ) ); ?> />
    154     <label for="bp-disable-blogforum-comments"><?php _e( 'Allow activity stream commenting on posts and comments', 'buddypress' ); ?></label>
     151    $support = post_type_supports( 'post', 'buddypress-activity' );
     152?>
     153
     154    <input id="bp-disable-blogforum-comments" name="bp-disable-blogforum-comments" type="checkbox" value="1" <?php checked( ! bp_disable_blogforum_comments( false ) ); ?> <?php disabled( ! $support ); ?> />
     155    <label for="bp-disable-blogforum-comments"><?php esc_html_e( 'Allow activity stream commenting on posts and comments', 'buddypress' ); ?></label>
     156    <?php if ( ! $support ) : ?>
     157        <p class="description"><?php esc_html_e( 'Activate the BuddyPress Site Tracking component in order to enable this feature.', 'buddypress' ); ?></p>
     158    <?php endif; ?>
    155159
    156160<?php
Note: See TracChangeset for help on using the changeset viewer.