Changeset 3453805
- Timestamp:
- 02/04/2026 12:59:47 PM (2 months ago)
- Location:
- bb-mega-menu
- Files:
-
- 1 added
- 6 edited
- 1 copied
-
assets/screenshot-3.jpg (added)
-
tags/1.0.9 (copied) (copied from bb-mega-menu/trunk)
-
tags/1.0.9/bb-mega-menu.php (modified) (1 diff)
-
tags/1.0.9/class-bb-mega-menu.php (modified) (2 diffs)
-
tags/1.0.9/readme.txt (modified) (3 diffs)
-
trunk/bb-mega-menu.php (modified) (1 diff)
-
trunk/class-bb-mega-menu.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bb-mega-menu/tags/1.0.9/bb-mega-menu.php
r3453391 r3453805 4 4 * Plugin URI: https://betterbuilds.app 5 5 * Description: Build flexible mega menus using the block editor, powered by a Mega Menu custom post type. 6 * Version: 1.0. 86 * Version: 1.0.9 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 8.0 -
bb-mega-menu/tags/1.0.9/class-bb-mega-menu.php
r3453321 r3453805 72 72 .bb-mm-header h1{display:flex;align-items:center;gap:8px;margin:0;font-size:23px;font-weight:400;line-height:1.3;} 73 73 .bb-mm-header-subtitle{margin:6px 0 0;color:#6b7280;font-size:13px;} 74 .bb-mm-settings{max-width:1200px;} 75 .bb-mm-settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px;margin:0 0 20px;} 76 .bb-mm-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:20px;box-shadow:0 1px 2px rgba(0,0,0,0.04);} 77 .bb-mm-card-header{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px;} 78 .bb-mm-card-icon{width:36px;height:36px;border-radius:10px;background:#f3f4f6;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 auto;} 79 .bb-mm-card-title{font-size:16px;margin:0 0 4px;font-weight:600;color:#111827;} 80 .bb-mm-card-subtitle{margin:0;color:#6b7280;font-size:13px;} 81 .bb-mm-field{display:flex;flex-direction:column;gap:8px;padding:12px 0;border-top:1px solid #f1f2f4;} 82 .bb-mm-field:first-of-type{border-top:0;padding-top:0;} 83 .bb-mm-label{font-weight:600;color:#111827;} 84 .bb-mm-help{margin:0;color:#6b7280;font-size:12px;} 85 .bb-mm-control{display:flex;align-items:center;gap:12px;} 86 .bb-mm-input,.bb-mm-select{width:100%;max-width:100%;padding:8px 10px;border:1px solid #d1d5db;border-radius:8px;background:#f9fafb;color:#111827;} 87 .bb-mm-input:focus,.bb-mm-select:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,0.15);outline:none;background:#fff;} 88 .bb-mm-color-swatch{width:32px;height:32px;border-radius:8px;border:1px solid #e5e7eb;flex:0 0 auto;} 89 .bb-mm-field--toggle{flex-direction:row;align-items:center;justify-content:space-between;gap:16px;} 90 .bb-mm-toggle{position:relative;display:inline-flex;align-items:center;} 91 .bb-mm-toggle input{opacity:0;position:absolute;left:0;top:0;width:100%;height:100%;margin:0;cursor:pointer;} 92 .bb-mm-toggle-slider{width:46px;height:26px;background:#d1d5db;border-radius:999px;position:relative;display:inline-block;transition:background 0.2s ease;} 93 .bb-mm-toggle-slider::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;background:#fff;border-radius:999px;box-shadow:0 1px 2px rgba(0,0,0,0.18);transition:transform 0.2s ease;} 94 .bb-mm-toggle input:checked + .bb-mm-toggle-slider{background:#2563eb;} 95 .bb-mm-toggle input:checked + .bb-mm-toggle-slider::after{transform:translateX(20px);} 96 .bb-mm-form-footer{display:flex;justify-content:flex-end;margin-top:16px;} 97 .bb-mm-form-footer .button-primary{min-width:140px;} 98 @media (max-width:782px){.bb-mm-field--toggle{align-items:flex-start;flex-direction:column;}} 74 99 '; 75 100 wp_add_inline_style( 'wp-admin', $css ); … … 273 298 return; 274 299 } 300 $settings = $this->get_settings(); 275 301 ?> 276 302 <div class="wrap"> 277 303 <?php $this->render_page_header( __( 'Settings', 'bb-mega-menu' ), 'menu', __( 'Mega Menu', 'bb-mega-menu' ) ); ?> 278 <form method="post" action="options.php" >304 <form method="post" action="options.php" class="bb-mm-settings"> 279 305 <?php 280 306 settings_fields( 'bb_mega_menu_settings_group' ); 281 do_settings_sections( self::SETTINGS_PAGE );282 submit_button();283 307 ?> 308 <div class="bb-mm-settings-grid"> 309 <section class="bb-mm-card"> 310 <div class="bb-mm-card-header"> 311 <span class="bb-mm-card-icon dashicons dashicons-layout"></span> 312 <div> 313 <h2 class="bb-mm-card-title"><?php esc_html_e( 'Layout', 'bb-mega-menu' ); ?></h2> 314 <p class="bb-mm-card-subtitle"><?php esc_html_e( 'Position and spacing settings', 'bb-mega-menu' ); ?></p> 315 </div> 316 </div> 317 <?php 318 $this->render_setting_control( 'header_offset', __( 'Header / Nav Height Offset', 'bb-mega-menu' ), 'text', $settings ); 319 $this->render_setting_control( 'panel_padding', __( 'Panel Padding', 'bb-mega-menu' ), 'text', $settings ); 320 $this->render_setting_control( 'z_index', __( 'Z-Index', 'bb-mega-menu' ), 'number', $settings ); 321 ?> 322 </section> 323 <section class="bb-mm-card"> 324 <div class="bb-mm-card-header"> 325 <span class="bb-mm-card-icon dashicons dashicons-admin-appearance"></span> 326 <div> 327 <h2 class="bb-mm-card-title"><?php esc_html_e( 'Appearance', 'bb-mega-menu' ); ?></h2> 328 <p class="bb-mm-card-subtitle"><?php esc_html_e( 'Visual styling options', 'bb-mega-menu' ); ?></p> 329 </div> 330 </div> 331 <?php 332 $this->render_setting_control( 'use_default_styling', __( 'Enable Default Styling', 'bb-mega-menu' ), 'checkbox', $settings ); 333 $this->render_setting_control( 'panel_bg', __( 'Panel Background Color', 'bb-mega-menu' ), 'text', $settings ); 334 $this->render_setting_control( 'panel_shadow', __( 'Panel Shadow', 'bb-mega-menu' ), 'select', $settings, $this->get_shadow_options() ); 335 ?> 336 </section> 337 </div> 338 <section class="bb-mm-card"> 339 <div class="bb-mm-card-header"> 340 <span class="bb-mm-card-icon dashicons dashicons-controls-repeat"></span> 341 <div> 342 <h2 class="bb-mm-card-title"><?php esc_html_e( 'Behavior', 'bb-mega-menu' ); ?></h2> 343 <p class="bb-mm-card-subtitle"><?php esc_html_e( 'Animation and interaction settings', 'bb-mega-menu' ); ?></p> 344 </div> 345 </div> 346 <?php $this->render_setting_control( 'transition_ms', __( 'Transition Speed', 'bb-mega-menu' ), 'number', $settings ); ?> 347 </section> 348 <div class="bb-mm-form-footer"> 349 <?php echo wp_kses_post( submit_button( __( 'Save Changes', 'bb-mega-menu' ), 'primary', 'submit', false ) ); ?> 350 </div> 284 351 </form> 352 </div> 353 <?php 354 } 355 356 /** 357 * Render a settings control. 358 * 359 * @param string $key Field key. 360 * @param string $label Field label. 361 * @param string $type Field type. 362 * @param array $settings Current settings. 363 * @param array $options Select options. 364 * @return void 365 */ 366 private function render_setting_control( string $key, string $label, string $type, array $settings, array $options = array() ): void { 367 $descriptions = array( 368 'header_offset' => __( 'Top offset for the mega menu panel. Use px, rem, or em units.', 'bb-mega-menu' ), 369 'panel_padding' => __( 'Inner padding for the mega menu panel content.', 'bb-mega-menu' ), 370 'z_index' => __( 'Stacking order. Higher values appear above other elements.', 'bb-mega-menu' ), 371 'use_default_styling' => __( 'Adds caret indicator and base padding.', 'bb-mega-menu' ), 372 'panel_bg' => __( 'Hex, RGB, or CSS color value for the panel background.', 'bb-mega-menu' ), 373 'panel_shadow' => __( 'Add depth with a drop shadow effect.', 'bb-mega-menu' ), 374 'transition_ms' => __( 'Animation speed in milliseconds.', 'bb-mega-menu' ), 375 ); 376 $value = $settings[ $key ] ?? ''; 377 378 if ( 'checkbox' === $type ) { 379 ?> 380 <div class="bb-mm-field bb-mm-field--toggle"> 381 <div> 382 <p class="bb-mm-label"><?php echo esc_html( $label ); ?></p> 383 <?php if ( isset( $descriptions[ $key ] ) ) : ?> 384 <p class="bb-mm-help"><?php echo esc_html( $descriptions[ $key ] ); ?></p> 385 <?php endif; ?> 386 </div> 387 <label class="bb-mm-toggle"> 388 <input type="checkbox" name="<?php echo esc_attr( self::SETTINGS_KEY ); ?>[<?php echo esc_attr( $key ); ?>]" value="1" <?php checked( (bool) $value, true ); ?> /> 389 <span class="bb-mm-toggle-slider" aria-hidden="true"></span> 390 </label> 391 </div> 392 <?php 393 return; 394 } 395 ?> 396 <div class="bb-mm-field"> 397 <label class="bb-mm-label" for="bb-mm-<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $label ); ?></label> 398 <div class="bb-mm-control"> 399 <?php if ( 'select' === $type ) : ?> 400 <select id="bb-mm-<?php echo esc_attr( $key ); ?>" class="bb-mm-select" name="<?php echo esc_attr( self::SETTINGS_KEY ); ?>[<?php echo esc_attr( $key ); ?>]"> 401 <?php foreach ( $options as $option_value => $option_label ) : ?> 402 <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $value, $option_value ); ?>> 403 <?php echo esc_html( $option_label ); ?> 404 </option> 405 <?php endforeach; ?> 406 </select> 407 <?php else : ?> 408 <input id="bb-mm-<?php echo esc_attr( $key ); ?>" class="bb-mm-input" type="<?php echo esc_attr( $type ); ?>" name="<?php echo esc_attr( self::SETTINGS_KEY ); ?>[<?php echo esc_attr( $key ); ?>]" value="<?php echo esc_attr( $value ); ?>" /> 409 <?php if ( 'panel_bg' === $key ) : ?> 410 <span class="bb-mm-color-swatch" style="background:<?php echo esc_attr( $value ); ?>"></span> 411 <?php endif; ?> 412 <?php endif; ?> 413 </div> 414 <?php if ( isset( $descriptions[ $key ] ) ) : ?> 415 <p class="bb-mm-help"><?php echo esc_html( $descriptions[ $key ] ); ?></p> 416 <?php endif; ?> 285 417 </div> 286 418 <?php -
bb-mega-menu/tags/1.0.9/readme.txt
r3453391 r3453805 5 5 Requires PHP: 8.0 6 6 Tested up to: 6.9 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 48 48 1. Settings screen under Appearance → BB Mega Menu. 49 49 2. Mega Menu panel opened on the frontend. 50 3. Mega Menu CPT open in the editor. 50 51 51 52 == Changelog == … … 72 73 * Updating the Icon 73 74 74 = 1.0. 7=75 = 1.0.8 = 75 76 * Reset the Changelog 77 78 = 1.0.9 = 79 * Clean up the Admin Settings page styling 80 * new icon 81 * Add a 3rd screenshot 76 82 77 83 == Upgrade Notice == -
bb-mega-menu/trunk/bb-mega-menu.php
r3453391 r3453805 4 4 * Plugin URI: https://betterbuilds.app 5 5 * Description: Build flexible mega menus using the block editor, powered by a Mega Menu custom post type. 6 * Version: 1.0. 86 * Version: 1.0.9 7 7 * Requires at least: 6.0 8 8 * Requires PHP: 8.0 -
bb-mega-menu/trunk/class-bb-mega-menu.php
r3453321 r3453805 72 72 .bb-mm-header h1{display:flex;align-items:center;gap:8px;margin:0;font-size:23px;font-weight:400;line-height:1.3;} 73 73 .bb-mm-header-subtitle{margin:6px 0 0;color:#6b7280;font-size:13px;} 74 .bb-mm-settings{max-width:1200px;} 75 .bb-mm-settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:20px;margin:0 0 20px;} 76 .bb-mm-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:20px;box-shadow:0 1px 2px rgba(0,0,0,0.04);} 77 .bb-mm-card-header{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px;} 78 .bb-mm-card-icon{width:36px;height:36px;border-radius:10px;background:#f3f4f6;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:18px;flex:0 0 auto;} 79 .bb-mm-card-title{font-size:16px;margin:0 0 4px;font-weight:600;color:#111827;} 80 .bb-mm-card-subtitle{margin:0;color:#6b7280;font-size:13px;} 81 .bb-mm-field{display:flex;flex-direction:column;gap:8px;padding:12px 0;border-top:1px solid #f1f2f4;} 82 .bb-mm-field:first-of-type{border-top:0;padding-top:0;} 83 .bb-mm-label{font-weight:600;color:#111827;} 84 .bb-mm-help{margin:0;color:#6b7280;font-size:12px;} 85 .bb-mm-control{display:flex;align-items:center;gap:12px;} 86 .bb-mm-input,.bb-mm-select{width:100%;max-width:100%;padding:8px 10px;border:1px solid #d1d5db;border-radius:8px;background:#f9fafb;color:#111827;} 87 .bb-mm-input:focus,.bb-mm-select:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,0.15);outline:none;background:#fff;} 88 .bb-mm-color-swatch{width:32px;height:32px;border-radius:8px;border:1px solid #e5e7eb;flex:0 0 auto;} 89 .bb-mm-field--toggle{flex-direction:row;align-items:center;justify-content:space-between;gap:16px;} 90 .bb-mm-toggle{position:relative;display:inline-flex;align-items:center;} 91 .bb-mm-toggle input{opacity:0;position:absolute;left:0;top:0;width:100%;height:100%;margin:0;cursor:pointer;} 92 .bb-mm-toggle-slider{width:46px;height:26px;background:#d1d5db;border-radius:999px;position:relative;display:inline-block;transition:background 0.2s ease;} 93 .bb-mm-toggle-slider::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;background:#fff;border-radius:999px;box-shadow:0 1px 2px rgba(0,0,0,0.18);transition:transform 0.2s ease;} 94 .bb-mm-toggle input:checked + .bb-mm-toggle-slider{background:#2563eb;} 95 .bb-mm-toggle input:checked + .bb-mm-toggle-slider::after{transform:translateX(20px);} 96 .bb-mm-form-footer{display:flex;justify-content:flex-end;margin-top:16px;} 97 .bb-mm-form-footer .button-primary{min-width:140px;} 98 @media (max-width:782px){.bb-mm-field--toggle{align-items:flex-start;flex-direction:column;}} 74 99 '; 75 100 wp_add_inline_style( 'wp-admin', $css ); … … 273 298 return; 274 299 } 300 $settings = $this->get_settings(); 275 301 ?> 276 302 <div class="wrap"> 277 303 <?php $this->render_page_header( __( 'Settings', 'bb-mega-menu' ), 'menu', __( 'Mega Menu', 'bb-mega-menu' ) ); ?> 278 <form method="post" action="options.php" >304 <form method="post" action="options.php" class="bb-mm-settings"> 279 305 <?php 280 306 settings_fields( 'bb_mega_menu_settings_group' ); 281 do_settings_sections( self::SETTINGS_PAGE );282 submit_button();283 307 ?> 308 <div class="bb-mm-settings-grid"> 309 <section class="bb-mm-card"> 310 <div class="bb-mm-card-header"> 311 <span class="bb-mm-card-icon dashicons dashicons-layout"></span> 312 <div> 313 <h2 class="bb-mm-card-title"><?php esc_html_e( 'Layout', 'bb-mega-menu' ); ?></h2> 314 <p class="bb-mm-card-subtitle"><?php esc_html_e( 'Position and spacing settings', 'bb-mega-menu' ); ?></p> 315 </div> 316 </div> 317 <?php 318 $this->render_setting_control( 'header_offset', __( 'Header / Nav Height Offset', 'bb-mega-menu' ), 'text', $settings ); 319 $this->render_setting_control( 'panel_padding', __( 'Panel Padding', 'bb-mega-menu' ), 'text', $settings ); 320 $this->render_setting_control( 'z_index', __( 'Z-Index', 'bb-mega-menu' ), 'number', $settings ); 321 ?> 322 </section> 323 <section class="bb-mm-card"> 324 <div class="bb-mm-card-header"> 325 <span class="bb-mm-card-icon dashicons dashicons-admin-appearance"></span> 326 <div> 327 <h2 class="bb-mm-card-title"><?php esc_html_e( 'Appearance', 'bb-mega-menu' ); ?></h2> 328 <p class="bb-mm-card-subtitle"><?php esc_html_e( 'Visual styling options', 'bb-mega-menu' ); ?></p> 329 </div> 330 </div> 331 <?php 332 $this->render_setting_control( 'use_default_styling', __( 'Enable Default Styling', 'bb-mega-menu' ), 'checkbox', $settings ); 333 $this->render_setting_control( 'panel_bg', __( 'Panel Background Color', 'bb-mega-menu' ), 'text', $settings ); 334 $this->render_setting_control( 'panel_shadow', __( 'Panel Shadow', 'bb-mega-menu' ), 'select', $settings, $this->get_shadow_options() ); 335 ?> 336 </section> 337 </div> 338 <section class="bb-mm-card"> 339 <div class="bb-mm-card-header"> 340 <span class="bb-mm-card-icon dashicons dashicons-controls-repeat"></span> 341 <div> 342 <h2 class="bb-mm-card-title"><?php esc_html_e( 'Behavior', 'bb-mega-menu' ); ?></h2> 343 <p class="bb-mm-card-subtitle"><?php esc_html_e( 'Animation and interaction settings', 'bb-mega-menu' ); ?></p> 344 </div> 345 </div> 346 <?php $this->render_setting_control( 'transition_ms', __( 'Transition Speed', 'bb-mega-menu' ), 'number', $settings ); ?> 347 </section> 348 <div class="bb-mm-form-footer"> 349 <?php echo wp_kses_post( submit_button( __( 'Save Changes', 'bb-mega-menu' ), 'primary', 'submit', false ) ); ?> 350 </div> 284 351 </form> 352 </div> 353 <?php 354 } 355 356 /** 357 * Render a settings control. 358 * 359 * @param string $key Field key. 360 * @param string $label Field label. 361 * @param string $type Field type. 362 * @param array $settings Current settings. 363 * @param array $options Select options. 364 * @return void 365 */ 366 private function render_setting_control( string $key, string $label, string $type, array $settings, array $options = array() ): void { 367 $descriptions = array( 368 'header_offset' => __( 'Top offset for the mega menu panel. Use px, rem, or em units.', 'bb-mega-menu' ), 369 'panel_padding' => __( 'Inner padding for the mega menu panel content.', 'bb-mega-menu' ), 370 'z_index' => __( 'Stacking order. Higher values appear above other elements.', 'bb-mega-menu' ), 371 'use_default_styling' => __( 'Adds caret indicator and base padding.', 'bb-mega-menu' ), 372 'panel_bg' => __( 'Hex, RGB, or CSS color value for the panel background.', 'bb-mega-menu' ), 373 'panel_shadow' => __( 'Add depth with a drop shadow effect.', 'bb-mega-menu' ), 374 'transition_ms' => __( 'Animation speed in milliseconds.', 'bb-mega-menu' ), 375 ); 376 $value = $settings[ $key ] ?? ''; 377 378 if ( 'checkbox' === $type ) { 379 ?> 380 <div class="bb-mm-field bb-mm-field--toggle"> 381 <div> 382 <p class="bb-mm-label"><?php echo esc_html( $label ); ?></p> 383 <?php if ( isset( $descriptions[ $key ] ) ) : ?> 384 <p class="bb-mm-help"><?php echo esc_html( $descriptions[ $key ] ); ?></p> 385 <?php endif; ?> 386 </div> 387 <label class="bb-mm-toggle"> 388 <input type="checkbox" name="<?php echo esc_attr( self::SETTINGS_KEY ); ?>[<?php echo esc_attr( $key ); ?>]" value="1" <?php checked( (bool) $value, true ); ?> /> 389 <span class="bb-mm-toggle-slider" aria-hidden="true"></span> 390 </label> 391 </div> 392 <?php 393 return; 394 } 395 ?> 396 <div class="bb-mm-field"> 397 <label class="bb-mm-label" for="bb-mm-<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $label ); ?></label> 398 <div class="bb-mm-control"> 399 <?php if ( 'select' === $type ) : ?> 400 <select id="bb-mm-<?php echo esc_attr( $key ); ?>" class="bb-mm-select" name="<?php echo esc_attr( self::SETTINGS_KEY ); ?>[<?php echo esc_attr( $key ); ?>]"> 401 <?php foreach ( $options as $option_value => $option_label ) : ?> 402 <option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $value, $option_value ); ?>> 403 <?php echo esc_html( $option_label ); ?> 404 </option> 405 <?php endforeach; ?> 406 </select> 407 <?php else : ?> 408 <input id="bb-mm-<?php echo esc_attr( $key ); ?>" class="bb-mm-input" type="<?php echo esc_attr( $type ); ?>" name="<?php echo esc_attr( self::SETTINGS_KEY ); ?>[<?php echo esc_attr( $key ); ?>]" value="<?php echo esc_attr( $value ); ?>" /> 409 <?php if ( 'panel_bg' === $key ) : ?> 410 <span class="bb-mm-color-swatch" style="background:<?php echo esc_attr( $value ); ?>"></span> 411 <?php endif; ?> 412 <?php endif; ?> 413 </div> 414 <?php if ( isset( $descriptions[ $key ] ) ) : ?> 415 <p class="bb-mm-help"><?php echo esc_html( $descriptions[ $key ] ); ?></p> 416 <?php endif; ?> 285 417 </div> 286 418 <?php -
bb-mega-menu/trunk/readme.txt
r3453391 r3453805 5 5 Requires PHP: 8.0 6 6 Tested up to: 6.9 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 48 48 1. Settings screen under Appearance → BB Mega Menu. 49 49 2. Mega Menu panel opened on the frontend. 50 3. Mega Menu CPT open in the editor. 50 51 51 52 == Changelog == … … 72 73 * Updating the Icon 73 74 74 = 1.0. 7=75 = 1.0.8 = 75 76 * Reset the Changelog 77 78 = 1.0.9 = 79 * Clean up the Admin Settings page styling 80 * new icon 81 * Add a 3rd screenshot 76 82 77 83 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.