upskill-event-manager/wordpress-dev/wordpress/wp-content/plugins/astra-addon/compatibility/class-astra-ubermenu-pro.php
bengizmo d1509b3d60 feat(dev-env): implement backup-based development workflow
This commit introduces a more reliable and consistent approach to setting up
the development environment using backups:

- Add setup-from-backup.sh script for environment setup from existing backups
- Standardize script naming and organization
- Move obsolete scripts to bin/obsolete directory
- Update documentation with new workflow instructions
- Create migration guide for transitioning to new workflow
- Update Memory Bank with workflow improvements

The new workflow provides:
- More reliable environment setup
- Faster setup process
- Offline development capability
- Consistent development environments across team members

Breaking changes:
- setup-dev.sh is replaced by setup-from-backup.sh
- sync-and-setup.sh is replaced by separate scripts
- verify-with-wpcli.sh is no longer used

Migration path is documented in MIGRATION_GUIDE.md
2025-03-26 11:26:18 -03:00

90 lines
1.9 KiB
PHP

<?php
/**
* Ubermenu Compatibility File.
*
* @link https://Ubermenu.me/
* @since 1.1.7
*
* @package Astra
*/
/**
* Astra Ubermenu Compatibility
*/
if ( ! class_exists( 'Astra_UberMenu_Pro' ) ) {
/**
* Astra Ubermenu Compatibility
*
* @since 1.0.0
*/
// @codingStandardsIgnoreStart
class Astra_UberMenu_Pro {
// @codingStandardsIgnoreEnd
/**
* Member Variable
*
* @var object instance
*/
private static $instance;
/**
* Initiator
*
* @since 1.1.7
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*
* @since 1.1.7
*/
public function __construct() {
add_action( 'after_setup_theme', array( $this, 'disable_above_below_header_toggle' ), 10 );
}
/**
* Disable the Mobile Menu toggles from Astra if Uber Menu is used.
*
* @since 1.1.7
*/
public function disable_above_below_header_toggle() {
// Don't override anything if ubermenu's function is not present.
if ( ! function_exists( 'ubermenu_get_menu_instance_by_theme_location' ) ) {
return;
}
if ( ! class_exists( 'Astra_Ext_Header_Sections_Markup' ) ) {
return;
}
$hs_class = Astra_Ext_Header_Sections_Markup::get_instance();
$ubermenu_above_header = ubermenu_get_menu_instance_by_theme_location( 'above_header_menu' );
$ubermenu_below_header = ubermenu_get_menu_instance_by_theme_location( 'below_header_menu' );
if ( $ubermenu_above_header ) {
remove_action( 'astra_above_header_toggle_buttons', array( $hs_class, 'above_header_toggle_button' ), 10 );
}
if ( $ubermenu_below_header ) {
remove_action( 'astra_below_header_toggle_buttons', array( $hs_class, 'below_header_toggle_button' ), 11 );
}
}
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_UberMenu_Pro::get_instance();