当前位置: 首页>>代码示例>>PHP>>正文


PHP network_admin_url函数代码示例

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


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

示例1: plugin_settings_link

 /**
  * Add a settings link to the  pluginlist
  *
  * @since   0.1
  * @access  public
  * @static
  * @param   string array links under the pluginlist
  * @return  array
  */
 public static function plugin_settings_link($links)
 {
     $settings_page = is_multisite() ? 'settings.php' : 'options-general.php';
     $settings_link = '<a href="' . network_admin_url($settings_page) . '?page=' . RW_Site_Config::$plugin_base_name . '">' . __('Settings') . '</a>';
     array_unshift($links, $settings_link);
     return $links;
 }
开发者ID:rpi-virtuell,项目名称:rw-site-config,代码行数:16,代码来源:RW_Site_Config_Options.php

示例2: w3tc_admin_bar_menu

 public function w3tc_admin_bar_menu($menu_items)
 {
     if ($this->_config->is_extension_active_frontend('fragmentcache')) {
         $menu_items['20510.fragmentcache'] = array('id' => 'w3tc_flush_fragmentcache', 'parent' => 'w3tc_flush', 'title' => __('Fragment Cache: All Fragments', 'w3-total-cache'), 'href' => wp_nonce_url(network_admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_fragmentcache'), 'w3tc'));
     }
     return $menu_items;
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:7,代码来源:Extension_FragmentCache_Plugin_Admin.php

示例3: ds_delete_stale

function ds_delete_stale()
{
    global $wpdb;
    $query = "SELECT * FROM {$wpdb->signups} ORDER BY registered DESC";
    $results = $wpdb->get_results($query, ARRAY_A);
    if (isset($_GET['delete'])) {
        $delete = $_GET['delete'];
    }
    if (isset($_GET['del_stale_active'])) {
        $del_stale_active = $_GET['del_stale_active'];
    }
    if (isset($_GET['del_stale_inactive'])) {
        $del_stale_inactive = $_GET['del_stale_inactive'];
    }
    $location = network_admin_url('users.php?page=act_keys');
    if (!empty($delete)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE activation_key = '{$delete}'");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    if (!empty($del_stale_active)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE active = 1 AND DATE(registered) < DATE_SUB(curdate(), INTERVAL 30 DAY)");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    if (!empty($del_stale_inactive)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE active = 0 AND DATE(registered) < DATE_SUB(curdate(), INTERVAL 30 DAY)");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    echo '<div class="wrap">';
    echo "<h2>User Activation Keys</h2>";
    if ($results) {
        echo '<p>The following is a list of user activation keys from $wpdb->signups. Delete a key to allow the username to (re)signup and bypass the "couple days" it takes WP to free up its hold on a user name. You can also manually approve users that for whatever reason have not completed their activation.</p>';
        echo '<div class="tablenav"> <span class="alignleft">';
        echo '<a class="button-secondary" href="' . wp_nonce_url($location . '&del_stale_active', 'activation_key') . '" class="delete">' . __('Delete stale active signup keys older than 30 days') . '</a>';
        echo '<a class="button-secondary" href="' . wp_nonce_url($location . '&del_stale_inactive', 'activation_key') . '" class="delete">' . __('Delete stale inactive signup keys older than 30 days') . '</a>';
        echo '</span>';
        echo '</div><br class="clear" />';
        echo '<table class="widefat"><tbody>';
        echo '<thead><th>#</th><th>Registered</th><th>User</th><th>Email</th><th>Approve</th></thead>';
        foreach ($results as $rows) {
            global $ct;
            echo '<tr><td>' . ++$ct . '</td><td>' . $rows['registered'] . '</td><td>' . $rows['user_login'] . '</td><td>' . $rows['user_email'] . '</td>';
            if ($rows['active'] != '1') {
                echo '<td><a href="' . site_url('wp-activate.php?key=' . $rows['activation_key']) . '" target="_blank">approve</a> | <a href="' . wp_nonce_url($location . '&delete=' . $rows['activation_key'], 'activation_key') . '">delete unused key</a></td>';
            } else {
                echo '<td>User Activated ' . $rows['activated'] . ' | <a href="' . wp_nonce_url($location . '&delete=' . $rows['activation_key'], 'activation_key') . '">delete uncecessary key</a></td>';
            }
            echo '</tr>';
        }
        echo '</tbody></table>';
    } else {
        echo '<p>No user activation keys in $wpdb->signups. If you delete a user, you should be able to reuse the username immediatley. If the user still had a registration key, it would need to be deleted before you could signup again right away with the same username. You can also manually approve users that for whatever reason have not completed their activation.</p>';
    }
    echo '</div>';
}
开发者ID:juslee,项目名称:e27,代码行数:60,代码来源:ds_wp3_user_activation_keys.php

示例4: updater_install

 function updater_install()
 {
     //normal
     $active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
     if (in_array('pagelines-updater/pagelines-updater.php', $active_plugins)) {
         return;
     }
     // ms
     if (!function_exists('is_plugin_active_for_network')) {
         require_once ABSPATH . '/wp-admin/includes/plugin.php';
     }
     if (is_plugin_active_for_network('pagelines-updater/pagelines-updater.php')) {
         return $slug = 'pagelines-updater';
     }
     $install_url = wp_nonce_url(network_admin_url('update.php?action=install-plugin&plugin=pagelines-updater'), 'install-plugin_pagelines-updater');
     $activate_url = 'plugins.php?action=activate&plugin=' . urlencode('pagelines-updater/pagelines-updater.php') . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode(wp_create_nonce('activate-plugin_pagelines-updater/pagelines-updater.php'));
     $message = sprintf('<a class="btn btn-mini" href="%s"> %s', esc_url($install_url), __('Install the PageLines Updater plugin</a> to activate a key and get updates for your PageLines themes and plugins.', 'pagelines'));
     $is_downloaded = false;
     $plugins = array_keys(get_plugins());
     foreach ($plugins as $plugin) {
         if (strpos($plugin, 'pagelines-updater.php') !== false) {
             $is_downloaded = true;
             $message = sprintf('<a class="btn btn-mini" href="%s">%s', esc_url(network_admin_url($activate_url)), __('Activate the PageLines Updater plugin</a> to activate your key and get updates for your PageLines themes and plugins.', 'pagelines'));
         }
     }
     echo '<div class="updated fade"><p>' . $message . '</p></div>' . "\n";
 }
开发者ID:benpeck,项目名称:experticity-fools,代码行数:27,代码来源:editor.updates.php

示例5: update_modules

 /**
  * Save module options.
  *
  * @return    void
  */
 public function update_modules()
 {
     check_admin_referer($this->nonce_action);
     if (!current_user_can('manage_network_options')) {
         wp_die('FU');
     }
     $this->set_module_activation_status();
     /**
      * Runs before the redirect.
      *
      * Process your fields in the $_POST superglobal here and then call update_site_option().
      *
      * @param array $_POST
      */
     do_action('mlp_modules_save_fields', $_POST);
     // backwards compatibility
     if (has_action('mlp_settings_save_fields')) {
         _doing_it_wrong('mlp_settings_save_fields', 'mlp_settings_save_fields is deprecated, use mlp_modules_save_fields instead.', '1.2');
         /**
          * @see mlp_modules_save_fields
          * @deprecated
          */
         do_action('mlp_settings_save_fields');
     }
     wp_safe_redirect(network_admin_url('settings.php?page=mlp&message=updated'));
     exit;
 }
开发者ID:luisarn,项目名称:multilingual-press,代码行数:32,代码来源:Mlp_General_Settings_Module_Mapper.php

示例6: wpweb_updater_notice

 /**
  * Display a notice if the "WPWeb Updater" plugin hasn't been installed.
  * @return void
  */
 function wpweb_updater_notice()
 {
     $active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
     if (in_array('wpweb-updater/wpweb-updater.php', $active_plugins)) {
         return;
     }
     $slug = 'wpweb-updater';
     $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $slug), 'install-plugin_' . $slug);
     $activate_url = 'plugins.php?action=activate&plugin=' . urlencode('wpweb-updater/wpweb-updater.php') . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode(wp_create_nonce('activate-plugin_wpweb-updater/wpweb-updater.php'));
     //initilize variables
     $message = $dismiss_url = $dismiss_link = '';
     $dismiss_notice = get_site_option('dismiss_install_wpweb_notice');
     //if( !$dismiss_notice ) { //if notice dismissed
     $message = '';
     $dismiss_url = add_query_arg('action', 'install-wpweb-dismiss', add_query_arg('nonce', wp_create_nonce('install-wpweb-dismiss')));
     $dismiss_link = '<p class="alignright"><a href="' . esc_url($dismiss_url) . '">' . 'Dismiss' . '</a></p>';
     //}
     $is_downloaded = false;
     $plugins = array_keys(get_plugins());
     foreach ($plugins as $plugin) {
         if (strpos($plugin, 'wpweb-updater.php') !== false) {
             $is_downloaded = true;
             $message = '<a href="' . esc_url(network_admin_url($activate_url)) . '">Activate the WPWeb Updater plugin</a> to get updates for your WPWeb plugins.';
             $dismiss_link = '';
         }
     }
     if (!empty($message)) {
         //If message is not empty
         echo '<div class="updated fade"><p  class="alignleft">' . $message . '</p>' . $dismiss_link . '<div class="clear"></div></div>' . "\n";
     }
 }
开发者ID:flasomm,项目名称:Montkailash,代码行数:35,代码来源:wpweb-upd-functions.php

示例7: get_login_url

 public function get_login_url($redirect_to, $extra_info)
 {
     if (is_array($extra_info) && !empty($extra_info['user_id']) && is_numeric($extra_info['user_id'])) {
         $user_id = $extra_info['user_id'];
         if (false == ($login_key = $this->_get_autologin_key($user_id))) {
             return $this->_generic_error_response('user_key_failure');
         }
         // Default value
         $redirect_url = network_admin_url();
         if (is_array($redirect_to) && !empty($redirect_to['module'])) {
             switch ($redirect_to['module']) {
                 case 'updraftplus':
                     if ('initiate_restore' == $redirect_to['action'] && class_exists('UpdraftPlus_Options')) {
                         $redirect_url = UpdraftPlus_Options::admin_page_url() . '?page=updraftplus&udaction=initiate_restore&entities=' . urlencode($redirect_to['data']['entities']) . '&showdata=' . urlencode($redirect_to['data']['showdata']) . '&backup_timestamp=' . (int) $redirect_to['data']['backup_timestamp'];
                     } elseif ('download_file' == $redirect_to['action']) {
                         $findex = empty($redirect_to['data']['findex']) ? 0 : (int) $redirect_to['data']['findex'];
                         // e.g. ?udcentral_action=dl&action=updraftplus_spool_file&backup_timestamp=1455101696&findex=0&what=plugins
                         $redirect_url = site_url() . '?udcentral_action=spool_file&action=updraftplus_spool_file&findex=' . $findex . '&what=' . urlencode($redirect_to['data']['what']) . '&backup_timestamp=' . (int) $redirect_to['data']['backup_timestamp'];
                     }
                     break;
                 case 'direct_url':
                     $redirect_url = $redirect_to['url'];
                     break;
             }
         }
         $login_key = apply_filters('updraftplus_remotecontrol_login_key', array('key' => $login_key, 'created' => time(), 'redirect_url' => $redirect_url), $redirect_to, $extra_info);
         // Over-write any previous value - only one can be valid at a time)
         update_user_meta($user_id, 'updraftcentral_login_key', $login_key);
         return $this->_response(array('login_url' => network_site_url('?udcentral_action=login&login_id=' . $user_id . '&login_key=' . $login_key['key'])));
     } else {
         return $this->_generic_error_response('user_unknown');
     }
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:33,代码来源:core-commands.php

示例8: qode_envato_toolkit_notice

/**
 * Function that outputs admin notice if theme has update
 */
function qode_envato_toolkit_notice()
{
    //is Envato WordPress Toolkit plugin installed?
    if (defined('EWPT_PLUGIN_VER')) {
        $options = get_option(EWPT_PLUGIN_SLUG);
        $current_page = get_current_screen();
        //don't show update notification on envato wordpress toolkit plugin page
        if ($current_page->parent_base !== 'envato-wordpress-toolkit') {
            if (is_array($options) && !empty($options['api_key']) && !empty($options['user_name'])) {
                $envato_api = new Envato_Protected_API($options['user_name'], $options['api_key']);
                //get current theme info
                $theme_version = qode_get_theme_info_item('Version');
                $theme_name = qode_get_theme_info_item('Name');
                $theme_author = qode_get_theme_info_item('Author');
                //get all user's themes
                $premium_themes = $envato_api->wp_list_themes();
                $qode_envato_item = new stdClass();
                if (is_array($premium_themes) && count($premium_themes)) {
                    foreach ($premium_themes as $premium_theme) {
                        //check if premium theme is current theme
                        if ($premium_theme->theme_name == $theme_name && $premium_theme->author_name == $theme_author) {
                            $qode_envato_item = $premium_theme;
                            break;
                        }
                    }
                }
                //is version if currently installed theme lower than latest version?
                $need_update = version_compare($theme_version, $qode_envato_item->version, '<') ? TRUE : FALSE;
                if ($need_update && current_user_can('update_themes')) {
                    echo '<div class="updated"><p>' . __('There is a new version of ' . $theme_name . ' available. You can view it\'s details <a href="' . network_admin_url('admin.php?page=' . EWPT_PLUGIN_SLUG . '&tab=themes') . '">here</a>', 'qode') . '</p></div>';
                }
            }
        }
    }
}
开发者ID:pedrogoncalvesk,项目名称:be-the-maker,代码行数:38,代码来源:envato-wordpress-toolkit.php

示例9: ra_replicator_filter_site_actions

function ra_replicator_filter_site_actions($actions, $blog_id)
{
    if (!is_main_site($blog_id)) {
        $actions['replicate'] = '<a href="' . esc_url(wp_nonce_url(network_admin_url('sites.php?page=wp-replicator&amp;replicate=' . $blog_id), 'replicate-' . $blog_id)) . '">' . __('Replicate') . '</a>';
    }
    return $actions;
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:7,代码来源:wp-replicator.php

示例10: init

 function init()
 {
     global $wpmudev_un;
     if (class_exists('WPMUDEV_Dashboard') || isset($wpmudev_un->version) && version_compare($wpmudev_un->version, '3.4', '<')) {
         return;
     }
     // Schedule update cron on main site only
     if (is_main_site()) {
         if (!wp_next_scheduled('wpmudev_scheduled_jobs')) {
             wp_schedule_event(time(), 'twicedaily', 'wpmudev_scheduled_jobs');
         }
         add_action('wpmudev_scheduled_jobs', array($this, 'updates_check'));
     }
     add_action('delete_site_transient_update_plugins', array(&$this, 'updates_check'));
     //refresh after upgrade/install
     add_action('delete_site_transient_update_themes', array(&$this, 'updates_check'));
     //refresh after upgrade/install
     if (is_admin() && current_user_can('install_plugins')) {
         add_action('site_transient_update_plugins', array(&$this, 'filter_plugin_count'));
         add_action('site_transient_update_themes', array(&$this, 'filter_theme_count'));
         add_filter('plugins_api', array(&$this, 'filter_plugin_info'), 101, 3);
         //run later to work with bad autoupdate plugins
         add_filter('themes_api', array(&$this, 'filter_plugin_info'), 101, 3);
         //run later to work with bad autoupdate plugins
         add_action('admin_init', array(&$this, 'filter_plugin_rows'), 15);
         //make sure it runs after WP's
         add_action('core_upgrade_preamble', array(&$this, 'disable_checkboxes'));
         add_action('activated_plugin', array(&$this, 'set_activate_flag'));
         //remove version 1.0
         remove_action('admin_notices', 'wdp_un_check', 5);
         remove_action('network_admin_notices', 'wdp_un_check', 5);
         //remove version 2.0, a bit nasty but only way
         remove_all_actions('all_admin_notices', 5);
         //if dashboard is installed but not activated
         if (file_exists(WP_PLUGIN_DIR . '/wpmudev-updates/update-notifications.php')) {
             if (!get_site_option('wdp_un_autoactivated')) {
                 //include plugin API if necessary
                 if (!function_exists('activate_plugin')) {
                     require_once ABSPATH . 'wp-admin/includes/plugin.php';
                 }
                 $result = activate_plugin('/wpmudev-updates/update-notifications.php', network_admin_url('admin.php?page=wpmudev'), is_multisite());
                 if (!is_wp_error($result)) {
                     //if autoactivate successful don't show notices
                     update_site_option('wdp_un_autoactivated', 1);
                     return;
                 }
             }
             add_action('admin_print_styles', array(&$this, 'notice_styles'));
             add_action('all_admin_notices', array(&$this, 'activate_notice'), 5);
         } else {
             //dashboard not installed at all
             if (get_site_option('wdp_un_autoactivated')) {
                 update_site_option('wdp_un_autoactivated', 0);
                 //reset flag when dashboard is deleted
             }
             add_action('admin_print_styles', array(&$this, 'notice_styles'));
             add_action('all_admin_notices', array(&$this, 'install_notice'), 5);
         }
     }
 }
开发者ID:olechka1505,项目名称:hungrylemur,代码行数:60,代码来源:wpmudev-dash-notification.php

示例11: add_network_entries

 private static function add_network_entries($wp_admin_bar)
 {
     // add network dashboard
     $wp_admin_bar->add_node(['id' => self::podcast_toolbar_id('network', 'dashboard'), 'title' => __('Podlove Dashboard', 'podlove'), 'parent' => 'network-admin', 'href' => network_admin_url('admin.php?page=podlove_network_settings_handle')]);
     // add network templates
     $wp_admin_bar->add_node(['id' => self::podcast_toolbar_id('network', 'templates'), 'title' => __('Podlove Templates', 'podlove'), 'parent' => 'network-admin', 'href' => network_admin_url('admin.php?page=podlove_templates_settings_handle')]);
 }
开发者ID:johannes-mueller,项目名称:podlove-publisher,代码行数:7,代码来源:admin_bar_menu.php

示例12: gettext

 function gettext($translated, $original, $domain)
 {
     if ('Comment author must have a previously approved comment' != $original) {
         return $translated;
     }
     return sprintf(__('Comment author must have a previously approved comment (<a href="%s">and not be on probation</a>)', 'comment-probation'), network_admin_url('plugins.php') . '#comment-probation');
 }
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:7,代码来源:comment-probation.php

示例13: wangguard_welcome_splash

function wangguard_welcome_splash()
{
    global $wuangguard_parent, $wangguard_version;
    if (!defined('WANGGUARD_VERSION')) {
        define('WANGGUARD_VERSION', $wangguard_version);
    }
    if (defined('WANGGUARD_VERSION')) {
        $wangguard_act_version = WANGGUARD_VERSION;
    }
    if (get_site_option('wangguard-option-version') == $wangguard_act_version) {
        return;
    } elseif ($wuangguard_parent == 'update.php') {
        return;
    } elseif ($wuangguard_parent == 'update-core.php') {
        return;
    } else {
        update_site_option('wangguard-option-version', $wangguard_act_version);
        if (!is_multisite()) {
            $wangguardredirect = esc_url(admin_url(add_query_arg(array('page' => 'wangguard_about'), 'admin.php')));
        } else {
            $wangguardredirect = esc_url(network_admin_url(add_query_arg(array('page' => 'wangguard_about'), 'admin.php')));
        }
        wp_redirect($wangguardredirect);
        exit;
    }
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:26,代码来源:wangguard-core.php

示例14: stats_is_plugin_available

function stats_is_plugin_available($plugin_slug = '', $plugin_name = '', $link_class = '', $link_id = '')
{
    if (empty($plugin_slug)) {
        return;
    }
    if (empty($plugin_name)) {
        $plugin_name = __('Activate Plugin', 'stats');
    }
    $action = '';
    if (file_exists(WP_PLUGIN_DIR . '/' . $plugin_slug)) {
        $plugins = get_plugins('/' . $plugin_slug);
        if (!empty($plugins)) {
            $keys = array_keys($plugins);
            $plugin_file = $plugin_slug . '/' . $keys[0];
            $action = '<a 	id="' . esc_attr($link_id) . '"
							class="' . esc_attr($link_class) . '"
							href="' . esc_url(wp_nonce_url(admin_url('plugins.php?action=activate&plugin=' . $plugin_file . '&from=plugins'), 'activate-plugin_' . $plugin_file)) . '"title="' . esc_attr__('Activate Plugin', 'stats') . '"">' . esc_attr($plugin_name) . '</a>';
        }
    }
    if (empty($action) && function_exists('is_main_site') && is_main_site()) {
        $action = '<a 	id="' . esc_attr($link_id) . '"
							class="thickbox ' . esc_attr($link_class) . '"
							href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&from=plugins&TB_iframe=true&width=600&height=550')) . '" title="' . esc_attr__('Install Plugin', 'stats') . '">' . esc_attr($plugin_name) . '</a>';
    }
    return $action;
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:26,代码来源:stats.php

示例15: update_notices

 /**
  * Add an extra update message to the update plugin notification. Thanks BP!
  */
 public static function update_notices()
 {
     if (!self::check_api_key()) {
         $admin_url = is_multisite() ? network_admin_url('admin.php?page=events-manager-options') : admin_url('edit.php?post_type=' . EM_POST_TYPE_EVENT . '&page=events-manager-options');
         echo '<p style="font-style:italic; border-top: 1px solid #ddd; padding-top: 3px">' . sprintf(__('Please enter a valid API key in your <a href="%s">settings page</a>.', 'em-pro'), $admin_url) . '</p>';
     }
 }
开发者ID:shieldsdesignstudio,项目名称:trilogic,代码行数:10,代码来源:emp-updates.php


注:本文中的network_admin_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。