/** * version_newer_than() - Returns true if current version is greater than given version. * * @since 2.0.3 * @deprecated 2.3 * @param mixed $version * @return boolean */ function version_newer_than($version) { _deprecated_function(__FUNCTION__, '2.3'); $version = version_to_integer($version); $current = version_to_integer(theme_version('current')); if ($version && $current) { return (bool) ($current > $version); } }
/** * add_version_to_styles() - Adds version number to style links. * * This makes browsers re-download the CSS file when the version * number changes, reducing problems that may occur when markup * changes but the corresponding new CSS is not downloaded. * @since 2.0.1 * @see tarski_stylesheets() * @param array $style_array * @return array $style_array */ function add_version_to_styles($style_array) { if (check_input($style_array, 'array')) { foreach ($style_array as $type => $values) { if (is_array($values) && $values['url']) { $style_array[$type]['url'] .= '?v=' . theme_version(); } } } return $style_array; }
/** * Generate meta elements pertaining to Tarski and the site. * * @hook filter tarski_asset_meta * Filters the metadata generated by the TarskiAsset wrapper. */ function meta() { $themeversion = theme_version(); $meta = array("<meta name=\"wp_theme\" content=\"Tarski {$themeversion}\" />"); global $wp_query; $excerpt = trim(strip_tags(wp_specialchars($wp_query->post->post_excerpt))); if ((is_single() || is_page()) && strlen($excerpt)) { $description = $excerpt; } else { $description = trim(strip_tags(wp_specialchars(get_bloginfo('description')))); } if (strlen($description)) { $meta[] = sprintf('<meta name="description" content="%s" />', wptexturize($description)); } if (get_option('blog_public') != '0') { $meta[] = '<meta name="robots" content="all" />'; } $this->meta = apply_filters('tarski_asset_meta', $meta); }
/** * tarski_options_defaults() - Sets Options object's properties to their default values. * * @since 2.0 */ function tarski_options_defaults() { $this->installed = theme_version('current'); $this->update_notification = true; $this->sidebar_pp_type = 'main'; $this->header = 'greytree.jpg'; $this->display_title = true; $this->display_tagline = true; $this->nav_pages = false; $this->collapsed_pages = ''; $this->home_link_name = __('Home', 'tarski'); $this->nav_extlinkcat = 0; $this->style = false; $this->asidescategory = 0; $this->centred_theme = true; $this->swap_sides = false; $this->swap_title_order = false; $this->tags_everywhere = true; $this->show_categories = true; $this->show_authors = true; $this->use_pages = true; }
<div id="admin-wrapper"> <div id="header-left"> <img src="<?php bloginfo('template_directory'); ?> /admin/images/ph-logo.gif" align="absmiddle" /> <a id="view-theme" class="iframe" href="<?php bloginfo('wpurl'); ?> " style="text-decoration:none;" /><input type="button" class="button" value="View Theme" /></a> </div> <div id="header-right"> <?php theme_version(); ?> </div> <form name="ecommerce-options" id="ecommerce-options" method="post"> <div id="container"> <div class="options">E-Commerce Settings</div> <div class="option-content"> <div id="option-container"> <div class="left" style="width:99%">
/** * function tarski_upgrade() - Upgrades Tarski's options where appropriate. * * Tarski preferences sometimes change between versions, and need to * be updated. This function does not determine whether an update is * needed, it merely perfoms it. It's also self-contained, so it * won't update the global $tarski_options object either. * @since 2.1 * @uses tarski_upgrade_special() * @uses tarski_upgrade_widgets() */ function tarski_upgrade() { // Get existing options $options = new Options(); $options->tarski_options_get(); // Get our defaults, so we can merge them in $defaults = new Options(); $defaults->tarski_options_defaults(); // Update the options version so we don't run this code more than once $options->installed = theme_version('current'); // Handle special cases first tarski_upgrade_special($options, $defaults); // Upgrade old display options to use widgets instead tarski_upgrade_widgets($options, $defaults); // Conform our options to the expected values, types, and defaults foreach ($options as $name => $value) { if (!isset($defaults->{$name})) { // Get rid of options which no longer exist unset($options->{$name}); } elseif (!isset($options->{$name})) { // Use the default if we don't have this option $options->{$name} = $defaults->{$name}; } elseif (is_array($options->{$name}) && !is_array($defaults->{$name})) { // If our option is an array and the default is not, implode using " " as a separator $options->{$name} = implode(" ", $options->{$name}); } elseif (!is_array($options->{$name}) && is_array($defaults->{$name})) { // If our option is a scalar and the default is an array, wrap our option in an array $options->{$name} = array($options->{$name}); } } // Save our upgraded options update_option('tarski_options', $options); }