本文整理汇总了PHP中get_stylesheet_directory函数的典型用法代码示例。如果您正苦于以下问题:PHP get_stylesheet_directory函数的具体用法?PHP get_stylesheet_directory怎么用?PHP get_stylesheet_directory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_stylesheet_directory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: cherry_plugin_settings
function cherry_plugin_settings()
{
global $wpdb;
if (!function_exists('get_plugin_data')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$upload_dir = wp_upload_dir();
$plugin_data = get_plugin_data(plugin_dir_path(__FILE__) . 'cherry-plugin.php');
//Cherry plugin constant variables
define('CHERRY_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('CHERRY_PLUGIN_URL', plugin_dir_url(__FILE__));
define('CHERRY_PLUGIN_DOMAIN', $plugin_data['TextDomain']);
define('CHERRY_PLUGIN_DOMAIN_DIR', $plugin_data['DomainPath']);
define('CHERRY_PLUGIN_VERSION', $plugin_data['Version']);
define('CHERRY_PLUGIN_NAME', $plugin_data['Name']);
define('CHERRY_PLUGIN_SLUG', plugin_basename(__FILE__));
define('CHERRY_PLUGIN_DB', $wpdb->prefix . CHERRY_PLUGIN_DOMAIN);
define('CHERRY_PLUGIN_REMOTE_SERVER', esc_url('http://tmbhtest.com/cherryframework.com/components_update/'));
//Other constant variables
define('CURRENT_THEME_DIR', get_stylesheet_directory());
define('CURRENT_THEME_URI', get_stylesheet_directory_uri());
define('UPLOAD_BASE_DIR', str_replace("\\", "/", $upload_dir['basedir']));
define('UPLOAD_DIR', str_replace("\\", "/", $upload_dir['path'] . '/'));
// if ( !defined('API_URL') ) {
// define( 'API_URL', esc_url( 'http://updates.cherry.template-help.com/cherrymoto/v3/api/' ) );
// }
load_plugin_textdomain(CHERRY_PLUGIN_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/' . CHERRY_PLUGIN_DOMAIN_DIR);
do_action('cherry_plugin_settings');
}
开发者ID:drupalninja,项目名称:schome_org,代码行数:29,代码来源:cherry-plugin.php
示例2: _tarski_list_header_images
/**
* Return a list of header images, both from the Tarski directory and the child
* theme (if one is being used).
*
* @uses get_tarski_option
* @uses wp_get_theme
* @uses get_template_directory_uri
* @uses get_stylesheet_directory_uri
*
* @return array
*/
function _tarski_list_header_images()
{
$headers = array();
$dirs = array('Tarski' => get_template_directory());
$current = get_tarski_option('header');
$theme = wp_get_theme();
if (strlen($theme->Template) > 0) {
$dirs[$theme->Name] = get_stylesheet_directory();
}
foreach ($dirs as $theme_name => $dir) {
$dirpath = $dir . '/headers';
if (is_dir($dirpath)) {
$header_dir = dir($dirpath);
} else {
continue;
}
while ($file = $header_dir->read()) {
if (preg_match('/^[^.].+\\.(jpg|png|gif)/', $file) && !preg_match('/-thumb\\.(jpg|png|gif)$/', $file)) {
$name = $theme_name . '/' . $file;
$id = 'header_' . preg_replace('/[^a-z_]/', '_', strtolower($name));
$path = $dir == get_template_directory() ? '%1$s' : '%2$s';
$thumb = preg_replace('/(\\.(?:png|gif|jpg))/', '-thumb\\1', $file);
$uri = $dir == get_template_directory() ? get_template_directory_uri() : get_stylesheet_directory_uri();
$is_current = is_string($current) && $current == $file || $current[0] == $theme_name && $current[1] == $file;
$headers[] = array('name' => $name, 'id' => $id, 'lid' => 'for_' . $id, 'path' => "{$uri}/headers/{$file}", 'current' => $is_current, 'thumb' => "{$uri}/headers/{$thumb}", 'description' => $name, 'url' => "{$path}/headers/{$file}", 'thumbnail_url' => "{$path}/headers/{$thumb}");
}
}
}
return $headers;
}
开发者ID:aleksking,项目名称:sherrill,代码行数:41,代码来源:core.php
示例3: init
static function init()
{
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
$wp_content_url = Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL);
self::$_url = trailingslashit($wp_content_url) . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
/**
Still need to port these.
$defaults['footer_credit'] = '<span id="footer-thankyou">' . __( 'Options panel created using', 'redux-framework') . ' <a href="' . $this->framework_url . '" target="_blank">' . __('Redux Framework', 'redux-framework') . '</a> v' . self::$_version . '</span>';
$defaults['help_tabs'] = array();
$defaults['help_sidebar'] = ''; // __( '', 'redux-framework' );
$defaults['database'] = ''; // possible: options, theme_mods, theme_mods_expanded, transient
$defaults['customizer'] = false; // setting to true forces get_theme_mod_expanded
$defaults['global_variable'] = '';
$defaults['output'] = true; // Dynamically generate CSS
$defaults['transient_time'] = 60 * MINUTE_IN_SECONDS;
// The defaults are set so it will preserve the old behavior.
$defaults['default_show'] = false; // If true, it shows the default value
$defaults['default_mark'] = ''; // What to print by the field's title if the value shown is default
**/
self::$_properties = array('args' => array('opt_name' => array('required', 'data_type' => 'string', 'label' => 'Option Name', 'desc' => 'Must be defined by theme/plugin. Is the unique key allowing multiple instance of Redux within a single Wordpress instance.', 'default' => ''), 'google_api_key' => array('data_type' => 'string', 'label' => 'Google Web Fonts API Key', 'desc' => 'Key used to request Google Webfonts. Google fonts are omitted without this.', 'default' => ''), 'last_tab' => array('data_type' => 'string', 'label' => 'Last Tab', 'desc' => 'Last tab used.', 'default' => '0'), 'menu_icon' => array('data_type' => 'string', 'label' => 'Default Menu Icon', 'desc' => 'Default menu icon used by sections when one is not specified.', 'default' => self::$_url . 'assets/img/menu_icon.png'), 'menu_title' => array('data_type' => 'string', 'label' => 'Menu Title', 'desc' => 'Label displayed when the admin menu is available.', 'default' => __('Options', 'redux-framework')), 'page_title' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Title used on the panel page.', 'default' => __('Options', 'redux-framework')), 'page_icon' => array('data_type' => 'string', 'label' => 'Page Title', 'desc' => 'Icon class to be used on the options page.', 'default' => 'icon-themes'), 'page_slug' => array('required', 'data_type' => 'string', 'label' => 'Page Slug', 'desc' => 'Slug used to access options panel.', 'default' => '_options'), 'page_permissions' => array('required', 'data_type' => 'string', 'label' => 'Page Capabilities', 'desc' => 'Permissions needed to access the options panel.', 'default' => 'manage_options'), 'menu_type' => array('required', 'data_type' => 'varchar', 'label' => 'Page Type', 'desc' => 'Specify if the admin menu should appear or not.', 'default' => 'menu', 'form' => array('type' => 'select', 'options' => array('menu' => 'Admin Menu', 'submenu' => 'Submenu Only')), 'validation' => array('required')), 'page_parent' => array('required', 'data_type' => 'varchar', 'label' => 'Page Parent', 'desc' => 'Specify if the admin menu should appear or not.', 'default' => 'themes.php', 'form' => array('type' => 'select', 'options' => array('index.php' => 'Dashboard', 'edit.php' => 'Posts', 'upload.php' => 'Media', 'link-manager.php' => 'Links', 'edit.php?post_type=page' => 'pages', 'edit-comments.php' => 'Comments', 'themes.php' => 'Appearance', 'plugins.php' => 'Plugins', 'users.php' => 'Users', 'tools.php' => 'Tools', 'options-general.php' => 'Settings')), 'validation' => array('required')), 'page_priority' => array('type' => 'int', 'label' => 'Page Position', 'desc' => 'Location where this menu item will appear in the admin menu. Warning, beware of overrides.', 'default' => null), 'output' => array('required', 'data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Output/Generate CSS', 'desc' => 'Global shut-off for dynamic CSS output by the framework', 'default' => true), 'allow_sub_menu' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Allow Submenu', 'desc' => 'Turn on or off the submenu that will typically be shown under Appearance.', 'default' => true), 'show_import_export' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Show', false => 'Hide')), 'label' => 'Show Import/Export', 'desc' => 'Show/Hide the import/export tab.', 'default' => true), 'dev_mode' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'Developer Mode', 'desc' => 'Turn on or off the dev mode tab.', 'default' => false), 'system_info' => array('data_type' => 'bool', 'form' => array('type' => 'radio', 'options' => array(true => 'Enabled', false => 'Disabled')), 'label' => 'System Info', 'desc' => 'Turn on or off the system info tab.', 'default' => false)));
}
开发者ID:patlegris,项目名称:angularpresstheme,代码行数:31,代码来源:framework.php
示例4: alm_get_default_repeater
function alm_get_default_repeater()
{
global $wpdb;
$file = null;
$template_dir = 'alm_templates';
// Allow user to load template from theme directory
// Since 2.8.5
// load repeater template from current theme folder
if (is_child_theme()) {
$template_theme_file = get_stylesheet_directory() . '/' . $template_dir . '/default.php';
// if child theme does not have repeater template, then use the parent theme dir
if (!file_exists($template_theme_file)) {
$template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php';
}
} else {
$template_theme_file = get_template_directory() . '/' . $template_dir . '/default.php';
}
// if theme or child theme contains the template, use that file
if (file_exists($template_theme_file)) {
$file = $template_theme_file;
}
// Since 2.0
// otherwise use pre-defined plug-in templates
if ($file == null) {
$blog_id = $wpdb->blogid;
if ($blog_id > 1) {
$file = ALM_PATH . 'core/repeater/' . $blog_id . '/default.php';
// File
} else {
$file = ALM_PATH . 'core/repeater/default.php';
}
}
return $file;
}
开发者ID:OneTimeUser,项目名称:retailwire,代码行数:34,代码来源:functions.php
示例5: mr_locate_template
/**
* Retrieve the name of the highest priority template file that exists.
*
* Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
* inherit from a parent theme can just overload one file. If the template is
* not found in either of those, it looks in the theme-compat folder last.
*
* Taken from bbPress
*
* @since v2.5
*
* @param string|array $template_names Template file(s) to search for, in order.
* @param bool $load If true the template file will be loaded if it is found.
* @param bool $require_once Whether to require_once or require. Default true.
* Has no effect if $load is false.
* @return string The template filename if one is located.
*/
function mr_locate_template($template_names, $load = false, $require_once = true, $template_vars)
{
// No file found yet
$located = false;
// Try to find a template file
foreach ((array) $template_names as $template_name) {
// Continue if template is empty
if (empty($template_name)) {
continue;
}
// Trim off any slashes from the template name
$template_name = ltrim($template_name, '/');
// Check child theme first
if (file_exists(trailingslashit(get_stylesheet_directory()) . 'multi-rating/' . $template_name)) {
$located = trailingslashit(get_stylesheet_directory()) . 'multi-rating/' . $template_name;
break;
// Check parent theme next
} elseif (file_exists(trailingslashit(get_template_directory()) . 'multi-rating/' . $template_name)) {
$located = trailingslashit(get_template_directory()) . 'multi-rating/' . $template_name;
break;
// Check theme compatibility last
} elseif (file_exists(trailingslashit(mr_get_templates_dir()) . $template_name)) {
$located = trailingslashit(mr_get_templates_dir()) . $template_name;
break;
}
}
if (true == $load && !empty($located)) {
mr_load_template($located, $require_once, $template_vars);
}
return $located;
}
开发者ID:ratheeshpkr,项目名称:multi-rating,代码行数:48,代码来源:template-functions.php
示例6: goran_setup
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function goran_setup()
{
/*
* Declare textdomain for this child theme.
*/
load_child_theme_textdomain('goran', get_stylesheet_directory() . '/languages');
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_image_size('edin-thumbnail-landscape', 314, 228, true);
add_image_size('edin-thumbnail-square', 314, 314, true);
add_image_size('edin-featured-image', 772, 9999);
add_image_size('edin-hero', 1230, 1230);
/*
* Unregister nav menu.
*/
unregister_nav_menu('secondary');
/*
* Editor styles.
*/
add_editor_style(array('editor-style.css', goran_noto_sans_font_url(), goran_noto_serif_font_url(), goran_droid_sans_mono_font_url()));
/**
* Add support for Eventbrite.
* See: https://wordpress.org/plugins/eventbrite-api/
*/
add_theme_support('eventbrite');
}
开发者ID:vegemite4me,项目名称:goran-pest,代码行数:36,代码来源:functions.php
示例7: includes
private function includes()
{
$parent = get_template_directory() . '/setup/';
$child = get_stylesheet_directory() . '/setup/';
require_once $parent . 'class.install.php';
require_once $parent . 'class.uw-scripts.php';
require_once $parent . 'class.uw-styles.php';
require_once $parent . 'class.uw-dropdowns.php';
require_once $parent . 'class.images.php';
require_once $parent . 'class.squish_bugs.php';
require_once $parent . 'class.filters.php';
require_once $parent . 'class.uw-oembeds.php';
require_once $parent . 'class.googleapps.php';
require_once $parent . 'class.mimes.php';
require_once $parent . 'class.users.php';
require_once $parent . 'class.dropdowns_walker.php';
// no initialization needed because it extends a WP class
require_once $parent . 'class.uw-basic-custom-post.php';
// no initialization needed unless a child theme makes one
require_once $parent . 'class.uw-sidebar-menu-walker.php';
// sidebar menu will initialize for us
require_once $parent . 'class.uw-quicklinks.php';
require_once $parent . 'class.uw-iframes.php';
require_once $parent . 'class.uw-shortcodes.php';
require_once $parent . 'class.uw-media-credit.php';
require_once $parent . 'class.uw-media-caption.php';
require_once $parent . 'class.uw-replace-media.php';
require_once $parent . 'class.uw-tinymce.php';
require_once $parent . 'class.uw-documentation-dashboard-widget.php';
require_once $parent . 'class.uw-enclosure.php';
require_once $parent . 'class.uw-carousel.php';
require_once $parent . 'class.uw-settings.php';
}
开发者ID:uweb,项目名称:uw-polr,代码行数:33,代码来源:class.uw.php
示例8: UM_Mail
function UM_Mail($user_id_or_email = 1, $subject_line = 'Email Subject', $template, $path = null, $args = array())
{
if (absint($user_id_or_email)) {
$user = get_userdata($user_id_or_email);
$email = $user->user_email;
} else {
$email = $user_id_or_email;
}
$headers = 'From: ' . um_get_option('mail_from') . ' <' . um_get_option('mail_from_addr') . '>' . "\r\n";
$attachments = null;
if (file_exists(get_stylesheet_directory() . '/ultimate-member/templates/email/' . get_locale() . '/' . $template . '.html')) {
$path_to_email = get_stylesheet_directory() . '/ultimate-member/templates/email/' . get_locale() . '/' . $template . '.html';
} else {
if (file_exists(get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html')) {
$path_to_email = get_stylesheet_directory() . '/ultimate-member/templates/email/' . $template . '.html';
} else {
$path_to_email = $path . $template . '.html';
}
}
if (um_get_option('email_html')) {
$message = file_get_contents($path_to_email);
add_filter('wp_mail_content_type', 'um_mail_content_type');
} else {
$message = um_get_option('email-' . $template) ? um_get_option('email-' . $template) : 'Untitled';
}
$message = um_convert_tags($message, $args);
wp_mail($email, $subject_line, $message, $headers, $attachments);
}
开发者ID:lytranuit,项目名称:wordpress,代码行数:28,代码来源:um-short-functions.php
示例9: builder_add_responsive_stylesheets
function builder_add_responsive_stylesheets()
{
$template_dir = get_template_directory();
$template_url = get_template_directory_uri();
$stylesheet_dir = get_stylesheet_directory();
$stylesheet_url = get_stylesheet_directory_uri();
$files = array('style-responsive.css' => 'tablet-width', 'style-tablet.css' => array('mobile-width', 'tablet-width'), 'style-mobile.css' => 'mobile-width');
$files = apply_filters('builder_get_responsive_stylesheet_files', $files);
$stylesheets = array();
$use_template = false;
if ($template_dir != $stylesheet_dir && !defined('BUILDER_DISABLE_PARENT_RESPONSIVE_STYLESHEETS')) {
$use_template = true;
}
foreach (array_keys($files) as $file) {
if (file_exists("{$stylesheet_dir}/{$file}")) {
$stylesheets[$file] = "{$stylesheet_url}/{$file}";
} else {
if ($use_template && file_exists("{$template_dir}/{$file}")) {
$stylesheets[$file] = "{$template_url}/{$file}";
}
}
}
if (empty($stylesheets)) {
return;
}
$size_widths = array('tablet-width' => builder_theme_supports('builder-responsive', 'tablet-width'), 'mobile-width' => builder_theme_supports('builder-responsive', 'mobile-width'), 'layout-width' => apply_filters('builder_get_layout_width', ''));
foreach ($stylesheets as $file => $stylesheet) {
$widths = $files[$file];
if (is_array($widths)) {
$min_width = $widths[0];
$max_width = $widths[1];
} else {
$min_width = '';
$max_width = $widths;
}
if (!empty($min_width) && isset($size_widths[$min_width])) {
$min_width = $size_widths[$min_width];
}
if (!empty($min_width) && isset($size_widths[$min_width])) {
$min_width = $size_widths[$min_width];
}
if (is_numeric($min_width)) {
$min_width .= 'px';
}
if (!empty($size_widths[$max_width])) {
$max_width = $size_widths[$max_width];
}
if (!empty($size_widths[$max_width])) {
$max_width = $size_widths[$max_width];
}
if (is_numeric($max_width)) {
$max_width .= 'px';
}
if (empty($min_width)) {
echo "<link rel=\"stylesheet\" href=\"{$stylesheet}\" type=\"text/css\" media=\"only screen and (max-width: {$max_width})\" />\n";
} else {
echo "<link rel=\"stylesheet\" href=\"{$stylesheet}\" type=\"text/css\" media=\"only screen and (min-width: {$min_width}) and (max-width: {$max_width})\" />\n";
}
}
}
开发者ID:jimrucinski,项目名称:Vine,代码行数:60,代码来源:functions.php
示例10: __construct
function __construct()
{
// This is how to call the template engine:
// do_action('wunderground_render_template', $file_name, $data_array );
add_action('wunderground_render_template', array(&$this, 'render'), 10, 2);
// Set up Twig
Twig_Autoloader::register();
// This path should always be the last
$base_path = trailingslashit(plugin_dir_path(Wunderground_Plugin::$file)) . 'templates';
$this->loader = new Twig_Loader_Filesystem($base_path);
// Tap in here to add additional template paths
$additional_paths = apply_filters('wunderground_template_paths', array(trailingslashit(get_stylesheet_directory()) . 'wunderground'));
foreach ($additional_paths as $path) {
// If the directory exists
if (is_dir($path)) {
// Tell Twig to use it first
$this->loader->prependPath($path);
}
}
// You can force debug mode by adding `add_filter( 'wunderground_twig_debug' '__return_true' );`
$debug = apply_filters('wunderground_twig_debug', current_user_can('manage_options') && isset($_GET['debug']));
$this->twig = new Twig_Environment($this->loader, array('debug' => !empty($debug), 'auto_reload' => true));
if (!empty($debug)) {
$this->twig->addExtension(new Twig_Extension_Debug());
}
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:26,代码来源:class-template.php
示例11: SLUG_load_template
function SLUG_load_template($out, $code, $template_name)
{
if (false !== ($template = file_get_contents(file_get_contents(trailingslashit(get_stylesheet_directory()) . "pods-templates/{$template_name}")))) {
$code = $template;
}
return $code;
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:7,代码来源:load-template-from-theme.php
示例12: projetcela_theme_setup
/**
* Activates default theme features
*
* @since 1.0
*/
function projetcela_theme_setup()
{
// Make theme available for translation.
// Translations can be filed in the /languages/ directory.
// uncomment to enable (remove the // before load_theme_textdomain )
load_theme_textdomain('suits', get_stylesheet_directory() . '/languages');
}
开发者ID:NicoGill,项目名称:projet-cela,代码行数:12,代码来源:functions.php
示例13: plandd_acf_path
function plandd_acf_path($path)
{
// update path
$path = get_stylesheet_directory() . '/includes/acf-pro/';
// return
return $path;
}
开发者ID:plandd,项目名称:pbagora,代码行数:7,代码来源:functions.php
示例14: widget
public function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget;
$apikey = getbapiapikey();
if (!empty($apikey)) {
$fname = get_stylesheet_directory() . '/insta-default-content/insta-footer.php';
if (!file_exists($fname)) {
$fname = plugin_dir_path(__FILE__) . 'insta-default-content/insta-footer.php';
}
if (file_exists($fname)) {
$t = file_get_contents($fname);
$m = new Mustache_Engine();
$wrapper = getbapisolutiondata();
//print_r($wrapper);
$string = $m->render($t, $wrapper);
echo $string;
} elseif (is_newapp_website()) {
echo '<div id="poweredby"><a rel="nofollow" target="_blank" href="http://kigo.net">Vacation Rental Software by Kigo</a></div>';
} else {
echo '<div id="poweredby"><a rel="nofollow" target="_blank" href="http://www.InstaManager.com">Vacation Rental Software by InstaManager</a></div>';
}
} elseif (is_newapp_website()) {
echo '<div id="poweredby"><a rel="nofollow" target="_blank" href="http://kigo.net">Vacation Rental Software by Kigo</a></div>';
} else {
echo '<div id="poweredby"><a rel="nofollow" target="_blank" href="http://www.InstaManager.com">Vacation Rental Software by InstaManager</a></div>';
}
echo $after_widget;
}
开发者ID:alfiedawes,项目名称:WP-InstaSites,代码行数:30,代码来源:widgets.php
示例15: my_acf_settings_path
function my_acf_settings_path($path)
{
// update path
$path = get_stylesheet_directory() . '/acf-pro/';
// return
return $path;
}
开发者ID:finestpixels,项目名称:riverplace2016,代码行数:7,代码来源:functions.php
示例16: isChildTheme
public static function isChildTheme($file)
{
if (strpos(self::cleanFilePath($file), self::cleanFilePath(get_stylesheet_directory())) !== false) {
return true;
}
return false;
}
开发者ID:chypriote,项目名称:wp-video,代码行数:7,代码来源:class.redux_helpers.php
示例17: templateChooser
/**
* Pick the correct template to include
* @param string $template Path to template
*
* @return string Path to template
*/
public static function templateChooser($template)
{
$events = TribeEvents::instance();
do_action('tribe_tec_template_chooser', $template);
// hijack this method right up front if it's a 404
if (is_404() && $events->displaying == 'single-event' && apply_filters('tribe_events_templates_is_404', '__return_true')) {
return get_404_template();
}
// no non-events need apply
if (!in_array(get_query_var('post_type'), array(TribeEvents::POSTTYPE, TribeEvents::VENUE_POST_TYPE, TribeEvents::ORGANIZER_POST_TYPE)) && !is_tax(TribeEvents::TAXONOMY)) {
return $template;
}
if (tribe_get_option('tribeEventsTemplate', 'default') == '') {
return self::getTemplateHierarchy('default-template');
} else {
// add_filter( 'wp_title', array(__CLASS__, 'remove_default_title'), 1);
if (!is_single() || !post_password_required()) {
add_action('loop_start', array(__CLASS__, 'setup_ecp_template'));
}
$template = locate_template(tribe_get_option('tribeEventsTemplate', 'default') == 'default' ? 'page.php' : tribe_get_option('tribeEventsTemplate', 'default'));
if ($template == '') {
$template = get_index_template();
}
// remove singular body class if sidebar-page.php
if ($template == get_stylesheet_directory() . '/sidebar-page.php') {
add_filter('body_class', array(__CLASS__, 'remove_singular_body_class'));
} else {
add_filter('body_class', array(__CLASS__, 'add_singular_body_class'));
}
return $template;
}
}
开发者ID:TyRichards,项目名称:river_of_life,代码行数:38,代码来源:tribe-templates.class.php
示例18: Dropdown
public static function Dropdown($params)
{
extract($params);
$type = isset($type) ? $type : 'link';
$ltpldir = get_stylesheet_directory() . '/donwload-manager/' . $type . '-templates/';
if (!file_exists($ltpldir)) {
$ltpldir = WPDM_BASE_DIR . '/tpls/' . $type . '-templates/';
}
$ctpls = scandir($ltpldir);
array_shift($ctpls);
array_shift($ctpls);
$name = isset($name) ? $name : $type . '_template';
$css = isset($css) ? "style='{$css}'" : '';
$id = isset($id) ? $id : uniqid();
$default = $type == 'link' ? 'link-template-calltoaction3.php' : 'page-template-1col-flat.php';
$html = "<select name='{$name}' id='{$id}' class='form-control template {$type}_template' {$css}><option value='{$default}'>Select " . ucfirst($type) . " Template</option>";
$data = array();
foreach ($ctpls as $ctpl) {
$tmpdata = file_get_contents($ltpldir . $ctpl);
$regx = "/WPDM.*Template[\\s]*:([^\\-\\->]+)/";
if (preg_match($regx, $tmpdata, $matches)) {
$data[$ctpl] = $matches[1];
$selected = isset($selected) && $selected == $ctpl ? 'selected=selected' : '';
$html .= "<option value='{$ctpl}' {$selected}>{$matches[1]}</option>";
}
}
$html .= "</select>";
return isset($data_type) && $data_type == 'ARRAY' ? $data : $html;
}
开发者ID:wilxsv,项目名称:prevensionPublicLibrary,代码行数:29,代码来源:class.Templates.php
示例19: init
public static function init()
{
global $wp_filesystem;
// Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester
self::$_dir = trailingslashit(Redux_Helpers::cleanFilePath(dirname(__FILE__)));
$wp_content_dir = trailingslashit(Redux_Helpers::cleanFilePath(WP_CONTENT_DIR));
$wp_content_dir = trailingslashit(str_replace('//', '/', $wp_content_dir));
$relative_url = str_replace($wp_content_dir, '', self::$_dir);
self::$wp_content_url = trailingslashit(Redux_Helpers::cleanFilePath(is_ssl() ? str_replace('http://', 'https://', WP_CONTENT_URL) : WP_CONTENT_URL));
self::$_url = self::$wp_content_url . $relative_url;
// See if Redux is a plugin or not
if (strpos(Redux_Helpers::cleanFilePath(__FILE__), Redux_Helpers::cleanFilePath(get_stylesheet_directory())) !== false) {
self::$_is_plugin = false;
}
// Create our private upload directory
Redux_Functions::initWpFilesystem();
self::$_upload_dir = trailingslashit($wp_filesystem->wp_content_dir()) . '/redux/';
self::$_upload_url = trailingslashit(content_url()) . '/redux/';
if (function_exists('sys_get_temp_dir')) {
$tmp = sys_get_temp_dir();
if (empty($tmp)) {
$tmpDir = self::$_upload_url . 'tmp';
if (file_exists($tmpDir)) {
Redux_Helpers::rmdir($tmpDir);
}
putenv('TMPDIR=' . self::$_upload_dir . 'tmp');
}
}
// Ensure it exists
if (!is_dir(self::$_upload_dir)) {
// Create the directory
$wp_filesystem->mkdir(self::$_upload_dir);
}
}
开发者ID:Ahmed-dawoud,项目名称:care4u,代码行数:34,代码来源:framework.php
示例20: ttEnqueueStyles
/**
* Enqueue custom stylesheets
*
* @author Jonny Frodsham
**/
function ttEnqueueStyles()
{
if (!is_admin()) {
wp_register_style('stylesheet', THEME_DIRECTORY . '/assets/css/tatton.css', array(), filemtime(get_stylesheet_directory() . '/assets/css/tatton.css'), 'all');
wp_enqueue_style('stylesheet');
}
}
开发者ID:paradigm-group,项目名称:tim,代码行数:12,代码来源:stylesheets.php
注:本文中的get_stylesheet_directory函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论