Changeset 6321
- Timestamp:
- 02/26/2017 07:25:15 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/settings.php
r6320 r6321 156 156 ), 157 157 158 // Allow engagements setting 159 '_bbp_enable_engagements' => array( 160 'title' => __( 'Engagements', 'bbpress' ), 161 'callback' => 'bbp_admin_setting_callback_engagements', 162 'sanitize_callback' => 'intval', 163 'args' => array() 164 ), 165 158 166 // Allow topic tags 159 167 '_bbp_allow_topic_tags' => array( … … 602 610 <input name="_bbp_enable_subscriptions" id="_bbp_enable_subscriptions" type="checkbox" value="1" <?php checked( bbp_is_subscriptions_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_subscriptions' ); ?> /> 603 611 <label for="_bbp_enable_subscriptions"><?php esc_html_e( 'Allow users to subscribe to forums and topics', 'bbpress' ); ?></label> 612 613 <?php 614 } 615 616 /** 617 * Allow engagements setting field 618 * 619 * @since 2.0.0 bbPress (r2737) 620 * 621 * @uses checked() To display the checked attribute 622 */ 623 function bbp_admin_setting_callback_engagements() { 624 ?> 625 626 <input name="_bbp_enable_engagements" id="_bbp_enable_engagements" type="checkbox" value="1" <?php checked( bbp_is_engagements_active( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_enable_engagements' ); ?> /> 627 <label for="_bbp_enable_engagements"><?php esc_html_e( 'Track topics each user engages in', 'bbpress' ); ?></label> 604 628 605 629 <?php -
trunk/src/includes/admin/tools/upgrades.php
r6320 r6321 158 158 * Upgrade user engagements for bbPress 2.6 and higher 159 159 * 160 * @since 2.6.0 bbPress (r63 010)160 * @since 2.6.0 bbPress (r6320) 161 161 * 162 162 * @return array An array of the status code and the message -
trunk/src/includes/core/options.php
r6320 r6321 232 232 233 233 /** 234 * Checks if engagements feature is enabled. 235 * 236 * @since 2.6.0 bbPress (r6320) 237 * 238 * @param $default bool Optional.Default value true 239 * @uses get_option() To get the engagements option 240 * @return bool Is engagements enabled or not 241 */ 242 function bbp_is_engagements_active( $default = 1 ) { 243 return (bool) apply_filters( 'bbp_is_engagements_active', (bool) get_option( '_bbp_enable_engagements', $default ) ); 244 } 245 246 /** 234 247 * Are topic tags allowed 235 248 * -
trunk/src/includes/extend/buddypress/loader.php
r6320 r6321 220 220 221 221 // Engagements 222 $sub_nav[] = array( 223 'name' => __( 'Engagements', 'bbpress' ), 224 'slug' => bbp_get_user_engagements_slug(), 225 'parent_url' => $forums_link, 226 'parent_slug' => $this->slug, 227 'screen_function' => 'bbp_member_forums_screen_engagements', 228 'position' => 60, 229 'item_css_id' => 'engagements' 230 ); 222 if ( bbp_is_engagements_active() ) { 223 $sub_nav[] = array( 224 'name' => __( 'Engagements', 'bbpress' ), 225 'slug' => bbp_get_user_engagements_slug(), 226 'parent_url' => $forums_link, 227 'parent_slug' => $this->slug, 228 'screen_function' => 'bbp_member_forums_screen_engagements', 229 'position' => 60, 230 'item_css_id' => 'engagements' 231 ); 232 } 231 233 232 234 // Favorite topics -
trunk/src/includes/extend/buddypress/members.php
r6250 r6321 115 115 } elseif ( bbp_is_subscriptions_active() && bp_is_current_action( bbp_get_user_subscriptions_slug() ) ) { 116 116 $profile_url = $this->get_subscriptions_permalink( '', $user_id ); 117 118 // 'engagements' action 119 } elseif ( bbp_is_engagements_active() && bp_is_current_action( bbp_get_user_engagements_slug() ) ) { 120 $profile_url = $this->get_subscriptions_permalink( '', $user_id ); 117 121 } 118 122 … … 168 172 169 173 /** 174 * Override bbPress engagements URL with BuddyPress profile URL 175 * 176 * @since 2.6.0 bbPress (r6320) 177 * 178 * @param string $url 179 * @param int $user_id 180 * @return string 181 */ 182 public function get_engagements_permalink( $url, $user_id ) { 183 184 // Do not filter if not on BuddyPress root blog 185 if ( ! bp_is_root_blog() ) { 186 return false; 187 } 188 189 $component_slug = bbpress()->extend->buddypress->slug; 190 $url = trailingslashit( bp_core_get_user_domain( $user_id ) . $component_slug . '/' . bbp_get_user_engagements_slug() ); 191 return $url; 192 } 193 194 /** 170 195 * Set favorites and subscriptions query variables if viewing member profile 171 196 * pages. -
trunk/src/templates/default/bbpress/user-details.php
r6320 r6321 44 44 </li> 45 45 46 <li class="<?php if ( bbp_is_single_user_engagements() ) :?>current<?php endif; ?>"> 47 <span class='bbp-user-engagements-created-link'> 48 <a href="<?php bbp_user_engagements_url(); ?>" title="<?php printf( esc_attr__( "%s's Engagements", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Engagements', 'bbpress' ); ?></a> 49 </span> 50 </li> 46 <?php if ( bbp_is_engagements_active() ) : ?> 47 <li class="<?php if ( bbp_is_single_user_engagements() ) :?>current<?php endif; ?>"> 48 <span class='bbp-user-engagements-created-link'> 49 <a href="<?php bbp_user_engagements_url(); ?>" title="<?php printf( esc_attr__( "%s's Engagements", 'bbpress' ), bbp_get_displayed_user_field( 'display_name' ) ); ?>"><?php esc_html_e( 'Engagements', 'bbpress' ); ?></a> 50 </span> 51 </li> 52 <?php endif; ?> 51 53 52 54 <?php if ( bbp_is_favorites_active() ) : ?>
Note: See TracChangeset
for help on using the changeset viewer.