本文整理汇总了PHP中SitePress::get_installed_plugins方法的典型用法代码示例。如果您正苦于以下问题:PHP SitePress::get_installed_plugins方法的具体用法?PHP SitePress::get_installed_plugins怎么用?PHP SitePress::get_installed_plugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SitePress
的用法示例。
在下文中一共展示了SitePress::get_installed_plugins方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mla_render_language_tab
/**
* Renders the Settings/Media Library Assistant "Language" tab
*
* @since 2.11
*
* @return array ( 'message' => '', 'body' => '' )
*/
public static function mla_render_language_tab()
{
$page_content = array('message' => '', 'body' => '<h2>' . __('Language', 'media-library-assistant') . '</h2>');
/*
* Check for submit buttons to change or reset settings.
* Initialize page messages and content.
*/
if (!empty($_REQUEST['mla-language-options-save'])) {
check_admin_referer(MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME);
$page_content = self::_save_language_settings();
} elseif (!empty($_REQUEST['mla-language-options-reset'])) {
check_admin_referer(MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME);
$page_content = self::_reset_language_settings();
} else {
$page_content = array('message' => '', 'body' => '');
}
if (!empty($page_content['body'])) {
return $page_content;
}
/*
* Find WPML Media plugin status
*/
$installed = false;
$active = false;
$wpml_media = SitePress::get_installed_plugins();
if (isset($wpml_media['WPML Media'])) {
$wpml_media = $wpml_media['WPML Media'];
if (!empty($wpml_media['plugin'])) {
$installed = true;
$active = isset($wpml_media['file']) && is_plugin_active($wpml_media['file']);
}
}
$wpml_media = '';
if (!$installed) {
$wpml_media = '<p><strong>' . __('WARNING:', 'media-library-assistant') . __(' WPML Media is not installed.', 'media-library-assistant') . '</strong></p>';
} elseif (!$active) {
$wpml_media = '<p><strong>' . __('WARNING:', 'media-library-assistant') . __(' WPML Media is not active.', 'media-library-assistant') . '</strong></p>';
}
$page_values = array('Language Options' => __('Language Options', 'media-library-assistant'), 'In this tab' => sprintf(__('In this tab you can find a number of options for controlling WPML-specific operations. Scroll down to find options for %1$s and %2$s. Be sure to click "Save Changes" at the bottom of the tab to save any changes you make.', 'media-library-assistant'), '<strong>' . __('Media/Assistant submenu table', 'media-library-assistant') . '</strong>', '<strong>' . __('Term Management', 'media-library-assistant') . '</strong>'), 'You can find' => sprintf(__('You can find more information about multilingual features in the %1$s section of the Documentation.', 'media-library-assistant'), '<a href="[+settingsURL+]?page=mla-settings-menu-documentation&mla_tab=documentation#mla_language_tab" title="' . __('Language Options documentation', 'media-library-assistant') . '">' . __('WPML & Polylang Multilingual Support; the MLA Language Tab', 'media-library-assistant') . '</a>'), 'WPML Status' => $wpml_media, 'settingsURL' => admin_url('options-general.php'), 'Save Changes' => __('Save Changes', 'media-library-assistant'), 'Delete Language options' => __('Delete Language options and restore default settings', 'media-library-assistant'), '_wpnonce' => wp_nonce_field(MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME, true, false), '_wp_http_referer' => wp_referer_field(false), 'Go to Top' => __('Go to Top', 'media-library-assistant'), 'form_url' => admin_url('options-general.php') . '?page=mla-settings-menu-language&mla_tab=language', 'options_list' => '');
$options_list = '';
foreach (MLA_WPML::$mla_language_option_definitions as $key => $value) {
if ('language' == $value['tab']) {
$options_list .= MLASettings::mla_compose_option_row($key, $value, MLA_WPML::$mla_language_option_definitions);
}
}
$page_values['options_list'] = $options_list;
$page_template = MLACore::mla_load_template('admin-display-language-tab.tpl');
$page_content['body'] = MLAData::mla_parse_template($page_template, $page_values);
return $page_content;
}
示例2: check_settings_integrity
public static function check_settings_integrity()
{
if (wpml_is_ajax()) {
return true;
}
if (isset($_GET['debug_action']) && $_GET['nonce'] == wp_create_nonce($_GET['debug_action'])) {
if ($_GET['debug_action'] == 'reset_wpml_settings') {
$referrer = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : get_admin_url();
$current_settings = get_option('icl_sitepress_settings');
unset($current_settings['setup_complete']);
unset($current_settings['setup_wizard_step']);
unset($current_settings['existing_content_language_verified']);
unset($current_settings['dont_show_help_admin_notice']);
global $wpdb;
$wpdb->query('TRUNCATE TABLE ' . $wpdb->prefix . 'icl_translations');
update_option('icl_sitepress_settings', $current_settings);
wp_redirect($referrer);
exit;
}
}
global $wpdb;
static $result;
if (isset($result)) {
return $result;
}
$current_settings = get_option('icl_sitepress_settings');
if (!$current_settings) {
return true;
}
$setup_wizard_step = false;
if (isset($current_settings['setup_wizard_step'])) {
$setup_wizard_step = $current_settings['setup_wizard_step'];
}
$setup_complete = false;
$setup_complete_missing = true;
if (isset($current_settings['setup_complete'])) {
$setup_complete = $current_settings['setup_complete'];
$setup_complete_missing = false;
}
//Skip checks during first setup wizard
if ($setup_wizard_step !== false && $setup_wizard_step < 4 || !$setup_complete_missing && $setup_complete === false && $setup_wizard_step == 4) {
return true;
}
$default_language = false;
$default_language_missing = true;
if (isset($current_settings['default_language'])) {
$default_language = $current_settings['default_language'];
$default_language_missing = false;
}
$active_languages_sql = "SELECT * FROM " . $wpdb->prefix . 'icl_languages WHERE active=%d';
$active_languages_prepared = $wpdb->prepare($active_languages_sql, array(1));
$active_languages = $wpdb->get_results($active_languages_prepared);
$existing_translations_sql = "SELECT count(*) FROM " . $wpdb->prefix . 'icl_translations';
$existing_translations = $wpdb->get_var($existing_translations_sql);
$show_notice = false;
$message = '';
if ((!$setup_complete || !$default_language) && $existing_translations) {
$message .= '<p>';
$message .= __('Your WPML settings seem to be corrupted. To avoid corrupting your existing data, we have hidden WPML from this site.', 'sitepress');
$message .= '</p>';
$message .= '<p>';
$message .= __('If this is the first time you install WPML on this site, you may have faced a database or script connection drop, that caused settings to be not completely store.', 'sitepress');
$message .= __('In this case, you can click on the <strong>Reset Settings</strong> button: this will reset WPML settings and any language translation information, allowing you to restart the wizard.', 'sitepress');
$message .= '</p>';
$message .= '<p>';
$message .= sprintf(__('If you have just upgraded WPML or after starting over you keep getting this message, please contact the <a href="%s">support forum</a> as soon as possible, in order to provide you with a fix to this issue.', 'sitepress'), 'https://wpml.org/forums/');
$message .= '</p>';
$message .= '<p>';
$confirm_message = _x('Are you sure you want to reset WPML Settings?', 'Reset WPML settings', 'sitepress');
$confirm_message .= ' ';
$confirm_message .= _x('This will also empty translation information (if any).', 'Reset WPML settings', 'sitepress');
$message .= '<a href="?icl_reset_settings=1&debug_action=reset_wpml_settings&nonce=' . wp_create_nonce('reset_wpml_settings') . '" class="button" onclick="return window.confirm(\'' . $confirm_message . '\');" >' . __('Reset Settings', 'sitepress') . '</a>';
$message .= ' ';
$message .= ' ';
$message .= ' ';
$message .= '<a href="https://wpml.org/forums/" class="button">' . __('Contact Support', 'sitepress') . '</a>';
$message .= '</p>';
$message .= '<p>';
$message .= __('Additional details for the support team (there is no need to copy it, as the support team will be able to see it once logged in):', 'sitepress');
$message .= '</p>';
$message .= '<p><textarea rows="10" style="width:100%;display:block;" onclick="this.focus();this.select();" readonly="readonly">';
$message .= str_repeat('=', 50);
$wpml_plugins_list = SitePress::get_installed_plugins();
foreach ($wpml_plugins_list as $name => $plugin_data) {
$plugin_name = $name;
$file = $plugin_data['file'];
$message .= PHP_EOL . $plugin_name;
$message .= ' ' . (isset($plugin_data['plugin']['Version']) ? $plugin_data['plugin']['Version'] : __('Version n/a', 'sitepress'));
$message .= ' => ';
if (empty($plugin_data['plugin'])) {
$message .= 'Not installed';
} else {
$message .= 'Installed';
}
$message .= '/';
$message .= isset($file) && is_plugin_active($file) ? 'Active' : 'Not Active';
}
$message .= PHP_EOL . str_repeat('-', 50);
$message .= PHP_EOL . 'icl_translations count: ' . ($existing_translations ? $existing_translations : '0');
$message .= PHP_EOL . 'setup_complete: ' . ($setup_complete ? 'true' : 'false');
//.........这里部分代码省略.........
示例3: _e
<div class="wrap">
<div id="icon-wpml" class="icon32" style="clear:both" ><br /></div>
<h2><?php
_e('Support', 'sitepress');
?>
</h2>
<p style="margin-top: 20px;">
<?php
_e('Technical support for clients is available via <a target="_blank" href="https://wpml.org/forums/">WPML forums</a>.', 'sitepress');
?>
</p>
<?php
$wpml_plugins_list = SitePress::get_installed_plugins();
echo '
<table class="widefat" style="width: auto;">
<thead>
<tr>
<th>' . __('Plugin Name', 'sitepress') . '</th>
<th style="text-align:right">' . __('Status', 'sitepress') . '</th>
<th>' . __('Active', 'sitepress') . '</th>
<th>' . __('Version', 'sitepress') . '</th>
</tr>
</thead>
<tbody>
';
foreach ($wpml_plugins_list as $name => $plugin_data) {
$plugin_name = $name;
$file = $plugin_data['file'];