Changeset 6156
- Timestamp:
- 11/22/2017 03:41:58 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-users.php
r5950 r6156 16 16 // Custom user contact methods. 17 17 add_filter( 'user_contactmethods', array( $this, 'custom_contact_methods' ) ); 18 19 // Add "My Account" submenu items to admin bar for quick access. 20 add_action( 'admin_bar_menu', array( $this, 'add_my_account_submenu_items' ) ); 18 21 19 22 // Only allow 3 published topics from a user in the first 24 hours. … … 101 104 $auto_topic_subscription = isset( $_POST['auto_topic_subscription'] ); 102 105 update_user_option( $user_id, 'auto_topic_subscription', $auto_topic_subscription ); 106 } 107 108 /** 109 * Add "My Account" submenu items to admin bar for quick access. 110 * 111 * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference. 112 */ 113 function add_my_account_submenu_items( $wp_admin_bar ) { 114 $user_id = bbp_get_current_user_id(); 115 116 $wp_admin_bar->add_group( array( 117 'parent' => 'my-account', 118 'id' => 'user-topics', 119 'meta' => array( 120 'class' => 'ab-sub-secondary', 121 ), 122 ) ); 123 124 $wp_admin_bar->add_menu( array( 125 'parent' => 'user-topics', 126 'id' => 'topics-started', 127 'title' => __( 'Topics Started', 'wporg-forums' ), 128 'href' => bbp_get_user_topics_created_url( $user_id ), 129 ) ); 130 131 $wp_admin_bar->add_menu( array( 132 'parent' => 'user-topics', 133 'id' => 'replies-created', 134 'title' => __( 'Replies Created', 'wporg-forums' ), 135 'href' => bbp_get_user_replies_created_url( $user_id ), 136 ) ); 137 138 $wp_admin_bar->add_menu( array( 139 'parent' => 'user-topics', 140 'id' => 'reviews-written', 141 'title' => __( 'Reviews Written', 'wporg-forums' ), 142 'href' => bbp_get_user_profile_url( $user_id ) . 'reviews/', 143 ) ); 144 145 $wp_admin_bar->add_menu( array( 146 'parent' => 'user-topics', 147 'id' => 'replied-to', 148 'title' => __( 'Topics Replied To', 'wporg-forums' ), 149 'href' => bbp_get_user_profile_url( $user_id ) . 'replied-to/', 150 ) ); 151 152 if ( function_exists( 'bbp_is_engagements_active' ) && bbp_is_engagements_active() ) { 153 $wp_admin_bar->add_menu( array( 154 'parent' => 'user-topics', 155 'id' => 'engagements', 156 'title' => __( 'Engagements', 'wporg-forums' ), 157 'href' => bbp_get_user_engagements_url( $user_id ), 158 ) ); 159 } 160 161 $wp_admin_bar->add_menu( array( 162 'parent' => 'user-topics', 163 'id' => 'subscriptions', 164 'title' => __( 'Subscriptions', 'wporg-forums' ), 165 'href' => bbp_get_subscriptions_permalink( $user_id ), 166 ) ); 167 168 $wp_admin_bar->add_menu( array( 169 'parent' => 'user-topics', 170 'id' => 'favorites', 171 'title' => __( 'Favorite Topics', 'wporg-forums' ), 172 'href' => bbp_get_favorites_permalink( $user_id ), 173 ) ); 103 174 } 104 175
Note: See TracChangeset
for help on using the changeset viewer.