本文整理汇总了PHP中get_theme_data函数的典型用法代码示例。如果您正苦于以下问题:PHP get_theme_data函数的具体用法?PHP get_theme_data怎么用?PHP get_theme_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_theme_data函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
*/
function __construct()
{
global $blog_id, $wpdb;
$pts = array();
foreach (get_post_types(array('public' => true)) as $pt) {
$count = wp_count_posts($pt);
$pts[$pt] = $count->publish;
}
$comments_count = wp_count_comments();
// wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
if (function_exists('wp_get_theme')) {
$theme_data = wp_get_theme();
$theme = array('name' => $theme_data->display('Name', false, false), 'theme_uri' => $theme_data->display('ThemeURI', false, false), 'version' => $theme_data->display('Version', false, false), 'author' => $theme_data->display('Author', false, false), 'author_uri' => $theme_data->display('AuthorURI', false, false));
} else {
$theme_data = (object) get_theme_data(get_stylesheet_directory() . '/style.css');
$theme = array('version' => $theme_data->Version, 'name' => $theme_data->Name, 'author' => $theme_data->Author, 'template' => $theme_data->Template);
}
$plugins = array();
foreach (get_option('active_plugins') as $plugin_path) {
if (!function_exists('get_plugin_data')) {
require_once ABSPATH . 'wp-admin/includes/admin.php';
}
$plugin_info = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_path);
$slug = str_replace('/' . basename($plugin_path), '', $plugin_path);
$plugins[$slug] = array('version' => $plugin_info['Version'], 'name' => $plugin_info['Name'], 'plugin_uri' => $plugin_info['PluginURI'], 'author' => $plugin_info['AuthorName'], 'author_uri' => $plugin_info['AuthorURI']);
}
$data = array('site' => array('hash' => site_url(), 'version' => get_bloginfo('version'), 'multisite' => is_multisite(), 'users' => $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->users} INNER JOIN {$wpdb->usermeta} ON ({$wpdb->users}.ID = {$wpdb->usermeta}.user_id) WHERE 1 = 1 AND ( {$wpdb->usermeta}.meta_key = %s )", 'wp_' . $blog_id . '_capabilities')), 'lang' => get_locale()), 'theme' => $theme, 'plugins' => $plugins, 'email' => get_option('admin_email'), 'param' => 'class_tracking', 'action' => 'license_validator');
$url = get_option("gallery-bank-updation-check-url");
$response = wp_remote_post($url, array('method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => $data));
}
开发者ID:shellygraham,项目名称:livestock-framing,代码行数:33,代码来源:class-tracking.php
示例2: get_theme_intro
function get_theme_intro(){
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css');
define('THEMEDESC', $theme_data['Description']);
$intro = '<div class="admin_billboard fix"><div class="admin_theme_screenshot"><img class="" src="'.THEME_ROOT.'/screenshot.png" /></div>' .
'<div class="admin_billboard_content"><div class="admin_header"><h3 class="admin_header_main">Welcome to '.THEMENAME.'!</h3></div>'.
'<div class="admin_billboard_text" style="width:400px;">'.THEMEDESC.'</div>'.
'</div></div>'.
'<ul class="admin_feature_list">'.
'<li class="feature_settings"><div class="feature_icon"></div><strong>E-Panel Theme Configuration & Setup</strong> <p>This panel is where you will start the customization of your website. Any options applied through this interface will make changes to your website.</p></li>' .
'<li class="feature_requirements"><div class="feature_icon"></div><strong>Hosting Requirements</strong> <p>In order to get this theme up an running without problems, your host needs these requirements.</p>
<ul>
<li>MySQL 5+</li>
<li>PHP 5.2 or better</li>
<li>PHP cURL Library w/SSL support</li>
<li>PHP GD 2 Library</li>
</ul>
</li>'.
'</ul>'
;
return apply_filters('epanel_theme_intro', $intro);
}
开发者ID:robbiespire,项目名称:paQui,代码行数:25,代码来源:config.intro.php
示例3: upfw_generate_theme_data
function upfw_generate_theme_data()
{
$get_up_theme = get_theme_data(TEMPLATEPATH . '/style.css');
$theme_title = $get_up_theme['Title'];
$theme_shortname = strtolower(preg_replace('/ /', '_', $theme_title));
$theme_version = $get_up_theme['Version'];
$theme_template = $get_up_theme['Template'];
define('UPTHEMES_NAME', $theme_title);
define('TEMPLATENAME', $theme_title);
define('UPTHEMES_SHORT_NAME', $theme_shortname);
define('UPTHEMES_THEME_VER', $theme_version);
if (file_exists(TEMPLATEPATH . '/admin/admin.php')) {
define('THEME_PATH', TEMPLATEPATH);
define('THEME_DIR', get_template_directory_uri());
} elseif (file_exists(STYLESHEETPATH . '/admin/admin.php')) {
define('THEME_PATH', STYLESHEETPATH);
define('THEME_DIR', get_stylesheet_directory_uri());
}
// Detect child theme info
if (STYLESHEETPATH != TEMPLATEPATH) {
$get_up_theme = get_theme_data(STYLESHEETPATH . '/style.css');
$theme_title = $get_up_theme['Title'];
$theme_shortname = strtolower(preg_replace('/ /', '_', $theme_title));
$theme_version = $get_up_theme['Version'];
$theme_template = $get_up_theme['Template'];
define('CHILD_NAME', $theme_title);
define('CHILD_SHORT_NAME', $theme_shortname);
define('CHILD_THEME_VER', $theme_version);
define('CHILD_PATH', STYLESHEETPATH);
}
}
开发者ID:n1smo,项目名称:UpThemes-Framework,代码行数:31,代码来源:admin.php
示例4: avia_check_xml
public function avia_check_xml()
{
//get user ID to store user meta data
$this->set_user_id();
//let's check if we already downloaded the xml lately - if yes return because we don't need to download the update xml on every page load
$latestversiondata = get_transient('avia_theme_latest_version');
$updatecheckfailed = get_transient('avia_update_check_failed');
if (empty($latestversiondata) && empty($updatecheckfailed)) {
$xml = @simplexml_load_file($this->xmlurl);
if ($xml === false) {
$failed_to_load_xml = true;
//error - we couldn't load the file
} else {
//convert SimpleXML object back to xml to store the xml data into the database
$latestversiondata = $xml->asXML();
}
//set transient option - otherwise we'd check for an update everytime the user reloads the page
if (!empty($latestversiondata)) {
set_transient('avia_theme_latest_version', $latestversiondata, $this->check_for_update_interval);
} else {
if ($failed_to_load_xml) {
set_transient('avia_update_check_failed', $failed_to_load_xml, $this->check_for_update_interval);
}
}
} else {
if (!empty($updatecheckfailed)) {
return;
//stop here because we have no data (latest theme version number, etc.)
}
}
// get themedata version wp 3.4+
if (function_exists('wp_get_theme')) {
$theme = wp_get_theme();
if (is_child_theme()) {
$theme = wp_get_theme($theme->get('Template'));
}
$this->themeversion = $theme->get('Version');
} else {
//wp older than 3.4
$theme = get_theme_data(AVIA_BASE . 'style.css');
$this->themeversion = $theme['Version'];
}
//retrieve xml string from database and convert it back into a SimpleXML object
$this->latestversiondata = simplexml_load_string($latestversiondata);
if (!empty($this->latestversiondata) && !empty($this->latestversiondata->LatestVersion)) {
$this->latestversion = (string) $this->latestversiondata->LatestVersion->version;
}
if (!empty($this->themeversion) && !empty($this->latestversion)) {
//compare versions - version_compare() returns -1 if the first version is lower than the second, 0 if they are equal, and 1 if the second is lower.
if (version_compare($this->themeversion, $this->latestversion) < 0) {
add_action('admin_notices', array($this, 'avia_update_notice'));
} else {
//delete user meta otherwise user won't see a notice for the next update
delete_user_meta($this->userid, 'avia_ignore_update_message');
}
} else {
return;
//something went wrong - close the case
}
}
开发者ID:bluedrone,项目名称:plugins,代码行数:60,代码来源:class-update-notifier.php
示例5: my_t_define_constants
function my_t_define_constants()
{
if (!defined('MY_ISDEV')) {
define('MY_ISDEV', in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')));
}
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!defined('EOL')) {
define('EOL', PHP_EOL);
}
define('MY_ISADMIN', is_admin() or basename($_SERVER['PHP_SELF'], '.php') == 'wp-login');
// based on CI
define('MY_BASEFILE', __FILE__);
define('MY_BASEPATH', realpath(dirname(MY_BASEFILE)));
// better than TEMPLATEPATH
define('MY_BASEURL', get_bloginfo('template_directory'));
define('MY_APPPATH', MY_BASEPATH . DS . 'library');
// update WP
add_filter('theme_root', create_function('$path', 'return MY_BASEPATH;'));
// MY_TNAME, MY_TVERSION, MY_TAUTHOR
$t_data = get_theme_data(MY_BASEPATH . DS . 'style.css');
foreach (array('name', 'version', 'author') as $field) {
define('MY_T' . strtoupper($field), $t_data[ucwords($field)]);
}
}
开发者ID:hlfcoding,项目名称:hlf-wordpress,代码行数:26,代码来源:functions.php
示例6: zilla_menu
/**
* Add the Framework to the menu
*/
function zilla_menu()
{
$zilla_options = get_option('zilla_framework_options');
$icon = ZILLA_URL . '/images/favicon.png';
// Theme Options page
add_object_page($zilla_options['theme_name'], $zilla_options['theme_name'], 'update_core', 'zillaframework', 'zilla_options_page', $icon);
add_submenu_page('zillaframework', __('Theme Options', 'zilla'), __('Theme Options', 'zilla'), 'update_core', 'zillaframework', 'zilla_options_page');
// Update Theme page
$menu_title = __('Theme Updates', 'zilla');
if ($xml = zilla_get_theme_changelog()) {
$theme_version = '';
if (function_exists('wp_get_theme')) {
if (is_child_theme()) {
$temp_obj = wp_get_theme();
$theme_obj = wp_get_theme($temp_obj->get('Template'));
} else {
$theme_obj = wp_get_theme();
}
$theme_version = $theme_obj->get('Version');
} else {
$template_path = get_template_directory();
$theme_data = get_theme_data($template_path . '/style.css');
$theme_version = $theme_data['Version'];
}
if (version_compare($theme_version, $xml->latest) == -1) {
$menu_title = __('Theme Updates <span class="update-plugins count-1"><span class="update-count">1</span></span>', 'zilla');
}
}
add_submenu_page('zillaframework', __('Theme Updates', 'zilla'), $menu_title, 'update_core', 'zillaframework-update', 'zilla_update_page');
// Theme Collection page
// add_submenu_page( 'zillaframework', __( 'More Themes', 'zilla' ), __( 'More Themes', 'zilla' ), 'update_core', 'zillaframework-themes', 'zilla_themes_page' );
// Support link/page
add_submenu_page('zillaframework', __('Support Forums', 'zilla'), __('Support Forums', 'zilla'), 'update_core', 'zillaframework-support', 'zilla_support_page');
}
开发者ID:RetroMotion,项目名称:RetroMotion-Creative-Website,代码行数:37,代码来源:zilla-admin-init.php
示例7: wdp_options
function wdp_options()
{
// VARIABLES
$theme_data = get_theme_data(STYLESHEETPATH . '/style.css');
$themename = $theme_data['Name'];
$themeversion = $theme_data['Version'];
$shortname = "tz";
// Populate option in array for use in theme
global $wdp_options;
$wdp_options = get_option('wdp_options');
$GLOBALS['template_path'] = wdp_DIRECTORY;
//Access the WordPress Categories via an Array
$wdp_categories = array();
$wdp_categories_obj = get_categories('hide_empty=0');
foreach ($wdp_categories_obj as $wdp_cat) {
$wdp_categories[$wdp_cat->cat_ID] = $wdp_cat->cat_name;
}
$categories_tmp = array_unshift($wdp_categories, "Select a category:");
//Access the WordPress Pages via an Array
$wdp_pages = array();
$wdp_pages_obj = get_pages('sort_column=post_parent,menu_order');
foreach ($wdp_pages_obj as $wdp_page) {
$wdp_pages[$wdp_page->ID] = $wdp_page->post_name;
}
$wdp_pages_tmp = array_unshift($wdp_pages, "Select a page:");
// Image Alignment radio box
$options_thumb_align = array("alignleft" => "Left", "alignright" => "Right", "aligncenter" => "Center");
// Image Links to Options
$options_image_link_to = array("image" => "The Image", "post" => "The Post");
//Stylesheets Reader
$alt_stylesheet_path = wdp_FILEPATH . '/css/';
$alt_stylesheets = array();
if (is_dir($alt_stylesheet_path)) {
if ($alt_stylesheet_dir = opendir($alt_stylesheet_path)) {
while (($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false) {
if (stristr($alt_stylesheet_file, ".css") !== false) {
$alt_stylesheets[] = $alt_stylesheet_file;
}
}
}
}
//More Options
$uploads_arr = wp_upload_dir();
$all_uploads_path = '';
if (isset($uploads_arr['path'])) {
$all_uploads_path = $uploads_arr['path'];
}
$all_uploads = get_option('wdp_uploads');
$other_entries = array("Select a number:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19");
// Set the Options Array
$options = array();
$options[] = array("name" => __('Background Images', 'framework'), "type" => "heading");
$options[] = array("name" => "", "message" => __('Here, you can change the background images. Use an image resolution of 1280px X 800px ~ 200 KB, if possible.', 'framework'), "type" => "intro");
$options[] = array("name" => __('Background Image 1', 'framework'), "desc" => __('Upload a logo for your theme, or specify the image address of your online logo. (http://example.com/logo.png)', 'framework'), "id" => $shortname . "_bg_image_1", "std" => "", "type" => "upload");
$options[] = array("name" => __('Background Image 2', 'framework'), "desc" => __('Upload a logo for your theme, or specify the image address of your online logo. (http://example.com/logo.png)', 'framework'), "id" => $shortname . "_bg_image_2", "std" => "", "type" => "upload");
$options[] = array("name" => __('Background Image 3', 'framework'), "desc" => __('Upload a logo for your theme, or specify the image address of your online logo. (http://example.com/logo.png)', 'framework'), "id" => $shortname . "_bg_image_3", "std" => "", "type" => "upload");
update_option('wdp_template', $options);
update_option('wdp_themename', $themename);
update_option('wdp_shortname', $shortname);
}
开发者ID:lokenxo,项目名称:familygenerator,代码行数:60,代码来源:theme-options.php
示例8: launch
function launch()
{
$theme_options = _WSH()->option();
$theme_options_url = admin_url('themes.php?page=' . SH_NAME . '_option');
$this->purchase_code = sh_set($theme_options, 'sh_purchase_code');
$this->purchase_user = sh_set($theme_options, 'sh_purchase_user');
if (function_exists('wp_get_theme')) {
$this->theme_data = wp_get_theme(get_option('template'));
$this->theme_version = $this->theme_data->Version;
} else {
$this->theme_data = get_theme_data(get_template_directory() . '/style.css');
$this->theme_version = $this->theme_data['Version'];
}
$this->theme_base = get_option('template');
if (!$this->purchase_code && !$this->purchase_user) {
$this->errors[] = sprintf(__('<strong>%s Theme Notice:</strong> Please enter a valid <a href="%s">purchase code and themeforest username</a> to get automatic theme update', SH_NAME), $this->theme_data['Name'], $theme_options_url);
}
add_action('admin_notices', array($this, '_admin_notice'));
if ($this->errors) {
return;
}
/**************************************************/
//Uncomment below to find the theme slug that will need to be setup on the api server
//var_dump($theme_base);
add_filter('pre_set_site_transient_update_themes', array($this, 'check_for_update'));
// Take over the Theme info screen on WP multisite
add_filter('themes_api', array($this, 'my_theme_api_call'), 10, 3);
if (is_admin()) {
$this->current = get_transient('update_themes');
}
}
开发者ID:estrategasdigitales,项目名称:kanet,代码行数:31,代码来源:update_theme.php
示例9: display
function display()
{
$browser = new SendPress_Browser();
if (get_bloginfo('version') < '3.4') {
$theme_data = get_theme_data(get_stylesheet_directory() . '/style.css');
$theme = $theme_data['Name'] . ' ' . $theme_data['Version'];
} else {
$theme_data = wp_get_theme();
$theme = $theme_data->Name . ' ' . $theme_data->Version;
}
// Try to identify the hosting provider
$host = false;
if (defined('WPE_APIKEY')) {
$host = 'WP Engine';
} elseif (defined('PAGELYBIN')) {
$host = 'Pagely';
}
$request['cmd'] = '_notify-validate';
$params = array('sslverify' => false, 'timeout' => 60, 'body' => $request);
$response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params);
if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
$WP_REMOTE_POST = 'wp_remote_post() works' . "\n";
} else {
$WP_REMOTE_POST = 'wp_remote_post() does not work' . "\n";
}
return $this->display_output($browser, $theme, $host, $WP_REMOTE_POST);
}
开发者ID:richardsweeney,项目名称:sendpress,代码行数:27,代码来源:class-sendpress-view-help.php
示例10: remove_footer_admin
function remove_footer_admin()
{
$themename = get_theme_data(get_stylesheet_directory() . '/style.css');
$version = "version " . $themename['Version'];
$themename = $themename['Name'];
echo "<b><a href=http://www.site5.com>{$themename} - {$version}</a></b> - Wordpress Bar & Restaurant Theme | <a href=http://www.site5.com/>Designed by Site5.com</a> ";
}
开发者ID:sudocoda,项目名称:ekiben,代码行数:7,代码来源:customfunctions.php
示例11: update_notifier
function update_notifier()
{
$xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL);
// Get the latest remote XML file on our server
$theme_data = get_theme_data(TEMPLATEPATH . '/style.css');
// Read theme current version from the style.css
?>
<style>
.update-nag { display: none; }
#instructions {max-width: 670px;}
h3.title {margin: 30px 0 0 0; padding: 30px 0 0 0; border-top: 1px solid #ddd;}
</style>
<div class="wrap">
<div id="icon-tools" class="icon32"></div>
<h2><?php
echo NOTIFIER_THEME_NAME;
?>
Theme Updates</h2>
<div id="message" class="updated below-h2"><p><strong>There is a new version of the <?php
echo NOTIFIER_THEME_NAME;
?>
theme available.</strong> You have version <?php
echo $theme_data['Version'];
?>
installed. Update to version <?php
echo $xml->latest;
?>
.</p></div>
<img style="float: left; margin: 0 20px 20px 0; border: 1px solid #ddd;" src="<?php
echo get_bloginfo('template_url') . '/screenshot.png';
?>
" />
<div id="instructions">
<h3>Update Download and Instructions</h3>
<p><strong>Please note:</strong> make a <strong>backup</strong> of the Theme inside your WordPress installation folder <strong>/wp-content/themes/<?php
echo NOTIFIER_THEME_FOLDER_NAME;
?>
/</strong></p>
<p>To update the Theme, login to <a href="http://www.themeforest.net/">ThemeForest</a>, head over to your <strong>downloads</strong> section and re-download the theme like you did when you bought it.</p>
<p>Extract the zip's contents, look for the extracted theme folder, and after you have all the new files upload them using FTP to the <strong>/wp-content/themes/<?php
echo NOTIFIER_THEME_FOLDER_NAME;
?>
/</strong> folder overwriting the old ones (this is why it's important to backup any changes you've made to the theme files).</p>
<p>If you didn't make any changes to the theme files, you are free to overwrite them with the new ones without the risk of losing theme settings, pages, posts, etc, and backwards compatibility is guaranteed.</p>
</div>
<h3 class="title">Changelog</h3>
<?php
echo $xml->changelog;
?>
</div>
<?php
}
开发者ID:nathanwaters,项目名称:HackagongWP,代码行数:60,代码来源:update-notifier.php
示例12: after
function after()
{
$update_actions = array();
if (!empty($this->upgrader->result['destination_name']) && ($theme_info = $this->upgrader->theme_info()) && !empty($theme_info)) {
$name = $theme_info['Name'];
$stylesheet = $this->upgrader->result['destination_name'];
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
$template = $this->installed_theme_key;
$stylesheet = $this->installed_theme_key;
$theme_info = get_theme_data(trailingslashit(WP_CONTENT_DIR) . 'themes/' . $stylesheet);
if (!empty($theme_info['Template'])) {
$template = $theme_info['Template'];
}
// End IF Statement
$preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
$activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
$update_actions['preview'] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”', 'woothemes'), $name)) . '">' . __('Preview', 'woothemes') . '</a>';
$update_actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate “%s”', 'woothemes'), $name)) . '">' . __('Activate', 'woothemes') . '</a>';
if (!$this->result || is_wp_error($this->result) || $stylesheet == get_stylesheet()) {
unset($update_actions['preview'], $update_actions['activate']);
}
$update_actions['themes_page'] = '<a href="' . admin_url('themes.php?page=woo-installer') . '" title="' . esc_attr(__('Install other WooThemes', 'woothemes')) . '" target="_parent">' . __('Install other WooThemes', 'woothemes') . '</a>';
}
$update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->installed_theme_key);
if (!empty($update_actions)) {
$this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array) $update_actions));
}
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:28,代码来源:upgrader-skin.class.php
示例13: __construct
/**
* Construct
*
* @since 1.0
*/
public function __construct()
{
// Get theme info
if (function_exists('wp_get_theme')) {
$theme = wp_get_theme();
$this->theme['authorURI'] = $theme->{'Author URI'};
} else {
$theme = get_theme_data(get_stylesheet_directory() . '/style.css');
$this->theme['authorURI'] = $theme['AuthorURI'];
}
// Set constants for theme info
$this->theme['name'] = $theme['Name'];
$this->theme['nicename'] = strtolower(str_replace(" ", "-", $this->theme['name']));
$this->theme['version'] = $theme['Version'];
$this->theme['author'] = $theme['Author'];
$this->theme['textdomain'] = strtolower(str_replace(" ", "_", $this->theme['name']));
$this->theme['uri'] = $this->theme['authorURI'] . "themes/" . $this->theme['nicename'];
$this->theme['support'] = $this->theme['authorURI'] . 'support/';
$this->theme['readme'] = get_template_directory_uri() . '/readme.txt';
// This will keep track of the checkbox options for the formHandler function.
$this->checkboxes = array();
$this->settings = array();
$this->getSettings();
add_action('admin_menu', array(&$this, 'addPages'));
add_action('admin_init', array(&$this, 'registerSettings'));
add_action('admin_notices', array(&$this, 'updateNotice'));
add_action('wp_ajax_readme', array(&$this, 'displayReadme'));
add_action('wp_ajax_fonts', array(&$this, 'displayFonts'));
/* if ( ! get_option( 'fullscreen_options' ) )
$this->initializeSettings(); */
}
开发者ID:lruelasvgim,项目名称:vgimwebsite,代码行数:36,代码来源:class-theme-options.php
示例14: __construct
function __construct()
{
/* GET INFORMATIONS FROM STYLE.CSS */
// get themedata version wp 3.4+
if (function_exists('wp_get_theme')) {
$tc_theme = wp_get_theme();
$tc_base_data['prefix'] = $tc_base_data['Title'] = $tc_theme->get('Name');
$tc_base_data['Version'] = $tc_theme->get('Version');
} else {
$tc_base_data = get_theme_data(TC_BASE . 'style.css');
$tc_base_data['prefix'] = $tc_base_data['Title'];
}
/* CUSTOMIZR_VER is the Version */
if (!defined('CUSTOMIZR_VER')) {
define('CUSTOMIZR_VER', $tc_base_data['Version']);
}
/* TC_BASE is the root server path */
if (!defined('TC_BASE')) {
define('TC_BASE', get_template_directory() . '/');
}
/* TC_BASE_URL http url of the loaded template */
if (!defined('TC_BASE_URL')) {
define('TC_BASE_URL', get_template_directory_uri() . '/');
}
/* THEMENAME contains the Name of the currently loaded theme */
if (!defined('THEMENAME')) {
define('THEMENAME', $tc_base_data['Title']);
}
/* theme class groups instanciation */
$groups = array('fire', 'main', 'header', 'content');
foreach ($groups as $g) {
tc__($g);
}
}
开发者ID:BackupTheBerlios,项目名称:vishwa-svn,代码行数:34,代码来源:class-customizr-__.php
示例15: presstrends
function presstrends()
{
// Add your PressTrends and Theme API Keys
$api_key = 'fwaauw8aofwq21vgs1mw8b8g87q9x0rrezv4';
$auth = 'kzsc8b4g65i3j88rsu3oix8dkmufi5gbp';
// NO NEED TO EDIT BELOW
$data = get_transient('presstrends_data');
if (!$data || $data == '') {
$api_base = 'http://api.presstrends.io/index.php/api/sites/add/auth/';
$url = $api_base . $auth . '/api/' . $api_key . '/';
$data = array();
$count_posts = wp_count_posts();
$comments_count = wp_count_comments();
$theme_data = get_theme_data(get_template_directory() . '/style.css');
$plugin_count = count(get_option('active_plugins'));
$data['url'] = stripslashes(str_replace(array('http://', '/', ':'), '', site_url()));
$data['posts'] = $count_posts->publish;
$data['comments'] = $comments_count->total_comments;
$data['theme_version'] = $theme_data['Version'];
$data['theme_name'] = str_replace(' ', '', get_bloginfo('name'));
$data['plugins'] = $plugin_count;
$data['wpversion'] = get_bloginfo('version');
foreach ($data as $k => $v) {
$url .= $k . '/' . $v . '/';
}
$response = wp_remote_get($url);
set_transient('presstrends_data', $data, 60 * 60 * 24);
}
}
开发者ID:aguerojahannes,项目名称:aguerojahannes.com,代码行数:29,代码来源:functions.php
示例16: __construct
public function __construct()
{
global $shortname;
// Get theme info
if (function_exists('wp_get_theme')) {
$theme = wp_get_theme();
$this->theme['authorURI'] = $theme->{'Author URI'};
} else {
$theme = get_theme_data(get_stylesheet_directory() . '/style.css');
$this->theme['authorURI'] = $theme['AuthorURI'];
}
$this->theme['name'] = $theme['Name'];
$this->theme['nicename'] = strtolower(str_replace(" ", "-", $this->theme['name']));
$this->theme['textdomain'] = strtolower(str_replace(" ", "_", $this->theme['name']));
$this->theme['version'] = $theme['Version'];
$this->theme['author'] = $theme['Author'];
$this->theme['uri'] = $this->theme['authorURI'] . "/themes/" . $this->theme['nicename'];
$this->theme['support'] = $this->theme['authorURI'] . '/support/';
$this->theme['readme'] = get_template_directory_uri() . '/readme.txt';
// This will keep track of the checkbox options for the validate_settings function.
$this->checkboxes = array();
$this->settings = array();
add_action('admin_menu', array(&$this, 'add_pages'));
add_action('admin_init', array(&$this, 'register_settings'));
add_action('wp_ajax_readme', array(&$this, 'displayReadme'));
// Load Theme Options
require_once get_template_directory() . '/includes/icore/theme-options.php';
if (!get_option($shortname . '_options')) {
$this->initialize_settings();
}
}
开发者ID:haithan,项目名称:11b5,代码行数:31,代码来源:icore.php
示例17: bizway_options
function bizway_options()
{
// VARIABLES
$themename = get_theme_data(get_template_directory() . '/style.css');
$themename = $themename['Name'];
$shortname = "of";
// Populate OptionsFramework option in array for use in theme
global $of_options;
$of_options = bizway_get_option('of_options');
// Background Defaults
$background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment' => 'scroll');
//Front page on/off
$file_rename = array("on" => "On", "off" => "Off");
//Stylesheet Reader
$alt_stylesheets = array("default" => "default", "blue" => "blue", "coffee" => "coffee", "green" => "green", "brown" => "brown", "pink" => "pink", "orange" => "orange", "purple" => "purple", "red" => "red", "forrest-green" => "forrest-green", "yellow" => "yellow");
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
// If using image radio buttons, define a directory path
$imagepath = get_stylesheet_directory_uri() . '/images/';
$options = array(array("name" => "General Settings", "type" => "heading"), array("name" => "Custom Logo", "desc" => "Choose your own logo. Optimal Size: 300px Wide by 90px Height.", "id" => "bizway_logo", "type" => "upload"), array("name" => "Custom Favicon", "desc" => "Specify a 16px x 16px image that will represent your website's favicon.", "id" => "bizway_favicon", "type" => "upload"), array("name" => "Tracking Code", "desc" => "Paste your Google Analytics (or other) tracking code here.", "id" => "bizway_analytics", "std" => "", "type" => "textarea"), array("name" => "Homepage Settings", "type" => "heading"), array("name" => "First Heading", "desc" => "Enter your text for first heading.", "id" => "bizway_first_head", "std" => "", "type" => "textarea"), array("name" => "Second Heading", "desc" => "Enter your text for second heading.", "id" => "bizway_second_head", "std" => "", "type" => "textarea"), array("name" => "Slider Settings", "type" => "heading"), array("name" => "Slider Image1", "desc" => "Choose your image for first slider. Optimal size is 950px wide and 350px height.", "id" => "bizway_slideimage1", "std" => "", "type" => "upload"), array("name" => "Slide 1 Link", "desc" => "Enter your link url for slide1", "id" => "bizway_slidelink1", "std" => "", "type" => "text"), array("name" => "Slider Image2", "desc" => "Choose your image for second slider. Optimal size is 950px wide and 350px height.", "id" => "bizway_slideimage2", "std" => "", "type" => "upload"), array("name" => "Slide 2 Link", "desc" => "Enter your link url for slide2", "id" => "bizway_slidelink2", "std" => "", "type" => "text"), array("name" => "Homepage Feature Area", "type" => "heading"), array("name" => "Homepage Feature Area First Image", "desc" => "Choose your image for homepage feature area first image.", "id" => "bizway_featureimg1", "std" => "", "type" => "upload"), array("name" => "First Feature Heading", "desc" => "Enter your text for first col heading.", "id" => "bizway_firsthead", "std" => "", "type" => "textarea"), array("name" => "First Feature Description", "desc" => "Enter your text for first col description.", "id" => "bizway_firstdesc", "std" => "", "type" => "textarea"), array("name" => "First Feature Link URL", "desc" => "Enter your link url for fourth feature section.", "id" => "bizway_link1", "std" => "", "type" => "text"), array("name" => "Second Feature Starts From Here.", "type" => "saperate", "class" => "saperator"), array("name" => "Homepage Feature Area Second Image", "desc" => "Choose your image for homepage Feature area second image.", "id" => "bizway_featureimg2", "std" => "", "type" => "upload"), array("name" => "Second Feature Heading", "desc" => "Enter your text for second col heading.", "id" => "bizway_secondhead", "std" => "", "type" => "textarea"), array("name" => "Second Col Description", "desc" => "Enter your text for second col description.", "id" => "bizway_seconddesc", "std" => "", "type" => "textarea"), array("name" => "Second Feature Link URL", "desc" => "Enter your link url for fourth feature section.", "id" => "bizway_link2", "std" => "", "type" => "text"), array("name" => "Third Feature Starts From Here.", "type" => "saperate", "class" => "saperator"), array("name" => "Homepage Third Feature Image", "desc" => "Choose your image for homepage Feature area third image.", "id" => "bizway_featureimg3", "std" => "", "type" => "upload"), array("name" => "Third Feature Heading", "desc" => "Enter your text for second col heading.", "id" => "bizway_thirdhead", "std" => "", "type" => "textarea"), array("name" => "Third Feature Description", "desc" => "Enter your text for Third Feature description.", "id" => "bizway_thirddesc", "std" => "", "type" => "textarea"), array("name" => "Third Feature Link URL", "desc" => "Enter your link url for fourth feature section.", "id" => "bizway_link3", "std" => "", "type" => "text"), array("name" => "Styling Options", "type" => "heading"), array("name" => "Custom CSS", "desc" => "Quickly add some CSS to your theme by adding it to this block.", "id" => "bizway_customcss", "std" => "", "type" => "textarea"));
bizway_update_option('of_template', $options);
bizway_update_option('of_themename', $themename);
bizway_update_option('of_shortname', $shortname);
}
开发者ID:besimhu,项目名称:legacy,代码行数:35,代码来源:theme-options.php
示例18: get_documentation_data
|
请发表评论