/** * Enqueue scripts and styles. * * @since Twenty Fifteen 1.0 */ function montkailash_scripts() { // Load our main stylesheet. wp_enqueue_style('bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css'); wp_enqueue_style('bootstrap-style', get_template_directory_uri() . '/css/bootstrap-theme.min.css'); wp_enqueue_style('lightbox-style', get_template_directory_uri() . '/css/lightbox.css'); wp_enqueue_style('montkailash-style', get_stylesheet_uri()); if (is_page('Contact')) { wp_register_script('gmap', "http://maps.google.com/maps/api/js?sensor=true", '', '', true); wp_enqueue_script('gmap'); wp_enqueue_script('gmaps', get_template_directory_uri() . '/js/gmaps.js', array('jquery'), '', true); wp_enqueue_script('function-map', get_template_directory_uri() . '/js/function_map.js', array('jquery'), '0.1', true); } if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", '', '1.8.3', true); wp_enqueue_script('jquery'); wp_deregister_script('wonderplugin-slider-skins-script'); wp_deregister_script('wonderplugin-slider-script'); wp_deregister_script('wonderplugin-slider-creator-script'); wp_deregister_script('woo-vou-public-script'); wp_register_script('wonderplugin-slider-skins-script', plugins_url() . '/wonderplugin-slider/engine/wonderpluginsliderskins.js', array('jquery'), '4.9', true); wp_register_script('wonderplugin-slider-script', plugins_url() . '/wonderplugin-slider/engine/wonderpluginslider.js', array('jquery'), '4.9', true); wp_register_script('wonderplugin-slider-creator-script', plugins_url() . '/wonderplugin-slider/app/wonderplugin-slider-creator.js', array('jquery'), '4.9', true); wp_register_script('woo-vou-public-script', plugins_url() . '/woocommerce-pdf-vouchers/includes/js/woo-vou-public.js', array('jquery'), '2.4.4', true); wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20150330', true); wp_enqueue_script('lightbox', get_template_directory_uri() . '/js/lightbox.js', array('jquery'), '2.8.1', true); wp_enqueue_script('montkailash-script', get_template_directory_uri() . '/js/functions.js', array('jquery'), '0.1', true); } }
/** * Show the setup wizard */ public function setup_wizard() { if (empty($_GET['page']) || 'wc-setup' !== $_GET['page']) { return; } $this->steps = array('introduction' => array('name' => __('Introduction', 'woocommerce'), 'view' => array($this, 'wc_setup_introduction'), 'handler' => ''), 'pages' => array('name' => __('Page Setup', 'woocommerce'), 'view' => array($this, 'wc_setup_pages'), 'handler' => array($this, 'wc_setup_pages_save')), 'locale' => array('name' => __('Store Locale', 'woocommerce'), 'view' => array($this, 'wc_setup_locale'), 'handler' => array($this, 'wc_setup_locale_save')), 'shipping_taxes' => array('name' => __('Shipping & Tax', 'woocommerce'), 'view' => array($this, 'wc_setup_shipping_taxes'), 'handler' => array($this, 'wc_setup_shipping_taxes_save')), 'payments' => array('name' => __('Payments', 'woocommerce'), 'view' => array($this, 'wc_setup_payments'), 'handler' => array($this, 'wc_setup_payments_save')), 'next_steps' => array('name' => __('Ready!', 'woocommerce'), 'view' => array($this, 'wc_setup_ready'), 'handler' => '')); $this->step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps)); $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; wp_register_script('select2', WC()->plugin_url() . '/assets/js/select2/select2' . $suffix . '.js', array('jquery'), '3.5.2'); wp_register_script('wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array('jquery', 'select2'), WC_VERSION); wp_localize_script('wc-enhanced-select', 'wc_enhanced_select_params', array('i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce'), 'ajax_url' => admin_url('admin-ajax.php'), 'search_products_nonce' => wp_create_nonce('search-products'), 'search_customers_nonce' => wp_create_nonce('search-customers'))); wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION); wp_enqueue_style('wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array('dashicons', 'install'), WC_VERSION); wp_register_script('wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array('jquery', 'wc-enhanced-select'), WC_VERSION); wp_localize_script('wc-setup', 'wc_setup_params', array('locale_info' => json_encode(include WC()->plugin_path() . '/i18n/locale-info.php'))); if (!empty($_POST['save_step']) && isset($this->steps[$this->step]['handler'])) { call_user_func($this->steps[$this->step]['handler']); } ob_start(); $this->setup_wizard_header(); $this->setup_wizard_steps(); $this->setup_wizard_content(); $this->setup_wizard_footer(); exit; }
public function filter_the_content($content) { $ww_problem = false; if (is_page('webwork')) { $ww_problem = true; } else { $ww_problem = get_query_var('ww_problem'); } if ($ww_problem) { $content = '<div id="webwork-app"></div>'; wp_enqueue_script('webwork-app', plugins_url() . '/webwork/build/index.js'); $route_base = get_option('home'); $route_base = preg_replace('|https?://[^/]+/|', '', $route_base); // @todo Centralize this logic. $main_site_url = get_blog_option(1, 'home'); $rest_api_endpoint = trailingslashit($main_site_url) . 'wp-json/webwork/v1/'; // @todo Abstract. $post_data = null; $ww_problem_text = ''; if (!empty($_GET['post_data_key'])) { $post_data = get_blog_option(1, $_GET['post_data_key']); $ww_problem_text = base64_decode($post_data['pg_object']); } // @todo This is awful. $clients = get_blog_option(1, 'webwork_clients'); $remote_course_url = array_search(get_current_blog_id(), $clients); wp_localize_script('webwork-app', 'WWData', array('problem_id' => $ww_problem, 'problem_text' => $ww_problem_text, 'remote_course_url' => $remote_course_url, 'rest_api_nonce' => wp_create_nonce('wp_rest'), 'rest_api_endpoint' => $rest_api_endpoint, 'route_base' => trailingslashit($route_base) . 'webwork/', 'user_can_ask_question' => is_user_logged_in(), 'user_can_post_response' => is_user_logged_in(), 'user_can_vote' => is_user_logged_in())); wp_enqueue_style('webwork-app', plugins_url() . '/webwork/assets/css/app.css'); wp_register_script('webwork-mathjax-loader', WEBWORK_PLUGIN_URL . '/assets/js/webwork-mathjax-loader.js'); $webwork_mathjax_loader_strings = array('mathjax_src' => esc_url('https://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js?config=TeX-MML-AM_HTMLorMML-full')); wp_localize_script('webwork-mathjax-loader', 'WeBWorK_MathJax', $webwork_mathjax_loader_strings); wp_enqueue_script('webwork-mathjax-loader'); } return $content; }
public function enqueueJavascripts($pageHookname) { if ($pageHookname === $this->adminConsolePageHookname) { $jsDir = $this->config->getPluginUrl() . '/js'; $version = $this->config->getVersion(); $knockoutSuffix = ''; $suffix = '.min'; if (defined('WP_DEBUG') && WP_DEBUG) { $knockoutSuffix = '.debug'; $suffix = ''; } wp_register_script('knockout', $jsDir . '/deps/knockout-3.1.0' . $knockoutSuffix . '.js', array(), $version, false); wp_enqueue_script('knockout'); wp_register_script('knockoutValidation', $jsDir . '/deps/knockout.validation' . $suffix . '.js', array('knockout'), $version, false); wp_enqueue_script('knockoutValidation'); wp_register_script('autosize', $jsDir . '/deps/jquery.autosize' . $suffix . '.js', array('jquery'), $version, false); wp_enqueue_script('autosize'); wp_register_script('chamameAdmin', $jsDir . '/admin' . $suffix . '.js', array('jquery', 'knockout', 'knockoutValidation', 'autosize'), $version, false); wp_enqueue_script('chamameAdmin'); $ajaxUrl = str_replace(array('https:', 'http:'), '', admin_url('admin-ajax.php')); $token = wp_create_nonce('chamameLiveChat'); $textDomain = $this->config->getTextDomain(); wp_localize_script('chamameAdmin', 'chamameParams', array('ajaxUrl' => $ajaxUrl, 'loggedIn' => $this->session->isLoggedIn(), 'conversationId' => $this->session->getActiveConversationId(), 'token' => $token, 'text' => array('error' => __('Something went wrong. Please try again', $textDomain)))); } }
function optionsframework_mlu_css() { $_html = ''; $_html .= '<link rel="stylesheet" href="' . site_url() . '/' . WPINC . '/js/thickbox/thickbox.css" type="text/css" media="screen" />' . "\n"; $_html .= '<script type="text/javascript"> var tb_pathToImage = "' . site_url() . '/' . WPINC . '/js/thickbox/loadingAnimation.gif"; var tb_closeImage = "' . site_url() . '/' . WPINC . '/js/thickbox/tb-close.png";
function core_mods() { if ( !is_admin() ) { wp_deregister_script('jquery'); wp_register_script('jquery', ("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false); wp_enqueue_script('jquery'); } }
static function InitClass() { wp_enqueue_style(WPFB . '-admin', WPFB_PLUGIN_URI . 'css/admin.css', array(), WPFB_VERSION, 'all'); wp_register_script('jquery-deserialize', WPFB_PLUGIN_URI . 'bower_components/jquery-deserialize/dist/jquery.deserialize.min.js', array('jquery'), WPFB_VERSION); if (isset($_GET['page'])) { $page = $_GET['page']; if ($page == 'wpfilebase_files') { wp_enqueue_script('postbox'); wp_enqueue_style('dashboard'); } elseif ($page == 'wpfilebase' && isset($_GET['action']) && $_GET['action'] == 'sync') { do_action('wpfilebase_sync'); wp_die("Filebase synced."); } } add_action('wp_dashboard_setup', array(__CLASS__, 'AdminDashboardSetup')); //wp_register_widget_control(WPFB_PLUGIN_NAME, "[DEPRECATED]".WPFB_PLUGIN_NAME .' '. __('File list','wp-filebase'), array(__CLASS__, 'WidgetFileListControl'), array('description' => __('DEPRECATED','wp-filebase'))); add_action('admin_print_scripts', array('WPFB_AdminLite', 'AdminPrintScripts')); self::CheckChangedVer(); if (basename($_SERVER['PHP_SELF']) === "plugins.php") { if (isset($_GET['wpfb-uninstall']) && current_user_can('edit_files')) { update_option('wpfb_uninstall', !empty($_GET['wpfb-uninstall']) && $_GET['wpfb-uninstall'] != "0"); } if (get_option('wpfb_uninstall')) { function wpfb_uninstall_warning() { echo "\n\t\t\t\t<div id='wpfb-warning' class='updated fade'><p><strong>" . __('WP-Filebase will be uninstalled completely when deactivating the Plugin! All settings and File/Category Info will be deleted. Actual files in the upload directory will not be removed.', 'wp-filebase') . ' <a href="' . add_query_arg('wpfb-uninstall', '0') . '">' . __('Cancel') . "</a></strong></p></div>\n\t\t\t\t"; } add_action('admin_notices', 'wpfb_uninstall_warning'); } } }
/** * Registers JavaScript files for the framework. This function merely registers scripts with WordPress using * the wp_register_script() function. It does not load any script files on the site. If a theme wants to register * its own custom scripts, it should do so on the 'wp_enqueue_scripts' hook. * * @since 1.2.0 */ function hybrid_register_scripts() { /* Register the 'drop-downs' script if the current theme supports 'hybrid-core-drop-downs'. */ if (current_theme_supports('hybrid-core-drop-downs')) { wp_register_script('drop-downs', esc_url(apply_atomic('drop_downs_script', trailingslashit(HYBRID_JS) . 'drop-downs.js')), array('jquery'), '20110705', true); } }
/** * Show the tag cloud */ public function show_tag_filter($shortcode_atts) { if (isset($shortcode_atts['show_tags']) && ($shortcode_atts['show_tags'] === false || (string) $shortcode_atts['show_tags'] == 'false')) { return; } if (wp_count_terms('job_listing_tag') == 0) { return; } wp_register_script('wp-job-manager-ajax-tag-filters', JOB_MANAGER_TAGS_PLUGIN_URL . '/assets/js/tag-filter.js', array('jquery'), '1.0', true); $args_data = array('orderby' => 'count', 'order' => 'DESC'); $jobs_tags_data = get_terms('job_listing_tag', $args_data); $queried_object = get_queried_object(); foreach ($jobs_tags_data as $key => $jobs_tag_data) { if ($jobs_tag_data->count > 1) { $jobs_txt = 'jobs'; $font_size = 2; } else { $jobs_txt = 'job'; $font_size = 1; } //if($queried_object->term_id == $jobs_tag_data->term_id){ $active_class = 'activee'; } $anchor_data[] = '<a href="#" id="test_' . $key . '" "class="tag-link-' . $jobs_tag_data->term_id . ' ' . $active_class . ' show_bg_tag" title="' . $jobs_tag_data->count . ' ' . $jobs_txt . '" style="font-size: ' . $font_size . 'em;">' . $jobs_tag_data->name . '</a>'; } $anchor_tag_data = array('anchor_tag_data' => $anchor_data); //anchor_tag_data wp_localize_script('wp-job-manager-ajax-tag-filters', 'anchor_tag_data_object', $anchor_tag_data); wp_enqueue_script('wp-job-manager-ajax-tag-filters', JOB_MANAGER_TAGS_PLUGIN_URL . '/assets/js/tag-filter.js', array('jquery'), '1.0', true); echo '<div class="filter_wide filter_by_tag">' . __('Filter by tag:', 'wp-job-manager-tags') . ' <span class="filter_by_tag_cloud"></span></div>'; }
function foundationpress_scripts() { // Enqueue Main Stylesheet wp_enqueue_style('Main Stylesheet', get_stylesheet_directory_uri() . '/css/foundation.css'); // Deregister the jquery version bundled with wordpress wp_deregister_script('jquery'); // Modernizr is used for polyfills and feature detection. Must be placed in header. (Not required) wp_register_script('modernizr', get_template_directory_uri() . '/js/vendor/modernizr.js', array(), '2.8.3', false); // Fastclick removes the 300ms delay on click events in mobile environments. Must be placed in header. (Not required) wp_register_script('fastclick', get_template_directory_uri() . '/js/vendor/fastclick.js', array(), '1.0.0', false); // CDN hosted jQuery placed in the header, as some plugins require that jQuery is loaded in the header. wp_enqueue_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', array(), '2.1.0', false); // Self hosted jQuery placed in the footer. (Comment the script above and uncomment the script below if you want to switch). //wp_register_script( 'jquery', get_template_directory_uri() . '/js/vendor/jquery.js', array(), '2.1.3', true ); // If you'd like to cherry-pick the foundation components you need in your project, head over to Gruntfile.js and see lines 67-88 // It's a good idea to do this, performance-wise. No need to load everything if you're just going to use the grid anyway, you know :) wp_register_script('foundation', get_template_directory_uri() . '/js/foundation.js', array('jquery'), '5.5.1', true); wp_register_script('troispointszero', get_template_directory_uri() . '/js/custom/troispointzero.js', array('jquery'), '1.0'); // Enqueue all registered scripts wp_enqueue_script('modernizr'); wp_enqueue_script('fastclick'); wp_enqueue_script('jquery'); wp_enqueue_script('foundation'); wp_enqueue_script('troispointszero'); }
static function init() { add_action('wp_enqueue_scripts', array('P2_JS', 'enqueue_scripts')); add_action('wp_enqueue_scripts', array('P2_JS', 'enqueue_styles')); add_action('wp_head', array('P2_JS', 'print_options'), 1); /** * Register scripts */ wp_register_script('jeditable', P2_JS_URL . '/jquery.jeditable.js', array('jquery'), '1.6.2-rc2'); wp_register_script('caret', P2_JS_URL . '/caret.js', array('jquery'), '20101025'); wp_register_script('jquery-ui-autocomplete-html', P2_JS_URL . '/jquery.ui.autocomplete.html.js', array('jquery-ui-autocomplete'), '20101025'); wp_register_script('jquery-ui-autocomplete-multiValue', P2_JS_URL . '/jquery.ui.autocomplete.multiValue.js', array('jquery-ui-autocomplete'), '20110405'); wp_register_script('jquery-ui-autocomplete-match', P2_JS_URL . '/jquery.ui.autocomplete.match.js', array('jquery-ui-autocomplete', 'caret'), '20110405'); /** * Bundle containing scripts included when the user is logged in. * Includes, in order: * jeditable, caret, jquery-ui-autocomplete, * jquery-ui-autocomplete-html, jquery-ui-autocomplete-multiValue, * jquery-ui-autocomplete-match * * Build the bundle with the bin/bundle-user-js shell script. * * @TODO: Improve bundle building/dependency process. */ wp_register_script('p2-user-bundle', P2_JS_URL . '/p2.user.bundle.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'), '20130819'); wp_register_script('scrollit', P2_JS_URL . '/jquery.scrollTo-min.js', array('jquery'), '20120402'); wp_register_script('wp-locale', P2_JS_URL . '/wp-locale.js', array(), '20130819'); // Media upload script registered based on info in script-loader. wp_register_script('media-upload', '/wp-admin/js/media-upload.js', array('thickbox'), '20110113'); wp_register_script('p2-spin', P2_JS_URL . '/spin.js', array('jquery'), '20120704'); }
/** * Ladda script */ function dazake_load_script() { if (!is_admin()) { /** * Deregister wordpress scripts */ wp_deregister_script('jquery'); /** * wp_register_script( $handle, $src, $deps, $ver, $in_footer ); */ wp_register_script('jquery', 'http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js'); wp_register_script('modernizr', get_template_directory_uri() . '/js/libs/modernizr.js'); wp_register_script('bootstrap', get_template_directory_uri() . '/js/libs/bootstrap/js/bootstrap.min.js'); wp_register_script('less', get_template_directory_uri() . '/js/libs/less.js'); wp_register_script('main', get_template_directory_uri() . '/js/main.js'); /** * Laddar skripten vi registrerat ovan. */ wp_enqueue_script('jquery'); wp_enqueue_script('modernizr'); wp_enqueue_script('bootstrap'); wp_enqueue_script('less'); wp_enqueue_script('main'); /** * load stylesheet */ wp_enqueue_style('style', get_stylesheet_uri()); wp_enqueue_style('bootstrap', get_template_directory_uri() . '/js/libs/bootstrap/css/bootstrap.min.css'); wp_enqueue_style('bootstrap-responsive', get_template_directory_uri() . '/js/libs/bootstrap/css/bootstrap-responsive.min.css'); } }
function wen_business_custom_customize_enqueue_scripts() { wp_register_script('wen_business_customizer_button', get_template_directory_uri() . '/assets/js/customizer-button.js', array('customize-controls'), '20130508', true); $data = array('updrade_button_text' => __('Upgrade To Pro', 'wen-business'), 'updrade_button_link' => esc_url('http://catchthemes.com/themes/wen-business-pro')); wp_localize_script('wen_business_customizer_button', 'WEN_Business_Customizer_Object', $data); wp_enqueue_script('wen_business_customizer_button'); }
function child_add_scripts() { if (is_page('bps')) { wp_register_script('bps-script', '/bps.js'); wp_enqueue_script('bps-script'); } }
/** * Plugin Name: WP-API Client JS */ function json_api_client_js() { $scripts = wp_scripts(); $src = plugins_url('build/js/wp-api.js', __FILE__); if (isset($scripts->registered['wp-api'])) { $scripts->registered['wp-api']->src = $src; } else { wp_register_script('wp-api', $src, array('jquery', 'underscore', 'backbone'), '1.0', true); } /** * @var \WP_REST_Server $wp_rest_server */ global $wp_rest_server; if (empty($wp_rest_server)) { /** This filter is documented in wp-includes/rest-api.php */ $wp_rest_server_class = apply_filters('wp_rest_server_class', 'WP_REST_Server'); $wp_rest_server = new $wp_rest_server_class(); /** This filter is documented in wp-includes/rest-api.php */ do_action('rest_api_init', $wp_rest_server); } $schema_request = new WP_REST_Request('GET', '/wp/v2'); $schema_response = $wp_rest_server->dispatch($schema_request); $schema = null; if (!$schema_response->is_error()) { $schema = $schema_response->get_data(); } $settings = array('root' => esc_url_raw(get_rest_url()), 'nonce' => wp_create_nonce('wp_rest'), 'versionString' => 'wp/v2/', 'schema' => $schema); wp_localize_script('wp-api', 'wpApiSettings', $settings); }
function add_scripts_after_footer() { // Register the script like this for a plugin: //wp_register_script( 'custom-script', plugins_url( '/js/custom-script.js', __FILE__ ) ); // or // Register the script like this for a theme: wp_register_script('jquery1.7', "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", false); wp_register_script('bootstrap-alert', get_template_directory_uri() . '/js/bootstrap-alert.js'); wp_register_script('bootstrap-button', get_template_directory_uri() . '/js/bootstrap-button.js'); wp_register_script('bootstrap-carousel', get_template_directory_uri() . '/js/bootstrap-carousel.js'); wp_register_script('bootstrap-collapse', get_template_directory_uri() . '/js/bootstrap-collapse.js'); wp_register_script('bootstrap-dropdown', get_template_directory_uri() . '/js/bootstrap-dropdown.js'); wp_register_script('bootstrap-modal', get_template_directory_uri() . '/js/bootstrap-modal.js'); wp_register_script('bootstrap-popover', get_template_directory_uri() . '/js/bootstrap-popover.js'); wp_register_script('bootstrap-scrollspy', get_template_directory_uri() . '/js/bootstrap-scrollspy.js'); wp_register_script('bootstrap-tab', get_template_directory_uri() . '/js/bootstrap-tab.js'); wp_register_script('bootstrap-tooltip', get_template_directory_uri() . '/js/bootstrap-tooltip.js'); wp_register_script('bootstrap-transition', get_template_directory_uri() . '/js/bootstrap-transition.js'); wp_register_script('bootstrap-typeahead', get_template_directory_uri() . '/js/bootstrap-typeahead.js'); // For either a plugin or a theme, you can then enqueue the script: wp_enqueue_script('jquery1.7'); wp_enqueue_script('bootstrap-transition'); wp_enqueue_script('bootstrap-alert'); wp_enqueue_script('bootstrap-modal'); wp_enqueue_script('bootstrap-dropdown'); wp_enqueue_script('bootstrap-scrollspy'); wp_enqueue_script('bootstrap-tab'); wp_enqueue_script('bootstrap-tooltip'); wp_enqueue_script('bootstrap-popover'); wp_enqueue_script('bootstrap-button'); wp_enqueue_script('bootstrap-collapse'); wp_enqueue_script('bootstrap-carousel'); wp_enqueue_script('bootstrap-typeahead'); }
/** * Enqueue styles and scripts * * @access public * @return void * @since 1.0.0 */ public function enqueue_styles_scripts() { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; wp_register_script('yith_wcas_jquery-autocomplete', YITH_WCAS_URL . 'assets/js/devbridge-jquery-autocomplete' . $suffix . '.js', array('jquery'), '1.2.7', true); $css = file_exists(get_stylesheet_directory() . '/woocommerce/yith_ajax_search.css') ? get_stylesheet_directory_uri() . '/woocommerce/yith_ajax_search.css' : YITH_WCAS_URL . 'assets/css/yith_wcas_ajax_search.css'; wp_enqueue_style('yith_wcas_frontend', $css); }
/** * Enqueue scripts and styles * * @return void */ static function admin_enqueue_scripts() { $url = RWMB_CSS_URL . 'jqueryui'; wp_register_style('jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17'); wp_register_style('jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17'); wp_register_style('jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17'); wp_register_style('jquery-ui-slider', "{$url}/jquery.ui.slider.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17'); wp_enqueue_style('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7'); wp_register_script('jquery-ui-timepicker', RWMB_JS_URL . 'jqueryui/jquery-ui-timepicker-addon.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7', true); // Load localized scripts $locale = str_replace('_', '-', get_locale()); $date_path = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js'; $time_path = 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . $locale . '.js'; $deps = array('jquery-ui-datepicker', 'jquery-ui-timepicker'); if (file_exists(RWMB_DIR . 'js/' . $date_path)) { wp_register_script('jquery-ui-datepicker-i18n', RWMB_JS_URL . $date_path, array('jquery-ui-datepicker'), '1.8.17', true); $deps[] = 'jquery-ui-datepicker-i18n'; } if (file_exists(RWMB_DIR . 'js/' . $time_path)) { wp_register_script('jquery-ui-timepicker-i18n', RWMB_JS_URL . $time_path, array('jquery-ui-timepicker'), '1.8.17', true); $deps[] = 'jquery-ui-timepicker-i18n'; } wp_enqueue_script('rwmb-datetime', RWMB_JS_URL . 'datetime.js', $deps, RWMB_VER, true); wp_localize_script('rwmb-datetime', 'RWMB_Datetimepicker', array('lang' => $locale)); }
function _cfs_admin_script() { wp_register_style('cfs-style', plugins_url('css/cfs_admin.css', dirname(__FILE__))); wp_enqueue_style('cfs-style'); wp_register_script('cfs-script', plugins_url('js/cfs_admin.js', dirname(__FILE__)), array(), '1.0.0', true); wp_enqueue_script('cfs-script'); }
function takeaway_register_woo_radio_button_scripts() { wp_deregister_script('wc-add-to-cart-variation'); wp_dequeue_script('wc-add-to-cart-variation'); wp_register_script('takeaway-add-to-cart-variation', UOU_JS . 'add-to-cart-variation.min.js', array('jquery'), $ver = false, true); wp_enqueue_script('takeaway-add-to-cart-variation'); }
/** * Register jquery scripts */ function spacious_scripts_styles_method() { /** * Loads our main stylesheet. */ wp_enqueue_style('spacious_style', get_stylesheet_uri()); if (of_get_option('spacious_color_skin', 'light') == 'dark') { wp_enqueue_style('spacious_dark_style', SPACIOUS_CSS_URL . '/dark.css'); } /** * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } /** * Register JQuery cycle js file for slider. */ wp_register_script('jquery_cycle', SPACIOUS_JS_URL . '/jquery.cycle.all.min.js', array('jquery'), '2.9999.5', true); // wp_register_style( 'google_fonts', 'http://fonts.googleapis.com/css?family=Lato' ); /** * Enqueue Slider setup js file. */ if (is_home() || is_front_page() && of_get_option('spacious_activate_slider', '0') == '1') { wp_enqueue_script('spacious_slider', SPACIOUS_JS_URL . '/spacious-slider-setting.js', array('jquery_cycle'), false, true); } wp_enqueue_script('spacious-navigation', SPACIOUS_JS_URL . '/navigation.js', array('jquery'), false, true); wp_enqueue_script('spacious-custom', SPACIOUS_JS_URL . '/spacious-custom.js', array('jquery')); wp_enqueue_style('google_fonts'); $spacious_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); if (preg_match('/(?i)msie [1-8]/', $spacious_user_agent)) { wp_enqueue_script('html5', SPACIOUS_JS_URL . '/html5.js', true); } }
function custom_scripts() { wp_deregister_script('Script 1 Handle/Name'); wp_register_script('Script 1 Handle/Name', 'Script URL', array('Script Dependencies'), 'Script Version', false); wp_enqueue_script('Script 1 Handle/Name'); wp_register_script('Script 2 Handle/Name', 'Script URL', array('Script Dependencies'), 'Script Version', false); }
function addScripts() { if (WP_DEBUG) { wp_register_script('livereload', 'http://localhost:35730/livereload.js?snipver=1', null, false, true); wp_enqueue_script('livereload'); } }
function add_styles() { wp_register_style('userpro_rd_custom', userpro_rd_url . 'admin/css/userpro-redirection.css'); wp_enqueue_style('userpro_rd_custom'); wp_register_script('userpro_rd_custom', userpro_rd_url . 'admin/scripts/userpro-redirection.js'); wp_enqueue_script('userpro_rd_custom'); }
function theme_front_enqueue_script() { wp_enqueue_script('jquery'); wp_enqueue_script("jquery-migrate"); wp_enqueue_script('jquery-ui-core'); wp_register_script('SFSIjqueryModernizr', SFSI_PLUGURL . 'js/shuffle/modernizr.custom.min.js', array('jquery'), '', true); wp_enqueue_script("SFSIjqueryModernizr"); wp_register_script('SFSIjqueryShuffle', SFSI_PLUGURL . 'js/shuffle/jquery.shuffle.min.js', array('jquery'), '', true); wp_enqueue_script("SFSIjqueryShuffle"); wp_register_script('SFSIjqueryrandom-shuffle', SFSI_PLUGURL . 'js/shuffle/random-shuffle-min.js', array('jquery'), '', true); wp_enqueue_script("SFSIjqueryrandom-shuffle"); wp_register_script('SFSICustomJs', SFSI_PLUGURL . 'js/custom.js', array('jquery'), '', true); wp_enqueue_script("SFSICustomJs"); /* end cusotm js */ /* initilaize the ajax url in javascript */ wp_localize_script('SFSICustomJs', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php'))); wp_localize_script('SFSICustomJs', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php'), 'plugin_url' => SFSI_PLUGURL)); /* include CSS for front-end and backend */ wp_enqueue_style("SFSImainCss", SFSI_PLUGURL . 'css/sfsi-style.css'); //including floating option css $option5 = unserialize(get_option('sfsi_section5_options', false)); if ($option5['sfsi_disable_floaticons'] == 'yes') { wp_enqueue_style("disable_sfsi", SFSI_PLUGURL . 'css/disable_sfsi.css'); } }
function Attachments() { wp_register_script('admin-bar-plugin', $this->pluginUrl . '/js/admin-bar.js', array('jquery-form')); wp_enqueue_script('admin-bar-plugin'); wp_register_style('admin-bar-plugin', $this->pluginUrl . '/css/admin-bar.css'); wp_enqueue_style('admin-bar-plugin'); }
function ox_adding_scripts() { if (!function_exists('is_login_page')) { function is_login_page() { return !strncmp($_SERVER['REQUEST_URI'], '/wp-login.php', strlen('/wp-login.php')); } } if (!is_admin() && !is_login_page()) { /*removed wp-embed.min.js*/ wp_deregister_script('wp-embed'); /*jquery*/ wp_deregister_script('jquery'); $infooter = !is_page(array($order_form_pages)) ? true : false; wp_register_script('jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", false, '1.11.3', $infooter); wp_enqueue_script('jquery'); /*bootstrap*/ wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css'); /*slicknav menu*/ wp_enqueue_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), '', true); /*bxslider*/ wp_enqueue_style('bxslider', get_template_directory_uri() . '/css/jquery.bxslider.min.css'); wp_enqueue_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '', true); /*zopim chat*/ wp_enqueue_script('zopim', get_template_directory_uri() . '/js/zopimClear.js', array('jquery'), '', true); /*custom css*/ wp_enqueue_style('custom', get_template_directory_uri() . '/style.css', array('bootstrap')); /*custom js*/ wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery'), '', true); } }
public function admin_script_load() { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; $rtl = is_rtl() ? '.rtl' : ''; wp_register_script('chosen', $this->admin_plugin_url() . '/assets/js/chosen/chosen.jquery' . $suffix . '.js', array('jquery'), true, false); wp_register_script('a3rev-chosen-new', $this->admin_plugin_url() . '/assets/js/chosen/chosen.jquery' . $suffix . '.js', array('jquery'), true, false); wp_register_script('a3rev-style-checkboxes', $this->admin_plugin_url() . '/assets/js/iphone-style-checkboxes' . $rtl . '.js', array('jquery'), true, false); wp_register_script('jquery-ui-slider-rtl', $this->admin_plugin_url() . '/assets/js/ui-slider/jquery.ui.slider.rtl' . $suffix . '.js', array('jquery'), true, true); wp_register_script('a3rev-admin-ui-script', $this->admin_plugin_url() . '/assets/js/admin-ui-script.js', array('jquery'), true, true); wp_register_script('a3rev-typography-preview', $this->admin_plugin_url() . '/assets/js/a3rev-typography-preview.js', array('jquery'), false, true); wp_register_script('a3rev-settings-preview', $this->admin_plugin_url() . '/assets/js/a3rev-settings-preview.js', array('jquery'), false, true); wp_register_script('jquery-tiptip', $this->admin_plugin_url() . '/assets/js/tipTip/jquery.tipTip' . $suffix . '.js', array('jquery'), true, true); wp_register_script('a3rev-metabox-ui', $this->admin_plugin_url() . '/assets/js/data-meta-boxes.js', array('jquery'), true, true); wp_enqueue_script('jquery'); wp_enqueue_script('wp-color-picker'); if (is_rtl()) { wp_enqueue_script('jquery-ui-slider-rtl'); } else { wp_enqueue_script('jquery-ui-slider'); } wp_enqueue_script('chosen'); wp_enqueue_script('a3rev-chosen-new'); wp_enqueue_script('a3rev-style-checkboxes'); wp_enqueue_script('a3rev-admin-ui-script'); wp_enqueue_script('a3rev-typography-preview'); wp_enqueue_script('a3rev-settings-preview'); wp_enqueue_script('jquery-tiptip'); wp_enqueue_script('a3rev-metabox-ui'); }
function admin_google_font_scripts() { wp_register_script('ultimate-google-fonts-script', plugins_url("../admin/js/google-fonts-admin.js", __FILE__), array('jquery')); wp_enqueue_script('ultimate-google-fonts-script'); wp_register_style('ultimate-google-fonts-style', plugins_url("../admin/css/google-fonts-admin.css", __FILE__)); wp_enqueue_style('ultimate-google-fonts-style'); }
function md_add_footer() { // Drone JS wp_register_script('drone', get_template_directory_uri() . '/js/drone.js'); wp_enqueue_script('drone'); wp_localize_script('drone', 'mdajaxurl', array('ajax' => admin_url('admin-ajax.php'))); }