本文整理汇总了PHP中is_network_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP is_network_admin函数的具体用法?PHP is_network_admin怎么用?PHP is_network_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_network_admin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
add_action('w3tc_dashboard_setup', array(&$this, 'wp_dashboard_setup'));
add_action('w3tc_network_dashboard_setup', array(&$this, 'wp_dashboard_setup'));
// Configure authorize and have_zone
$this->_setup($this->_config);
/**
* Retry setup with main blog
*/
if (w3_is_network() && is_network_admin() && !$this->authorized) {
$this->_config = new W3_Config(false, 1);
$this->_setup($this->_config);
}
if (w3_is_network()) {
$conig_admin = w3_instance('W3_ConfigAdmin');
$this->_sealed = $conig_admin->get_boolean('cdn.configuration_sealed');
}
if ($this->have_zone && $this->authorized && isset($_GET['page']) && strpos($_GET['page'], 'w3tc_dashboard') !== false) {
w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');
w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNAPresentation.php');
$authorization_key = $this->_config->get_string('cdn.maxcdn.authorization_key');
$alias = $consumerkey = $consumersecret = '';
$keys = explode('+', $authorization_key);
if (sizeof($keys) == 3) {
list($alias, $consumerkey, $consumersecret) = $keys;
}
$this->api = new NetDNA($alias, $consumerkey, $consumersecret);
add_action('admin_head', array(&$this, 'admin_head'));
}
}
示例2: flush
/**
* Flush varnish cache
*/
function flush()
{
if (!is_network_admin()) {
$this->_purge(w3_get_home_url() . '/.*');
} else {
global $wpdb;
$protocall = w3_is_https() ? 'https://' : 'http://';
// If WPMU Domain Mapping plugin is installed and active
if (defined('SUNRISE_LOADED') && SUNRISE_LOADED && isset($wpdb->dmtable) && !empty($wpdb->dmtable)) {
$blogs = $wpdb->get_results("SELECT {$wpdb->blogs}.domain, {$wpdb->blogs}.path, {$wpdb->dmtable}.domain AS mapped_domain\n FROM {$wpdb->dmtable}\n RIGHT JOIN {$wpdb->blogs} ON {$wpdb->dmtable}.blog_id = {$wpdb->blogs}.blog_id\n WHERE site_id = {$wpdb->siteid}\n AND spam = 0\n AND deleted = 0\n AND archived = '0'\n ");
foreach ($blogs as $blog) {
if (!isset($blog->mapped_domain)) {
$url = $protocall . $blog->domain . (strlen($blog->path) > 1 ? '/' . trim($blog->path, '/') : '') . '/.*';
} else {
$url = $protocall . $blog->mapped_domain . '/.*';
}
$this->_purge($url);
}
} else {
if (!w3_is_subdomain_install()) {
$this->_purge(w3_get_home_url() . '/.*');
} else {
$blogs = $wpdb->get_results("\n SELECT domain, path\n FROM {$wpdb->blogs}\n WHERE site_id = '{$wpdb->siteid}'\n AND spam = 0\n AND deleted = 0\n AND archived = '0'\n ");
foreach ($blogs as $blog) {
$url = $protocall . $blog->domain . (strlen($blog->path) > 1 ? '/' . trim($blog->path, '/') : '') . '/.*';
$this->_purge($url);
}
}
}
}
}
示例3: after
function after()
{
if (empty($this->upgrader->result['destination_name'])) {
return;
}
$theme_info = $this->upgrader->theme_info();
if (empty($theme_info)) {
return;
}
$name = $theme_info['Name'];
$stylesheet = $this->upgrader->result['destination_name'];
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
$preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
$activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
$install_actions = array('preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>', 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate “%s”'), $name)) . '">' . __('Activate') . '</a>');
if (is_network_admin() && current_user_can('manage_network_themes')) {
$install_actions['network_enable'] = '<a href="' . esc_url(wp_nonce_url('themes.php?action=enable&theme=' . $template, 'enable-theme_' . $template)) . '" title="' . esc_attr__('Enable this theme for all sites in this network') . '" target="_parent">' . __('Network Enable') . '</a>';
}
$install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('View Installed Themes', 'wp-app-store') . '</a>';
if (!$this->result || is_wp_error($this->result) || is_network_admin()) {
unset($install_actions['activate'], $install_actions['preview']);
}
$install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
if (!empty($install_actions)) {
$this->feedback(implode(' | ', (array) $install_actions));
}
}
示例4: log
public function log($connector, $message, $args, $object_id, $contexts, $user_id = null)
{
global $wpdb;
if (is_null($user_id)) {
$user_id = get_current_user_id();
}
require_once MAINWP_WP_STREAM_INC_DIR . 'class-wp-stream-author.php';
$user = new WP_User($user_id);
$roles = get_option($wpdb->get_blog_prefix() . 'user_roles');
if (!isset($args['author_meta'])) {
$args['author_meta'] = array('user_email' => $user->user_email, 'display_name' => defined('WP_CLI') && empty($user->display_name) ? 'WP-CLI' : $user->display_name, 'user_login' => $user->user_login, 'user_role_label' => !empty($user->roles) ? $roles[$user->roles[0]]['name'] : null, 'agent' => MainWP_WP_Stream_Author::get_current_agent());
if (defined('WP_CLI') && function_exists('posix_getuid')) {
$uid = posix_getuid();
$user_info = posix_getpwuid($uid);
$args['author_meta']['system_user_id'] = $uid;
$args['author_meta']['system_user_name'] = $user_info['name'];
}
}
// Remove meta with null values from being logged
$meta = array_filter($args, function ($var) {
return !is_null($var);
});
$recordarr = array('object_id' => $object_id, 'site_id' => is_multisite() ? get_current_site()->id : 1, 'blog_id' => apply_filters('blog_id_logged', is_network_admin() ? 0 : get_current_blog_id()), 'author' => $user_id, 'author_role' => !empty($user->roles) ? $user->roles[0] : null, 'created' => current_time('mysql', 1), 'summary' => vsprintf($message, $args), 'parent' => self::$instance->prev_record, 'connector' => $connector, 'contexts' => $contexts, 'meta' => $meta, 'ip' => mainwp_wp_stream_filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP));
$record_id = MainWP_WP_Stream_DB::get_instance()->insert($recordarr);
return $record_id;
}
示例5: mgjp_mv_extra_activation_steps_page
/**
* Adds an admin page to the plugins admin menu dropdown.
* The page displays instructions to admins to fully activate
* the Media Vault plugin
*
* @since 0.8.5
*/
function mgjp_mv_extra_activation_steps_page()
{
if (is_multisite() && !is_network_admin()) {
return;
}
add_submenu_page('plugins.php', __('Media Vault Activation Helper', 'media-vault'), __('Media Vault Activation', 'media-vault'), 'install_plugins', 'mgjp-mv-eas', 'mgjp_mv_render_extra_activation_steps_page');
}
示例6: __construct
public function __construct()
{
/**
* Check current WooCommerce version to ensure compatibility.
*/
$woo_version = $this->wpbo_get_woo_version_number();
if (version_compare($woo_version, '2.1', '<')) {
exit(__('PayPal for WooCommerce requires WooCommerce version 2.1 or higher. Please backup your site files and database, update WooCommerce, and try again.', 'paypal-for-woocommerce'));
}
add_filter('woocommerce_paypal_args', array($this, 'ae_paypal_standard_additional_parameters'));
add_action('plugins_loaded', array($this, 'init'));
register_activation_hook(__FILE__, array($this, 'activate_paypal_for_woocommerce'));
register_deactivation_hook(__FILE__, array($this, 'deactivate_paypal_for_woocommerce'));
add_action('wp_enqueue_scripts', array($this, 'woocommerce_paypal_express_init_styles'), 12);
add_action('admin_notices', array($this, 'admin_notices'));
add_action('admin_init', array($this, 'set_ignore_tag'));
add_filter('woocommerce_product_title', array($this, 'woocommerce_product_title'));
add_action('woocommerce_sections_checkout', array($this, 'donate_message'), 11);
add_action('parse_request', array($this, 'woocommerce_paypal_express_review_order_page_angelleye'), 11);
// http://stackoverflow.com/questions/22577727/problems-adding-action-links-to-wordpress-plugin
$basename = plugin_basename(__FILE__);
$prefix = is_network_admin() ? 'network_admin_' : '';
add_filter("{$prefix}plugin_action_links_{$basename}", array($this, 'plugin_action_links'), 10, 4);
add_action('woocommerce_after_add_to_cart_button', array($this, 'buy_now_button'));
add_action('woocommerce_after_mini_cart', array($this, 'mini_cart_button'));
add_action('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
add_action('woocommerce_after_single_variation', array($this, 'buy_now_button_js'));
add_action('admin_enqueue_scripts', array($this, 'onetarek_wpmut_admin_scripts'));
add_action('admin_print_styles', array($this, 'onetarek_wpmut_admin_styles'));
add_action('woocommerce_cart_calculate_fees', array($this, 'woocommerce_custom_surcharge'));
add_action('woocommerce_before_add_to_cart_button', array($this, 'add_div_before_add_to_cart_button'), 25);
add_action('woocommerce_after_add_to_cart_button', array($this, 'add_div_after_add_to_cart_button'), 35);
add_action('admin_init', array($this, 'angelleye_check_version'), 5);
}
示例7: admin_init
public function admin_init()
{
if (!empty($_GET['developer_plugin_reset']) && current_user_can('manage_options')) {
delete_option(self::OPTION);
}
$this->recommended_plugins = array('debug-bar' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar', 'a8c-developer'), 'active' => class_exists('Debug_Bar')), 'debug-bar-console' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Console', 'a8c-developer'), 'active' => function_exists('debug_bar_console_panel')), 'debug-bar-cron' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Cron', 'a8c-developer'), 'active' => function_exists('zt_add_debug_bar_cron_panel')), 'debug-bar-extender' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Extender', 'a8c-developer'), 'active' => class_exists('Debug_Bar_Extender')), 'rewrite-rules-inspector' => array('project_type' => 'all', 'name' => esc_html__('Rewrite Rules Inspector', 'a8c-developer'), 'active' => class_exists('Rewrite_Rules_Inspector')), 'log-deprecated-notices' => array('project_type' => 'all', 'name' => esc_html__('Log Deprecated Notices', 'a8c-developer'), 'active' => class_exists('Deprecated_Log')), 'log-viewer' => array('project_type' => 'all', 'name' => esc_html__('Log Viewer', 'a8c-developer'), 'active' => class_exists('ciLogViewer')), 'vip-scanner' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('VIP Scanner', 'a8c-developer'), 'active' => class_exists('VIP_Scanner')), 'jetpack' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Jetpack', 'a8c-developer'), 'active' => class_exists('Jetpack')), 'polldaddy' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Polldaddy Polls & Ratings', 'a8c-developer'), 'active' => class_exists('WP_Polldaddy')), 'monster-widget' => array('project_type' => 'all', 'name' => esc_html__('Monster Widget', 'a8c-developer'), 'active' => class_exists('Monster_Widget')), 'user-switching' => array('project_type' => 'all', 'name' => esc_html__('User Switching', 'a8c-developer'), 'active' => class_exists('user_switching')), 'piglatin' => array('project_type' => array('wporg-theme', 'wporg'), 'name' => esc_html__('Pig Latin', 'a8c-developer'), 'active' => class_exists('PigLatin')), 'rtl-tester' => array('project_type' => 'wporg-theme', 'name' => esc_html__('RTL Tester', 'a8c-developer'), 'active' => class_exists('RTLTester')), 'regenerate-thumbnails' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Regenerate Thumbnails', 'a8c-developer'), 'active' => class_exists('RegenerateThumbnails')), 'simply-show-ids' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Simply Show IDs', 'a8c-developer'), 'active' => function_exists('ssid_add')), 'theme-test-drive' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Theme Test Drive', 'a8c-developer'), 'active' => function_exists('TTD_filters'), 'filename' => 'themedrive.php'), 'theme-check' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Theme Check', 'a8c-developer'), 'active' => function_exists('tc_add_headers')));
if (!self::is_dev_version()) {
$this->recommended_plugins['wordpress-beta-tester'] = array('project_type' => 'all', 'name' => esc_html__('Beta Tester', 'a8c-developer'), 'active' => class_exists('wp_beta_tester'), 'filename' => 'wp-beta-tester.php');
}
$this->recommended_constants = array('WP_DEBUG' => array('project_type' => 'all', 'description' => __('Enables <a href="http://codex.wordpress.org/Debugging_in_WordPress" target="_blank">debug mode</a> which helps identify and resolve issues', 'a8c-developer')), 'SAVEQUERIES' => array('project_type' => 'all', 'description' => esc_html__('Logs database queries to an array so you can review them. The Debug Bar plugin will list out database queries if you set this constant.', 'a8c-developer')), 'JETPACK_DEV_DEBUG' => array('project_type' => 'wpcom-vip', 'description' => __('Enables <a href="http://jetpack.me/2013/03/28/jetpack-dev-mode-release/">Development Mode</a> in Jetpack for testing features without a connection to WordPress.com.', 'a8c-developer')));
register_setting(self::OPTION, self::OPTION, array($this, 'settings_validate'));
wp_register_script('a8c-developer', plugins_url('developer.js', __FILE__), array('jquery'), self::VERSION);
$strings = array('settings_slug' => self::PAGE_SLUG, 'go_to_step_2' => current_user_can('install_plugins') && current_user_can('activate_plugins') && 'direct' == get_filesystem_method() ? 'yes' : 'no', 'lightbox_title' => __('Developer: Plugin Setup', 'a8c-developer'), 'saving' => __('Saving...', 'a8c-developer'), 'installing' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Installing...', 'a8c-developer'), 'installed' => __('Installed', 'a8c-developer'), 'activating' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Activating...', 'a8c-developer'), 'activated' => __('Activated', 'a8c-developer'), 'error' => __('Error!', 'a8c-developer'), 'ACTIVE' => __('ACTIVE', 'a8c-developer'), 'INSTALLED' => __('INSTALLED', 'a8c-developer'), 'ERROR' => __('ERROR!', 'a8c-developer'));
wp_localize_script('a8c-developer', 'a8c_developer_i18n', $strings);
wp_register_style('a8c-developer', plugins_url('developer.css', __FILE__), array(), self::VERSION);
// Handle the submission of the lightbox form if step 2 won't be shown
if (!empty($_POST['action']) && 'a8c_developer_lightbox_step_1' == $_POST['action'] && !empty($_POST['a8c_developer_project_type']) && check_admin_referer('a8c_developer_lightbox_step_1')) {
$this->save_project_type($_POST['a8c_developer_project_type']);
add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
}
if (!get_option(self::OPTION)) {
if (!empty($_GET['a8cdev_errorsaving'])) {
add_settings_error(self::PAGE_SLUG, self::PAGE_SLUG . '_error_saving', __('Error saving settings. Please try again.', 'a8c-developer'));
} elseif (!is_network_admin() && current_user_can('manage_options')) {
add_action('admin_enqueue_scripts', array($this, 'load_lightbox_scripts_and_styles'));
add_action('admin_footer', array($this, 'output_setup_box_html'));
}
}
}
示例8: __construct
/**
* Constructor.
* @param string $file The base file of the plugin.
* @since 1.0.0
* @return void
*/
public function __construct($file, $version)
{
// If multisite, plugin must be network activated. First make sure the is_plugin_active_for_network function exists
if (is_multisite() && !is_network_admin()) {
remove_action('admin_notices', 'woothemes_updater_notice');
// remove admin notices for plugins outside of network admin
if (!function_exists('is_plugin_active_for_network')) {
require_once ABSPATH . '/wp-admin/includes/plugin.php';
}
if (!is_plugin_active_for_network(plugin_basename($file))) {
add_action('admin_notices', array($this, 'admin_notice_require_network_activation'));
}
return;
}
$this->file = $file;
$this->version = $version;
$this->plugin_url = trailingslashit(plugins_url('', $plugin = $file));
$this->plugin_path = trailingslashit(dirname($file));
$this->products = array();
$this->load_plugin_textdomain();
// Run this on activation.
register_activation_hook($this->file, array($this, 'activation'));
if (is_admin()) {
// Load the admin.
require_once 'class-woothemes-updater-admin.php';
$this->admin = new WooThemes_Updater_Admin($file);
// Look for enabled updates across all themes (active or otherwise). If they are available, queue them.
add_action('init', array($this, 'maybe_queue_theme_updates'), 1);
// Get queued plugin updates - Run on init so themes are loaded as well as plugins.
add_action('init', array($this, 'load_queued_updates'), 2);
}
$this->add_notice_unlicensed_product();
add_filter('site_transient_' . 'update_plugins', array($this, 'change_update_information'));
}
示例9: register
/**
* Register the top-level 'Snippets' menu and associated 'Manage' subpage
*
* @uses add_menu_page() to register a top-level menu
* @uses add_submenu_page() to register a sub-menu
*/
function register()
{
/* Register the top-level menu */
add_menu_page(__('Snippets', 'code-snippets'), __('Snippets', 'code-snippets'), code_snippets()->get_cap(), code_snippets()->get_menu_slug(), array($this, 'render'), 'div', is_network_admin() ? 21 : 67);
/* Register the sub-menu */
parent::register();
}
示例10: _isInstantiatable
protected function _isInstantiatable()
{
if (isset($GLOBALS['pagenow']) && 'admin-ajax.php' === $GLOBALS['pagenow']) {
return false;
}
return !is_network_admin();
}
示例11: install
/**
* Install WPCM
*/
public static function install()
{
if (!defined('WPCM_INSTALLING')) {
define('WPCM_INSTALLING', true);
}
// Ensure needed classes are loaded
include_once 'admin/class-wpcm-admin-notices.php';
self::create_options();
self::create_roles();
// Register post types
WPCM_Post_Types::register_post_types();
WPCM_Post_Types::register_taxonomies();
// Queue upgrades
$current_version = get_option('wpclubmanager_version', null);
if ($current_version) {
update_option('wpcm_version_upgraded_from', $current_version);
}
// Update version
delete_option('wpclubmanager_version');
add_option('wpclubmanager_version', WPCM()->version);
// Flush rules after install
flush_rewrite_rules();
// Redirect to welcome screen
if (!is_network_admin() && !isset($_GET['activate-multi'])) {
set_transient('_wpcm_activation_redirect', 1, 30);
}
// Trigger action
do_action('wpclubmanager_installed');
}
示例12: bws_show_demo_button
/**
* Display "Install demo data" or "Uninstal demo data" buttons
* @return void
*/
function bws_show_demo_button($form_title)
{
if (!(is_multisite() && is_network_admin())) {
if (empty($this->bws_demo_options)) {
$value = 'install';
$button_title = __('Install Demo Data', $this->bws_plugin_text_domain);
} else {
$value = 'remove';
$button_title = __('Remove Demo Data', $this->bws_plugin_text_domain);
$form_title = __('Delete demo-data and restore old plugin settings.', $this->bws_plugin_text_domain);
}
?>
<form method="post" action="" id="bws_handle_demo_data">
<p><?php
echo $form_title;
?>
</p>
<p>
<button class="button" name="bws_handle_demo" value="<?php
echo $value;
?>
"><?php
echo $button_title;
?>
</button>
<?php
wp_nonce_field($this->bws_plugin_basename, 'bws_settings_nonce_name');
?>
</p>
</form>
<?php
}
}
示例13: onDisplaySettingsPage
public function onDisplaySettingsPage()
{
$this->check_wplister_setup('settings');
$default_tab = is_network_admin() ? 'license' : 'settings';
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : $default_tab;
if ('categories' == $active_tab) {
return $this->displayCategoriesPage();
}
if ('developer' == $active_tab) {
return $this->displayDeveloperPage();
}
if ('advanced' == $active_tab) {
return $this->displayAdvancedSettingsPage();
}
if ('accounts' == $active_tab) {
return $this->displayAccountsPage();
}
// // action FetchToken
// if ( $this->requestAction() == 'FetchToken' ) {
// // FetchToken
// $this->initEC();
// $ebay_token = $this->EC->doFetchToken();
// $this->EC->closeEbay();
// // check if we have a token
// if ( self::getOption('ebay_token') == '' ) {
// $this->showMessage( "There was a problem fetching your token. Make sure you follow the instructions.", 1 );
// }
// $this->check_wplister_setup('settings');
// }
$aData = array('plugin_url' => self::$PLUGIN_URL, 'message' => $this->message, 'ebay_sites' => EbayController::getEbaySites(), 'ebay_token_userid' => self::getOption('ebay_token_userid'), 'ebay_user' => self::getOption('ebay_user'), 'option_cron_auctions' => self::getOption('cron_auctions'), 'local_auction_display' => self::getOption('local_auction_display', 'off'), 'send_weight_and_size' => self::getOption('send_weight_and_size', 'default'), 'is_staging_site' => $this->isStagingSite(), 'settings_url' => 'admin.php?page=' . self::ParentMenuId . '-settings', 'auth_url' => 'admin.php?page=' . self::ParentMenuId . '-settings' . '&tab=' . $active_tab . '&action=wplRedirectToAuthURL', 'form_action' => 'admin.php?page=' . self::ParentMenuId . '-settings' . '&tab=' . $active_tab);
$this->display('settings_page', $aData);
}
示例14: __construct
/**
* Sets up properties.
*/
public function __construct($sOptionKey)
{
$this->bIsNetworkAdmin = is_network_admin();
// must be done first
$this->sOptionKey = $sOptionKey;
$this->aOptions = $this->_getFormattedOptions($sOptionKey);
}
示例15: edd_install
/**
* Install
*
* Runs on plugin install.
*
* @access private
* @since 1.0
* @return void
*/
function edd_install()
{
global $wpdb, $edd_options;
// Setup the Downloads Custom Post Type
edd_setup_edd_post_types();
// Setup the Download Taxonomies
edd_setup_download_taxonomies();
// Clear the permalinks
flush_rewrite_rules();
// Checks if the purchase page option exists
if (!isset($edd_options['purchase_page'])) {
// Checkout Page
$checkout = wp_insert_post(array('post_title' => __('Checkout', 'edd'), 'post_content' => '[download_checkout]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
// Purchase Confirmation (Success) Page
$success = wp_insert_post(array('post_title' => __('Purchase Confirmation', 'edd'), 'post_content' => __('Thank you for your purchase!', 'edd'), 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
// Failed Purchase Page
$failed = wp_insert_post(array('post_title' => __('Transaction Failed', 'edd'), 'post_content' => __('Your transaction failed, please try again or contact site support.', 'edd'), 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_parent' => $checkout, 'comment_status' => 'closed'));
// Purchase History (History) Page
$history = wp_insert_post(array('post_title' => __('Purchase History', 'edd'), 'post_content' => '[download_history]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_parent' => $checkout, 'comment_status' => 'closed'));
}
// Bail if activating from network, or bulk
if (is_network_admin() || isset($_GET['activate-multi'])) {
return;
}
// Add the transient to redirect
set_transient('_edd_activation_redirect', true, 30);
}