本文整理汇总了PHP中Jetpack::module_configuration_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Jetpack::module_configuration_url方法的具体用法?PHP Jetpack::module_configuration_url怎么用?PHP Jetpack::module_configuration_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jetpack
的用法示例。
在下文中一共展示了Jetpack::module_configuration_url方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jetpack_json_api_configuration_load
function jetpack_json_api_configuration_load()
{
if (isset($_POST['action']) && $_POST['action'] == 'save_options' && wp_verify_nonce($_POST['_wpnonce'], 'json-api')) {
Jetpack_Options::update_option('json_api_full_management', isset($_POST['json_api_full_management']));
Jetpack::state('message', 'module_configured');
wp_safe_redirect(Jetpack::module_configuration_url('json-api'));
exit;
}
}
示例2: minileven_configuration_load
function minileven_configuration_load()
{
if (isset($_POST['action']) && $_POST['action'] == 'save_options' && $_POST['_wpnonce'] == wp_create_nonce('minileven')) {
if (isset($_POST['wp_mobile_excerpt'])) {
update_option('wp_mobile_excerpt', '1' == $_POST['wp_mobile_excerpt'] ? '1' : '0');
}
update_option('wp_mobile_app_promos', isset($_POST['wp_mobile_app_promos']) ? '1' : '0');
Jetpack::state('message', 'module_configured');
wp_safe_redirect(Jetpack::module_configuration_url('minileven'));
exit;
}
}
示例3: jetpack_configuration_load
public function jetpack_configuration_load()
{
if (Jetpack::is_user_connected() && !self::is_active()) {
Jetpack::deactivate_module($this->module);
Jetpack::state('message', 'module_deactivated');
wp_safe_redirect(Jetpack::admin_url('page=jetpack'));
die;
}
if (!empty($_POST['action']) && $_POST['action'] == 'monitor-save') {
check_admin_referer('monitor-settings');
$this->update_option_receive_jetpack_monitor_notification(isset($_POST['receive_jetpack_monitor_notification']));
Jetpack::state('message', 'module_configured');
wp_safe_redirect(Jetpack::module_configuration_url($this->module));
}
}
示例4: get_modules
function get_modules()
{
include_once JETPACK__PLUGIN_DIR . 'modules/module-info.php';
$available_modules = $this->jetpack->get_available_modules();
$active_modules = $this->jetpack->get_active_modules();
$modules = array();
$jetpack_active = Jetpack::is_active() || Jetpack::is_development_mode();
foreach ($available_modules as $module) {
if ($module_array = $this->jetpack->get_module($module)) {
$short_desc = apply_filters('jetpack_short_module_description', $module_array['description'], $module);
// Fix: correct multibyte strings truncate with checking for mbstring extension
$short_desc_trunc = function_exists('mb_strlen') ? mb_strlen($short_desc) > 143 ? mb_substr($short_desc, 0, 140) . '...' : $short_desc : (strlen($short_desc) > 143 ? substr($short_desc, 0, 140) . '...' : $short_desc);
$module_array['module'] = $module;
$module_array['activated'] = $jetpack_active ? in_array($module, $active_modules) : false;
$module_array['deactivate_nonce'] = wp_create_nonce('jetpack_deactivate-' . $module);
$module_array['activate_nonce'] = wp_create_nonce('jetpack_activate-' . $module);
$module_array['available'] = self::is_module_available($module_array);
$module_array['short_description'] = $short_desc_trunc;
$module_array['configure_url'] = Jetpack::module_configuration_url($module);
ob_start();
do_action('jetpack_learn_more_button_' . $module);
$module_array['learn_more_button'] = ob_get_clean();
ob_start();
if (Jetpack::is_active() && has_action('jetpack_module_more_info_connected_' . $module)) {
do_action('jetpack_module_more_info_connected_' . $module);
} else {
do_action('jetpack_module_more_info_' . $module);
}
$module_array['long_description'] = ob_get_clean();
$module_array['configurable'] = false;
if (current_user_can('manage_options') && apply_filters('jetpack_module_configurable_' . $module, false)) {
$module_array['configurable'] = sprintf('<a href="%1$s">%2$s</a>', esc_url(Jetpack::module_configuration_url($module)), __('Configure', 'jetpack'));
}
$modules[$module] = $module_array;
}
}
uasort($modules, array($this->jetpack, 'sort_modules'));
if (!Jetpack::is_active()) {
uasort($modules, array(__CLASS__, 'sort_requires_connection_last'));
}
return $modules;
}
示例5: admin_screen_list_modules
//.........这里部分代码省略.........
<p><?php
echo apply_filters('jetpack_short_module_description', $module_data['description'], $module);
?>
</p>
</div>
<div class="jetpack-module-actions">
<?php
if ($jetpack_connected || Jetpack::is_development_mode() && !$module_data['requires_connection']) {
?>
<?php
if (!$activated && current_user_can('manage_options') && apply_filters('jetpack_can_activate_' . $module, true)) {
?>
<a href="<?php
echo esc_url($toggle_url);
?>
" class="<?php
echo 'inactive' == $css ? ' button-primary' : ' button-secondary';
?>
"><?php
echo $toggle;
?>
</a>
<?php
}
?>
<?php
do_action('jetpack_learn_more_button_' . $module);
?>
<?php
if (current_user_can('manage_options') && apply_filters('jetpack_module_configurable_' . $module, false)) {
echo '<a href="' . esc_url(Jetpack::module_configuration_url($module)) . '" class="jetpack-configure-button button-secondary">' . __('Configure', 'jetpack') . '</a>';
}
if ($activated && $module_data['deactivate'] && current_user_can('manage_options')) {
?>
<a style="display: none;" href="<?php
echo esc_url($toggle_url);
?>
" class="jetpack-deactivate-button button-secondary"><?php
echo $toggle;
?>
</a> <?php
}
?>
<?php
} else {
?>
<?php
do_action('jetpack_learn_more_button_' . $module);
?>
<?php
}
?>
</div>
</div>
<?php
if ('inactive' == $css && $jetpack_connected && current_user_can('manage_options') && apply_filters('jetpack_can_activate_' . $module, true)) {
?>
<script type="text/javascript">
jQuery( '#<?php
echo esc_js($module);
?>
' ).bind( 'click', function(e){
示例6: configuration_load
/**
* Get or delete API key
*/
public function configuration_load()
{
if (isset($_POST['action']) && $_POST['action'] == 'jetpack_protect_save_whitelist' && wp_verify_nonce($_POST['_wpnonce'], 'jetpack-protect')) {
$whitelist = str_replace(' ', '', $_POST['whitelist']);
$whitelist = explode(PHP_EOL, $whitelist);
$result = jetpack_protect_save_whitelist($whitelist);
$this->whitelist_saved = !is_wp_error($result);
$this->whitelist_error = is_wp_error($result);
}
if (isset($_POST['action']) && 'get_protect_key' == $_POST['action'] && wp_verify_nonce($_POST['_wpnonce'], 'jetpack-protect')) {
$result = $this->get_protect_key();
// Only redirect on success
// If it fails we need access to $this->api_key_error
if ($result) {
wp_safe_redirect(Jetpack::module_configuration_url('protect'));
}
}
$this->api_key = get_site_option('jetpack_protect_key', false);
$this->whitelist = get_site_option('jetpack_protect_whitelist', array());
$this->user_ip = jetpack_protect_get_ip();
}
示例7: stats_configuration_load
function stats_configuration_load()
{
if (isset($_POST['action']) && $_POST['action'] == 'save_options' && $_POST['_wpnonce'] == wp_create_nonce('stats')) {
$options = stats_get_options();
$options['admin_bar'] = isset($_POST['admin_bar']) && $_POST['admin_bar'];
$options['hide_smile'] = isset($_POST['hide_smile']) && $_POST['hide_smile'];
$options['roles'] = array('administrator');
foreach (get_editable_roles() as $role => $details) {
if (isset($_POST["role_{$role}"]) && $_POST["role_{$role}"]) {
$options['roles'][] = $role;
}
}
$options['count_roles'] = array();
foreach (get_editable_roles() as $role => $details) {
if (isset($_POST["count_role_{$role}"]) && $_POST["count_role_{$role}"]) {
$options['count_roles'][] = $role;
}
}
stats_set_options($options);
stats_update_blog();
Jetpack::state('message', 'module_configured');
wp_safe_redirect(Jetpack::module_configuration_url('stats'));
exit;
}
}
示例8: jetpack_configuration_load
/**
* Runs before the VideoPress Configuration screen loads, useful
* to update options and yield errors.
*/
function jetpack_configuration_load()
{
$this->enqueue_admin_scripts();
/**
* Save configuration
*/
if (!empty($_POST['action']) && $_POST['action'] == 'videopress-save') {
check_admin_referer('videopress-settings');
$options = $this->get_options();
if (isset($_POST['blog_id']) && in_array($_POST['blog_id'], wp_list_pluck($options['blogs'], 'blog_id'))) {
$options['blog_id'] = $_POST['blog_id'];
}
// Allow the None setting too.
if (isset($_POST['blog_id']) && $_POST['blog_id'] == 0) {
$options['blog_id'] = 0;
}
/**
* @see $this->can()
*/
if (isset($_POST['videopress-access']) && in_array($_POST['videopress-access'], array('', 'read', 'edit', 'delete'))) {
$options['access'] = $_POST['videopress-access'];
}
$options['freedom'] = isset($_POST['videopress-freedom']);
$options['hd'] = isset($_POST['videopress-hd']);
// Allow upload only if some level of access has been granted, and uploads were allowed.
$options['allow-upload'] = false;
if (!empty($options['access']) && isset($_POST['videopress-upload'])) {
$options['allow-upload'] = true;
}
$this->update_options($options);
Jetpack::state('message', 'module_configured');
wp_safe_redirect(Jetpack::module_configuration_url($this->module));
}
/**
* Refresh the list of available WordPress.com blogs
*/
if (!empty($_GET['videopress']) && $_GET['videopress'] == 'refresh-blogs') {
check_admin_referer('videopress-settings');
$options = $this->get_options();
$result = $this->query('jetpack.vpGetBlogs');
if (!is_wp_error($result)) {
$options['blogs'] = $result;
$this->update_options($options);
}
wp_safe_redirect(Jetpack::module_configuration_url($this->module));
}
}
示例9: action_links
/**
* Add action links to Stream drop row in admin list screen
*
* @filter wp_stream_action_links_{connector}
*
* @param array $links Previous links registered
* @param object $record Stream record
*
* @return array Action links
*/
public function action_links($links, $record)
{
// @todo provide proper action links
if ('jetpack' === $record->connector) {
if ('modules' === $record->context) {
$slug = $record->get_meta('module_slug', true);
if (is_array($slug)) {
$slug = current($slug);
}
if (Jetpack::is_module_active($slug)) {
if (apply_filters('jetpack_module_configurable_' . $slug, false)) {
$links[esc_html__('Configure', 'stream')] = Jetpack::module_configuration_url($slug);
}
$links[esc_html__('Deactivate', 'stream')] = wp_nonce_url(add_query_arg(array('action' => 'deactivate', 'module' => $slug), Jetpack::admin_url()), 'jetpack_deactivate-' . sanitize_title($slug));
} else {
$links[esc_html__('Activate', 'stream')] = wp_nonce_url(add_query_arg(array('action' => 'activate', 'module' => $slug), Jetpack::admin_url()), 'jetpack_activate-' . sanitize_title($slug));
}
} elseif (Jetpack::is_module_active(str_replace('jetpack-', '', $record->context))) {
$slug = str_replace('jetpack-', '', $record->context);
// handling jetpack-comment anomaly
if (apply_filters('jetpack_module_configurable_' . $slug, false)) {
$links[esc_html__('Configure module', 'stream')] = Jetpack::module_configuration_url($slug);
}
}
}
return $links;
}
示例10: get_modules
function get_modules()
{
include_once JETPACK__PLUGIN_DIR . 'modules/module-info.php';
$available_modules = $this->jetpack->get_available_modules();
$active_modules = $this->jetpack->get_active_modules();
$modules = array();
$jetpack_active = Jetpack::is_active() || Jetpack::is_development_mode();
foreach ($available_modules as $module) {
if ($module_array = $this->jetpack->get_module($module)) {
$short_desc = apply_filters('jetpack_short_module_description', $module_array['description'], $module);
// Fix: correct multibyte strings truncate with checking for mbstring extension
$short_desc_trunc = function_exists('mb_strlen') ? mb_strlen($short_desc) > 143 ? mb_substr($short_desc, 0, 140) . '...' : $short_desc : (strlen($short_desc) > 143 ? substr($short_desc, 0, 140) . '...' : $short_desc);
$module_array['module'] = $module;
$module_array['activated'] = $jetpack_active ? in_array($module, $active_modules) : false;
$module_array['deactivate_nonce'] = wp_create_nonce('jetpack_deactivate-' . $module);
$module_array['activate_nonce'] = wp_create_nonce('jetpack_activate-' . $module);
$module_array['available'] = self::is_module_available($module_array);
$module_array['short_description'] = $short_desc_trunc;
$module_array['configure_url'] = Jetpack::module_configuration_url($module);
ob_start();
do_action('jetpack_learn_more_button_' . $module);
$module_array['learn_more_button'] = ob_get_clean();
ob_start();
if (Jetpack::is_active() && has_action('jetpack_module_more_info_connected_' . $module)) {
do_action('jetpack_module_more_info_connected_' . $module);
} else {
do_action('jetpack_module_more_info_' . $module);
}
/**
* Filter the long description of a module.
*
* @since 3.5.0
*
* @param string ob_get_clean() The module long description.
* @param string $module The module name.
*/
$module_array['long_description'] = apply_filters('jetpack_long_module_description', ob_get_clean(), $module);
ob_start();
/**
* Filter the search terms for a module
*
* Search terms are be typically added to a module in module-info.php.
*
* Use syntax:
* function jetpack_$module_search_terms( $terms ) {
* $terms = _x( 'term 1, term 2', 'search terms', 'jetpack' );
* return $terms;
* }
* add_filter( 'jetpack_search_terms_$module', 'jetpack_$module_search_terms' );
*
* @since 3.5.0
* @param string The search terms (comma separated)
*/
echo apply_filters('jetpack_search_terms_' . $module, '');
$module_array['search_terms'] = ob_get_clean();
$module_array['configurable'] = false;
if (current_user_can('manage_options') && apply_filters('jetpack_module_configurable_' . $module, false)) {
$module_array['configurable'] = sprintf('<a href="%1$s">%2$s</a>', esc_url(Jetpack::module_configuration_url($module)), __('Configure', 'jetpack'));
}
$modules[$module] = $module_array;
}
}
uasort($modules, array($this->jetpack, 'sort_modules'));
if (!Jetpack::is_active()) {
uasort($modules, array(__CLASS__, 'sort_requires_connection_last'));
}
return $modules;
}
示例11: admin_screen_list_modules
//.........这里部分代码省略.........
echo apply_filters('jetpack_short_module_description_' . $module, $module_data['description']);
?>
</p>
</div>
<div class="jetpack-module-actions">
<?php
if ($jetpack_connected) {
$activated = in_array($module, $active);
?>
<?php
if (!$activated) {
?>
<a href="<?php
echo esc_url($toggle_url);
?>
" class="jetpack-toggle-button<?php
echo 'inactive' == $css ? ' button-primary' : ' button';
?>
"><?php
echo $toggle;
?>
</a>
<?php
}
?>
<?php
do_action('jetpack_learn_more_button_' . $module);
?>
<?php
if (apply_filters('jetpack_module_configurable_' . $module, false)) {
echo '<a href="' . esc_attr(Jetpack::module_configuration_url($module)) . '" class="jetpack-configure-button button">' . __('Configure', 'jetpack') . '</a>';
}
if ($activated) {
?>
<a style="display: none;" href="<?php
echo esc_url($toggle_url);
?>
" class="jetpack-deactivate-button button"><?php
echo $toggle;
?>
</a> <?php
}
?>
<?php
} else {
?>
<?php
do_action('jetpack_learn_more_button_' . $module);
?>
<?php
}
?>
</div>
</div>
<?php
if ('inactive' == $css && $jetpack_connected) {
?>
<script type="text/javascript">
jQuery( '#<?php
echo esc_js($module);
?>
' ).bind( 'click', function(e){