<?php

//new category
function register_skill_widget_category($elements_manager) {
    $elements_manager->add_category(
        'skill-category',
        [
            'title' => esc_html__('ویجت‌های اختصاصی قالب مهارت', 'skill'),
            'icon' => 'eicon-apps',
        ]
    );
}
add_action('elementor/elements/categories_registered', 'register_skill_widget_category');
//end new category


//widgets my skill
function register_skill_widgets() {
    if (!did_action('elementor/loaded')) {
        return;
    }

    $widgets = [
        'work-edoction' => 'work_edoction_widget',
        'progress' => 'skill_progress_widget',
        'title' => 'skill_Title_page_Widget',
        'personal-info' => 'skill_info_personal_Widget',
        'box' => 'skill_box_Widget',
        'pricing' => 'skill_pricing_Widget',
        'comments' => 'skill_comments_Widget',
        'tabs-project' => 'skill_tabs_project_Widget',
        'contact-info' => 'skill_contact_info_Widget'
    ];

    foreach ($widgets as $file => $class) {
        $file_path = get_template_directory() . "/elementor/widgets/skill-{$file}-widget.php";
        if (file_exists($file_path)) {
            require_once $file_path;

            if (class_exists($class)) {
                \Elementor\Plugin::instance()->widgets_manager->register(new $class());
            }
        }
    }
}
add_action('elementor/widgets/register', 'register_skill_widgets');
//end widgets my skill

//widgets progress
function progress_skill_widgets($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-progress-widget.php');
    $widgets_manager->register(new \skill_progress_widget());
}
add_action('elementor/widgets/register', 'progress_skill_widgets');
//end widgets progress

//widgets title page
function register_widget_title_elementor($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-widget-title.php');
    $widgets_manager->register(new skill_Title_page_Widget());
}
add_action('elementor/widgets/register', 'register_widget_title_elementor');
//end widgets title page

//widgets personal info
function register_widget_personal_info($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-personal-info-widget.php');
    $widgets_manager->register(new skill_info_personal_Widget());
}
add_action('elementor/widgets/register', 'register_widget_personal_info');
//end widgets personal info

//widgets box skill
function register_widget_box_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-box.php');
    $widgets_manager->register(new skill_box_Widget());
}
add_action('elementor/widgets/register', 'register_widget_box_skill');
//end widgets box skill

//widgets pricing skill
function register_widget_pricing_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-pricing-widget.php');
    $widgets_manager->register(new skill_pricing_Widget());
}
add_action('elementor/widgets/register', 'register_widget_pricing_skill');
//end widgets pricing skill

//widgets comments widget
function register_widget_comments_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-comments-widget.php');
    $widgets_manager->register(new skill_comments_Widget());
}
add_action('elementor/widgets/register', 'register_widget_comments_skill');
//end widgets comments widget

//widgets tabs project
function register_widget_tabs_project_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-tabs-project.php');
    $widgets_manager->register(new skill_tabs_project_Widget());
}
add_action('elementor/widgets/register', 'register_widget_tabs_project_skill');
//end widgets tabs project

//widgets contact info
function register_widget_contact_info_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-cantact-info-widget.php');
    $widgets_manager->register(new skill_contact_info_Widget());
}
add_action('elementor/widgets/register', 'register_widget_contact_info_skill');
//end widgets contact info

//widgets onepage menu
function register_widget_main_menu_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-onepage-menu-widget.php');
    $widgets_manager->register(new skill_onepage_menu_Widget());
}
add_action('elementor/widgets/register', 'register_widget_main_menu_skill');
//end widgets onepage menu

//widgets my image personal
function register_widget_image_personal_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-my-image-personal-widget.php');
    $widgets_manager->register(new skill_my_image_personal_Widget());
}
add_action('elementor/widgets/register', 'register_widget_image_personal_skill');
//end widgets my image personal

//widgets my name & job
function register_widget_my_name_job_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-my-name-job-widget.php');
    $widgets_manager->register(new skill_my_name_job_Widget());
}
add_action('elementor/widgets/register', 'register_widget_my_name_job_skill');
//end widgets my name & job

//widgets my personal new
function register_widget_my_personal_new_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-my-personal-new-widget.php');
    $widgets_manager->register(new skill_my_personal_new_Widget());
}
add_action('elementor/widgets/register', 'register_widget_my_personal_new_skill');
//end widgets my personal new

//widgets Work and educational experience
function register_widget_work_educational_exprience_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-work-educational-experience-widget.php');
    $widgets_manager->register(new skill_work_educational_exprience_Widget());
}
add_action('elementor/widgets/register', 'register_widget_work_educational_exprience_skill');
//end widgets Work and educational experience

//widgets skill tools
function register_widget_skill_tools_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-tools-widget.php');
    $widgets_manager->register(new skill_tools_Widget());
}
add_action('elementor/widgets/register', 'register_widget_skill_tools_skill');
//end widgets skill tools

//widgets progress bar
function register_widget_progress_bar_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-progress-bar-widget.php');
    $widgets_manager->register(new skill_progress_bar_Widget());
}
add_action('elementor/widgets/register', 'register_widget_progress_bar_skill');
//end widgets progress bar

//widgets Foreign language
function register_widget_foreign_language_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-foreign-language-widget.php');
    $widgets_manager->register(new skill_foreign_language_Widget());
}
add_action('elementor/widgets/register', 'register_widget_foreign_language_skill');
//end widgets Foreign language

//widgets progress bar circle
function register_widget_progress_bar_circle_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-progress-bar-circle-widget.php');
    $widgets_manager->register(new skill_progress_bar_circle_Widget());
}
add_action('elementor/widgets/register', 'register_widget_progress_bar_circle_skill');
//end widgets progress bar circle

//widgets collaboration
function register_widget_collaboration_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-collaboration-widget.php');
    $widgets_manager->register(new skill_collaboration_Widget());
}
add_action('elementor/widgets/register', 'register_widget_collaboration_skill');
//end widgets collaboration

//widgets image gallery
function register_widget_image_gallery_slider_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-image-gallery-slider-widget.php');
    $widgets_manager->register(new skill_image_gallery_slider_Widget());
}
add_action('elementor/widgets/register', 'register_widget_image_gallery_slider_skill');
//end widgets image gallery

//widgets button share
function register_widget_button_share_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-button-share-widget.php');
    $widgets_manager->register(new skill_button_share_Widget());
}
add_action('elementor/widgets/register', 'register_widget_button_share_skill');
//end widgets button share

//widgets breadcrumb
function register_widget_breadcrumb_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-breadcrumb-widget.php');
    $widgets_manager->register(new skill_breadcrumb_Widget());
}
add_action('elementor/widgets/register', 'register_widget_breadcrumb_skill');
//end widgets breadcrumb

//widgets career history
function register_widget_career_history_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-career-history-widget.php');
    $widgets_manager->register(new skill_career_history_Widget());
}
add_action('elementor/widgets/register', 'register_widget_career_history_skill');
//end widgets career history

//widgets certificate
function register_widget_certificate_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-certificate-widget.php');
    $widgets_manager->register(new skill_certificate_Widget());
}
add_action('elementor/widgets/register', 'register_widget_certificate_skill');
//end widgets certificate

//widgets list weblog
function register_list_weblog_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-list-weblog-widget.php');
    $widgets_manager->register(new skill_list_weblog_Widget());
}
add_action('elementor/widgets/register', 'register_list_weblog_skill');
//end widgets list weblog

//widgets archive weblog
function register_archive_web_log_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-archive-blog-widget.php');
    $widgets_manager->register(new skill_archive_web_log_Widget());
}
add_action('elementor/widgets/register', 'register_archive_web_log_skill');
//end widgets archive weblog

//widgets thumbnail post
function register_thumbnail_post_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-thumbnail-post-widget.php');
    $widgets_manager->register(new skill_thumbnail_post_Widget());
}
add_action('elementor/widgets/register', 'register_thumbnail_post_skill');
//end widgets thumbnail post

//widgets info post
function register_info_post_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-info-post-widget.php');
    $widgets_manager->register(new skill_info_post_Widget());
}
add_action('elementor/widgets/register', 'register_info_post_skill');
//end widgets info post

//widgets comment
function register_comment_post_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-comment-post-widget.php');
    $widgets_manager->register(new skill_comment_post_Widget());
}
add_action('elementor/widgets/register', 'register_comment_post_skill');
//end widgets comment

//widgets customer reviews
function register_customer_reviews_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-customer-reviews-widget.php');
    $widgets_manager->register(new skill_customer_reviews_Widget());
}
add_action('elementor/widgets/register', 'register_customer_reviews_skill');
//end widgets customer reviews

//widgets top button
function register_top_button_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-top-button-widget.php');
    $widgets_manager->register(new skill_top_button_Widget());
}
add_action('elementor/widgets/register', 'register_top_button_skill');
//end widgets top button

//widgets progressbar e
function register_progress_bar_e_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-progressbar-e-widget.php');
    $widgets_manager->register(new skill_progress_bar_e_Widget());
}
add_action('elementor/widgets/register', 'register_progress_bar_e_skill');
//end widgets progressbar e

//widgets contact us
function register_contact_us_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-contact-us-widget.php');
    $widgets_manager->register(new skill_contact_us_widget());
}
add_action('elementor/widgets/register', 'register_contact_us_skill');
//end widgets contact us

//widgets counter animation
function register_counter_animation_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-counter-animation-widget.php');
    $widgets_manager->register(new skill_counter_animation_widget());
}
add_action('elementor/widgets/register', 'register_counter_animation_skill');
//end widgets counter animation

//widgets progressbar line
function register_progressbar_line_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-progressbar-line-widget.php');
    $widgets_manager->register(new skill_progressbar_line_widget());
}
add_action('elementor/widgets/register', 'register_progressbar_line_skill');
//end widgets progressbar line

//widgets project gallery
function register_project_gallery_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-project-gallery-widget.php');
    $widgets_manager->register(new skill_project_gallery_Widget());
}
add_action('elementor/widgets/register', 'register_project_gallery_skill');
//end widgets project gallery

//widgets project info
function register_project_info_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-project-info-widget.php');
    $widgets_manager->register(new skill_project_info_Widget());
}
add_action('elementor/widgets/register', 'register_project_info_skill');
//end widgets project info

//widgets project timeline
function register_project_timeline_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-project-timeline-widget.php');
    $widgets_manager->register(new skill_project_timeline_Widget());
}
add_action('elementor/widgets/register', 'register_project_timeline_skill');
//end widgets project timeline

//widgets project team
function register_project_team_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-project-team-widget.php');
    $widgets_manager->register(new skill_project_team_Widget());
}
add_action('elementor/widgets/register', 'register_project_team_skill');
//end widgets project team

//widgets project links
function register_project_links_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-project-links-widget.php');
    $widgets_manager->register(new skill_project_links_Widget());
}
add_action('elementor/widgets/register', 'register_project_links_skill');
//end widgets project links

//widgets select project
function register_select_project_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-select-project-widget.php');
    $widgets_manager->register(new Skill_Featured_Projects_Widget());
}
add_action('elementor/widgets/register', 'register_select_project_skill');
//end widgets select project

//widgets menu oner page demo-developer
function register_menu_oner_page_demo_developer_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-menu-oner-page-demo-developer-widget.php');
    $widgets_manager->register(new Skill_Feamenu_oner_page_demo_developer_Widget());
}
add_action('elementor/widgets/register', 'register_menu_oner_page_demo_developer_skill');
//end widgets menu oner page demo-developer

//widgets certificate slider
function register_certificate_slider_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-certificate-slider-widget.php');
    $widgets_manager->register(new Skill_certificate_slider_Widget());
}
add_action('elementor/widgets/register', 'register_certificate_slider_skill');
//end widgets certificate slider

//widgets story
function register_story_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-story-widget.php');
    $widgets_manager->register(new Skill_story_Widget());
}
add_action('elementor/widgets/register', 'register_story_skill');
//end widgets story

//widgets text gradient
function register_text_gradient_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-text-gradient-widget.php');
    $widgets_manager->register(new Skill_text_gradient_Widget());
}
add_action('elementor/widgets/register', 'register_text_gradient_skill');
//end widgets text gradient

//widgets panel pricing
function register_panel_pricing_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-panel-pricing-widget.php');
    $widgets_manager->register(new Skill_Panel_Pricing_Widget());
}
add_action('elementor/widgets/register', 'register_panel_pricing_skill');
//end widgets panel pricing

//widgets my personal modern
function register_my_personal_mdern_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-my-personal-modern-widget.php');
    $widgets_manager->register(new Skill_my_personal_mdern_Widget());
}
add_action('elementor/widgets/register', 'register_my_personal_mdern_skill');
//end widgets my personal modern

//widgets title desc
function register_title_desc_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-title-desc-widget.php');
    $widgets_manager->register(new Skill_title_desc_Widget());
}
add_action('elementor/widgets/register', 'register_title_desc_skill');
//end widgets title desc

//widgets Educational 
function register_educational_skill($widgets_manager) {
    require_once(__DIR__ . '/widgets/skill-educational-widget.php');
    $widgets_manager->register(new Skill_educational_Widget());
}
add_action('elementor/widgets/register', 'register_educational_skill');
//end widgets Educational