/**
  * Initialize the class.
  *
  * @since 1.0.0
  */
 function __construct($config = array(), $strings = array())
 {
     $config = wp_parse_args($config, array('remote_api_url' => 'http://easydigitaldownloads.com', 'theme_slug' => get_template(), 'item_name' => '', 'license' => '', 'version' => '', 'author' => '', 'download_id' => '', 'renew_url' => ''));
     // Set config arguments
     $this->remote_api_url = $config['remote_api_url'];
     $this->item_name = $config['item_name'];
     $this->theme_slug = sanitize_key($config['theme_slug']);
     $this->version = $config['version'];
     $this->author = $config['author'];
     $this->download_id = $config['download_id'];
     $this->renew_url = $config['renew_url'];
     // Populate version fallback
     if ('' == $config['version']) {
         $theme = wp_get_theme($this->theme_slug);
         $this->version = $theme->get('Version');
     }
     // Strings passed in from the updater config
     $this->strings = $strings;
     add_action('admin_init', array($this, 'updater'));
     add_action('admin_init', array($this, 'register_option'));
     add_action('admin_init', array($this, 'license_action'));
     add_action('admin_menu', array($this, 'license_menu'));
     add_action('update_option_' . $this->theme_slug . '_license_key', array($this, 'activate_license'), 10, 2);
     add_filter('http_request_args', array($this, 'disable_wporg_request'), 5, 2);
 }
 /**
  * Grab the setting element selectors defined in the customize-inline-editing theme support,
  * or provide fallback defaults for themes bundled with Core.
  *
  * @return array
  */
 function get_theme_support()
 {
     $support = get_theme_support('customize-inline-editing');
     if (!empty($support)) {
         $setting_element_selectors = array_shift($support);
     } else {
         $setting_element_selectors = array();
         if ('twentyten' === get_template()) {
             $setting_element_selectors['blogname'] = '#branding a[rel=home]';
             $setting_element_selectors['blogdescription'] = '#site-description';
         } elseif ('twentyeleven' === get_template()) {
             $setting_element_selectors['blogname'] = '#site-title a';
             $setting_element_selectors['blogdescription'] = '#site-description';
         } elseif ('twentytwelve' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
             $setting_element_selectors['blogdescription'] = '.site-description';
         } elseif ('twentythirteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title';
             $setting_element_selectors['blogdescription'] = '.site-description';
         } elseif ('twentyfourteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
         } elseif ('twentyfifteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
             $setting_element_selectors['blogdescription'] = '.site-description';
         } elseif ('twentysixteen' === get_template()) {
             $setting_element_selectors['blogname'] = '.site-title a';
             $setting_element_selectors['blogdescription'] = '.site-description';
         }
     }
     return $setting_element_selectors;
 }
Пример #3
0
/**
 * Setup auto updates.
 *
 * @since 1.0.0
 */
function jumpstart_updates()
{
    global $_tb_jumpstart_edd_updater;
    global $_tb_jumpstart_license_admin;
    // Include Theme_Blvd_License_Admin class for admin page.
    include_once TB_FRAMEWORK_DIRECTORY . '/admin/updates/class-tb-license-admin.php';
    // Theme Data
    $theme_data = wp_get_theme(get_template());
    // Will ignore Child theme
    // Args
    $args = array('remote_api_url' => 'http://wpjumpstart.com', 'item_name' => $theme_data->get('Name'));
    // Add admin page.
    $_tb_jumpstart_license_admin = new Theme_Blvd_License_Admin($args);
    // License Key
    $license_key = get_option('themeblvd_license_key');
    $license_key_status = get_option('themeblvd_license_key_status');
    // No license key or it isn't activated? Let's blow this joint.
    if (!$license_key || !$license_key_status) {
        return;
    }
    // Include EDD_SL_Theme_Updater class to check and administer updates.
    include_once TB_FRAMEWORK_DIRECTORY . '/admin/updates/class-edd-sl-theme-updater.php';
    // Adjust args for EDD_SL_Theme_Updater class.
    $args['license'] = $license_key;
    $args['author'] = 'Theme Blvd';
    // Run Updater.
    $_tb_jumpstart_edd_updater = new EDD_SL_Theme_Updater($args);
}
Пример #4
0
/**
 * Display a nag in the dashboard to alert the user that the framework is not a theme.
 *
 * @since 1.2.0
 */
function audiotheme_framework_not_a_theme_nag()
{
    $notice = '';
    $message_id = isset($_REQUEST['atmovemsg']) ? $_REQUEST['atmovemsg'] : '';
    $move_url = wp_nonce_url('themes.php', 'audiotheme-theme-to-plugin');
    switch ($message_id) {
        case 'plugin-exists':
            if (!is_multisite() && current_user_can('delete_themes')) {
                $stylesheet = get_template();
                $delete_link = sprintf(__('You should <a href="%s">delete the theme</a> and activate as a plugin instead.', 'audiotheme'), wp_nonce_url('themes.php?action=delete&amp;stylesheet=' . urlencode($stylesheet), 'delete-theme_' . $stylesheet));
            }
            $notice = __('The AudioTheme framework appears to already exist as a plugin.', 'audiotheme');
            $notice .= empty($delete_link) ? '' : ' ' . $delete_link;
            break;
        case 'move-failed':
            $notice = __('The AudioTheme framework could not be moved to your plugins folder automatically. You should move it manually.', 'audiotheme');
            break;
        default:
            $notice = __('<strong>The AudioTheme framework is not a theme.</strong> It should be installed as a plugin.', 'audiotheme');
            $notice .= current_user_can('install_plugins') ? sprintf(' <a href="%s">%s</a>', esc_url($move_url), __('Would you like to move it now?', 'audiotheme')) : '';
    }
    if (!empty($notice)) {
        ?>
		<div class="error">
			<p><?php 
        echo $notice;
        ?>
</p>
		</div>
		<?php 
    }
}
Пример #5
0
function title_button_new_plugin($title)
{
    if (IS_CHILD && get_template() == 'runway-framework' && $_GET['page'] == 'plugin-installer') {
        $title .= ' <a href="' . admin_url('admin.php?page=plugin-installer&navigation=add-plugin') . '" class="add-new-h2">' . __('Add New', 'framework') . '</a> ';
    }
    return $title;
}
Пример #6
0
/**
 * Returns a link to the parent theme URI.
 *
 * @since  2.0.0
 * @access public
 * @return string
 */
function hybrid_get_theme_link()
{
    $theme = wp_get_theme(get_template());
    $allowed = array('abbr' => array('title' => true), 'acronym' => array('title' => true), 'code' => true, 'em' => true, 'strong' => true);
    // Note: URI is escaped via `WP_Theme::markup_header()`.
    return sprintf('<a class="theme-link" href="%s">%s</a>', $theme->display('ThemeURI'), wp_kses($theme->display('Name'), $allowed));
}
Пример #7
0
 /**
  * Whether the theme is active.
  *
  * @since 1.0.0
  *
  * @return boolean
  */
 public function is_active()
 {
     if (is_multisite()) {
         return false;
     }
     return get_stylesheet() === $this->get_slug() || get_template() === $this->get_slug();
 }
Пример #8
0
function Include_my_php($params = array())
{
    extract(shortcode_atts(array('file' => 'default'), $params));
    ob_start();
    include get_theme_root() . '/' . get_template() . "/{$file}.php";
    return ob_get_clean();
}
Пример #9
0
function get_template_url()
{
    $template = get_template();
    $tpl_root_uri = site_url('data/templates');
    $template_dir_uri = "{$tpl_root_uri}/{$template}";
    return $template_dir_uri;
}
Пример #10
0
 function activate()
 {
     // Add the stub widget removal plugin
     $plugins = (array) get_option('active_plugins');
     $plugins[] = '../themes/' . get_template() . '/app/includes/widgets-removal.php';
     update_option('active_plugins', $plugins);
 }
Пример #11
0
 protected function __construct()
 {
     // WordPress Importer
     add_action('init', array(&$this, 'maybe_wordpress_importer'));
     // YARPP
     // just makes YARPP aware of the language taxonomy (after Polylang registered it)
     add_action('init', create_function('', "\$GLOBALS['wp_taxonomies']['language']->yarpp_support = 1;"), 20);
     // Yoast SEO
     add_action('pll_language_defined', array(&$this, 'wpseo_init'));
     // Custom field template
     add_action('add_meta_boxes', array(&$this, 'cft_copy'), 10, 2);
     // Aqua Resizer
     add_filter('pll_home_url_black_list', create_function('$arr', "return array_merge(\$arr, array(array('function' => 'aq_resize')));"));
     // Twenty Fourteen
     if ('twentyfourteen' == get_template()) {
         add_filter('transient_featured_content_ids', array(&$this, 'twenty_fourteen_featured_content_ids'));
         add_filter('option_featured-content', array(&$this, 'twenty_fourteen_option_featured_content'));
     }
     // Jetpack 3
     add_action('jetpack_widget_get_top_posts', array(&$this, 'jetpack_widget_get_top_posts'), 10, 3);
     add_filter('grunion_contact_form_field_html', array(&$this, 'grunion_contact_form_field_html_filter'), 10, 3);
     add_filter('jetpack_open_graph_tags', array(&$this, 'jetpack_ogp'));
     // Jetpack infinite scroll
     if (!defined('PLL_AJAX_ON_FRONT') && isset($_GET['infinity'], $_POST['action']) && 'infinite_scroll' == $_POST['action']) {
         define('PLL_AJAX_ON_FRONT', true);
     }
 }
Пример #12
0
 /**
  * Defines the constant paths for use within the core theme, parent theme, and child theme.
  *
  * @since 1.0.0
  */
 public function constants()
 {
     /**
      * Fires before definitions the constant.
      *
      * @since 1.0.0
      */
     do_action('cherry_constants_before');
     global $content_width;
     $template = get_template();
     $theme_obj = wp_get_theme($template);
     /** Sets the theme version number. */
     define('KING_NEWS_THEME_VERSION', $theme_obj->get('Version'));
     /** Sets the path to the theme directory. */
     define('KING_NEWS_THEME_DIR', get_template_directory());
     /** Sets the path to the theme directory URI. */
     define('KING_NEWS_THEME_URI', get_template_directory_uri());
     /** Sets the path to the core framework directory. */
     define('CHERRY_DIR', trailingslashit(KING_NEWS_THEME_DIR) . 'cherry-framework');
     /** Sets the path to the core framework directory URI. */
     define('CHERRY_URI', trailingslashit(KING_NEWS_THEME_URI) . 'cherry-framework');
     // Sets the content width in pixels, based on the theme's design and stylesheet.
     if (!isset($content_width)) {
         $content_width = 710;
     }
 }
Пример #13
0
 /**
  * Enqueue custom CSS
  *
  * @return void
  */
 function enqueue_css()
 {
     if (!file_exists($this->get_dir() . $this->file)) {
         return;
     }
     wp_enqueue_style(get_template() . '-custom-css', $this->get_dir(false) . $this->file, '', constructent_option('last_saved'));
 }
Пример #14
0
 public static function ktz_definitions()
 {
     /* 
      * Get slug for kentooz framework look @ define( 'ktz_theme_textdomain', ktz_theme_slug );
      */
     define('ktz_theme_slug', get_template());
     /* 
      * Retrieves the absolute path to the directory of the current theme, without the trailing slash.
      * ktz or kentooz use directory /includes for all function
      */
     define('ktz_dir', get_template_directory() . '/');
     define('ktz_inc', get_template_directory() . '/includes/');
     /* 
      * Retrieve template directory URI for the current theme. Checks for SSL.
      * Note: Does not return a trailing slash following the directory address. 
      * This can use path for JS, stylesheet, or image
      * ktz or kentooz use directory /includes for all function
      */
     define('ktz_url', get_template_directory_uri() . '/');
     define('ktz_styleinc', get_template_directory_uri() . '/includes/');
     /* 
      * Get locale or translating for kentooz framework
      */
     define('ktz_theme_textdomain', ktz_theme_slug);
 }
    /**
     * Activate admin notice
     */
    public function activate_demo_extension_admin_notice()
    {
        global $blog_id;
        $themes = wp_get_themes($blog_id);
        if ('layerswp' !== get_template()) {
            ?>
				<div class="updated is-dismissible error">
					<p><?php 
            _e(sprintf("Layers is required to use the Demo Extension. <a href=\"%s\" target=\"_blank\">Click here</a> to get it.", isset($themes['layerswp']) ? admin_url('themes.php?s=layerswp') : "http://www.layerswp.com"), LAYERS_DEMO_EXTENSION_SLUG);
            ?>
</p>
				</div>
			<?php 
        } else {
            if (FALSE !== $this->update_required) {
                ?>
				<div class="updated is-dismissible error">
					<p><?php 
                _e(sprintf("Demo Extension requires Layers Version " . $this->update_required . ". <a href=\"%s\" target=\"_blank\">Click here</a> to get the Layers Updater.", "http://www.layerswp.com/download/layers-updater"), LAYERS_DEMO_EXTENSION_SLUG);
                ?>
</p>
				</div>
		<?php 
            }
        }
    }
Пример #16
0
 /**
  * Constructor
  *
  * @since 1.0
  */
 protected function __construct()
 {
     // WordPress Importer
     add_action('init', array(&$this, 'maybe_wordpress_importer'));
     add_filter('wp_import_terms', array(&$this, 'wp_import_terms'));
     // YARPP
     add_action('init', array(&$this, 'yarpp_init'));
     // after Polylang has registered its taxonomy in setup_theme
     // Yoast SEO
     add_action('pll_language_defined', array(&$this, 'wpseo_init'));
     // Custom field template
     add_action('add_meta_boxes', array(&$this, 'cft_copy'), 10, 2);
     // Aqua Resizer
     add_filter('pll_home_url_black_list', array(&$this, 'aq_home_url_black_list'));
     // Twenty Fourteen
     if ('twentyfourteen' == get_template()) {
         add_filter('transient_featured_content_ids', array(&$this, 'twenty_fourteen_featured_content_ids'));
         add_filter('option_featured-content', array(&$this, 'twenty_fourteen_option_featured_content'));
     }
     // Duplicate post
     add_filter('option_duplicate_post_taxonomies_blacklist', array(&$this, 'duplicate_post_taxonomies_blacklist'));
     // Jetpack 3
     add_action('jetpack_widget_get_top_posts', array(&$this, 'jetpack_widget_get_top_posts'), 10, 3);
     add_filter('grunion_contact_form_field_html', array(&$this, 'grunion_contact_form_field_html_filter'), 10, 3);
     add_filter('jetpack_open_graph_tags', array(&$this, 'jetpack_ogp'));
     add_filter('jetpack_relatedposts_filter_filters', array(&$this, 'jetpack_relatedposts_filter_filters'), 10, 2);
     // Jetpack infinite scroll
     if (!defined('PLL_AJAX_ON_FRONT') && isset($_GET['infinity'], $_POST['action']) && 'infinite_scroll' == $_POST['action']) {
         define('PLL_AJAX_ON_FRONT', true);
     }
 }
function pugpig_get_theme_manifest()
{
    $theme_name = get_option("pugpig_opt_theme_switch");
    if (!isset($theme_name) || $theme_name == '') {
        $theme_name = get_template();
    }
    $theme_dir = get_theme_root();
    $theme_url = get_theme_root_uri();
    if (!is_dir($theme_dir . "/{$theme_name}") && $theme_name != '') {
        echo "ERROR: Invalid theme name: {$theme_name}";
        exit;
    }
    $theme_path = pugpig_strip_domain($theme_url . "/" . $theme_name);
    $theme_dir = $theme_dir . "/" . $theme_name . "/";
    $output = pugpig_theme_manifest_string($theme_path, $theme_dir, $theme_name);
    if (is_child_theme()) {
        $output .= "\n# Child Theme Assets\n";
        $theme_name = get_stylesheet();
        $theme_dir = get_theme_root();
        if (!is_dir($theme_dir . "/{$theme_name}") && $theme_name != '') {
            echo "ERROR: Invalid child theme name: {$theme_name}";
            exit;
        }
        $theme_path = pugpig_strip_domain($theme_url . "/" . $theme_name);
        $theme_dir = $theme_dir . "/" . $theme_name . "/";
        $output .= pugpig_theme_manifest_string($theme_path, $theme_dir, $theme_name);
    }
    return $output;
}
 /**
  * Load the credits functionality.
  *
  * @since 1.0.0
  */
 public function register_hooks()
 {
     $filter = sprintf('%s_credits', str_replace('/src', '', get_template()));
     add_filter($filter, array($this, 'credits_text'), 1000);
     add_filter('footer_credits', array($this, 'credits_text'), 1000);
     add_action('customize_register', array($this, 'customize_register'), 20);
 }
Пример #19
0
function main($args)
{
    //input sanity check
    if (!is_array($args) || is_array($args) && !array_key_exists('name', $args)) {
        print_help(true);
    }
    $migration_name = $args['name'];
    //clear any filesystem stats cache
    clearstatcache();
    //check to make sure our migration directory exists
    if (!is_dir(MIGRATION_DIR)) {
        die_with_error("ERROR: migration directory '" . MIGRATION_DIR . "' does not exist. Specify MIGRATION_DIR in config/config.inc.php and try again.");
    }
    //generate a complete complete
    $highest_version = VersionUtil::get_highest_migration(MIGRATION_DIR);
    $next_version = VersionUtil::to_migration_number($highest_version + 1);
    $klass = NamingUtil::camelcase($migration_name);
    $file_name = $next_version . '_' . $klass . '.php';
    $full_path = realpath(MIGRATION_DIR) . '/' . $file_name;
    $template_str = get_template($klass);
    //check to make sure our destination directory is writable
    if (!is_writable(MIGRATION_DIR . '/')) {
        die_with_error("ERROR: migration directory '" . MIGRATION_DIR . "' is not writable by the current user. Check permissions and try again.");
    }
    //write it out!
    $file_result = file_put_contents($full_path, $template_str);
    if ($file_result === FALSE) {
        die_with_error("Error writing to migrations directory/file. Do you have sufficient privileges?");
    } else {
        echo "\nCreated migration: {$file_name}\n\n";
    }
}
Пример #20
0
/**
 * Compare two version numbers.
 *
 * This function abstracts the logic for determining the current version
 * number for various packages, so the only version number that needs to be
 * known is the one to compare against.
 *
 * Basically serves as a wrapper for the native PHP version_compare()
 * function, but allows a known package to be passed as the first parameter.
 *
 * @since 1.0.0
 * @see PHP docs for version_compare()
 * @uses version_compare()
 *
 * @param string $version A package identifier or version number to compare against.
 * @param string $version2 The version number to compare to.
 * @param string $operator Optional. Relationship to test. <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne
 * @return mixed True or false if operator is supplied. -1, 0, or 1 if operator is empty.
 */
function audiotheme_version_compare($version, $version2, $operator = null)
{
    switch ($version) {
        case 'audiotheme':
            $version = AUDIOTHEME_VERSION;
            break;
        case 'php':
            $version = phpversion();
            break;
        case 'stylesheet':
            // Child theme if it exists, otherwise same as template.
            $theme = wp_get_theme();
            $version = $theme->get('Version');
            break;
        case 'template':
            // Parent theme.
            $theme = wp_get_theme(get_template());
            $version = $theme->get('Version');
            break;
        case 'wp':
            $version = get_bloginfo('version');
            break;
    }
    return version_compare($version, $version2, $operator);
}
Пример #21
0
 function _init()
 {
     // Something has changed the template, I'm guessing an alternative theme for mobile scenarios.
     if (get_template() != get_option('template')) {
         return;
     }
     $this->add_moderator_role();
     // If we're requesting ajax stuff we'll hand over control to spec ajax then die.
     if (isset($_REQUEST['_spec_ajax'])) {
         new spectacula_ajax();
     }
     $this->comment_moderation_calls();
     add_filter('body_class', array($this, 'get_agent_body_class'));
     add_action('wp_head', array($this, 'css'));
     add_action('wp', array($this, 'before_headers'));
     add_action('comment_form', array($this, 'our_credit'));
     add_filter('comments_template', array($this, 'comment_template_hijack'));
     // The live comment toggle metabox. Lets you toggle live comments on
     // a post by post basis.
     add_action('admin_init', array($this, 'add_meta_boxes'));
     add_action('save_post', array($this, 'save_metabox_toggle_status'), 100, 2);
     add_filter('comments_array', array($this, 'comment_query_hijack'));
     // Make sure the stylesheet has the correct schema
     add_filter('spec_comment_css', array($this, 'set_stylesheet_schema'), 1000);
 }
/**
 * Load theme compat file if it exists.
 */
function jetpack_load_theme_compat()
{
    /**
     * Filter theme compat files.
     *
     * Themes can add their own compat files here if they like. For example:
     *
     * add_filter( 'jetpack_theme_compat_files', 'mytheme_jetpack_compat_file' );
     * function mytheme_jetpack_compat_file( $files ) {
     *     $files['mytheme'] = locate_template( 'jetpack-compat.php' );
     *     return $files;
     * }
     *
     * @module theme-tools
     *
     * @since 2.8.0
     *
     * @param array Associative array of theme compat files to load.
     */
    $compat_files = apply_filters('jetpack_theme_compat_files', array('twentyfourteen' => JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentyfourteen.php', 'twentyfifteen' => JETPACK__PLUGIN_DIR . 'modules/theme-tools/compat/twentyfifteen.php'));
    _jetpack_require_compat_file(get_stylesheet(), $compat_files);
    if (is_child_theme()) {
        _jetpack_require_compat_file(get_template(), $compat_files);
    }
}
Пример #23
0
function importend()
{
    global $wpdb, $shortname;
    #make custom fields image paths point to sampledata/sample_images folder
    $sample_images_postmeta = $wpdb->get_results($wpdb->prepare("SELECT meta_id, meta_value FROM {$wpdb->postmeta} WHERE meta_value REGEXP %s", 'http://et_sample_images.com'));
    if ($sample_images_postmeta) {
        foreach ($sample_images_postmeta as $postmeta) {
            $template_dir = get_template_directory_uri();
            if (is_multisite()) {
                switch_to_blog(1);
                $main_siteurl = site_url();
                restore_current_blog();
                $template_dir = $main_siteurl . '/wp-content/themes/' . get_template();
            }
            preg_match('/http:\\/\\/et_sample_images.com\\/([^.]+).jpg/', $postmeta->meta_value, $matches);
            $image_path = $matches[1];
            $local_image = preg_replace('/http:\\/\\/et_sample_images.com\\/([^.]+).jpg/', $template_dir . '/sampledata/sample_images/$1.jpg', $postmeta->meta_value);
            $local_image = preg_replace('/s:55:/', 's:' . strlen($template_dir . '/sampledata/sample_images/' . $image_path . '.jpg') . ':', $local_image);
            $wpdb->update($wpdb->postmeta, array('meta_value' => esc_url_raw($local_image)), array('meta_id' => $postmeta->meta_id), array('%s'));
        }
    }
    if (!isset($_POST['importepanel'])) {
        return;
    }
    $importedOptions = array($shortname . '_logo' => '', $shortname . '_favicon' => '', $shortname . '_bgcolor' => '', $shortname . '_bgtexture_url' => 'Default', $shortname . '_bgimage' => '', $shortname . '_header_font' => 'Kreon', $shortname . '_header_font_color' => '', $shortname . '_body_font' => 'Droid Sans', $shortname . '_body_font_color' => '', $shortname . '_show_twitter_icon' => 'on', $shortname . '_show_rss_icon' => 'on', $shortname . '_show_facebook_icon' => 'on', $shortname . '_twitter_url' => '#', $shortname . '_rss_url' => '', $shortname . '_facebook_url' => '#', $shortname . '_catnum_posts' => '6', $shortname . '_archivenum_posts' => '5', $shortname . '_searchnum_posts' => '5', $shortname . '_tagnum_posts' => '5', $shortname . '_date_format' => 'M j, Y', $shortname . '_new_thumb_method' => 'on', $shortname . '_show_control_panel' => 'on', $shortname . '_display_blurbs' => 'on', $shortname . '_display_media' => 'on', $shortname . '_quote' => 'on', $shortname . '_quote_one' => 'Chameleon is an extremely versatile theme with a myriad of options and styles', $shortname . '_quote_two' => 'Aliquam venenatis enim in mi iaculis in tempor lectus tempor et convallis erat pellentesque', $shortname . '_home_page_1' => 'About', $shortname . '_home_page_2' => 'What I Do', $shortname . '_home_page_3' => 'Who I Am', $shortname . '_posts_media' => '10', $shortname . '_exlcats_media' => array(13), $shortname . '_homepage_posts' => '7', $shortname . '_featured' => 'on', $shortname . '_duplicate' => 'on', $shortname . '_slider_type' => 'cycle', $shortname . '_feat_cat' => 'Featured', $shortname . '_featured_num' => '3', $shortname . '_slider_autospeed' => '7000', $shortname . '_menupages' => array(724), $shortname . '_enable_dropdowns' => 'on', $shortname . '_home_link' => 'on', $shortname . '_sort_pages' => 'post_title', $shortname . '_order_page' => 'asc', $shortname . '_tiers_shown_pages' => '3', $shortname . '_menucats' => array(14, 15, 1), $shortname . '_enable_dropdowns_categories' => 'on', $shortname . '_categories_empty' => 'on', $shortname . '_tiers_shown_categories' => '3', $shortname . '_sort_cat' => 'name', $shortname . '_order_cat' => 'asc', $shortname . '_postinfo2' => array('author', 'date', 'categories', 'comments'), $shortname . '_thumbnails' => 'on', $shortname . '_show_postcomments' => 'on', $shortname . '_postinfo1' => array('author', 'date', 'categories', 'comments'), $shortname . '_thumbnails_index' => 'on', $shortname . '_child_cssurl' => '', $shortname . '_color_mainfont' => '', $shortname . '_color_mainlink' => '', $shortname . '_color_pagelink' => '', $shortname . '_color_pagelink_active' => '', $shortname . '_color_headings' => '', $shortname . '_color_sidebar_links' => '', $shortname . '_footer_text' => '', $shortname . '_color_footerlinks' => '', $shortname . '_seo_home_titletext' => '', $shortname . '_seo_home_descriptiontext' => '', $shortname . '_seo_home_keywordstext' => '', $shortname . '_seo_home_type' => 'BlogName | Blog description', $shortname . '_seo_home_separate' => ' | ', $shortname . '_seo_single_field_title' => 'seo_title', $shortname . '_seo_single_field_description' => 'seo_description', $shortname . '_seo_single_field_keywords' => 'seo_keywords', $shortname . '_seo_single_type' => 'Post title | BlogName', $shortname . '_seo_single_separate' => ' | ', $shortname . '_seo_index_type' => 'Category name | BlogName', $shortname . '_seo_index_separate' => ' | ', $shortname . '_integrate_header_enable' => 'on', $shortname . '_integrate_body_enable' => 'on', $shortname . '_integrate_singletop_enable' => 'on', $shortname . '_integrate_singlebottom_enable' => 'on', $shortname . '_integration_head' => '', $shortname . '_integration_body' => '', $shortname . '_integration_single_top' => '', $shortname . '_integration_single_bottom' => '', $shortname . '_468_image' => '', $shortname . '_468_url' => '', $shortname . '_468_adsense' => '');
    foreach ($importedOptions as $key => $value) {
        if ($value != '') {
            update_option($key, $value);
        }
    }
    update_option($shortname . '_use_pages', 'false');
}
Пример #24
0
function render_vista($html, $data)
{
    global $diccionario;
    $template = get_template($html);
    $html = render_dinamico($template, $diccionario["form_actions"]);
    print $html;
}
Пример #25
0
    function devtheme_load_styles()
    {
        global $theme_version, $bp_existed;
        wp_enqueue_style('dev-base', get_template_directory_uri() . '/lib/css/base.css', array(), $theme_version);
        if ($bp_existed) {
            wp_enqueue_style('dev-bp-base', get_template_directory_uri() . '/_inc/css/bp-default.css', array('dev-base'), $theme_version);
            wp_enqueue_style('dev-bp-css', get_template_directory_uri() . '/lib/css/bp-css.css', array('dev-base'), $theme_version);
            wp_enqueue_style('dev-bp-adminbar', get_template_directory_uri() . '/_inc/css/adminbar.css', array('dev-base'), $theme_version);
        }
        /*if( is_rtl() ):
        wp_enqueue_style( 'dev-rtl', get_template_directory_uri() . '/lib/css/rtl.css', array( 'dev-base' ), $theme_version );
        endif;*/
        if (file_exists(TEMPLATEPATH . '/lib/css/custom.css')) {
            wp_enqueue_style('dev-custom', get_template_directory_uri() . '/lib/css/custom.css', array('dev-base'), $theme_version);
        }
        // If the current theme is a child theme, enqueue its stylesheet
        if (is_child_theme() && 'wpmu-nelo' == get_template()) {
            if (file_exists(STYLESHEETPATH . '/lib/css/child-style.css')) {
                wp_enqueue_style('dev-base-child', get_stylesheet_directory_uri() . '/lib/css/child-style.css', array('dev-base'), $theme_version);
            }
        }
        ?>

<?php 
    }
Пример #26
0
/**
 * Function for getting an array of available custom templates with a specific header. Ideally, this function 
 * would be used to grab custom singular post (any post type) templates.  It is a recreation of the WordPress
 * page templates function because it doesn't allow for other types of templates.
 *
 * @since 0.7.0
 * @param string $post_type The name of the post type to get templates for.
 * @return array $post_templates The array of templates.
 */
function hybrid_get_post_templates($post_type = 'post')
{
    /* Set up an empty post templates array. */
    $post_templates = array();
    /* Get the post type object. */
    $post_type_object = get_post_type_object($post_type);
    /* Get the theme (parent theme if using a child theme) object. */
    $theme = wp_get_theme(get_template(), get_theme_root(get_template_directory()));
    /* Get the theme PHP files one level deep. */
    $files = (array) $theme->get_files('php', 1);
    /* If a child theme is active, get its files and merge with the parent theme files. */
    if (is_child_theme()) {
        $child = wp_get_theme(get_stylesheet(), get_theme_root(get_stylesheet_directory()));
        $child_files = (array) $child->get_files('php', 1);
        $files = array_merge($files, $child_files);
    }
    /* Loop through each of the PHP files and check if they are post templates. */
    foreach ($files as $file => $path) {
        /* Get file data based on the post type singular name (e.g., "Post Template", "Book Template", etc.). */
        $headers = get_file_data($path, array("{$post_type_object->name} Template" => "{$post_type_object->name} Template"));
        /* Continue loop if the header is empty. */
        if (empty($headers["{$post_type_object->name} Template"])) {
            continue;
        }
        /* Add the PHP filename and template name to the array. */
        $post_templates[$file] = $headers["{$post_type_object->name} Template"];
    }
    /* Return array of post templates. */
    return array_flip($post_templates);
}
Пример #27
0
function dtheme_startup()
{
    global $dt_revealData, $krypton_Scripts, $krypton_config;
    $dt_revealData = array();
    $krypton_Scripts = array();
    $theme_name = get_template();
    $locale = get_locale();
    $localelanguage = get_template_directory() . '/languages';
    if (is_child_theme() && !load_textdomain('Krypton', untrailingslashit(get_stylesheet_directory()) . "/{$locale}.mo") || !is_child_theme() && !load_theme_textdomain('Krypton', get_template_directory())) {
        $aaa = load_theme_textdomain('Krypton', $localelanguage);
    }
    // Add post thumbnail supports. http://codex.wordpress.org/Post_Thumbnails
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_theme_support('menus');
    add_theme_support('woocommerce');
    add_theme_support('title-tag');
    register_nav_menus(array('primary' => __('Top Navigation', 'Krypton'), 'footer_navigation' => __('Footer Navigation', 'Krypton')));
    // sidebar widget
    register_sidebar(array('name' => 'Sidebar', 'id' => 'krypton-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Bottom Widget', 'id' => 'krypton-bottom', 'description' => __('Bottom Widget Area. Recomended 3 widgets', 'Krypton'), 'before_widget' => '<div class="col-lg-4 col-md-4 col-sm-4 clearfix"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="row"><div class="section-head"><header class="col col-sm-12 centered"><h2>', 'after_title' => '</h2><hr></header></div></div>'));
    register_sidebar(array('name' => 'Contact Page Sidebar', 'id' => 'krypton-contact-sidebar', 'description' => __('Widget area for contact page', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    if (is_plugin_active('woocommerce/woocommerce.php')) {
        register_sidebar(array('name' => 'Shop Sidebar', 'id' => 'shop-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
        register_sidebar(array('name' => 'Shop Bottom ', 'id' => 'shop-bottom', 'description' => __('Shop Bottom Widget Area. Displayed at shop pages', 'Krypton'), 'before_widget' => '<div class="col-md-3 col-sm-6"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
    }
    add_action('wp_enqueue_scripts', 'dt_enqueue_color_scheme');
    add_action('wp_enqueue_scripts', 'dtheme_scripts', 999);
    add_action('wp_print_scripts', 'dtheme_register_var', 998);
    add_action('wp_print_scripts', 'detheme_print_inline_style');
    add_action('wp_footer', 'dtheme_register_mainmenu', 997);
    add_action('wp_enqueue_scripts', 'dtheme_css_style', 999);
    add_action('wp_footer', create_function('', 'global $krypton_Scripts;if(count($krypton_Scripts)) print "<script type=\\"text/javascript\\">\\n".@implode("\\n",$krypton_Scripts)."\\n</script>\\n";'), 99998);
}
Пример #28
0
/**
 * Returns an array of the available styles for use in themes.
 *
 * @since 1.0.0
 * @access public
 * @return array
 */
function hoot_get_styles()
{
    /* Initialize */
    $styles = array();
    /* If a child theme is active, add the parent theme's style. */
    if (is_child_theme()) {
        $parent = wp_get_theme(get_template());
        /* Get the parent theme stylesheet (if a '.min' version of the stylesheet exists, use it) */
        if (defined('HOOT_DEBUG')) {
            $loadminified = HOOT_DEBUG ? false : true;
        } else {
            $loadminified = hoot_get_mod('load_minified', 0);
        }
        $suffix = $loadminified ? '.min' : '';
        if (!empty($suffix) && file_exists(trailingslashit(THEME_DIR) . "style{$suffix}.css")) {
            $src = trailingslashit(THEME_URI) . "style{$suffix}.css";
        } else {
            $src = trailingslashit(THEME_URI) . "style.css";
        }
        $styles['parent'] = array('src' => $src, 'version' => $parent->get('Version'));
    }
    /* Add the active theme style. */
    $styles['style'] = array('src' => get_stylesheet_uri(), 'version' => wp_get_theme()->get('Version'));
    /* Return the array of styles. */
    return apply_filters('hoot_styles', $styles);
}
Пример #29
0
/**
 * Defines and returns a prefix.
 * 
 * @access public
 * @return void
 */
function pls_get_prefix()
{
    global $placester_blueprint;
    if (empty($placester_blueprint['prefix'])) {
        $placester_blueprint['prefix'] = apply_filters('pls_prefix', get_template());
    }
    return $placester_blueprint['prefix'];
}
Пример #30
0
 function nice_constants()
 {
     define('NICE_TPL_DIR', get_template_directory_uri());
     define('NICE_TPL_PATH', get_theme_root() . '/' . get_template());
     define('NICE_PREFIX', 'nice');
     define('NICE_FRAMEWORK_VERSION', '1.1.5');
     define('NICE_UPDATES_URL', 'http://updates.nicethemes.com');
 }