| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/hello-plus/classes/ |
Upload File : |
<?php
namespace HelloPlus\Classes;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
use HelloPlus\Includes\Utils as Theme_Utils;
class Widget_Utils {
public static function get_configured_breakpoints(): array {
$active_devices = Theme_Utils::elementor()->breakpoints->get_active_devices_list( [ 'reverse' => true ] );
$active_breakpoint_instances = Theme_Utils::elementor()->breakpoints->get_active_breakpoints();
$devices_options = [];
foreach ( $active_devices as $device_key ) {
$device_label = 'desktop' === $device_key ? esc_html__( 'Desktop', 'hello-plus' ) : $active_breakpoint_instances[ $device_key ]->get_label();
$devices_options[ $device_key ] = $device_label;
}
return [
'active_devices' => $active_devices,
'devices_options' => $devices_options,
];
}
public static function maybe_render_text_html(
\Elementor\Widget_Base $context,
string $render_key,
string $css_class,
string $settings_text,
string $settings_tag = 'p'
): void {
if ( '' === $settings_text ) {
return;
}
$context->add_render_attribute( $render_key, 'class', $css_class );
$element_html = sprintf(
'<%1$s %2$s>%3$s</%1$s>',
\Elementor\Utils::validate_html_tag( $settings_tag ),
$context->get_render_attribute_string( $render_key ),
$settings_text,
);
echo wp_kses_post( $element_html );
}
public static function get_available_menus(): array {
$menus = wp_get_nav_menus();
$options = [];
foreach ( $menus as $menu ) {
$options[ $menu->slug ] = $menu->name;
}
return $options;
}
public static function get_empty_menus(): array {
$menus = wp_get_nav_menus();
$options = [];
foreach ( $menus as $menu ) {
$menu_items = wp_get_nav_menu_items( $menu->term_id );
if ( empty( $menu_items ) ) {
$options[ $menu->term_id ] = $menu->slug;
}
}
return $options;
}
}