本文整理汇总了PHP中wpml_site_uses_icl函数的典型用法代码示例。如果您正苦于以下问题:PHP wpml_site_uses_icl函数的具体用法?PHP wpml_site_uses_icl怎么用?PHP wpml_site_uses_icl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpml_site_uses_icl函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
global $pagenow;
$this->dependencies = new Installer_Dependencies();
if (empty($this->settings['_pre_1_0_clean_up'])) {
$this->_pre_1_0_clean_up();
}
$this->settings = $this->_old_products_format_backwards_compatibility($this->settings);
if (!function_exists('get_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$this->_using_icl = function_exists('wpml_site_uses_icl') && wpml_site_uses_icl();
$this->_wpml_version = defined('ICL_SITEPRESS_VERSION') ? ICL_SITEPRESS_VERSION : '';
wp_enqueue_script('installer-admin', $this->res_url() . '/res/js/admin.js', array('jquery'), $this->version());
wp_enqueue_style('installer-admin', $this->res_url() . '/res/css/admin.css', array(), $this->version());
$translation_array = array('installing' => __('Installing %s', 'installer'), 'updating' => __('Updating %s', 'installer'), 'activating' => __('Activating %s', 'installer'));
wp_localize_script('installer-admin', 'installer_strings', $translation_array);
if ($pagenow == 'plugins.php') {
add_action('admin_notices', array($this, 'setup_plugins_page_notices'));
add_action('admin_notices', array($this, 'setup_plugins_renew_warnings'), 10);
add_action('admin_notices', array($this, 'queue_plugins_renew_warnings'), 20);
add_action('admin_init', array($this, 'setup_plugins_action_links'));
}
if ($this->is_repositories_page()) {
add_action('admin_init', array($this, 'validate_repository_subscription'));
}
if (defined('DOING_AJAX')) {
add_action('wp_ajax_save_site_key', array($this, 'save_site_key'));
add_action('wp_ajax_remove_site_key', array($this, 'remove_site_key'));
add_action('wp_ajax_update_site_key', array($this, 'update_site_key'));
add_action('wp_ajax_installer_download_plugin', array($this, 'download_plugin_ajax_handler'));
add_action('wp_ajax_installer_activate_plugin', array($this, 'activate_plugin'));
add_action('wp_ajax_installer_dismiss_nag', array($this, 'dismiss_nag'));
}
if ($pagenow == 'update.php') {
if (isset($_GET['action']) && $_GET['action'] == 'update-selected') {
add_action('admin_head', array($this, 'plugin_upgrade_custom_errors'));
//iframe/bulk
} else {
add_action('all_admin_notices', array($this, 'plugin_upgrade_custom_errors'));
//regular/singular
}
}
// WP 4.2
if (defined('DOING_AJAX')) {
add_action('wp_ajax_update-plugin', array($this, 'plugin_upgrade_custom_errors'), 0);
// high priority, before WP
}
//Include theme support
include_once $this->plugin_path() . '/includes/class-installer-theme.php';
// Extra information about the source of Installer
$package_source_file = $this->plugin_path() . '/installer-source.json';
if (file_exists($package_source_file)) {
$this->package_source = json_decode(file_get_contents($package_source_file));
}
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:56,代码来源:installer.class.php
示例2: filter_downloads_by_icl
public function filter_downloads_by_icl()
{
if (function_exists('wpml_site_uses_icl') && wpml_site_uses_icl()) {
if (!empty($this->settings['repositories'])) {
foreach ($this->settings['repositories'] as $repository_id => $repository) {
if (empty($repository['data']['packages'])) {
continue;
}
foreach ($repository['data']['packages'] as $package_id => $package) {
foreach ($package['products'] as $product_id => $product) {
foreach ($product['downloads'] as $download_id => $download) {
if (isset($download['version-for-icl']) && isset($download['url-for-icl'])) {
$download['version'] = $download['version-for-icl'];
$download['url'] = $download['url-for-icl'];
unset($download['version-for-icl']);
unset($download['url-for-icl']);
$this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id] = $download;
}
}
}
}
}
}
}
// Exception: WPML before 3.2 should not be able to upgrade to 3.2+ automatically
// Only when the exact folder name is used: sitepress-multilignaul-cms
$plugins = get_plugins();
foreach ($plugins as $id => $plugin) {
if (dirname($id) == 'sitepress-multilingual-cms') {
$wpml_version = $plugin['Version'];
}
}
if (!empty($wpml_version) && version_compare($wpml_version, '3.2', '<')) {
if (!empty($this->settings['repositories']['wpml'])) {
foreach ($this->settings['repositories']['wpml']['data']['packages'] as $package_id => $package) {
foreach ($package['products'] as $product_id => $product) {
foreach ($product['downloads'] as $download_id => $download) {
$this->settings['repositories']['wpml']['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id]['changelog'] = '';
$this->settings['repositories']['wpml']['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id]['description'] = '';
if (isset($download['version-for-icl']) && isset($download['url-for-icl'])) {
$download['version'] = $download['version-for-icl'];
$download['url'] = $download['url-for-icl'];
unset($download['version-for-icl']);
unset($download['url-for-icl']);
$this->settings['repositories']['wpml']['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id] = $download;
}
}
}
}
}
}
// Exception pre-WPML 3.2 - END
}
开发者ID:quanglong05,项目名称:unicons,代码行数:53,代码来源:installer.class.php
示例3: wpml_set_plugin_as_inactive
require ICL_PLUGIN_PATH . '/inc/functions-security.php';
require ICL_PLUGIN_PATH . '/inc/wpml-post-comments.class.php';
require ICL_PLUGIN_PATH . '/inc/icl-admin-notifier.php';
if (!function_exists('filter_input')) {
wpml_set_plugin_as_inactive();
add_action('admin_notices', 'wpml_missing_filter_input_notice');
return;
}
$icl_plugin_url = untrailingslashit(plugin_dir_url(__FILE__));
if ((bool) wpml_get_setting_filter(array(), 'language_domains') === true && isset($_SERVER['HTTP_HOST'])) {
global $wpdb, $wpml_include_url_filter;
$wpml_include_url_filter = new WPML_Include_Url($wpdb, $_SERVER['HTTP_HOST']);
$icl_plugin_url = $wpml_include_url_filter->filter_include_url($icl_plugin_url);
}
define('ICL_PLUGIN_URL', $icl_plugin_url);
if ((!defined('WPML_BYPASS_ICL_CHECK') || !WPML_BYPASS_ICL_CHECK) && wpml_version_is('3.2', '>=') && wpml_site_uses_icl()) {
wpml_set_plugin_as_inactive();
add_action('admin_notices', 'wpml_site_uses_icl_message_notice');
if (is_admin()) {
activate_installer();
}
return;
}
require ICL_PLUGIN_PATH . '/inc/template-functions.php';
require ICL_PLUGIN_PATH . '/inc/lang-data.php';
require ICL_PLUGIN_PATH . '/inc/setup/sitepress-setup.class.php';
require ICL_PLUGIN_PATH . '/inc/not-compatible-plugins.php';
if (!empty($icl_ncp_plugins)) {
return;
}
require ICL_PLUGIN_PATH . '/inc/setup/sitepress-schema.php';
开发者ID:breakthroughdesign,项目名称:qaulitrol,代码行数:31,代码来源:sitepress.php
示例4: filter_downloads_by_icl
public function filter_downloads_by_icl()
{
if (function_exists('wpml_site_uses_icl') && wpml_site_uses_icl()) {
if (!empty($this->settings['repositories'])) {
foreach ($this->settings['repositories'] as $repository_id => $repository) {
if (empty($repository['data']['packages'])) {
continue;
}
foreach ($repository['data']['packages'] as $package_id => $package) {
foreach ($package['products'] as $product_id => $product) {
foreach ($product['downloads'] as $download_id => $download) {
$this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id]['changelog'] = '';
$this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id]['description'] = '';
if (isset($download['version-for-icl']) && isset($download['url-for-icl'])) {
$download['version'] = $download['version-for-icl'];
$download['url'] = $download['url-for-icl'];
unset($download['version-for-icl']);
unset($download['url-for-icl']);
$this->settings['repositories'][$repository_id]['data']['packages'][$package_id]['products'][$product_id]['downloads'][$download_id] = $download;
}
}
}
}
}
}
}
}
开发者ID:PHQ-Design,项目名称:souza-lima,代码行数:27,代码来源:installer.class.php
示例5: wpml_set_plugin_as_inactive
}
require ICL_PLUGIN_PATH . '/inc/wpml-dependencies-check/wpml-bundle-check.class.php';
require ICL_PLUGIN_PATH . '/inc/wpml-private-actions.php';
require ICL_PLUGIN_PATH . '/inc/locale/wpml-locale.class.php';
require ICL_PLUGIN_PATH . '/inc/functions.php';
require ICL_PLUGIN_PATH . '/inc/functions-security.php';
require ICL_PLUGIN_PATH . '/inc/core-abstract-classes/wpml-element-translation.class.php';
require ICL_PLUGIN_PATH . '/inc/wpml-post-comments.class.php';
require ICL_PLUGIN_PATH . '/inc/icl-admin-notifier.php';
if (!function_exists('filter_input')) {
wpml_set_plugin_as_inactive();
add_action('admin_notices', 'wpml_missing_filter_input_notice');
return;
}
define('ICL_PLUGIN_URL', wpml_filter_include_url(untrailingslashit(plugin_dir_url(__FILE__))));
if (wpml_version_is('3.2') && wpml_site_uses_icl()) {
wpml_set_plugin_as_inactive();
add_action('admin_notices', 'wpml_site_uses_icl_message_notice');
return;
}
require ICL_PLUGIN_PATH . '/inc/template-functions.php';
add_action('plugins_loaded', 'wpml_apply_include_filters');
require ICL_PLUGIN_PATH . '/inc/lang-data.php';
require ICL_PLUGIN_PATH . '/inc/setup/sitepress-setup.class.php';
require ICL_PLUGIN_PATH . '/inc/not-compatible-plugins.php';
if (!empty($icl_ncp_plugins)) {
return;
}
require ICL_PLUGIN_PATH . '/inc/setup/sitepress-schema.php';
require ICL_PLUGIN_PATH . '/inc/functions-load.php';
require ICL_PLUGIN_PATH . '/inc/constants.php';
开发者ID:quyetdc,项目名称:ceramic,代码行数:31,代码来源:sitepress.php
示例6: wpml_set_plugin_as_inactive
}
require ICL_PLUGIN_PATH . '/inc/wpml-dependencies-check/wpml-bundle-check.class.php';
require ICL_PLUGIN_PATH . '/inc/wpml-private-actions.php';
require ICL_PLUGIN_PATH . '/inc/locale/wpml-locale.class.php';
require ICL_PLUGIN_PATH . '/inc/functions.php';
require ICL_PLUGIN_PATH . '/inc/functions-security.php';
require ICL_PLUGIN_PATH . '/inc/core-abstract-classes/wpml-element-translation.class.php';
require ICL_PLUGIN_PATH . '/inc/wpml-post-comments.class.php';
require ICL_PLUGIN_PATH . '/inc/icl-admin-notifier.php';
if (!function_exists('filter_input')) {
wpml_set_plugin_as_inactive();
add_action('admin_notices', 'wpml_missing_filter_input_notice');
return;
}
define('ICL_PLUGIN_URL', wpml_filter_include_url(untrailingslashit(plugin_dir_url(__FILE__))));
if (wpml_version_is(ICL_SITEPRESS_VERSION) && wpml_site_uses_icl()) {
wpml_set_plugin_as_inactive();
add_action('admin_notices', 'wpml_site_uses_icl_message_notice');
return;
}
require ICL_PLUGIN_PATH . '/inc/template-functions.php';
add_action('plugins_loaded', 'wpml_apply_include_filters');
require ICL_PLUGIN_PATH . '/inc/lang-data.php';
require ICL_PLUGIN_PATH . '/inc/setup/sitepress-setup.class.php';
require ICL_PLUGIN_PATH . '/inc/not-compatible-plugins.php';
if (!empty($icl_ncp_plugins)) {
return;
}
require ICL_PLUGIN_PATH . '/inc/setup/sitepress-schema.php';
require ICL_PLUGIN_PATH . '/inc/functions-load.php';
require ICL_PLUGIN_PATH . '/inc/constants.php';
开发者ID:ngocthangict,项目名称:edo,代码行数:31,代码来源:sitepress.php
注:本文中的wpml_site_uses_icl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论