Changeset 6705
- Timestamp:
- 09/14/2017 10:57:06 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
-
bbpress.php (modified) (1 diff)
-
includes/admin/assets/css/admin.css (modified) (1 diff)
-
includes/admin/classes/class-bbp-admin.php (modified) (2 diffs)
-
includes/core/options.php (modified) (1 diff)
-
includes/core/update.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bbpress.php
r6699 r6705 204 204 /** Versions **********************************************************/ 205 205 206 $this->version = '2.6-rc-6 698';206 $this->version = '2.6-rc-6701'; 207 207 $this->db_version = '262'; 208 208 -
trunk/src/includes/admin/assets/css/admin.css
r6690 r6705 42 42 .bbp-hive:before { 43 43 content: "\f449"; 44 } 45 46 .notice-bbpress { 47 border-left: 4px solid #78cd95; 48 padding-left: 36px; 49 background-color: rgb(235, 255, 235); 50 position: relative; 51 } 52 53 .notice-bbpress .bbpress-logo-icon { 54 position: absolute; 55 height: auto; 56 width: auto; 57 padding: 7px 9px; 58 top: 50%; 59 left: 0; 60 transform: translateY(-50%); 61 font: 400 24px/1 dashicons !important; 62 } 63 64 .notice-bbpress .bbpress-logo-icon:before { 65 content: "\f477"; 66 color: #555; 44 67 } 45 68 -
trunk/src/includes/admin/classes/class-bbp-admin.php
r6604 r6705 150 150 /** General Actions ***************************************************/ 151 151 152 add_action( 'bbp_admin_init', array( $this, 'setup_notices' ) ); 153 add_action( 'bbp_admin_init', array( $this, 'hide_notices' ) ); 152 154 add_action( 'bbp_admin_menu', array( $this, 'admin_menus' ) ); // Add menu item to settings menu 153 155 add_action( 'bbp_admin_head', array( $this, 'admin_head' ) ); // Add some general styling to the admin area … … 185 187 // Allow plugins to modify these actions 186 188 do_action_ref_array( 'bbp_admin_loaded', array( &$this ) ); 189 } 190 191 /** 192 * Setup general admin area notices. 193 * 194 * @since 2.6.0 bbPress (r6701) 195 */ 196 public function setup_notices() { 197 198 // Database upgrade skipped? 199 $skipped = get_option( '_bbp_db_upgrade_skipped', 0 ); 200 201 // Database upgrade skipped! 202 if ( ! empty( $skipped ) && ( $skipped < 260 ) && current_user_can( 'bbp_tools_upgrade_page' ) ) { 203 204 // Link to upgrade page 205 $upgrade_url = add_query_arg( array( 'page' => 'bbp-upgrade' ), admin_url( 'tools.php' ) ); 206 $dismiss_url = wp_nonce_url( add_query_arg( array( 'bbp-hide-notice' => 'bbp-skip-upgrade' ) ), 'bbp-hide-notice' ); 207 $upgrade_link = '<a href="' . esc_url( $upgrade_url ) . '">' . esc_html__( 'Go Upgrade', 'bbpress' ) . '</a>'; 208 $dismiss_link = '<a href="' . esc_url( $dismiss_url ) . '">' . esc_html__( 'Hide Forever', 'bbpress' ) . '</a>'; 209 $bbp_dashicon = '<span class="bbpress-logo-icon"></span>'; 210 $message = $bbp_dashicon . sprintf( 211 esc_html__( 'bbPress requires a manual database upgrade. %s or %s', 'bbpress' ), 212 $upgrade_link, 213 $dismiss_link 214 ); 215 216 // Add tools feedback 217 bbp_admin_tools_feedback( $message, 'notice-bbpress', false ); 218 } 219 } 220 221 /** 222 * Handle hiding of general admin area notices. 223 * 224 * @since 2.6.0 bbPress (r6701) 225 */ 226 public function hide_notices() { 227 228 // Bail if not hiding a notice 229 if ( empty( $_GET['bbp-hide-notice'] ) ) { 230 return; 231 } 232 233 // Check the admin referer 234 check_admin_referer( 'bbp-hide-notice' ); 235 236 // Maybe delete notices 237 switch ( $_GET['bbp-hide-notice'] ) { 238 239 // Skipped upgrade notice 240 case 'bbp-skip-upgrade' : 241 delete_option( '_bbp_db_upgrade_skipped' ); 242 break; 243 } 187 244 } 188 245 -
trunk/src/includes/core/options.php
r6695 r6705 31 31 32 32 '_bbp_db_version' => 0, // Database version 33 '_bbp_db_upgrade_skipped' => 0, // Database upgrade skipped 33 34 34 35 /** Features **********************************************************/ -
trunk/src/includes/core/update.php
r6573 r6705 315 315 /** 2.6 Branch ********************************************************/ 316 316 317 // 2.6 .x317 // 2.6 Alpha 318 318 if ( $raw_db_version < 261 ) { 319 319 … … 327 327 bbp_admin_upgrade_user_topic_subscriptions(); 328 328 bbp_admin_upgrade_user_forum_subscriptions(); 329 } else { 330 update_option( '_bbp_db_upgrade_skipped', $raw_db_version ); 329 331 } 330 332 } 331 333 334 // 2.6 Beta/RC/GM 332 335 if ( $raw_db_version < 262 ) { 333 336 … … 339 342 if ( ! bbp_is_large_install() ) { 340 343 bbp_admin_upgrade_user_engagements(); 344 } else { 345 update_option( '_bbp_db_upgrade_skipped', $raw_db_version ); 341 346 } 342 347 }
Note: See TracChangeset
for help on using the changeset viewer.