• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_plugin_directory_constants函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: finishRestore

 /**
  * Finishes clone operation
  *
  * @subcommand finish-restore-site
  *
  * @when before_wp_load
  *
  */
 public function finishRestore($args, $assoc_args)
 {
     define('SHORTINIT', true);
     $wpConfigPath = \WP_CLI\Utils\locate_wp_config();
     require_once $wpConfigPath;
     require ABSPATH . WPINC . '/formatting.php';
     require ABSPATH . WPINC . '/link-template.php';
     require ABSPATH . WPINC . '/shortcodes.php';
     require ABSPATH . WPINC . '/taxonomy.php';
     wp_plugin_directory_constants();
     require_once WP_PLUGIN_DIR . '/versionpress/bootstrap.php';
     $versionPressContainer = DIContainer::getConfiguredInstance();
     /** @var ActionsDefinitionRepository $actionsDefinitionRepository */
     $actionsDefinitionRepository = $versionPressContainer->resolve(VersionPressServices::ACTIONS_DEFINITION_REPOSITORY);
     $actionsDefinitionRepository->restoreAllDefinitionFilesFromHistory();
     // Truncate tables
     /** @var Database $database */
     $database = $versionPressContainer->resolve(VersionPressServices::DATABASE);
     /** @var DbSchemaInfo $dbSchema */
     $dbSchema = $versionPressContainer->resolve(VersionPressServices::DB_SCHEMA);
     $tables = array_map(function ($entityName) use($dbSchema) {
         return $dbSchema->getPrefixedTableName($entityName);
     }, array_merge($dbSchema->getAllEntityNames(), array_map(function ($referenceDetails) {
         return $referenceDetails['junction-table'];
     }, $dbSchema->getAllMnReferences())));
     $tables = array_filter($tables, function ($table) use($database) {
         return $table !== $database->options;
     });
     foreach ($tables as $table) {
         $truncateCmd = "TRUNCATE TABLE `{$table}`";
         @$database->query($truncateCmd);
         // Intentional @ - not existing table is ok for us but TRUNCATE ends with error
     }
     // Create VersionPress tables
     /** @var \VersionPress\Initialization\Initializer $initializer */
     $initializer = $versionPressContainer->resolve(VersionPressServices::INITIALIZER);
     $initializer->createVersionPressTables();
     WP_CLI::success("VersionPress tables created");
     // Install Custom merge driver
     MergeDriverInstaller::installMergeDriver(VP_PROJECT_ROOT, VERSIONPRESS_PLUGIN_DIR, VP_VPDB_DIR);
     WP_CLI::success("Git merge driver added");
     // Run synchronization
     /** @var SynchronizationProcess $syncProcess */
     $syncProcess = $versionPressContainer->resolve(VersionPressServices::SYNCHRONIZATION_PROCESS);
     $syncProcess->synchronizeAll();
     WP_CLI::success("Database synchronized");
     VPCommandUtils::runWpCliCommand('vp-internal', 'flush-regenerable-values', ['require' => __FILE__]);
 }
开发者ID:versionpress,项目名称:versionpress,代码行数:56,代码来源:vp-internal.php


示例2: wp_plugin_directory_constants

require ABSPATH . WPINC . '/cron.php';
require ABSPATH . WPINC . '/deprecated.php';
require ABSPATH . WPINC . '/script-loader.php';
require ABSPATH . WPINC . '/taxonomy.php';
require ABSPATH . WPINC . '/update.php';
require ABSPATH . WPINC . '/canonical.php';
require ABSPATH . WPINC . '/shortcodes.php';
require ABSPATH . WPINC . '/class-wp-embed.php';
require ABSPATH . WPINC . '/media.php';
//require( ABSPATH . WPINC . '/http.php' );
//require( ABSPATH . WPINC . '/class-http.php' );
require ABSPATH . WPINC . '/widgets.php';
//require( ABSPATH . WPINC . '/nav-menu.php' );
//require( ABSPATH . WPINC . '/nav-menu-template.php' );
//require( ABSPATH . WPINC . '/admin-bar.php' );
wp_plugin_directory_constants();
require 'calendarize-it.php';
// Load pluggable functions.
require ABSPATH . WPINC . '/pluggable.php';
require ABSPATH . WPINC . '/pluggable-deprecated.php';
do_action('plugins_loaded');
$GLOBALS['wp_the_query'] = new WP_Query();
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
$GLOBALS['wp_rewrite'] = new WP_Rewrite();
$GLOBALS['wp'] = new WP();
$GLOBALS['wp_widget_factory'] = new WP_Widget_Factory();
$GLOBALS['wp_roles'] = new WP_Roles();
do_action('setup_theme');
do_action('after_setup_theme');
//$GLOBALS['wp']->init();
do_action('init');
开发者ID:kaydwithers,项目名称:crossfittanjongpagar,代码行数:31,代码来源:ajax.php


示例3: get_path

 /**
  * Returns path to the plugin's directory. If `$file` is provided
  * than is appended to the end of the path.
  *
  * @since 0.1.3
  * @param string $file (Optional).
  * @return string
  */
 public function get_path($file = '')
 {
     if (!defined('WP_PLUGIN_DIR')) {
         wp_plugin_directory_constants();
     }
     // TODO There is probably better constant than WP_CONTENT_DIR!
     $path = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $this->id;
     if (!empty($file)) {
         $path .= DIRECTORY_SEPARATOR . $file;
     }
     return $path;
 }
开发者ID:ondrejd,项目名称:odwp,代码行数:20,代码来源:SimplePlugin.php


示例4: 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_plugin_directory_constants函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_plupload_default_settings函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_password_change_notification函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap