本文整理汇总了PHP中get_theme_root_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP get_theme_root_uri函数的具体用法?PHP get_theme_root_uri怎么用?PHP get_theme_root_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_theme_root_uri函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: computeTargetPath
/**
* Returns the computed path for a given dependency
*
* @author oncletom
* @since 1.0
* @version 1.0
* @return string
*/
public function computeTargetPath()
{
$target_path = preg_replace('#^' . get_theme_root_uri() . '#U', '', $this->stylesheet->src);
$target_path = preg_replace('/.less$/U', '', $target_path);
$target_path .= '-%s.css';
return apply_filters('wp-less_stylesheet_compute_target_path', $target_path);
}
开发者ID:raurieres-ljsl,项目名称:wp-less,代码行数:15,代码来源:Stylesheet.class.php
示例2: presscore_load_theme_modules
function presscore_load_theme_modules()
{
/**
* Icons Bar.
*/
if (is_admin() && current_theme_supports('presscore_admin_icons_bar')) {
include_once PRESSCORE_ADMIN_MODS_DIR . '/mod-admin-icons-bar/icons-bar.class.php';
$icons_bar = new Presscore_Admin_Icons_Bar(array('fontello_css_url' => str_replace(get_theme_root(), get_theme_root_uri(), locate_template('css/fontello/css/fontello.css', false)), 'fontello_json_path' => locate_template("/css/fontello/config.json", false), 'textdomain' => LANGUAGE_ZONE));
}
/**
* TGM Plugin Activation.
*/
if (is_admin() && current_theme_supports('presscore_admin_tgm_plugins_setup')) {
require_once PRESSCORE_ADMIN_MODS_DIR . '/mod-tgm-plugin-activation/tgm-plugin-setup.php';
}
/**
* Theme Update.
*/
if (!is_child_theme() && is_admin() && current_theme_supports('presscore_theme_update')) {
require_once PRESSCORE_ADMIN_MODS_DIR . '/mod-theme-update/mod-theme-update.php';
}
/**
* Presscore Mega Menu.
*/
if (current_theme_supports('presscore_mega_menu')) {
require_once PRESSCORE_MODS_DIR . '/mod-theme-mega-menu/mod-theme-mega-menu.php';
}
/**
* The7 adapter.
*/
if (current_theme_supports('presscore_the7_adapter')) {
require_once PRESSCORE_MODS_DIR . '/mod-the7-compatibility/mod-the7-compatibility.php';
}
}
开发者ID:noman90rauf,项目名称:wp-content,代码行数:34,代码来源:theme-setup.php
示例3: bp_gallery_get_template_cssjs_dir_url
function bp_gallery_get_template_cssjs_dir_url(){
$theme_dir="";
$stylesheet_dir="";
global $bp,$current_blog;
if(is_multisite()&&$current_blog->blog_id!=BP_ROOT_BLOG){
//find the stylesheet path and
$stylesheet = get_blog_option(BP_ROOT_BLOG,'stylesheet');
$theme_root = get_theme_root( $stylesheet );
$stylesheet_dir = "$theme_root/$stylesheet";
$template=get_blog_option(BP_ROOT_BLOG,'template');
$theme_root = get_theme_root( $template );
$template_dir = "$theme_root/$template";
$theme_root_uri = get_theme_root_uri( $stylesheet );
$stylesheet_dir_uri = "$theme_root_uri/$stylesheet";
$theme_root_uri = get_theme_root_uri( $template );
$template_dir_uri = "$theme_root_uri/$template";
}
else{
$stylesheet_dir=STYLESHEETPATH;
$template_dir=TEMPLATEPATH;
$stylesheet_dir_uri=get_stylesheet_directory_uri();
$template_dir_uri=get_template_directory_uri();
}
if ( file_exists( $stylesheet_dir. '/gallery/inc'))
$theme_uri=$stylesheet_dir_uri;//child theme
else if ( file_exists( $template_dir. '/gallery/inc') )
$theme_uri=$template_dir_uri;//parent theme
if($theme_uri)
return $theme_uri."/gallery";
return false;////template is not present in the active theme/child theme
}
开发者ID:r-chopra17,项目名称:p2bp,代码行数:32,代码来源:functions.php
示例4: bluerockre_scripts
function bluerockre_scripts()
{
wp_deregister_script('wpex-sticky');
wp_deregister_script('wpex-hoverintent');
wp_deregister_script('wpex-animsition');
wp_deregister_script('wpex-tipsy');
wp_deregister_script('wpex-images-loaded');
wp_deregister_script('wpex-isotope');
wp_deregister_script('wpex-leanner-modal');
wp_deregister_script('wpex-sliderpro-customthumbnails');
wp_deregister_script('wpex-touch-swipe');
wp_deregister_script('wpex-owl-carousel');
wp_deregister_script('wpex-count-to');
wp_deregister_script('wpex-appear');
wp_deregister_script('wpex-custom-select');
wp_deregister_script('wpex-mousewheel');
wp_deregister_script('wpex-match-height');
wp_deregister_script('wpex-scrolly');
wp_deregister_script('wpex-ilightbox');
wp_dequeue_style('wpa-css');
// Dequeue admin stylesheet from WP-Attachment Plugin
wp_dequeue_style('wpex-style');
wp_dequeue_style('wpex-responsive');
wp_enqueue_style('style', get_theme_root_uri() . '/brg/style.css');
wp_enqueue_style('brg', get_theme_root_uri() . '/brg/css/brg.css');
wp_enqueue_style('responsive', get_theme_root_uri() . '/brg/css/responsive.css');
}
开发者ID:brboise,项目名称:brg,代码行数:27,代码来源:functions.php
示例5: wppa_add_style
function wppa_add_style()
{
global $wppa_api_version;
// Are we allowed to look in theme?
if (wppa_switch('wppa_use_custom_style_file')) {
// In child theme?
$userstyle = get_theme_root() . '/' . get_option('stylesheet') . '/wppa-style.css';
if (is_file($userstyle)) {
wp_register_style('wppa_style', get_theme_root_uri() . '/' . get_option('stylesheet') . '/wppa-style.css', array(), $wppa_api_version);
wp_enqueue_style('wppa_style');
return;
}
// In theme?
$userstyle = get_theme_root() . '/' . get_option('template') . '/wppa-style.css';
if (is_file($userstyle)) {
wp_register_style('wppa_style', get_theme_root_uri() . '/' . get_option('template') . '/wppa-style.css', array(), $wppa_api_version);
wp_enqueue_style('wppa_style');
return;
}
}
// Use standard
wp_register_style('wppa_style', WPPA_URL . '/theme/wppa-style.css', array(), $wppa_api_version);
wp_enqueue_style('wppa_style');
// Dynamic css
if (!wppa_switch('wppa_inline_css')) {
if (!file_exists(WPPA_PATH . '/wppa-dynamic.css')) {
wppa_create_wppa_dynamic_css();
update_option('wppa_dynamic_css_version', get_option('wppa_dynamic_css_version', '0') + '1');
}
if (file_exists(WPPA_PATH . '/wppa-dynamic.css')) {
wp_enqueue_style('wppa-dynamic', WPPA_URL . '/wppa-dynamic.css', array('wppa_style'), get_option('wppa_dynamic_css_version'));
}
}
}
开发者ID:billadams,项目名称:forever-frame,代码行数:34,代码来源:wppa-non-admin.php
示例6: pugpig_get_theme_manifest
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;
}
开发者ID:shortlist-digital,项目名称:agreable-pugpig-plugin,代码行数:29,代码来源:pugpig_html_manifest.php
示例7: __construct
/**
* Initialize the plugin
*
*/
private function __construct()
{
$settings = self::get_option('settings');
$validate = $settings['validation'];
// check the package version and upgrade if needed
if (version_compare($settings['version'], self::VERSION) < 0) {
$settings = self::activate();
}
// the action hook which will be fired by cron job
if ($settings['update']['auto'] && !has_action(self::CRON_NAME)) {
add_action(self::CRON_NAME, array(__CLASS__, 'download_database'), 10, 1);
}
if ($validate['comment']) {
// message text on comment form
if ($settings['comment']['pos']) {
$pos = 'comment_form' . ($settings['comment']['pos'] == 1 ? '_top' : '');
add_action($pos, array($this, 'comment_form_message'));
}
// wp-comments-post.php @since 2.8.0, wp-trackback.php @since 1.5.0
add_action('pre_comment_on_post', array($this, 'validate_comment'));
add_filter('preprocess_comment', array($this, 'validate_comment'));
// bbPress: prevent creating topic/relpy and rendering form
add_action('bbp_post_request_bbp-new-topic', array($this, 'validate_comment'));
add_action('bbp_post_request_bbp-new-reply', array($this, 'validate_comment'));
add_filter('bbp_current_user_can_access_create_topic_form', array($this, 'validate_front'));
add_filter('bbp_current_user_can_access_create_reply_form', array($this, 'validate_front'));
}
// xmlrpc.php @since 3.1.0, wp-includes/class-wp-xmlrpc-server.php @since 3.5.0
if ($validate['xmlrpc']) {
add_filter('wp_xmlrpc_server_class', array($this, 'validate_xmlrpc'));
add_filter('xmlrpc_login_error', array($this, 'auth_fail'));
}
// wp-login.php @since 2.1.0, wp-includes/pluggable.php @since 2.5.0
if ($validate['login']) {
add_action('login_init', array($this, 'validate_login'));
add_action('wp_login_failed', array($this, 'auth_fail'));
// BuddyPress: prevent registration and rendering form
add_action('bp_core_screen_signup', array($this, 'validate_login'));
add_action('bp_signup_pre_validate', array($this, 'validate_login'));
}
// get content folders (with/without trailing slash)
self::$content_dir = array('root' => untrailingslashit(parse_url($uri = home_url(), PHP_URL_PATH)), 'admin' => trailingslashit(str_replace($uri, '', admin_url())), 'plugins' => trailingslashit(str_replace($uri, '', plugins_url())), 'themes' => trailingslashit(str_replace($uri, '', get_theme_root_uri())));
// wp-admin/(admin.php|admin-apax.php|admin-post.php) @since 2.5.0
if (is_admin() && ($validate['admin'] || $validate['ajax'] || $settings['signature'])) {
add_action('init', array($this, 'validate_admin'), $settings['priority']);
} else {
$uri = preg_replace('!(//+|/\\.+/)!', '/', $_SERVER['REQUEST_URI']);
$pos = FALSE !== strpos($uri, self::$content_dir['plugins']) || FALSE !== strpos($uri, self::$content_dir['themes']);
if ($pos && ($validate['plugins'] || $validate['themes'] || $settings['signature'])) {
add_action('init', array($this, 'validate_direct'), $settings['priority']);
}
}
// force to change the redirect URL at logout to remove nonce, embed a nonce into pages
add_filter('wp_redirect', array($this, 'logout_redirect'), 20, 2);
// logout_redirect @4.2
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_nonce'), $settings['priority']);
}
开发者ID:pemiu01,项目名称:WordPress-IP-Geo-Block,代码行数:61,代码来源:class-ip-geo-block.php
示例8: cocorico_enqueue
function cocorico_enqueue()
{
//Cocorico is supposed to be dropped in a plugin or a theme-get the url either way
if (strpos(COCORICO_PATH, str_replace('\\', '/', get_theme_root())) === 0) {
$rootlessPath = substr(COCORICO_PATH, strlen(get_theme_root()));
$coco_path = get_theme_root_uri() . str_replace('\\', '/', $rootlessPath);
} else {
$url = plugin_dir_url(__FILE__);
$coco_path = substr($url, 0, strlen($url) - 1);
}
wp_register_script('cocorico', $coco_path . '/frontend/cocorico.js', array('jquery'), '1', true);
wp_enqueue_script('cocorico');
wp_enqueue_style('wp-color-picker');
wp_enqueue_script('wp-color-picker');
wp_enqueue_media();
}
开发者ID:Offirmo,项目名称:base-wordpress,代码行数:16,代码来源:Cocorico.php
示例9: __construct
function __construct($name, $dir = null, $uri = null)
{
$this->theme = wp_get_theme($name);
if (!$this->theme->exists()) {
$this->theme = wp_get_theme();
}
if ($dir) {
$this->dir = $dir;
} else {
$this->dir = get_theme_root();
}
if ($uri) {
$this->uri = $uri;
} else {
$this->uri = get_theme_root_uri();
}
}
开发者ID:ashenkar,项目名称:sanga,代码行数:17,代码来源:SwitchTheme.php
示例10: test_switch_theme
/**
* @expectedDeprecated get_themes
* @expectedDeprecated get_current_theme
*/
function test_switch_theme()
{
$themes = get_themes();
// Switch to each theme in sequence.
// Do it twice to make sure we switch to the first theme, even if it's our starting theme.
// Do it a third time to ensure switch_theme() works with one argument.
for ($i = 0; $i < 3; $i++) {
foreach ($themes as $name => $theme) {
// switch to this theme
if ($i === 2) {
switch_theme($theme['Template'], $theme['Stylesheet']);
} else {
switch_theme($theme['Stylesheet']);
}
$this->assertEquals($name, get_current_theme());
// make sure the various get_* functions return the correct values
$this->assertEquals($theme['Template'], get_template());
$this->assertEquals($theme['Stylesheet'], get_stylesheet());
$root_fs = get_theme_root();
$this->assertTrue(is_dir($root_fs));
$root_uri = get_theme_root_uri();
$this->assertTrue(!empty($root_uri));
$this->assertEquals($root_fs . '/' . get_stylesheet(), get_stylesheet_directory());
$this->assertEquals($root_uri . '/' . get_stylesheet(), get_stylesheet_directory_uri());
$this->assertEquals($root_uri . '/' . get_stylesheet() . '/style.css', get_stylesheet_uri());
# $this->assertEquals($root_uri . '/' . get_stylesheet(), get_locale_stylesheet_uri());
$this->assertEquals($root_fs . '/' . get_template(), get_template_directory());
$this->assertEquals($root_uri . '/' . get_template(), get_template_directory_uri());
//get_query_template
// template file that doesn't exist
$this->assertEquals('', get_query_template(rand_str()));
// template files that do exist
//foreach ($theme['Template Files'] as $path) {
//$file = basename($path, '.php');
// FIXME: untestable because get_query_template uses TEMPLATEPATH
//$this->assertEquals('', get_query_template($file));
//}
// these are kind of tautologies but at least exercise the code
$this->assertEquals(get_404_template(), get_query_template('404'));
$this->assertEquals(get_archive_template(), get_query_template('archive'));
$this->assertEquals(get_author_template(), get_query_template('author'));
$this->assertEquals(get_category_template(), get_query_template('category'));
$this->assertEquals(get_date_template(), get_query_template('date'));
$this->assertEquals(get_home_template(), get_query_template('home', array('home.php', 'index.php')));
$this->assertEquals(get_page_template(), get_query_template('page'));
$this->assertEquals(get_paged_template(), get_query_template('paged'));
$this->assertEquals(get_search_template(), get_query_template('search'));
$this->assertEquals(get_single_template(), get_query_template('single'));
$this->assertEquals(get_attachment_template(), get_query_template('attachment'));
// this one doesn't behave like the others
if (get_query_template('comments-popup')) {
$this->assertEquals(get_comments_popup_template(), get_query_template('comments-popup'));
} else {
$this->assertEquals(get_comments_popup_template(), ABSPATH . 'wp-includes/theme-compat/comments-popup.php');
}
$this->assertEquals(get_tag_template(), get_query_template('tag'));
// nb: this probably doesn't run because WP_INSTALLING is defined
$this->assertTrue(validate_current_theme());
}
}
}
开发者ID:Benrajalu,项目名称:philRaj,代码行数:65,代码来源:theme.php
示例11: get_theme_screenshot
function get_theme_screenshot()
{
foreach (array_keys($this->ctc()->imgmimes) as $extreg) {
foreach (explode('|', $extreg) as $ext) {
if ($screenshot = $this->ctc()->css->is_file_ok($this->ctc()->css->get_child_target('screenshot.' . $ext))) {
$screenshot = trailingslashit(get_theme_root_uri()) . $this->ctc()->theme_basename('', $screenshot);
return $screenshot . '?' . time();
}
}
}
return FALSE;
}
开发者ID:BastienMottier,项目名称:teknologeek,代码行数:12,代码来源:class-ctc-ui.php
示例12: trailingslashit
?>
</section>
<section class="widget sabre">
<a
href="<?php
echo $demo_video;
?>
"
class="phone row video colorbox prevent-underline-on-fa"><img class="phone" src="<?php
echo trailingslashit(get_theme_root_uri());
?>
air-craft/img/sabre-phone-flat-1.png" alt="AC Sabre Instrument View"/><i class="fa fa-play-circle-o"></i></a>
<img class="title" src="<?php
echo trailingslashit(get_theme_root_uri());
?>
air-craft/img/ac-sabre-text.png" alt="AC Sabre"/>
<p class="byline">Musical Instrument, Evolved</p>
<div class="call-to-action">
<a href="<?php
echo $demo_video;
?>
"
id="video-play-btn"
class="row video colorbox prevent-underline-on-fa"><i class="fa fa-play-circle-o"></i> <span>Watch the Demo</span></a></div>
<div class=""><a target="_blank" href="https://itunes.apple.com/gb/app/id1039046999?mt=8&at=1000lob4&ct=website" style="position: relative; left: 6px; display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/images/badges/en-us/badge_appstore-lrg.svg) no-repeat;width:165px;height:40px; zoom:1.5"></a></div>
<!-- <div class="row subscribe">
<i class="fa fa-envelope"></i>
<div>
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:31,代码来源:template-sidebar.php
示例13: create_manifest
/**
* create manifest file
* @return bool
*/
public function create_manifest()
{
$this->substeps_todo = 3;
$this->log(sprintf(__('%d. Trying to generate a manifest file …', 'backwpup'), $this->steps_data[$this->step_working]['STEP_TRY']));
//build manifest
$manifest = array();
// add blog information
$manifest['blog_info']['url'] = home_url();
$manifest['blog_info']['wpurl'] = site_url();
$manifest['blog_info']['prefix'] = $GLOBALS['wpdb']->prefix;
$manifest['blog_info']['description'] = get_option('blogdescription');
$manifest['blog_info']['stylesheet_directory'] = get_template_directory_uri();
$manifest['blog_info']['activate_plugins'] = wp_get_active_and_valid_plugins();
$manifest['blog_info']['activate_theme'] = wp_get_theme()->get('Name');
$manifest['blog_info']['admin_email'] = get_option('admin_email');
$manifest['blog_info']['charset'] = get_bloginfo('charset');
$manifest['blog_info']['version'] = BackWPup::get_plugin_data('wp_version');
$manifest['blog_info']['backwpup_version'] = BackWPup::get_plugin_data('version');
$manifest['blog_info']['language'] = get_bloginfo('language');
$manifest['blog_info']['name'] = get_bloginfo('name');
$manifest['blog_info']['abspath'] = ABSPATH;
$manifest['blog_info']['uploads'] = wp_upload_dir(null, false, true);
$manifest['blog_info']['contents']['basedir'] = WP_CONTENT_DIR;
$manifest['blog_info']['contents']['baseurl'] = WP_CONTENT_URL;
$manifest['blog_info']['plugins']['basedir'] = WP_PLUGIN_DIR;
$manifest['blog_info']['plugins']['baseurl'] = WP_PLUGIN_URL;
$manifest['blog_info']['themes']['basedir'] = get_theme_root();
$manifest['blog_info']['themes']['baseurl'] = get_theme_root_uri();
// add job settings
$manifest['job_settings'] = $this->job;
// add archive info
foreach ($this->additional_files_to_backup as $file) {
$manifest['archive']['extra_files'][] = basename($file);
}
if (isset($this->steps_data['JOB_FILE'])) {
if ($this->job['backuproot']) {
$manifest['archive']['abspath'] = trailingslashit($this->get_destination_path_replacement(ABSPATH));
}
if ($this->job['backupuploads']) {
$manifest['archive']['uploads'] = trailingslashit($this->get_destination_path_replacement(BackWPup_File::get_upload_dir()));
}
if ($this->job['backupcontent']) {
$manifest['archive']['contents'] = trailingslashit($this->get_destination_path_replacement(WP_CONTENT_DIR));
}
if ($this->job['backupplugins']) {
$manifest['archive']['plugins'] = trailingslashit($this->get_destination_path_replacement(WP_PLUGIN_DIR));
}
if ($this->job['backupthemes']) {
$manifest['archive']['themes'] = trailingslashit($this->get_destination_path_replacement(get_theme_root()));
}
}
if (!file_put_contents(BackWPup::get_plugin_data('TEMP') . 'manifest.json', json_encode($manifest))) {
return false;
}
$this->substeps_done = 1;
//Create backwpup_readme.txt
$readme_text = __('You may have noticed the manifest.json file in this archive.', 'backwpup') . PHP_EOL;
$readme_text .= __('manifest.json might be needed for later restoring a backup from this archive.', 'backwpup') . PHP_EOL;
$readme_text .= __('Please leave manifest.json untouched and in place. Otherwise it is safe to be ignored.', 'backwpup') . PHP_EOL;
if (!file_put_contents(BackWPup::get_plugin_data('TEMP') . 'backwpup_readme.txt', $readme_text)) {
return false;
}
$this->substeps_done = 2;
//add file to backup files
if (is_readable(BackWPup::get_plugin_data('TEMP') . 'manifest.json')) {
$this->additional_files_to_backup[] = BackWPup::get_plugin_data('TEMP') . 'manifest.json';
$this->additional_files_to_backup[] = BackWPup::get_plugin_data('TEMP') . 'backwpup_readme.txt';
$this->log(sprintf(__('Added manifest.json file with %1$s to backup file list.', 'backwpup'), size_format(filesize(BackWPup::get_plugin_data('TEMP') . 'manifest.json'), 2)));
}
$this->substeps_done = 3;
return true;
}
开发者ID:skinnard,项目名称:FTL-2,代码行数:76,代码来源:class-job.php
示例14: get_assets_uri
protected function get_assets_uri()
{
$theme_root = str_replace('\\', '/', get_theme_root());
$current_dir = str_replace('\\', '/', trailingslashit(dirname(__FILE__)));
return str_replace($theme_root, get_theme_root_uri(), $current_dir);
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:6,代码来源:icons-bar.class.php
示例15: loadStyle
public function loadStyle()
{
$eventsURL = trailingslashit($this->pluginUrl) . 'resources/';
wp_enqueue_script('tribe-events-pjax', $eventsURL . 'jquery.pjax.js', array('jquery'));
wp_enqueue_script('tribe-events-calendar-script', $eventsURL . 'events.js', array('jquery', 'tribe-events-pjax'));
// is there an events.css file in the theme?
if ($user_style = locate_template(array('events/events.css'))) {
$styleUrl = str_replace(get_theme_root(), get_theme_root_uri(), $user_style);
} else {
$styleUrl = $eventsURL . 'events.css';
}
$styleUrl = apply_filters('tribe_events_stylesheet_url', $styleUrl);
if ($styleUrl) {
wp_enqueue_style('tribe-events-calendar-style', $styleUrl);
}
}
开发者ID:kevinreilly,项目名称:redwood-city-chamber-wp,代码行数:16,代码来源:the-events-calendar.class.php
示例16: admin_data_management
//.........这里部分代码省略.........
if (strtolower(get_theme_info($theme, 'Template')) == 'cherryframework' && strtolower($theme) != 'cherryframework') {
array_push($themes_array, $theme);
}
}
}
if (count($themes_array) != 0) {
?>
<div class="theme_box">
<h4><?php
echo theme_locals("child_theme");
?>
</h4>
<div class="controls child_theme">
<div class="child_theme_title">
<span class="select"> </span>
<span class="child_preview"><?php
echo theme_locals("preview");
?>
</span>
<span class="name"><?php
echo theme_locals("name");
?>
</span>
<span class="date"><?php
echo theme_locals("backup_date");
?>
</span>
</div>
<div class="child_theme_list">
<?php
$input_checked = true;
foreach ($themes_array as $theme) {
echo '<label>';
echo '<span class="select">';
add_radio_button($theme, "theme_name", $input_checked);
if ($input_checked) {
$input_checked = false;
}
echo '</span>';
echo '<span class="child_preview">';
if (file_exists($themes_dir . "/{$theme}/screenshot.png")) {
echo '<img src="' . get_theme_root_uri() . "/{$theme}/screenshot.png" . '" alt="' . $theme . '">';
}
echo '</span>';
echo '<span class="name">' . $theme . '</span>';
echo '<span id="date_' . $theme . '" class="date">' . get_file_date($theme)->date . '</span>';
echo '</label>';
$not_child_theme = false;
}
?>
</div>
</div>
<?php
if (FILE_WRITEABLE) {
?>
<div class="buttons_controls">
<div class="button_wrapper">
<a class="button-primary backup_theme" href="CherryFramework" title="<?php
echo theme_locals('backup');
?>
"><?php
echo theme_locals("backup");
?>
</a>
</div>
<div class="button_wrapper">
<a class="button-primary restore_theme" href="CherryFramework" title="<?php
echo theme_locals('restore');
?>
"><?php
echo theme_locals("restore");
?>
</a>
</div>
<div class="button_wrapper">
<a class="button-primary download_backup" href="CherryFramework" title="<?php
echo theme_locals('download_backup');
?>
"><?php
echo theme_locals("download_backup");
?>
</a>
</div>
</div>
<?php
} else {
printf('<p><em>' . theme_locals('warning_notice_1') . ' ' . theme_locals('warning_notice_3') . '</em></p>');
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
}
开发者ID:hoangluanlee,项目名称:dlbh,代码行数:101,代码来源:data_management_interface.php
示例17: get_template_directory_uri
function get_template_directory_uri() {
$template = get_template();
$template_dir_uri = get_theme_root_uri() . "/$template";
return apply_filters('template_directory_uri', $template_dir_uri, $template);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:5,代码来源:theme.php
示例18: get_template_directory
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/****************************************************************
* REQUIRE ALETHEME
****************************************************************/
if (get_stylesheet_directory() == get_template_directory()) {
define('ALETHEME_PATH', get_template_directory() . '/aletheme');
define('ALETHEME_URL', get_template_directory_uri() . '/aletheme');
} else {
define('ALETHEME_PATH', get_theme_root() . '/aletheme');
define('ALETHEME_URL', get_theme_root_uri() . '/aletheme');
}
require_once ALETHEME_PATH . '/init.php';
开发者ID:navinweb,项目名称:wordpress-starter-pack,代码行数:31,代码来源:functions.php
示例19: define
<?php
/****************************************************************
* NO BORRAR
****************************************************************/
if (get_stylesheet_directory() == get_template_directory()) {
define('THEME_PATH', get_template_directory());
define('THEME_URL', get_template_directory_uri());
define('MDLTHEME_PATH', get_template_directory() . '/theme');
define('MDLTHEME_URL', get_template_directory_uri() . '/theme');
} else {
define('THEME_PATH', get_theme_root() . '/modelo');
define('THEME_URL', get_theme_root_uri() . '/modelo');
define('MDLTHEME_PATH', get_theme_root() . '/modelo/theme');
define('MDLTHEME_URL', get_theme_root_uri() . '/modelo/theme');
}
require_once MDLTHEME_PATH . '/init.php';
/**
* Make theme available for translation.
* Translations can be placed in the /lang/ directory.
*/
load_theme_textdomain('mdltheme', get_template_directory() . '/lang');
$locale = get_locale();
$locale_file = get_template_directory() . "/lang/{$locale}.php";
if (is_readable($locale_file)) {
require_once $locale_file;
}
/****************************************************************
* A�adir funciones extras desde este punto
****************************************************************/
开发者ID:jcglp,项目名称:wptheme-modelo,代码行数:30,代码来源:functions.php
示例20: set_admin_bar_blog_icon
/**
* Add Favicon from each blog to Multisite Menu of "My Sites".
*
* Use the filter hook to change style
* Hook: multisite_enhancements_add_admin_bar_favicon
*
* @since 0.0.2
*/
public function set_admin_bar_blog_icon()
{
// Only usable if the user is logged in and use the admin bar.
if (!is_user_logged_in() || !is_admin_bar_showing()) {
return;
}
if (function_exists('wp_get_sites')) {
// Since 3.7 inside the Core.
$blogs = wp_get_sites(array('limit' => $this->sites_limit));
} else {
// Use alternative to core function get_blog_list().
$blogs = Multisite_Core::get_blog_list(0, 'all');
}
$output = '';
foreach ((array) $blogs as $blog) {
$custom_icon = FALSE;
// Validate, that we use nly int value.
$blog_id = (int) $blog['blog_id'];
$stylesheet = get_blog_option($blog_id, 'stylesheet');
// Get stylesheet directory uri.
$theme_root_uri = get_theme_root_uri($stylesheet);
$stylesheet_dir_uri = "{$theme_root_uri}/{$stylesheet}";
// Get stylesheet directory.
$theme_root = get_theme_root($stylesheet);
$stylesheet_dir = "{$theme_root}/{$stylesheet}";
// Create favicon directory and directory url locations.
$favicon_dir_uri = $this->get_favicon_path($blog_id, $stylesheet_dir_uri, 'url');
$favicon_dir = $this->get_favicon_path($blog_id, $stylesheet_dir, 'dir');
// Check if the user has manually added a site icon in WP (since WP 4.3).
$site_icon_id = (int) get_blog_option($blog_id, 'site_icon');
if (0 !== $site_icon_id) {
switch_to_blog($blog_id);
$url_data = wp_get_attachment_image_src($site_icon_id, array(32, 32));
$custom_icon = esc_url($url_data[0]);
restore_current_blog();
} else {
if (file_exists($favicon_dir)) {
$custom_icon = $favicon_dir_uri;
}
}
if (FALSE !== $custom_icon) {
$output .= '#wpadminbar .quicklinks li#wp-admin-bar-blog-' . $blog['blog_id'] . ' .blavatar { font-size: 0 !important; }';
$output .= '#wp-admin-bar-blog-' . $blog['blog_id'] . ' div.blavatar { background: url( "' . $custom_icon . '" ) left bottom/16px no-repeat !important; background-size: 16px !important; margin: 0 2px 0 -2px; }' . "\n";
}
}
if ('' !== $output) {
/**
* Use the filter hook to change style.
*
* @type string
*/
echo apply_filters('multisite_enhancements_add_admin_bar_favicon', "\n" . '<style>' . $output . '</style>' . "\n");
}
}
开发者ID:aarontgrogg,项目名称:aarontgrogg,代码行数:62,代码来源:class-add-admin-favicon.php
注:本文中的get_theme_root_uri函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论