admin_url('admin-ajax.php')));
//Add to cart
wp_register_script('abcbiz-add-to-cart', ABCBIZ_Assets . "/js/abcbiz-add-to-cart.js", array('jquery'), 1.0, true);
$abcbiz_add_to_cart_nonce = wp_create_nonce('abcbiz_add_to_cart_nonce');
wp_localize_script('abcbiz-add-to-cart', 'acbbiz_add_to_cart', array(
'ajax_url' => admin_url('admin-ajax.php'),
'abcbiz_add_to_cart_nonce' => $abcbiz_add_to_cart_nonce
));
}
wp_register_script('abcbiz-anim-text-main', ABCBIZ_Assets . "/js/anim-text-main.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-search-icon', ABCBIZ_Assets . "/js/abcbiz-search-icon.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-wp-menu-js', ABCBIZ_Assets . "/js/abcbiz-wp-menu.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-popup', ABCBIZ_Assets . "/js/abcbiz-popup.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-sticker-text', ABCBIZ_Assets . "/js/abcbiz-sticker-text.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-jquery-appear', ABCBIZ_Assets . "/js/jquery.appear.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-circular-progress', ABCBIZ_Assets . "/js/circular-progress.js", array('jquery'), '1.0', true);
wp_register_script('jquery-event-move', ABCBIZ_Assets . "/js/jquery.event.move.js", array('jquery'), '1.0', true);
wp_register_script('jquery-twentytwenty', ABCBIZ_Assets . "/js/jquery.twentytwenty.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-count-down', ABCBIZ_Assets . "/js/abcbiz-count-down.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-back-to-top', ABCBIZ_Assets . "/js/abcbiz-back-to-top.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-skill-bar', ABCBIZ_Assets . "/js/skill-bar.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-counter-up', ABCBIZ_Assets . "/js/abcbiz-counterup.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-wapoints', ABCBIZ_Assets . "/js/waypoints.min.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-circular-skills', ABCBIZ_Assets . "/js/abcbiz-circular-skills.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-magnific-popup', ABCBIZ_Assets . "/js/magnific-popup.min.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-mailchimp-newsletter', ABCBIZ_Assets . "/js/mailchimp-newsletter.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-template-slider', ABCBIZ_Assets . "/js/abcbiz-template-slider.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-posts-sliders', ABCBIZ_Assets . "/js/posts-sliders.js", array('jquery'), '1.0', true);
wp_register_script('abcbiz-cost-estimation', ABCBIZ_Assets . "/js/abcbiz-cost-estimation.js", array('jquery'), '1.0', true);
wp_enqueue_script('abcbiz-elementor-custom', ABCBIZ_Assets . "/js/main.js", array('jquery'), false, true);
wp_localize_script('abcbiz-mailchimp-newsletter', 'abcbizMailchimpAjax', [
'ajax_url' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('abcbiz_mailchimp_nonce'),
]);
}
}
add_action('wp_enqueue_scripts', 'abcbiz_elementor_enqueue');
//add ABCBiz Elementor Category
if (!function_exists('abcbiz_elementor_add_widget_categories')) {
function abcbiz_elementor_add_widget_categories($elements_manager)
{
$elements_manager->add_category(
'abcbiz-category',
[
'title' => esc_html__('ABCBiz Elements', 'abcbiz-addons'),
'icon' => 'eicon-kit-plugins',
]
);
}
}
add_action('elementor/elements/categories_registered', 'abcbiz_elementor_add_widget_categories');
//add ABCBiz Elementor WooCommerce Category
if (!function_exists('abcbiz_elementor_add_widget_wc_categories')) {
function abcbiz_elementor_add_widget_wc_categories($elements_manager)
{
if (function_exists('is_plugin_active') && is_plugin_active('woocommerce/woocommerce.php')) {
$elements_manager->add_category(
'abcbiz-wc-category',
[
'title' => esc_html__('ABCBiz WooCommerce', 'abcbiz-addons'),
'icon' => 'eicon-woocommerce',
]
);
}
}
}
add_action('elementor/elements/categories_registered', 'abcbiz_elementor_add_widget_wc_categories');
//Load Editor CSS
add_action('elementor/editor/before_enqueue_scripts', function () {
wp_enqueue_style('abcbiz-elementor-admin-style', ABCBIZ_Assets . "/css/ele-editor.css");
});
//Get Plugin Info
function abcbiz_multi_plugin_info()
{
// Ensure the function is available
if (!function_exists('get_plugin_data')) {
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
}
$plugin_file_path = ABCBIZ_Path . '/abcbiz-addons.php';
if (file_exists($plugin_file_path)) {
$plugin_data = get_plugin_data($plugin_file_path);
$plugin_info = [
'Name' => $plugin_data['Name'],
'Version' => $plugin_data['Version'],
'Author' => $plugin_data['Author'],
'PluginURI' => $plugin_data['PluginURI'],
'AuthorURI' => $plugin_data['AuthorURI'],
'Description' => $plugin_data['Description']
];
} else {
$plugin_info = [
'Name' => esc_html__('Plugin Name Not Found', 'abcbiz-addons'),
'Version' => esc_html__('Plugin Version Not Found', 'abcbiz-addons'),
'Author' => esc_html__('Author Not Found', 'abcbiz-addons'),
'PluginURI' => esc_html__('Plugin URI Not Found', 'abcbiz-addons'),
'AuthorURI' => esc_html__('Author URI Not Found', 'abcbiz-addons'),
'Description' => esc_html__('Description Not Found', 'abcbiz-addons')
];
}
return $plugin_info;
}
// Add "Get Pro" and "Settings" link to the plugin action links
function abcbiz_add_plugin_links($links)
{
// Add "Settings" link
$settings_link = 'Settings';
// Add "Get Pro" link
$pro_link = 'Get Pro';
// Add the links to the list of existing plugin action links
array_unshift($links, $settings_link); // Puts "Settings" as the first link
//array_push($links, $pro_link); // Puts "Get Pro" at the end of the list
return $links;
}
// Hook the function to modify the plugin action links
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'abcbiz_add_plugin_links');