function wpgrade_callback_load_woocommerce_assets() { global $woocommerce; if (!wpgrade::option('enable_woocommerce_support', '0')) { return; } wp_enqueue_style('wpgrade-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce.css', array('woocommerce-general'), wpgrade::cachebust_string(wpgrade::themefilepath('assets/css/woocommerce.css'))); }
function wpGrade_ajax_import_widgets() { $response = array('what' => 'import_widgets', 'action' => 'import_submit', 'id' => 'true'); // check if user is allowed to save and if its his intention with // a nonce check if (function_exists('check_ajax_referer')) { check_ajax_referer('wpGrade_nonce_import_demo_widgets'); } require_once wpgrade::themefilepath('inc/import/import-demo-widgets' . EXT); $response = new WP_Ajax_Response($response); $response->send(); }
function wpgrade_callback_load_google_fonts_config_rosa() { $fonts_array = array('google_titles_font', 'google_subtitles_font', 'google_nav_font', 'google_body_font'); $families = array(); foreach ($fonts_array as $font) { $clean_font = wpgrade::get_google_font_name($font); if (!empty($clean_font)) { $families[] = $clean_font; } } $families = apply_filters('wpgrade_google_fonts', $families); if (!empty($families) || is_preview()) { // any variables in scope will be available in the partial include wpgrade::themefilepath('templates/core/google-fonts-config' . EXT); } }
function wpgrade_callback_load_google_fonts() { if (wpgrade::option('use_google_fonts')) { $fonts_array = array('google_titles_font', 'google_second_font', 'google_nav_font', 'google_body_font'); $families = array(); foreach ($fonts_array as $font) { $clean_font = wpgrade::get_google_font_name($font); if (!empty($clean_font)) { $families[] = $clean_font; } } if (!empty($families)) { // any variables in scope will be available in the partial include wpgrade::themefilepath('wpgrade-core/resources/views/google-fonts-script' . EXT); } } }
} //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = wpgrade::themefilepath('inc/import/wordpress-importer/wordpress-importer.php'); if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $response['id'] = new WP_Error('import_posts_pages_noscript', 'The Auto importing script could not be loaded. Please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.xml')) { $response['id'] = new WP_Error('import_posts_pages_nofile', 'The XML file containing the demo data could not be found or could not be read in <pre>' . wpgrade::themefilepath('inc/import/demo-data') . '</pre><br/> You might want to try to set the file permission to 777.<br/>If this doesn\'t work please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_posts_pages($import_filepath . '.xml', $response['supplemental']['stepNumber'], $response['supplemental']['numberOfSteps']); //after the last step we assign the menus to the proper locations if ($response['supplemental']['stepNumber'] == $response['supplemental']['numberOfSteps']) { $wp_import->set_menus(); } $response['data'] = ob_get_contents(); ob_end_clean(); } }
<?php return array('name' => 'Rosa', 'shortname' => 'rosa', 'prefix' => '_rosa_', 'textdomain' => 'rosa_txtd', 'language-path' => 'languages', 'update-notifier' => array('xml-source' => REQUEST_PROTOCOL . '//pixelgrade.com/updates/', 'cache-interval' => 10800, 'update-page-name' => 'theme-update-notifier'), 'theme-adminpanel-path' => 'config/admin-panel', 'include-paths' => array('inc/classes', 'inc/functions'), 'include-files' => array('inc/required-plugins/required-plugins.php'), 'core-partials-overwrite-path' => 'templates/core', 'resource-path' => '/assets', 'theme-options' => array(), 'body-classes' => array(), 'custom-css-handler' => null, 'content-filters' => array('default' => array('wpgrade_callback_theme_general_filters' => 100, 'wpgrade_callback_shortcode_filters' => 200, 'wpgrade_callback_attachment_filters' => 300, 'wpgrade_callback_paragraph_filters' => 400)), 'post-formats' => array(), 'shortcodes' => array('Columns', 'Button', 'Icon', 'Tabs', 'Heading', 'Separator', 'Slider', 'OpenTableReservations', 'RestaurantMenu'), 'import_homepage_name' => 'Home Page', 'import_blogpage_name' => 'News', 'import_nav_menu' => array('main_menu' => 'Main Menu', 'footer_menu' => 'Footer Menu'), 'resources' => array('register' => array('head-scripts' => array('modernizr' => array('path' => get_template_directory_uri() . '/assets/js/vendor/modernizr.min.js', 'require' => array('jquery')), 'webfont-script' => array('path' => REQUEST_PROTOCOL . '//ajax.googleapis.com/ajax/libs/webfont/1.5.3/webfont.js', 'require' => array('jquery'))), 'footer-scripts' => array('wpgrade-plugins' => array('path' => get_template_directory_uri() . '/assets/js/plugins.js', 'require' => array('jquery', 'modernizr')), 'wpgrade-main-scripts' => array('path' => get_template_directory_uri() . '/assets/js/main.js', 'cache_bust' => wpgrade::cachebust_string(wpgrade::themefilepath('assets/js/main.js')), 'require' => array('wpgrade-plugins')), 'addthis-api' => array('path' => REQUEST_PROTOCOL . '//s7.addthis.com/js/300/addthis_widget.js#async=1', 'require' => array('jquery')), 'google-maps-api' => array('path' => REQUEST_PROTOCOL . '//maps.google.com/maps/api/js?sensor=false&language=en', 'require' => array('jquery'))), 'styles' => array('google-webfonts' => array('path' => REQUEST_PROTOCOL . '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,900|Cabin:400,700,400italic,700italic|Herr+Von+Muellerhoff'), 'wpgrade-main-style' => array('path' => get_template_directory_uri() . '/assets/css/style.css', 'cache_bust' => wpgrade::cachebust_string(wpgrade::themefilepath('assets/css/style.css'))))), 'auto-enqueue-scripts' => array('wpgrade-main-scripts'), 'auto-localize-scripts' => array('wpgrade-main-scripts' => array('ajaxurl' => admin_url('admin-ajax.php'), 'objectl10n' => array('tPrev' => __('Previous (Left arrow key)', 'rosa_txtd'), 'tNext' => __('Next (Right arrow key)', 'rosa_txtd'), 'tCounter' => __('of', 'rosa_txtd'), 'infscrLoadingText' => "", 'infscrReachedEnd' => ""))), 'script-enqueue-handlers' => array('google-web-fonts' => 'wpgrade_callback_enqueue_google_fonts_rosa', 'thread-comments' => 'wpgrade_callback_thread_comments_scripts', 'addthis' => 'wpgrade_callback_addthis'), 'auto-enqueue-styles' => array('google-webfonts', 'wpgrade-main-style'), 'style-enqueue-handlers' => array('dynamic-css' => array('handler' => 'wpgrade_callback_enqueue_dynamic_css_rosa', 'priority' => 9999), 'rtl-support' => 'wpgrade_callback_enqueue_rtl_support', '404-page' => 'wpgrade_callback_enqueue_404_css')), 'pagination' => array('formatter' => 'wpgrade_callback_pagination_formatter', 'prev_next' => true, 'prev_text' => __('Prev', 'rosa_txtd'), 'next_text' => __('Next', 'rosa_txtd'), 'sorted_paging' => false, 'order' => 'desc', 'show_all' => false, 'end_size' => 1, 'mid_size' => 2, 'add_args' => false, 'add_fragment' => null), 'pagination-targets' => array(), 'thumbnails_sizes' => array('full-size' => array('width' => 2048), 'large-size' => array('width' => 1200), 'medium-size' => array('width' => 900), 'small-size' => array('width' => 400))); # end theme configuration
// the handler is the main object responsible for managing the drivers wpgrade::options_handler(new WPGradeOptions()); # [!!] driver priority works like a LIFO stack, last in = highest priority // register basic configuration driver $config = wpgrade::config(); wpgrade::options()->add_optiondriver(new WPGradeOptionDriver_Config($config['theme-options'])); // we register redux as option driver via a resolver function wpgrade_callback_bootstrap_redux_instance($redux) { $reduxdriver = new WPGradeOptionDriver_Redux($redux); wpgrade::options()->add_optiondriver($reduxdriver); } wpgrade::register_resolver('redux-instance', 'wpgrade_callback_bootstrap_redux_instance'); // Plugins & Resolvable Dependencies // --------------------------------- require wpgrade::themefilepath(wpgrade::confoption('theme-adminpanel-path', 'theme-content/admin-panel') . '/bootstrap' . EXT); // Hooks // ----- get_template_part('wpgrade-core/hooks'); // Upgrade Notifier // ---------------- add_action('wp_ajax_wpgrade_upgradestep_check_marketplace_data', 'wpgrade_ajax_upgradestep_check_marketplace_data'); add_action('wp_ajax_wpgrade_upgradestep_search_for_update', 'wpgrade_ajax_upgradestep_search_for_update'); add_action('wp_ajax_wpgrade_upgradestep_backup_theme', 'wpgrade_ajax_upgradestep_backup_theme'); add_action('wp_ajax_wpgrade_upgradestep_analyze_download_options', 'wpgrade_ajax_upgradestep_analyze_download_options'); add_action('wp_ajax_wpgrade_upgradestep_download_package', 'wpgrade_ajax_upgradestep_download_package'); add_action('wp_ajax_wpgrade_upgradestep_install_package', 'wpgrade_ajax_upgradestep_install_package'); if (is_admin() && basename($_SERVER["PHP_SELF"]) != 'update-core.php') { add_action('admin_enqueue_scripts', 'wpgrade_callback_update_notifier_admin_initialization'); add_action('admin_menu', 'wpgrade_callback_update_notifier_menu'); add_action('admin_bar_menu', 'wpgrade_callback_update_notifier_bar_menu', 1000);
/** * ... */ function add_scripts() { $pointers = $this->valid; if (empty($pointers)) { return; } $pointers = json_encode($pointers); include wpgrade::themefilepath('inc/assets/wp-help-pointer' . EXT); }
require_once $class_wp_importer; } else { $wpGrade_importerError = true; } } //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = wpgrade::themefilepath('inc/import/wordpress-importer/wordpress-importer.php'); if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $response['id'] = new WP_Error('import_theme_options_noscript', 'The Auto importing script could not be loaded. Please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.php')) { $response['id'] = new WP_Error('import_theme_options_nofile', 'The PHP file containing the theme options data could not be found or could not be read in <pre>' . wpgrade::themefilepath('inc/import/demo-data') . '</pre><br/> You might want to try to set the file permission to 777.<br/>If this doesn\'t work please use the Theme Options Import/Export and import the .txt file provided in the archive you\'ve received on purchase manually.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_theme_options($import_filepath . '.php'); $response['data'] = ob_get_contents(); ob_end_clean(); } }
function wpgrade_callback_twitter_card() { include wpgrade::themefilepath('inc/assets/social-and-seo/twitter-card-tags' . EXT); }
require_once $class_wp_importer; } else { $wpGrade_importerError = true; } } //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = wpgrade::themefilepath('inc/import/wordpress-importer/wordpress-importer.php'); if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $response['id'] = new WP_Error('import_widgets_menus_noscript', 'The Auto importing script could not be loaded. Please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.php')) { $response['id'] = new WP_Error('import_widgets_menus_nofile', 'The PHP file containing the widgets data could not be found or could not be read in <pre>' . wpgrade::themefilepath('inc/import/demo-data') . '</pre><br/> You might want to try to set the file permission to 777.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_widget_data($import_filepath . '.php'); $response['data'] = ob_get_contents(); ob_end_clean(); } }