本文整理汇总了PHP中Jetpack::glob_php方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::glob_php方法的具体用法?PHP Jetpack::glob_php怎么用?PHP Jetpack::glob_php使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack
的用法示例。
在下文中一共展示了Jetpack::glob_php方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
$shortcode_includes = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
$shortcode_includes[] = $file;
}
$shortcode_includes = apply_filters('jetpack_shortcodes_to_include', $shortcode_includes);
foreach ($shortcode_includes as $include) {
include $include;
}
}
示例2: jetpack_load_widgets
/**
* Module Name: Extra Sidebar Widgets
* Module Description: Easily add images, Twitter updates, and your site's RSS links to your theme's sidebar.
* Sort Order: 13
* First Introduced: 1.2
* Requires Connection: No
*/
function jetpack_load_widgets()
{
$widgets_include = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/widgets') as $file) {
$widgets_include[] = $file;
}
$widgets_include = apply_filters('jetpack_widgets_to_include', $widgets_include);
foreach ($widgets_include as $include) {
include $include;
}
}
示例3: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
if (version_compare(PHP_VERSION, 5, '<')) {
$php5_only = array('videopress.php' => true);
} else {
$php5_only = array();
}
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
if (isset($php5_only[basename($file)])) {
continue;
}
include $file;
}
}
示例4: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
global $wp_version;
$shortcode_includes = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
$shortcode_includes[] = $file;
}
$shortcode_includes = apply_filters('jetpack_shortcodes_to_include', $shortcode_includes);
foreach ($shortcode_includes as $include) {
if (version_compare($wp_version, '3.6-z', '>=') && stristr($include, 'audio.php')) {
continue;
}
include $include;
}
}
示例5: jetpack_load_widgets
/**
* Module Name: Extra Sidebar Widgets
* Module Description: Add images, Twitter streams, your site’s RSS links, and more to your sidebar.
* Sort Order: 4
* First Introduced: 1.2
* Requires Connection: No
* Auto Activate: Yes
* Module Tags: Social, Appearance
*/
function jetpack_load_widgets()
{
$widgets_include = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/widgets') as $file) {
$widgets_include[] = $file;
}
/**
* Modify which Jetpack Widgets to register.
*
* @since 2.2.1
*
* @param array $widgets_include An array of widgets to be registered.
*/
$widgets_include = apply_filters('jetpack_widgets_to_include', $widgets_include);
foreach ($widgets_include as $include) {
include $include;
}
}
示例6: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
global $wp_version;
$shortcode_includes = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
$shortcode_includes[] = $file;
}
/**
* This filter allows other plugins to override which shortcodes Jetpack loads.
*
* @module shortcodes
*
* @since 2.2.1
*
* @param array $shortcode_includes An array of which shortcodes to include.
*/
$shortcode_includes = apply_filters('jetpack_shortcodes_to_include', $shortcode_includes);
foreach ($shortcode_includes as $include) {
include $include;
}
}
示例7: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
global $wp_version;
$shortcode_includes = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
$shortcode_includes[] = $file;
}
/**
* This filter allows other plugins to override which shortcodes Jetpack loads.
*
* @since 2.2.1
*
* @param array $shortcode_includes An array of which shortcodes to include.
*/
$shortcode_includes = apply_filters('jetpack_shortcodes_to_include', $shortcode_includes);
foreach ($shortcode_includes as $include) {
if (version_compare($wp_version, '3.6-z', '>=') && stristr($include, 'audio.php')) {
continue;
}
include $include;
}
}
示例8: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
$shortcode_includes = array();
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
$filename = substr(basename($file), 0, -4);
$shortcode_includes[$filename] = $file;
}
/**
* This filter allows other plugins to override which shortcodes Jetpack loads.
*
* @module shortcodes
*
* @since 2.2.1
* @since 4.2.0 Added filename without extension as array key.
*
* @param array $shortcode_includes An array of which shortcodes to include.
*/
$shortcode_includes = apply_filters('jetpack_shortcodes_to_include', $shortcode_includes);
foreach ($shortcode_includes as $include) {
include $include;
}
}
示例9: get_available_modules
/**
* List available Jetpack modules. Simply lists .php files in /modules/.
* Make sure to tuck away module "library" files in a sub-directory.
*/
public static function get_available_modules($min_version = false, $max_version = false)
{
static $modules = null;
if (!isset($modules)) {
$files = Jetpack::glob_php(JETPACK__PLUGIN_DIR . 'modules');
$modules = array();
foreach ($files as $file) {
if (!($headers = Jetpack::get_module($file))) {
continue;
}
$modules[Jetpack::get_module_slug($file)] = $headers['introduced'];
}
}
$modules = apply_filters('jetpack_get_available_modules', $modules, $min_version, $max_version);
if (!$min_version && !$max_version) {
return array_keys($modules);
}
$r = array();
foreach ($modules as $slug => $introduced) {
if ($min_version && version_compare($min_version, $introduced, '>=')) {
continue;
}
if ($max_version && version_compare($max_version, $introduced, '<')) {
continue;
}
$r[] = $slug;
}
return $r;
}
示例10: get_available_modules
/**
* List available Jetpack modules. Simply lists .php files in /modules/.
* Make sure to tuck away module "library" files in a sub-directory.
*/
public static function get_available_modules($min_version = false, $max_version = false)
{
static $modules = null;
if (!isset($modules)) {
$available_modules_option = Jetpack_Options::get_option('available_modules', array());
// Use the cache if we're on the front-end and it's available...
if (!is_admin() && !empty($available_modules_option[JETPACK__VERSION])) {
$modules = $available_modules_option[JETPACK__VERSION];
} else {
$files = Jetpack::glob_php(JETPACK__PLUGIN_DIR . 'modules');
$modules = array();
foreach ($files as $file) {
if (!($headers = Jetpack::get_module($file))) {
continue;
}
$modules[Jetpack::get_module_slug($file)] = $headers['introduced'];
}
Jetpack_Options::update_option('available_modules', array(JETPACK__VERSION => $modules));
}
}
/**
* Filters the array of modules available to be activated.
*
* @since 2.4.0
*
* @param array $modules Array of available modules.
* @param string $min_version Minimum version number required to use modules.
* @param string $max_version Maximum version number required to use modules.
*/
$mods = apply_filters('jetpack_get_available_modules', $modules, $min_version, $max_version);
if (!$min_version && !$max_version) {
return array_keys($mods);
}
$r = array();
foreach ($mods as $slug => $introduced) {
if ($min_version && version_compare($min_version, $introduced, '>=')) {
continue;
}
if ($max_version && version_compare($max_version, $introduced, '<')) {
continue;
}
$r[] = $slug;
}
return $r;
}
示例11: get_available_modules
/**
* List available Jetpack modules. Simply lists .php files in /modules/.
* Make sure to tuck away module "library" files in a sub-directory.
*/
function get_available_modules($min_version = false, $max_version = false)
{
static $modules = null;
if (!isset($modules)) {
$files = Jetpack::glob_php(dirname(__FILE__) . '/modules');
$modules = array();
foreach ($files as $file) {
if (!($headers = Jetpack::get_module($file))) {
continue;
}
$modules[Jetpack::get_module_slug($file)] = $headers['introduced'];
}
}
if (!$min_version && !$max_version) {
return array_keys($modules);
}
$r = array();
foreach ($modules as $slug => $introduced) {
if ($min_version && version_compare($min_version, $introduced, '>=')) {
continue;
}
if ($max_version && version_compare($max_version, $introduced, '<')) {
continue;
}
$r[] = $slug;
}
return $r;
}
示例12: jetpack_load_widgets
/**
* Module Name: Extra Sidebar Widgets
* Module Description: Easily add images, Twitter updates, and your site's RSS links to your theme's sidebar.
* Sort Order: 9
* First Introduced: 1.2
*/
function jetpack_load_widgets()
{
foreach (Jetpack::glob_php(dirname(__FILE__) . '/widgets') as $file) {
include $file;
}
}
示例13: jetpack_load_shortcodes
function jetpack_load_shortcodes()
{
foreach (Jetpack::glob_php(dirname(__FILE__) . '/shortcodes') as $file) {
include $file;
}
}
示例14: get_available_modules
/**
* List available Jetpack modules. Simply lists .php files in /modules/.
* Make sure to tuck away module "library" files in a sub-directory.
*/
function get_available_modules()
{
static $modules = null;
if (isset($modules)) {
return $modules;
}
$files = Jetpack::glob_php(dirname(__FILE__) . '/modules');
foreach ($files as $file) {
if ($headers = Jetpack::get_module($file)) {
$modules[] = Jetpack::get_module_slug($file);
}
}
return $modules;
}