当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_templating_constants函数代码示例

本文整理汇总了PHP中wp_templating_constants函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_templating_constants函数的具体用法?PHP wp_templating_constants怎么用?PHP wp_templating_constants使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wp_templating_constants函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: WP

$wp = new WP();
/**
 * WordPress Widget Factory Object
 * @global object $wp_widget_factory
 * @since 2.8.0
 */
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
/**
 * WordPress User Roles
 * @global object $wp_roles
 * @since 2.0.0
 */
$GLOBALS['wp_roles'] = new WP_Roles();
do_action('setup_theme');
// Define the template related constants.
wp_templating_constants();
// Load the default text localization domain.
load_default_textdomain();
$locale = get_locale();
$locale_file = WP_LANG_DIR . "/{$locale}.php";
if (0 === validate_file($locale) && is_readable($locale_file)) {
    require $locale_file;
}
unset($locale_file);
// Pull in locale data after loading text domain.
require_once ABSPATH . WPINC . '/locale.php';
/**
 * WordPress Locale object for loading locale domain date and various strings.
 * @global object $wp_locale
 * @since 2.1.0
 */
开发者ID:openify,项目名称:wordpress-composer,代码行数:31,代码来源:wp-settings.php

示例2: bootstrap_wp_for_direct_access

 /**
  * Include only the WP files needed
  *
  * This brilliant piece of code (cough) is from the dsIDXpress plugin.
  *
  * @since 1.3
  */
 function bootstrap_wp_for_direct_access()
 {
     /** @define "$bootstrap_dir" "/srv/www/wordpress-default" */
     $bootstrap_dir = dirname($_SERVER['SCRIPT_FILENAME']);
     /** @define "$bootstrap_dir" "/srv/www" */
     $document_root = dirname(isset($_SERVER['APPL_PHYSICAL_PATH']) ? $_SERVER['APPL_PHYSICAL_PATH'] : $_SERVER['DOCUMENT_ROOT']);
     // Loop through folders and keep looking up the directories until you find a directory that has wp-load.php
     while (!file_exists($bootstrap_dir . '/wp-load.php')) {
         $bootstrap_dir = dirname($bootstrap_dir);
         // The base is no longer part of the path. We're in the weeds.
         // Let's fall back to default relative path to this file from wordpress
         // (wp-content/plugins/gravityview-datatables/includes/)
         if (false === strpos($bootstrap_dir, $document_root)) {
             $bootstrap_dir = "../../../../..";
             break;
         }
     }
     require $bootstrap_dir . '/wp-load.php';
     // Only load what we need.
     if (!function_exists('get_locale')) {
         require_once ABSPATH . WPINC . '/locale.php';
         // is_rtl()
         require_once ABSPATH . WPINC . '/class-wp-walker.php';
         // Needed for GF
         require_once ABSPATH . WPINC . '/plugin.php';
         require_once ABSPATH . WPINC . '/load.php';
         require_once ABSPATH . WPINC . '/l10n.php';
         require_once ABSPATH . WPINC . '/general-template.php';
         require_once ABSPATH . WPINC . '/link-template.php';
         require_once ABSPATH . WPINC . '/formatting.php';
         require_once ABSPATH . WPINC . '/kses.php';
         require_once ABSPATH . WPINC . '/pluggable.php';
         require_once ABSPATH . WPINC . '/capabilities.php';
         require_once ABSPATH . WPINC . '/user.php';
         require_once ABSPATH . WPINC . '/meta.php';
         require_once ABSPATH . WPINC . '/session.php';
         require_once ABSPATH . WPINC . '/shortcodes.php';
         require_once ABSPATH . WPINC . '/theme.php';
         require_once ABSPATH . WPINC . '/template.php';
         require_once ABSPATH . WPINC . '/widgets.php';
         require_once ABSPATH . WPINC . '/rewrite.php';
         require_once ABSPATH . WPINC . '/query.php';
     }
     // Setup WP_PLUGIN_URL, WP_PLUGIN_DIR, etc.
     if (function_exists('wp_plugin_directory_constants')) {
         wp_plugin_directory_constants();
     }
     // USER_COOKIE, AUTH_COOKIE, etc.
     if (function_exists('wp_cookie_constants')) {
         wp_cookie_constants();
     }
     // TEMPLATEPATH, STYLESHEETPATH, etc.
     if (function_exists('wp_templating_constants')) {
         wp_templating_constants();
     }
 }
开发者ID:hansstam,项目名称:makerfaire,代码行数:63,代码来源:class-datatables-data.php


注:本文中的wp_templating_constants函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。