easyel_settings_ajax();
}
public function easyel_settings_ajax( ) {
// AJAX handler for saving minify js option
add_action('wp_ajax_easy_elements_save_widget_setting', array( $this, "easy_elements_save_widget_setting" ) );
add_action('wp_ajax_easy_elements_bulk_action', array( $this, 'easy_elements_bulk_action') );
add_action('wp_ajax_easy_elements_toggle_widget', array( $this, 'easyel_elements_toggle_widget_callback') ) ;
add_action('wp_ajax_easy_elements_save_global_extensions', array( $this, 'easy_elements_save_global_extensions') ) ;
add_action('wp_ajax_easy_elements_save_global_extensions_bulk', array( $this, 'easy_elements_save_global_extensions_bulk') ) ;
add_action('admin_enqueue_scripts', array( $this, 'easyel_elements_enqueue_admin_assets') );
add_action( 'admin_head', array( $this, 'easyel_hide_admin_notices' ) );
}
// Singleton get_instance
public static function get_instance() {
if (self::$instance === null) {
self::$instance = new self();
}
return self::$instance;
}
public function easyel_elements_settings_menu() {
// Main Menu
add_menu_page(
__('Easy Elements', 'easy-elements'),
__('Easy Elements', 'easy-elements'),
'manage_options',
'easy-elements-dashboard',
array( $this, 'easyel_elements_settings_callback' ),
'dashicons-admin-generic',
59
);
global $submenu;
// Main slug
$slug = 'easy-elements-dashboard';
$submenu[$slug][] = [ __('Overview', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#overview' ];
$submenu[$slug][] = [ __('Widgets', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#widget' ];
$submenu[$slug][] = [ __('All Extensions', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#extensions' ];
// Header & Footer Submenu
add_submenu_page(
'easy-elements-dashboard',
__('Header & Footer', 'easy-elements'),
__('Header & Footer', 'easy-elements'),
'manage_options',
'edit.php?post_type=ee-elementor-hf'
);
// Upload Custom Fonts Submenu
add_submenu_page(
'easy-elements-dashboard',
__('Upload Custom Fonts', 'easy-elements'),
__('Upload Custom Fonts', 'easy-elements'),
'manage_options',
'easyel-custom-fonts',
array( $this, 'easyel_custom_fonts_page_html' )
);
// Off Canvas Submenu
add_submenu_page(
'easy-elements-dashboard',
__('Off Canvas', 'easy-elements'),
__('Off Canvas', 'easy-elements'),
'manage_options',
'edit.php?post_type=easy-offcanvas'
);
}
public function easyel_elements_register_settings() {
register_setting( 'easyel_elements_extensions_group', 'easyel_enable_js_animation', [
'sanitize_callback' => 'absint',
'default' => 0,
] );
// Cursor setting register
register_setting( 'easyel_elements_extensions_group', 'easyel_enable_cursor', [
'sanitize_callback' => 'absint',
'default' => 0,
] );
}
public function easy_elements_save_global_extensions_bulk() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_send_json_error( __( 'Unauthorized', 'easy-elements' ) );
}
check_ajax_referer( 'easy_elements_widget_settings_nonce', 'nonce' );
$tab = isset( $_POST['tab'] ) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'extensions';
$keys = isset( $_POST['keys'] ) ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['keys'] ) ) : [];
$status = isset( $_POST['status'] ) ? intval( wp_unslash( $_POST['status'] ) ) : 0;
$group_slug = isset( $_POST['group'] ) ? sanitize_text_field( wp_unslash( $_POST['group'] ) ) : '';
if ( empty( $keys ) ) {
wp_send_json_error( [ 'message' => __( 'No keys provided', 'easy-elements' ) ] );
}
$settings = get_option( 'easy_element_' . $tab, [] );
foreach ( $keys as $key ) {
$key = sanitize_text_field( $key );
$settings[ $key ] = $status;
}
update_option( 'easy_element_' . $tab, $settings );
if ( $group_slug ) {
update_option( 'easy_element_group_' . $group_slug, $status );
}
wp_send_json_success( [ 'message' => __( 'Bulk settings updated', 'easy-elements' ) ] );
}
public function easy_elements_save_global_extensions() {
if (!current_user_can('manage_options')) {
wp_send_json_error(__('Unauthorized', 'easy-elements'));
}
check_ajax_referer('easy_elements_widget_settings_nonce', 'nonce');
$tab = isset( $_POST['tab'] ) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'extensions';
$key = isset($_POST['key']) ? sanitize_text_field( wp_unslash( $_POST['key'] )) : '';
$status = isset( $_POST['status'] ) ? intval( wp_unslash( $_POST['status'] ) ) : 0;
if (!$key) {
wp_send_json_error(['message' => __('Invalid key', 'easy-elements')]);
}
$settings = get_option('easy_element_' . $tab, []);
$settings[$key] = $status;
update_option('easy_element_' . $tab, $settings);
wp_send_json_success(['message' => __('Settings updated', 'easy-elements')]);
}
// AJAX handler for saving individual widget settings
public function easy_elements_save_widget_setting() {
if (!current_user_can('manage_options')) {
wp_send_json_error(__('Unauthorized', 'easy-elements'));
}
check_ajax_referer('easy_elements_widget_settings_nonce', 'nonce');
$widget_key = isset($_POST['widget_key']) ? sanitize_text_field( wp_unslash($_POST['widget_key'] ) ) : '';
$status = isset($_POST['status']) && $_POST['status'] === '1' ? '1' : '0';
$tab_slug = isset($_POST['tab']) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'widget';
if (!empty( $widget_key ) ) {
$option_name = 'easy_element_' . $tab_slug . '_' . $widget_key;
update_option($option_name, $status);
wp_send_json_success([
'message' => __('Widget setting updated successfully', 'easy-elements'),
'status' => $status,
]);
} else {
wp_send_json_error(['message' => __('Invalid widget key', 'easy-elements')]);
}
}
// AJAX handler for bulk actions
public function easy_elements_bulk_action() {
if (!current_user_can('manage_options')) {
wp_send_json_error(__('Unauthorized', 'easy-elements'));
}
check_ajax_referer('easy_elements_bulk_action_nonce', 'nonce');
$bulk_action = isset($_POST['bulk_action']) ? sanitize_text_field(wp_unslash($_POST['bulk_action'])) : '';
$tab = isset($_POST['tab']) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'widget';
$status = $bulk_action === 'activate_all' ? '1' : '0';
$available_elements = $this->easyel_elements_get_available_widgets();
$updated_count = 0;
$is_pro_active = class_exists('Easy_Elements_Pro');
foreach ($available_elements as $key => $widget) {
if (isset($widget['tab']) && $widget['tab'] === $tab) {
$option_name = 'easy_element_' . $tab . '_' . $key;
if (!$is_pro_active && isset($widget['is_pro']) && $widget['is_pro']) {
update_option($option_name, '0');
} else {
$status = $bulk_action === 'activate_all' ? '1' : '0';
update_option($option_name, $status);
}
}
}
wp_send_json_success([
'message' => sprintf('%d widgets %s successfully', $updated_count, $status ? 'activated' : 'deactivated'),
'count' => $updated_count,
'is_pro_active' => $is_pro_active
]);
}
function easyel_elements_settings_callback() {
$available_elements = $this->easyel_elements_get_available_widgets();
$easyel_tabs = [
'overview' => __('Overview', 'easy-elements'),
'widget' => __('All Widgets', 'easy-elements'),
'extensions' => __('All Extensions', 'easy-elements'),
'advsettings' => __('Advanced Settings', 'easy-elements'),
];
$easyel_tab_list = apply_filters("easyel_all_tab_list", $easyel_tabs );
?>
admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('easy_elements_nonce'),
'widget_settings_nonce' => wp_create_nonce('easy_elements_widget_settings_nonce'),
'bulk_action_nonce' => wp_create_nonce('easy_elements_bulk_action_nonce'),
'advance_settings_nonce' => wp_create_nonce('easy_elements_save_advance_settings_nonce'),
'js_animation_nonce' => wp_create_nonce('easyel_js_animation_nonce'),
'strings' => [
'confirm_activate_all' => __('Are you sure you want to activate all widgets?', 'easy-elements'),
'confirm_deactivate_all' => __('Are you sure you want to deactivate all widgets?', 'easy-elements'),
'processing' => __('Processing...', 'easy-elements'),
'saving' => __('Saving...', 'easy-elements'),
'saved' => __('Saved!', 'easy-elements'),
'error' => __('Error!', 'easy-elements'),
'updated' => __('Updated!', 'easy-elements'),
]
]);
}
function easyel_elements_get_available_widgets() {
$widgets = [
'heading' => [
'icon' => 'easyelIcon-heading',
'title' => 'Heading',
'description' => 'Add customizable headings with style options.',
'demo_url' => 'https://wpeasyelements.com/heading/',
'docx_url' => 'https://wpeasyelements.com/docs/heading/',
'is_pro' => false,
'tab' => 'widget',
],
'clients_logo' => [
'icon' => 'easyelIcon-clients-logo-grid',
'title' => 'Clients Logo Grid',
'description' => 'Showcase client logos in a neat grid layout.',
'demo_url' => 'https://wpeasyelements.com/clients-logo-grid/',
'docx_url' => 'https://wpeasyelements.com/docs/clients-logo-grid',
'is_pro' => false,
'tab' => 'widget',
],
'clients_logo_slider' => [
'icon' => 'easyelIcon-clients-logo-slider',
'title' => 'Clients Logo Slider',
'description' => 'Display client logos in a slider format.',
'demo_url' => 'https://wpeasyelements.com/clients-logo-slider/',
'docx_url' => 'https://wpeasyelements.com/docs/clients-logo-slider/',
'is_pro' => true,
'tab' => 'widget',
],
'tab' => [
'icon' => 'easyelIcon-tab',
'title' => 'Tab',
'description' => 'Add simple tab content.',
'demo_url' => 'https://wpeasyelements.com/tab',
'docx_url' => 'https://wpeasyelements.com/docs/tab',
'is_pro' => false,
'tab' => 'widget',
],
'tab_advance' => [
'icon' => 'easyelIcon-tab',
'title' => 'Advanced Tab',
'description' => 'Create advanced tab content.',
'demo_url' => 'https://wpeasyelements.com/advanced-tab/',
'docx_url' => 'https://wpeasyelements.com/docs/advanced-tab/',
'is_pro' => true,
'tab' => 'widget',
],
'testimonials' => [
'icon' => 'easyelIcon-testimonials-grid',
'title' => 'Testimonials Grid',
'description' => 'Show testimonials in a grid format.',
'demo_url' => 'https://wpeasyelements.com/testimonials-grid',
'docx_url' => 'https://wpeasyelements.com/docs/testimonials-grid',
'is_pro' => false,
'tab' => 'widget',
],
'testimonials_slider' => [
'icon' => 'easyelIcon-testimonials-slider',
'title' => 'Testimonials Slider',
'description' => 'Display testimonials in a slider format.',
'demo_url' => 'https://wpeasyelements.com/testimonials-slider/',
'docx_url' => 'https://wpeasyelements.com/docs/testimonials-slider/',
'is_pro' => true,
'tab' => 'widget',
],
'image_carousel' => [
'icon' => 'easyelIcon-image-carousel',
'title' => 'Image Carousel',
'description' => 'Create an image slider with multiple images.',
'demo_url' => 'https://wpeasyelements.com/image-carousel/',
'docx_url' => 'https://wpeasyelements.com/docs/image-carousel',
'is_pro' => true,
'tab' => 'widget',
],
'image_reveal' => [
'icon' => 'easyelIcon-marquee-logo',
'title' => 'Reveal Image',
'description' => 'reveal Image Here',
'demo_url' => 'https://wpeasyelements.com/reveal-image/',
'docx_url' => 'https://wpeasyelements.com/docs/reveal-image/',
'is_pro' => true,
'tab' => 'widget',
],
'rotate_text' => [
'icon' => 'easyelIcon-heading',
'title' => 'Rotate Text',
'description' => 'rotate text here',
'demo_url' => 'https://wpeasyelements.com/rotate-text/',
'docx_url' => 'https://wpeasyelements.com/docs/rotate-text/',
'is_pro' => true,
'tab' => 'widget',
],
'icon_box' => [
'icon' => 'easyelIcon-iconbox',
'title' => 'Info Box',
'description' => 'Display content with an icon.',
'demo_url' => 'https://wpeasyelements.com/info-box',
'docx_url' => 'https://wpeasyelements.com/docs/info-box',
'is_pro' => false,
'tab' => 'widget',
],
'process_grid' => [
'icon' => 'easyelIcon-process-grid',
'title' => 'Process Grid',
'description' => 'Show process steps in a grid format.',
'demo_url' => 'https://wpeasyelements.com/process-grid',
'docx_url' => 'https://wpeasyelements.com/docs/process-grid',
'is_pro' => false,
'tab' => 'widget',
],
'process_slider' => [
'icon' => 'easyelIcon-process-slider',
'title' => 'Process Slider',
'description' => 'Show process steps in a slider.',
'demo_url' => 'https://wpeasyelements.com/process-slider/',
'docx_url' => 'https://wpeasyelements.com/docs/process-slider/',
'is_pro' => true,
'tab' => 'widget',
],
'team_grid' => [
'icon' => 'easyelIcon-team-grid',
'title' => 'Team Grid',
'description' => 'Display team members in a grid format.',
'demo_url' => 'https://wpeasyelements.com/team-grid',
'docx_url' => 'https://wpeasyelements.com/docs/team-grid',
'is_pro' => false,
'tab' => 'widget',
],
'team_slider' => [
'icon' => 'easyelIcon-team-slider',
'title' => 'Team Slider',
'description' => 'Showcase team members in a slider format.',
'demo_url' => 'https://wpeasyelements.com/team-slider',
'docx_url' => 'https://wpeasyelements.com/docs/team-slider',
'is_pro' => true,
'tab' => 'widget',
],
'contact_box' => [
'icon' => 'easyelIcon-contact-box',
'title' => 'Contact Box',
'description' => 'Contact Box.',
'demo_url' => 'https://wpeasyelements.com/contact-box',
'docx_url' => 'https://wpeasyelements.com/docs/contact-box',
'is_pro' => false,
'tab' => 'widget',
],
'icon_box_slider' => [
'icon' => 'easyelIcon-icon-box-slider',
'title' => 'Info Box Slider',
'description' => 'Info Box Slider.',
'demo_url' => 'https://wpeasyelements.com/info-box-slider/',
'docx_url' => 'https://wpeasyelements.com/docs/info-box-slider/',
'is_pro' => true,
'tab' => 'widget',
],
'timeline_slider' => [
'icon' => 'easyelIcon-timeline-slider',
'title' => 'Timeline Slider',
'description' => 'Timeline Slider.',
'demo_url' => 'https://wpeasyelements.com/timeline-slider/',
'docx_url' => 'https://wpeasyelements.com/docs/timeline-slider',
'is_pro' => true,
'tab' => 'widget',
],
'faq' => [
'icon' => 'easyelIcon-faq-1',
'title' => 'FAQ',
'description' => 'FAQ.',
'demo_url' => 'https://wpeasyelements.com/faq',
'docx_url' => 'https://wpeasyelements.com/docs/faq',
'is_pro' => false,
'tab' => 'widget',
],
'blog_grid' => [
'icon' => 'easyelIcon-post-grid',
'title' => 'Post Grid',
'description' => 'Post.',
'demo_url' => 'https://wpeasyelements.com/post-grid',
'docx_url' => 'https://wpeasyelements.com/docs/post-grid',
'is_pro' => false,
'tab' => 'widget',
],
'post_slider' => [
'icon' => 'easyelIcon-post-slider',
'title' => 'Post Slider',
'description' => 'Post Slider.',
'demo_url' => 'https://wpeasyelements.com/post-slider/',
'docx_url' => 'https://wpeasyelements.com/docs/post-slider/',
'is_pro' => true,
'tab' => 'widget',
],
'easy_cf7' => [
'icon' => 'easyelIcon-contact-form',
'title' => 'Contact Form 7',
'description' => 'Contact form 7.',
'demo_url' => 'https://wpeasyelements.com/contact-form-7',
'docx_url' => 'https://wpeasyelements.com/docs/contact-form-7',
'is_pro' => false,
'tab' => 'widget',
],
'video' => [
'icon' => 'easyelIcon-video',
'title' => 'Video',
'description' => 'Video.',
'demo_url' => 'https://wpeasyelements.com/video',
'docx_url' => 'https://wpeasyelements.com/docs/video',
'is_pro' => false,
'tab' => 'widget',
],
'pricing_table' => [
'icon' => 'easyelIcon-pricing-table',
'title' => 'Pricing Table',
'description' => 'Pricing Table.',
'demo_url' => 'https://wpeasyelements.com/pricing-table',
'docx_url' => 'https://wpeasyelements.com/docs/pricing-table',
'is_pro' => false,
'tab' => 'widget',
],
'pricing_list' => [
'icon' => 'easyelIcon-pricing-list',
'title' => 'Pricing List',
'description' => 'Pricing List.',
'demo_url' => 'https://wpeasyelements.com/pricing-list/',
'docx_url' => 'https://wpeasyelements.com/docs/pricing-list/',
'is_pro' => true,
'tab' => 'widget',
],
'pricing_tab' => [
'icon' => 'easyelIcon-pricing-table',
'title' => 'Pricing Tab',
'description' => 'Pricing Tab.',
'demo_url' => 'https://wpeasyelements.com/pricing-tab/',
'docx_url' => 'https://wpeasyelements.com/docs/pricing-tab/',
'is_pro' => true,
'tab' => 'widget',
],
'service_list' => [
'icon' => 'easyelIcon-service-list',
'title' => 'Service List',
'description' => 'Service List.',
'demo_url' => 'https://wpeasyelements.com/service-list',
'docx_url' => 'https://wpeasyelements.com/docs/service-list/',
'is_pro' => false,
'tab' => 'widget',
],
'process_list' => [
'icon' => 'easyelIcon-process-list',
'title' => 'Process List',
'description' => 'Process List.',
'demo_url' => 'https://wpeasyelements.com/process-list/',
'docx_url' => 'https://wpeasyelements.com/docs/process-list/',
'is_pro' => false,
'tab' => 'widget',
],
'marquee_logo' => [
'icon' => 'easyelIcon-marquee-logo',
'title' => 'Marquee',
'description' => 'Marquee.',
'demo_url' => 'https://wpeasyelements.com/marquee/',
'docx_url' => 'https://wpeasyelements.com/docs/marquee/',
'is_pro' => true,
'tab' => 'widget',
],
'button' => [
'icon' => 'easyelIcon-button',
'title' => 'Button',
'description' => 'Button.',
'demo_url' => 'https://wpeasyelements.com/button/',
'docx_url' => 'https://wpeasyelements.com/docs/button',
'is_pro' => false,
'tab' => 'widget',
],
'social_share' => [
'icon' => 'easyelIcon-social-share',
'title' => 'Social Share',
'description' => 'Social Share.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'tab' => 'widget',
],
'social_icon' => [
'icon' => 'easyelIcon-social-icons',
'title' => 'Social Icon',
'description' => 'Social Icon.',
'demo_url' => 'https://wpeasyelements.com/social-icon',
'docx_url' => 'https://wpeasyelements.com/docs/social-icon',
'is_pro' => false,
'tab' => 'widget',
],
'breadcrumb' => [
'icon' => 'easyelIcon-breadcumb',
'title' => 'Breadcrumb',
'description' => 'Breadcrumb.',
'demo_url' => 'https://wpeasyelements.com/breadcrumb',
'docx_url' => 'https://wpeasyelements.com/docs/breadcrumb',
'is_pro' => false,
'tab' => 'widget',
],
'easy_slider' => [
'icon' => 'easyelIcon-slider',
'title' => 'Slider',
'description' => 'Slider.',
'demo_url' => 'https://wpeasyelements.com/slider',
'docx_url' => 'https://wpeasyelements.com/docs/slider',
'is_pro' => true,
'tab' => 'widget',
],
'image_accordion' => [
'icon' => 'easyelIcon-image-accordion',
'title' => 'Image Accordion',
'description' => 'Image Accordion',
'demo_url' => 'https://wpeasyelements.com/image-accordion/',
'docx_url' => 'https://wpeasyelements.com/docs/image-accordion/',
'is_pro' => true,
'tab' => 'widget',
],
'domain_search' => [
'icon' => 'easyelIcon-domain-search',
'title' => 'Domain Search',
'description' => 'Domain Search.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'tab' => 'widget',
],
'featured_project' => [
'icon' => 'easyelIcon-custom-projects',
'title' => 'Custom Projects',
'description' => 'Custom Projects.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => true,
'tab' => 'widget',
],
'advance_button' => [
'icon' => 'easyelIcon-button',
'title' => 'Advance Button',
'description' => 'Advance Button.',
'demo_url' => 'https://wpeasyelements.com/advance-button/',
'docx_url' => 'https://wpeasyelements.com/docs/advance-button',
'is_pro' => true,
'tab' => 'widget',
],
'hr_image_scroll' => [
'icon' => 'easyelIcon-image-horizontal-scroll',
'title' => 'Horizontal Scroll',
'description' => 'Horizontal Scroll.',
'demo_url' => 'https://wpeasyelements.com/horizontal-scroll/',
'docx_url' => 'https://wpeasyelements.com/docs/horizontal-scroll/',
'is_pro' => true,
'tab' => 'widget',
],
'Flip_Box' => [
'icon' => 'easyelIcon-image-horizontal-scroll',
'title' => 'Flip Box',
'description' => 'Flip Box.',
'demo_url' => 'https://wpeasyelements.com/flip-box',
'docx_url' => 'https://wpeasyelements.com/docs/flip-box',
'is_pro' => true,
'tab' => 'widget',
],
'easy_offcanvas' => [
'icon' => 'easyelIcon-canvas',
'title' => 'Offcanvas',
'description' => 'Offcanvas.',
'demo_url' => 'https://wpeasyelements.com/offcanvas',
'docx_url' => 'https://wpeasyelements.com/docs/offcanvas',
'is_pro' => false,
'group' => 'Header & Footer Widget',
'tab' => 'widget',
],
'site_logo' => [
'icon' => 'easyelIcon-site-logo',
'title' => 'Site Logo',
'description' => 'Display your website logo easily with this widget.',
'demo_url' => 'https://wpeasyelements.com/site-logo/',
'docx_url' => 'https://wpeasyelements.com/docs/site-logo/',
'is_pro' => false,
'group' => 'Header & Footer Widget',
'tab' => 'widget',
],
'search' => [
'icon' => 'easyelIcon-search',
'title' => 'Simple Search',
'description' => 'Search All Content.',
'demo_url' => 'https://wpeasyelements.com/search',
'docx_url' => 'https://wpeasyelements.com/docs/search',
'is_pro' => false,
'group' => 'Header & Footer Widget',
'tab' => 'widget',
],
'navigation_menu' => [
'icon' => 'easyelIcon-navigation',
'title' => 'Navigation Menu',
'description' => 'Navigation Menu.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Header & Footer Widget',
'tab' => 'widget',
],
'page_title' => [
'icon' => 'easyelIcon-page-title',
'title' => 'Page Title',
'description' => 'Page Title.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Header & Footer Widget',
'tab' => 'widget',
],
'post_tags' => [
'icon' => 'easyelIcon-post-tag',
'title' => 'Current Post Tags',
'description' => 'Current Post Tags.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'post_author' => [
'icon' => 'easyelIcon-author',
'title' => 'Post Author Info',
'description' => 'Post Author Info.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'post_title' => [
'icon' => 'easyelIcon-post-title',
'title' => 'Post Title',
'description' => 'Post Title.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'post_content' => [
'icon' => 'easyelIcon-post-content',
'title' => 'Post Content',
'description' => 'Post Content.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'excerpt' => [
'icon' => 'easyelIcon-post-excerpt',
'title' => 'Post Excerpt',
'description' => 'Post Excerpt.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'related_post' => [
'icon' => 'easyelIcon-related-post',
'title' => 'Related Post',
'description' => 'Related Post.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => true,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'post_pagination' => [
'icon' => 'easyelIcon-pagination',
'title' => 'Post Pagination',
'description' => 'Post Pagination.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'post_meta' => [
'icon' => 'easyelIcon-meta',
'title' => 'Post Meta',
'description' => 'Post Meta.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'post_comments' => [
'icon' => 'easyelIcon-comments',
'title' => 'Post Comments',
'description' => 'Post Comments.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'featured_image' => [
'icon' => 'easyelIcon-image-carousel',
'title' => 'Featured Image',
'description' => 'Featured Image.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'easy_scroll_to_top' => [
'icon' => 'easyelIcon-scroll-top',
'title' => 'Scroll Top',
'description' => 'Scroll Top.',
'demo_url' => 'https://wpeasyelements.com/docs/scroll-to-top/',
'docx_url' => 'https://wpeasyelements.com/docs/scroll-to-top/',
'is_pro' => false,
'group' => 'Theme Builder Widget',
'tab' => 'widget',
],
'easy_table' => [
'icon' => 'easyelIcon-clients-logo-grid',
'title' => 'Table',
'description' => 'Table.',
'demo_url' => 'https://wpeasyelements.com/table',
'docx_url' => 'https://wpeasyelements.com/docs/table',
'is_pro' => false,
'tab' => 'widget',
],
'advance_image' => [
'icon' => 'easyelIcon-image-carousel',
'title' => 'Advance Image',
'description' => 'Advance Image Here.',
'demo_url' => 'https://wpeasyelements.com/advance-image/',
'docx_url' => 'https://wpeasyelements.com/docs/advance-image/',
'is_pro' => true,
'group' => 'Animations',
'tab' => 'widget',
],
'typewriter' => [
'icon' => 'easyelIcon-heading',
'title' => 'Typewriter',
'description' => 'Animated typewriter text effect.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => true,
'group' => 'Animations',
'tab' => 'widget',
],
'animated_title' => [
'icon' => 'easyelIcon-animated-title',
'title' => 'Animated Title',
'description' => 'Animated title text effect.',
'demo_url' => 'https://wpeasyelements.com/animated-title/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => true,
'group' => 'Animations',
'tab' => 'widget',
],
'easytext_animation' => [
'icon' => 'easyelIcon-heading',
'title' => 'Animated Text',
'description' => 'Animated text animation effect.',
'demo_url' => 'https://wpeasyelements.com/',
'docx_url' => 'https://wpeasyelements.com/docs/',
'is_pro' => true,
'group' => 'Animations',
'tab' => 'widget',
],
'easy_feature' => [
'icon' => 'easyelIcon-marquee-logo',
'title' => 'Hover Image Box',
'description' => 'Hover image box content.',
'demo_url' => 'https://wpeasyelements.com/hover-image-box/',
'docx_url' => 'https://wpeasyelements.com/docs/hover-image-box/',
'is_pro' => true,
'tab' => 'widget',
],
'easy_gallery' => [
'icon' => 'easyelIcon-marquee-logo',
'title' => 'Simple Gallery',
'description' => 'Gallery',
'demo_url' => 'https://wpeasyelements.com/simple-gallery/',
'docx_url' => 'https://wpeasyelements.com/docs/simple-gallery/',
'is_pro' => false,
'tab' => 'widget',
],
'image_gallery_filter' => [
'icon' => 'easyelIcon-filterable-gallery',
'title' => 'Filterable Gallery',
'description' => 'filterable Gallery',
'demo_url' => 'https://wpeasyelements.comsimple-gallery/',
'docx_url' => 'https://wpeasyelements.comdocs/simple-gallery/',
'is_pro' => true,
'tab' => 'widget',
],
'portfolio_pro' => [
'icon' => 'easyelIcon-marquee-logo',
'title' => 'Portfolio',
'description' => 'Portfolio',
'demo_url' => 'https://wpeasyelements.comportfolio/',
'docx_url' => 'https://wpeasyelements.comdocs/portfolio/',
'is_pro' => true,
'tab' => 'widget',
],
'protected_content' => [
'icon' => 'easyelIcon-protected-content',
'title' => 'Protected Content',
'description' => 'This Widget is protected content',
'demo_url' => 'https://wpeasyelements.comprotected-content/',
'docx_url' => 'https://wpeasyelements.comdocs/protected-content/',
'is_pro' => true,
'tab' => 'widget',
],
'advanced_search' => [
'icon' => 'easyelIcon-advance-search',
'title' => 'Advanced Search',
'description' => 'This Widget is advanced search',
'demo_url' => 'https://wpeasyelements.comprotected-content/',
'docx_url' => 'https://wpeasyelements.comdocs/protected-content/',
'is_pro' => true,
'tab' => 'widget',
],
'enable_image_hover_effect' => [
'icon' => 'easyelIcon-marquee-logo',
'title' => 'Image Hover Effect',
'description' => 'This Widget is image hover effect',
'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
'is_pro' => true,
'tab' => 'widget',
],
'hr_image_scroll' => [
'icon' => 'easyelIcon-image-horizontal-scroll',
'title' => 'ScrollTrigger',
'description' => 'This Widget is image hover effect',
'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
'is_pro' => true,
'group' => 'Animations',
'tab' => 'widget',
],
'archive_post' => [
'icon' => 'easyelIcon-post-grid',
'title' => 'Archive Post',
'description' => 'This Widget is archive post widget',
'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
'is_pro' => false,
'tab' => 'widget',
],
'counter' => [
'icon' => 'eicon-counter',
'title' => 'Counter',
'description' => 'This is a widget that counts up.',
'demo_url' => 'https://wpeasyelements.com/counter/',
'docx_url' => 'https://wpeasyelements.com/docs/counter/',
'is_pro' => false,
'tab' => 'widget',
],
'countdown' => [
'icon' => 'eicon-countdown',
'title' => 'Countdown',
'description' => 'This is a countdown widget.',
'demo_url' => 'https://wpeasyelements.com/countdown/',
'docx_url' => 'https://wpeasyelements.com/docs/countdown/',
'is_pro' => false,
'tab' => 'widget',
]
];
return apply_filters( 'easyel_available_widgets', $widgets );
}
/**
* Admin page HTML
*/
function easyel_custom_fonts_page_html() {
if ( ! current_user_can( 'manage_options' ) ) return;
if ( ! defined( 'EASY_ELEMENTS_PRO_ACTIVE' ) || ! EASY_ELEMENTS_PRO_ACTIVE ) {
echo '' . esc_html__( 'Upload Custom Fonts', 'easy-elements' ) . '
';
echo '
' . esc_html__( 'This feature is available in Easy Elements Pro. Please install and activate the Pro version to use it.', 'easy-elements' ) . '
';
echo '
';
return;
}
easyel_pro_custom_fonts_page();
}
/**
* Hide admin notices on the Easy Elements dashboard page.
*/
function easyel_hide_admin_notices() {
$screen = get_current_screen();
if ( $screen && 'toplevel_page_easy-elements-dashboard' === $screen->id ) {
$custom_css = '
/* Hide all common notices */
.notice,
.updated,
.error,
.update-nag,
.notice-success,
.notice-error,
.notice-warning {
display: none !important;
}
/* But allow EasyEL notice */
.easyel-promo-notice {
display: block !important;
}
';
$handle = 'easyel-admin-hide-notices';
wp_register_style( $handle, false, [], EASYELEMENTS_VER );
wp_enqueue_style( $handle );
wp_add_inline_style( $handle, $custom_css );
}
}
}
// Initialize the plugin
Easyel_Elements::get_instance();