BluePrint-Q %s Edition. Version %s, © 2014-%s.', 'bpq' ), admin::url_landing(), sales::edition_name(), BPQ_VERSION, date( 'Y' ) ); } /** * Explicitly calls out WP as the version number that is normally * in the bottom-right corner of the admin backend screens. * @return string The desired text */ function admin_footer_right() { global $wp_version; return sprintf( __( 'WordPress, Version %s.', 'bpq' ), $wp_version ); } /** * Normally, the head titles in the admin screens look something like this: * Name of page < Theme title - WordPress * This function removes the '<' and everything after it. * * @param string $admin_title The full title as it would normally appear * @param string $title The plain title of the page * @return string The desired title that will appear in the browser tab and/or title bar */ function admin_title( $admin_title, $title ) { return $title; } /** * Supplies the Google Analytics tracking code to be included * at the top of each page. This function pulls the code from * the option sitting in the Customizer. * @link http://www.google.com/analytics/ * @return string The desired Analytics code */ function analytics( $path ) { // No analytics if in debug mode - do not want false positives. if ( constant( 'WP_DEBUG' ) ) return ''; // OPTION: Analytics $opt_analytics = get_theme_mod( 'bpq_opt_auxiliary_analytics', '' ); return $opt_analytics; } /** * Add classes to the body that represent the current tone selections. * @param type $classes The classes that WP has already figured out * @return array The massaged classes */ function body_classes( $classes ) { $tones = tones(); foreach ( $tones as $key => $tone ) { $tone_name = pathinfo( basename( $tone, '.css' ), PATHINFO_EXTENSION ); $classes[] = $key.'-'.$tone_name; } return $classes; } /** * Sets the favicon, which is the icon typically displayed in the browser tab * or address bar. It searches for the icon in the following priority: * 1. Use the icon set in the Customizer. * 2. Look in the child theme folder for favicon.png, .ico, or .gif. * 3. Look in the parent theme folder for favicon.png, .ico, or .gif. * * Note: The markup that is generated and echoed in this function is a * element that goes into the
block. */ function favicon() { // Default icon. $icon = get_template_directory_uri().'/favicon.png'; // OPTION: Favicon $opt_favicon = get_theme_mod( 'bpq_opt_auxiliary_favicon', '' ); if ( !empty( $opt_favicon ) ) { $icon = home_url().$opt_favicon; } // If the icon is not set in the Customizer, then try finding it in the theme folders. else { $file = \ski\question::locate_template_uri( array( 'favicon.png', 'favicon.ico', 'favicon.gif' ) ); if ( !empty( $file ) ) $icon = $file; } // Put together the markup. echo ''; } /** * Shortcut to determine if the Ski.Web plugin is installed. * This is largely important to avoid crashes that can happen * with specific features that depend on the library. * @return boolean */ function is_ski_plugin_activated() { return function_exists( 'ski\init' ); } /** * Introduces the Bootstrap framework to this theme. */ function queue_bootstrap() { wp_enqueue_style( 'bootstrap_css', get_template_directory_uri().'/packages/bootstrap-3.2.0/dist/css/bootstrap.min.css', array(), time() ); wp_enqueue_script( 'bootstrap_js', get_template_directory_uri().'/packages/bootstrap-3.2.0/dist/js/bootstrap.min.js', array( 'jquery' ), time(), true ); } /** * Queues up this theme's CSS/JS. Also queues up auxiliary * scripts based on the selected options. */ function queue_core() { wp_enqueue_style( 'bpq_css', get_template_directory_uri().'/bpq.css', array( 'bootstrap_css' ), time() ); wp_enqueue_script( 'bpq_js', get_template_directory_uri().'/bpq.js', array( 'bootstrap_js' ), time() ); // OPTION: Navbar affix $opt_affix = get_theme_mod( 'bpq_opt_navigation_affix', 1 ); if ( !empty( $opt_affix ) ) { wp_enqueue_script( 'bpq_affix_js', get_template_directory_uri().'/services/bpq.service.navfix.js', array( 'bootstrap_js' ), time() ); } } /** * Introduces the Font Awesome icons to this theme. */ function queue_font_awesome() { wp_enqueue_style( 'font_awesome_css', get_template_directory_uri().'/packages/font-awesome-4.1.0/css/font-awesome.min.css', array(), time() ); } /** * WP provides their own styles for the login screen - this function * introduces the BluePrint-Q styling also. */ function queue_login() { wp_enqueue_style( 'bootstrap_css', get_template_directory_uri().'/packages/bootstrap-3.2.0/dist/css/bootstrap.min.css', array(), time() ); wp_enqueue_script( 'bootstrap_js', get_template_directory_uri().'/packages/bootstrap-3.2.0/dist/js/bootstrap.min.js', array( 'jquery' ), time(), true ); wp_enqueue_style( 'bpq_css', get_template_directory_uri().'/bpq.css', array( 'bootstrap_css' ), time() ); wp_enqueue_script( 'bpq_js', get_template_directory_uri().'/bpq.js', array( 'bootstrap_js' ), time() ); } /** * Queues up the current tone. */ function queue_tone() { // Queue up the CSS associated with the selected tones; that is, if there is a selection. // // Note: The Theme Customizer appears to cache old CSS - to make these tones load properly // whenever a new tone is selected, we use the current time as the version number. $tones = tones(); foreach ( $tones as $key => $tone ) { wp_enqueue_style( 'bpq_tone_'.$key.'_css', $tone, array( 'bootstrap_css' ), time() ); } } /** * Calls out plugins that are to be installed for this theme. * @link https://github.com/thomasgriffin/TGM-Plugin-Activation */ function register_packaged_plugins() { /** * Array of plugin arrays. Required keys are name and slug. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array( // bootstrap-3-shortcodes array( 'name' => 'Bootstrap 3 Shortcodes', // The plugin name. 'slug' => 'bootstrap-3-shortcodes', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // contact-form-7 array( 'name' => 'Contact Form 7', // The plugin name. 'slug' => 'contact-form-7', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // crayon-syntax-highlighter array( 'name' => 'Crayon Syntax Highlighter', // The plugin name. 'slug' => 'crayon-syntax-highlighter', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // enable-media-replace array( 'name' => 'Enable Media Replace', // The plugin name. 'slug' => 'enable-media-replace', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // sendpress array( 'name' => 'SendPress', // The plugin name. 'slug' => 'sendpress', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // simple image array( 'name' => 'Simple Image Widget', // The plugin name. 'slug' => 'simple-image-widget', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // ski.web array( 'name' => 'Ski.Web', // The plugin name. 'slug' => 'ski.web', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/ski.web.2.0.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // woocommerce array( 'name' => 'WooCommerce', // The plugin name. 'slug' => 'woocommerce', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), /** * DAN-KEEP * This block is unnecessary for bpq purposes, but keeping it * around to demonstrate original examples. */ /* // This is an example of how to include a plugin pre-packaged with a theme. array( 'name' => 'Debug Bar', // The plugin name. 'slug' => 'debug-bar', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/debug-bar.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. 'external_url' => '', // If set, overrides default API URL and points to an external URL. ), // This is an example of how to include a plugin from a private repo in your theme. array( 'name' => 'TGM New Media Plugin', // The plugin name. 'slug' => 'tgm-new-media-plugin', // The plugin slug (typically the folder name). 'source' => 'https://s3.amazonaws.com/tgm/tgm-new-media-plugin.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => 'https://github.com/thomasgriffin/New-Media-Image-Uploader', // If set, overrides default API URL and points to an external URL. ), // This is an example of how to include a plugin from the WordPress Plugin Repository. array( 'name' => 'BuddyPress', 'slug' => 'buddypress', 'required' => false, ), */ ); /** * Some plugins are only intended for the architect edition. */ if ( BPQ_EDITION >= 2 ) { $plugins_architect = array( // bpq.posttypes array( 'name' => 'BPQ Posttypes', // The plugin name. 'slug' => 'bpq.posttypes', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/bpq.posttypes.1.1.zip', // The plugin source. 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // bpq.shortcodes array( 'name' => 'BPQ Shortcodes', // The plugin name. 'slug' => 'bpq.shortcodes', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/bpq.shortcodes.1.1.zip', // The plugin source. 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), ); $plugins = array_merge( $plugins, $plugins_architect ); } /** * Some plugins are only intended for the premium edition. */ if ( BPQ_EDITION >= 3 ) { $plugins_premium = array( // bpq.vc array( 'name' => 'BPQ Visual Composer', // The plugin name. 'slug' => 'bpq.vc', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/bpq.vc.1.1.zip', // The plugin source. 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // js_composer array( 'name' => 'Visual Composer', // The plugin name. 'slug' => 'js_composer', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/js_composer.4.3.3.zip', // The plugin source. 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), // revslider array( 'name' => 'Revolution Slider', // The plugin name. 'slug' => 'revslider', // The plugin slug (typically the folder name). 'source' => get_template_directory() . '/plugins/revslider.4.6.zip', // The plugin source. 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch. 'force_deactivation' => true, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins. ), ); $plugins = array_merge( $plugins, $plugins_premium ); } /** * Array of configuration settings. Amend each line as needed. * If you want the default strings to be available under your own theme domain, * leave the strings uncommented. * Some of the strings are added into a sprintf, so see the comments at the * end of each line for what each argument will be. */ $config = array( 'id' => 'tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to pre-packaged plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. 'strings' => array( 'page_title' => __( 'Install Required Plugins', 'tgmpa' ), 'menu_title' => __( 'Install Plugins', 'tgmpa' ), 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ), // %s = plugin name. 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ), 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'tgmpa' ), // %1$s = plugin name(s). 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'tgmpa' ), // %1$s = plugin name(s). 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'tgmpa' ), 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'tgmpa' ), 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ), 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ), 'complete' => __( 'All plugins installed and activated successfully. %s', 'tgmpa' ), // %s = dashboard link. 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. ) ); tgmpa( $plugins, $config ); } /** * There are a number of features that are not turned on by default - turn them on. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support */ function register_theme_support() { // Support for RSS. add_theme_support( 'automatic-feed-links' ); // Keep in mind that if menu locations are registered, then an explicit // call to add theme support for 'menus' is unnecessary. // @link http://codex.wordpress.org/Function_Reference/register_nav_menu add_theme_support( 'menus' ); // Support a number of post formats. // @link http://codex.wordpress.org/Post_Formats add_theme_support( 'post-formats', array( 'aside', 'chat', 'link', 'quote', 'status' ) ); // Support featured images. add_theme_support( 'post-thumbnails' ); // Note: Add/remove support to suppress recommendations that // can improperly trigger false positives from potential // automated theme-check processes. add_theme_support( 'custom-background' ); add_theme_support( 'custom-header' ); remove_theme_support( 'custom-background' ); remove_theme_support( 'custom-header' ); } /** * The title typically appears in a browser's tab and/or title bar. * * @param string $title The plain title of the page * @return string The desired title that will appear in the browser tab and/or title bar */ function title( $title ) { return get_bloginfo( 'name' ).' · '.get_bloginfo( 'description' ); } /** * Figures the CSS paths to all selected tones. * @return array An array of the selected tone CSS paths */ function tones() { // Defaults for each tone, if none are selected. $color_default = 'tones/colors/bpq.tone.color.gradient-blues.css'; $flair_default = 'tones/flairs/bpq.tone.flair.architect.css'; $type_default = 'tones/types/bpq.tone.type.soundwave.css'; // OPTION: Tone $opt_tone_color = get_theme_mod( 'bpq_opt_tone_color', $color_default ); $opt_tone_flair = get_theme_mod( 'bpq_opt_tone_flair', $flair_default ); $opt_tone_type = get_theme_mod( 'bpq_opt_tone_type', $type_default ); // Construct a list of all tones to return - let potential // child theme versions override parent versions. return array ( 'color' => \ski\question::locate_template_uri( $opt_tone_color ), 'flair' => \ski\question::locate_template_uri( $opt_tone_flair ), 'type' => \ski\question::locate_template_uri( $opt_tone_type ), ); } /** * This is a dummy action so that custom BluePrint-Q hooks can * mainly be called out in the corresponding hooks file. */ function unused_action() { // Intentionally blank. } /** * This is a dummy filter so that custom BluePrint-Q hooks can * mainly be called out in the corresponding hooks file. * * @param mixed $incoming The text to be altered * @return string The text that was passed in */ function unused_filter( $incoming ) { return $incoming; } /** * Perform setup of Visual Composer - specifically, for VC to * initialize as "built into the theme"; this will hide certain * tabs under the Settings -> Visual Composer page. * * Note: These VC-related functions only make sense for the * premium edition of BluePrint-Q. * * @link http://kb.wpbakery.com/index.php?title=Vc_set_as_theme * @link http://kb.wpbakery.com/index.php?title=Visual_Composer_Theme_Integration */ function vc_integrate() { if( function_exists( 'vc_set_as_theme' ) ) { // Remove a bunch of settings that do not make sense if integrated within a theme. vc_set_as_theme( true ); } } ?>