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


PHP is_main_site函数代码示例

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


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

示例1: add_rewrite_rules

 public static function add_rewrite_rules($rules)
 {
     //Get taxonomies
     $taxonomies = get_taxonomies();
     $blog_prefix = '';
     $endpoint = Slash_Edit::get_instance()->get_endpoint();
     if (is_multisite() && !is_subdomain_install() && is_main_site()) {
         /* stolen from /wp-admin/options-permalink.php */
         $blog_prefix = 'blog/';
     }
     $exclude = array('category', 'post_tag', 'nav_menu', 'link_category', 'post_format');
     foreach ($taxonomies as $key => $taxonomy) {
         if (in_array($key, $exclude)) {
             continue;
         }
         $rules["{$blog_prefix}{$key}/([^/]+)/{$endpoint}(/(.*))?/?\$"] = 'index.php?' . $key . '=$matches[1]&' . $endpoint . '=$matches[3]';
     }
     //Add home_url/edit to rewrites
     $add_frontpage_edit_rules = false;
     if (!get_page_by_path($endpoint)) {
         $add_frontpage_edit_rules = true;
     } else {
         $page = get_page_by_path($endpoint);
         if (is_a($page, 'WP_Post') && $page->post_status != 'publish') {
             $add_frontpage_edit_rules = true;
         }
     }
     if ($add_frontpage_edit_rules) {
         $edit_array_rule = array("{$endpoint}/?\$" => 'index.php?' . $endpoint . '=frontpage');
         $rules = $edit_array_rule + $rules;
     }
     return $rules;
 }
开发者ID:sebjon-bytbil,项目名称:BytBil-Hemsida,代码行数:33,代码来源:slash-edit.php

示例2: isBook

 /**
  * Check if the current blog_id is considered a "book"
  *
  * @return bool
  */
 static function isBook()
 {
     // Currently, the main site is considered a "blog/landing page" whereas everything else is considered a "book".
     // We might improve this in the future.
     $is_book = is_main_site() === false;
     return $is_book;
 }
开发者ID:stackpoet,项目名称:pressbooks,代码行数:12,代码来源:class-pb-book.php

示例3: category_rewrite_rules

 /**
  * This function taken and only slightly adapted from WP No Category Base plugin by Saurabh Gupta
  */
 function category_rewrite_rules($rewrite)
 {
     global $wp_rewrite;
     $category_rewrite = array();
     $categories = get_categories(array('hide_empty' => false));
     $blog_prefix = '';
     if (function_exists('is_multisite') && is_multisite() && !is_subdomain_install() && is_main_site()) {
         $blog_prefix = 'blog/';
     }
     foreach ($categories as $category) {
         $category_nicename = $category->slug;
         if ($category->parent == $category->cat_ID) {
             // recursive recursion
             $category->parent = 0;
         } elseif ($category->parent != 0) {
             $category_nicename = get_category_parents($category->parent, false, '/', true) . $category_nicename;
         }
         $category_rewrite[$blog_prefix . '(' . $category_nicename . ')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
         $category_rewrite[$blog_prefix . '(' . $category_nicename . ')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
         $category_rewrite[$blog_prefix . '(' . $category_nicename . ')/?$'] = 'index.php?category_name=$matches[1]';
     }
     // Redirect support from Old Category Base
     $old_base = $wp_rewrite->get_category_permastruct();
     $old_base = str_replace('%category%', '(.+)', $old_base);
     $old_base = trim($old_base, '/');
     $category_rewrite[$old_base . '$'] = 'index.php?wpseo_category_redirect=$matches[1]';
     return $category_rewrite;
 }
开发者ID:kitfrench,项目名称:Futurestep,代码行数:31,代码来源:class-rewrite.php

示例4: 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

示例5: widget

 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     $limit = (int) @$instance['limit'];
     $limit = $limit ? $limit : 5;
     $data = new Wdpv_Options();
     $voted_timeframe = @$instance['voted_timeframe'];
     if (!in_array($voted_timeframe, array_keys($data->timeframes))) {
         $voted_timeframe = false;
     }
     if (is_main_site()) {
         $model = new Wdpv_Model();
         $posts = $model->get_popular_on_network($limit, $voted_timeframe);
         echo $before_widget;
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         if (is_array($posts)) {
             echo "<ul class='wdpv_popular_posts wdpv_network_popular'>";
             foreach ($posts as $post) {
                 $data = get_blog_post($post['blog_id'], $post['post_id']);
                 echo "<li>";
                 echo '<a href="' . get_blog_permalink($post['blog_id'], $post['post_id']) . '">' . $data->post_title . '</a> ';
                 printf(__('<span class="wdpv_vote_count">(%s votes)</span>', 'wdpv'), $post['total']);
                 echo "</li>";
             }
             echo "</ul>";
         }
         echo $after_widget;
     }
 }
开发者ID:hscale,项目名称:webento,代码行数:32,代码来源:class_wpdv_widget_network_popular.php

示例6: scan_for_files

 /**
  * This function scans theme folder for files.
  *
  * @param $ext string File extension to scan
  * @param $mode int 0 - theme, 1 - plugin
  * @return array Relative file path.
  */
 public static function scan_for_files($ext, $mode = 0)
 {
     $root = $_SERVER['DOCUMENT_ROOT'];
     switch ($mode) {
         case 0:
             $url = get_template_directory_uri();
             break;
         case 1:
             $url = plugin_dir_url(__FILE__) . 'assets/custom';
             break;
         default:
             $url = get_template_directory_uri();
             break;
     }
     if (is_multisite() && !is_main_site()) {
         $dir = preg_replace('/https?:\\/\\/[^\\/]+\\/[^\\/]+/i', '', $url);
     } else {
         $dir = preg_replace('/https?:\\/\\/[^\\/]+/i', '', $url);
     }
     $files = self::rglob($root . $dir . "/*.{$ext}");
     $result = array();
     $root_preg = preg_quote($root, '/');
     $path_preg = preg_quote($dir, '/');
     foreach ((array) $files as $file) {
         $strip_root = preg_replace("/{$root_preg}/", '', $file, 1);
         $path = preg_replace("/{$path_preg}/", '', $strip_root, 1);
         if ($mode == 1) {
             $result[] = array('path' => 'custom' . $path);
         } else {
             $result[] = array('path' => $path);
         }
     }
     return $result;
 }
开发者ID:boykodev,项目名称:wp-enqueue,代码行数:41,代码来源:wpenq-helper.php

示例7: subscribe

 /**
  * Subscribe.
  *
  * @since 141004
  * @package s2Member\List_Servers
  *
  * @param array $args Input arguments.
  *
  * @return bool True if successful.
  */
 public static function subscribe($args)
 {
     if (!($args = self::validate_args($args))) {
         return FALSE;
     }
     // Invalid args.
     if (!$args->opt_in) {
         // Double check.
         return FALSE;
     }
     // Must say explicitly.
     if (empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $args->level . '_aweber_list_ids'])) {
         return FALSE;
     }
     // No list configured at this level.
     $aw_level_list_ids = $GLOBALS['WS_PLUGIN__']['s2member']['o']['level' . $args->level . '_aweber_list_ids'];
     foreach (preg_split('/[' . "\r\n\t" . '\\s;,]+/', $aw_level_list_ids, NULL, PREG_SPLIT_NO_EMPTY) as $_aw_list) {
         $_aw = array('args' => $args, 'function' => __FUNCTION__, 'list' => trim($_aw_list), 'list_id' => trim($_aw_list), 'api_method' => 'listSubscribe');
         if (!$_aw['list']) {
             continue;
         }
         // List missing.
         $_aw['bcc'] = apply_filters('ws_plugin__s2member_aweber_bcc', FALSE, get_defined_vars());
         $_aw['pass_inclusion'] = apply_filters('ws_plugin__s2member_aweber_pass_inclusion', FALSE, get_defined_vars()) && $args->pass ? "\n" . 'Pass: ' . $args->pass : '';
         if ($_aw['wp_mail_response'] = wp_mail($_aw['list_id'] . '@aweber.com', $_aw['wp_mail_sbj'] = apply_filters('ws_plugin__s2member_aweber_sbj', 's2Member Subscription Request', get_defined_vars()), $_aw['wp_mail_msg'] = apply_filters('ws_plugin__s2member_aweber_msg', 's2Member Subscription Request' . "\n" . 's2Member w/ PayPal Email ID' . "\n" . 'Ad Tracking: s2Member-' . (is_multisite() && !is_main_site() ? $GLOBALS['current_blog']->domain . $GLOBALS['current_blog']->path : $_SERVER['HTTP_HOST']) . "\n" . 'EMail Address: ' . $args->email . "\n" . 'Buyer: ' . $args->name . "\n" . 'Full Name: ' . $args->name . "\n" . 'First Name: ' . $args->fname . "\n" . 'Last Name: ' . $args->lname . "\n" . 'IP Address: ' . $args->ip . "\n" . 'User ID: ' . $args->user_id . "\n" . 'Login: ' . $args->login . $_aw['pass_inclusion'] . "\n" . 'Role: ' . $args->role . "\n" . 'Level: ' . $args->level . "\n" . 'CCaps: ' . $args->ccaps . "\n" . ' - end.', get_defined_vars()), $_aw['wp_mail_headers'] = 'From: "' . preg_replace('/"/', "'", $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_name']) . '" <' . $GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_from_email'] . '>' . ($_aw['bcc'] ? "\r\n" . 'Bcc: ' . $_aw['bcc'] : '') . "\r\n" . 'Content-Type: text/plain; charset=UTF-8')) {
             $_aw['wp_mail_success'] = $success = TRUE;
         }
         // Flag this as `TRUE`; assists with return value below.
         c_ws_plugin__s2member_utils_logs::log_entry('aweber-api', $_aw);
     }
     unset($_aw_list, $_aw);
     // Just a little housekeeping.
     return !empty($success);
     // If one suceeds.
 }
开发者ID:codeforest,项目名称:s2member,代码行数:45,代码来源:aweber-e.inc.php

示例8: __construct

 public function __construct()
 {
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     echo '<h3 style="margin:0;">Auto-Return Page Template (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-pro-paypal-return-page-template\').toggle(); return false;" class="ws-dotted-link">optional customizations</a>)</h3>' . "\n";
     echo '<div id="ws-plugin--s2member-pro-paypal-return-page-template" style="display:none;">' . "\n";
     echo '<p>With s2Member Pro installed, you have the ability to customize your <a href="' . esc_attr(site_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">Auto-Return Page Template</a>. If you are using PayPal Standard integration <em>(i.e. PayPal Buttons)</em>, each of your Customers are returned back to your site immediately after they complete checkout at PayPal. Your Auto-Return Page displays a message and instructions for the Customer. s2Member may change the message and instructions dynamically, based on what the Customer is actually doing <em>(i.e. based on the type of transaction that is taking place)</em>. So, although we do NOT recommend that you attempt to change the message and instructions presented dynamically by s2Member, you CAN certainly control the Header, and/or the overall appearance of s2Member\'s Auto-Return Page Template.</p>' . "\n";
     echo '<p>The quickest/easiest way, is to simply add some HTML code in the box below. For instance, you might include an &lt;img&gt; tag with your logo. The box below, allows you to customize the Header section <em>(i.e. the top)</em> of s2Member\'s default Auto-Return Page Template. Everything else, including the textual response and other important details that each Customer needs to know about, are already handled dynamically by s2Member <em>(based on the type of transaction that is taking place)</em>. All you need to do is customize the Header with your logo and anything else you feel is important. Although this Header customization is completely optional, we recommend an <a href="http://www.w3schools.com/tags/tag_img.asp" target="_blank" rel="external">&lt;img&gt; tag</a>, with a logo that is around 300px wide. After you "Save All Changes" below, you may <a href="' . esc_attr(site_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">click this link to see what your Header looks like</a>.</p>' . "\n";
     echo '<table class="form-table">' . "\n";
     echo '<tbody>' . "\n";
     echo '<tr>' . "\n";
     echo '<th>' . "\n";
     echo '<label for="ws-plugin--s2member-pro-paypal-return-template-header">' . "\n";
     echo 'Auto-Return Page Template Header:' . "\n";
     echo '</label>' . "\n";
     echo '</th>' . "\n";
     echo '</tr>' . "\n";
     echo '<tr>' . "\n";
     echo '<td>' . "\n";
     echo '<textarea name="ws_plugin__s2member_pro_paypal_return_template_header" id="ws-plugin--s2member-pro-paypal-return-template-header" rows="5" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_paypal_return_template_header"]) . '</textarea><br />' . "\n";
     echo 'Any valid XHTML / JavaScript' . (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site() ? '' : ' (or even PHP)') . ' code will work just fine here.' . "\n";
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '<div class="ws-menu-page-hr"></div>' . "\n";
     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<p>It is also possible to build your own Auto-Return Page Template, if you prefer. If you feel the need to create your own Auto-Return Page Template, please make a copy of s2Member\'s default template: <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir"] . "/includes/templates/returns/default-template.php")) . '</code>. Place your copy of this default template, inside your active WordPress theme directory, and name the file: <code>/paypal-return.php</code>. s2Member will automatically find your Auto-Return Page Template in this location, and s2Member will use your template, instead of the default. Further details are provided inside s2Member\'s default template file. Once your custom template file is in place, you may <a href="' . esc_attr(site_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">click this link to see what it looks like</a>.</p>' . "\n";
     }
     echo '<p>It is also possible to bypass s2Member\'s Auto-Return system all together, if you prefer. For further details, please read more about the <code>success=""</code> Shortcode Attribute for PayPal Buttons generated by s2Member. You will find details on this inside your Dashboard, under: <code>s2Member -› PayPal Buttons -› Shortcode Attributes (Explained)</code>. Please note: you will still need to configure your PayPal account for Auto-Return/PDT <em>(as instructed above)</em>. Then, you may use the <code>success=""</code> Attribute in your Shortcode, when/if you need it. In other words, if you use the <code>success=""</code> Attribute in your Shortcode, the initial redirection back to s2Member\'s default Auto-Return/PDT handler MUST still occur. However, instead of s2Member displaying an Auto-Return Template to the Customer, s2Member will silently redirect the Customer to the URL that you specified in the <code>success="http://..."</code> Attribute of your Shortcode, allowing you to take complete control over what happens next.</p>' . "\n";
     echo '</div>' . "\n";
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:31,代码来源:paypal-ops-return-template.inc.php

示例9: register

 /**
  * Handles Registration Links.
  *
  * @package s2Member\Registrations
  * @since 3.5
  *
  * @attaches-to ``add_action("init");``
  *
  * @return null Or exits script execution after redirection.
  */
 public static function register()
 {
     do_action("ws_plugin__s2member_before_register", get_defined_vars());
     /**/
     if (!empty($_GET["s2member_register"])) {
         eval('while (@ob_end_clean ());');
         /* First we end/clean any output buffers that may exist already. */
         /**/
         $msg_503 = _x('<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
         /**/
         if (is_array($register = preg_split("/\\:\\.\\:\\|\\:\\.\\:/", c_ws_plugin__s2member_utils_encryption::decrypt(trim(stripslashes((string) $_GET["s2member_register"])))))) {
             if (count($register) === 6 && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time") {
                 if (is_numeric($register[5]) && $register[5] <= strtotime("now") && $register[5] >= strtotime("-" . apply_filters("ws_plugin__s2member_register_link_exp_time", "2 days", get_defined_vars()))) {
                     $_COOKIE["s2member_subscr_gateway"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[1]);
                     $_COOKIE["s2member_subscr_id"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[2]);
                     $_COOKIE["s2member_custom"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[3]);
                     $_COOKIE["s2member_item_number"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[4]);
                     /**/
                     if (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
                         status_header(200);
                         /* Send a 200 OK status header. */
                         header("Content-Type: text/html; charset=utf-8");
                         /* Content-Type with UTF-8. */
                         /**/
                         setcookie("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         setcookie("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         setcookie("s2member_custom", $_COOKIE["s2member_custom"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_custom", $_COOKIE["s2member_custom"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         setcookie("s2member_item_number", $_COOKIE["s2member_item_number"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_item_number", $_COOKIE["s2member_item_number"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
                         /**/
                         do_action("ws_plugin__s2member_during_register", get_defined_vars());
                         /**/
                         if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() && ($location = c_ws_plugin__s2member_utils_urls::wp_signup_url())) {
                             echo '<script type="text/javascript">' . "\n";
                             echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($location) . "';";
                             echo '</script>' . "\n";
                         } else {
                             if ($location = c_ws_plugin__s2member_utils_urls::wp_register_url()) {
                                 echo '<script type="text/javascript">' . "\n";
                                 echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($location) . "';";
                                 echo '</script>' . "\n";
                             }
                         }
                         exit;
                         /* Clean exit. The browser will now be redirected to ``$location``. */
                     } else {
                         status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
                     }
                 } else {
                     status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
                 }
             } else {
                 status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
             }
         } else {
             status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
         }
     }
     /**/
     do_action("ws_plugin__s2member_after_register", get_defined_vars());
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:70,代码来源:register-in.inc.php

示例10: return_template

 /**
  * Handles Return templates w/ response message.
  *
  * @package s2Member\Return_Templates
  * @since 110720
  *
  * @param string $template Optional A Subscr. Gateway code should be used as the template name, or `default` is a multipurpose template. Defaults to `default`. Used in template selection.
  * @param string $response Optional. Response message to fill template with, using the Replacement Code `%%response%%` inside the template file. Defaults to: `Thank you. Please click the link below.`.
  * @param string $continue_html Optional. The HTML value of the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: `Continue`.
  * @param string $continue_link Optional. The HREF value for the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: ``home_url ('/', 'http')``.
  *
  * @return string The full HTML code of the template. All Replacement Codes inside the template file will have already been filled by this routine.
  */
 public static function return_template($template = '', $response = '', $continue_html = '', $continue_link = '')
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_return_template', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     $template = $template ? $template : 'default';
     $continue_link = $continue_link ? $continue_link : home_url('/', 'http');
     $continue_html = $continue_html ? $continue_html : _x('Continue', 's2member-front', 's2member');
     $response = $response ? $response : _x('Thank you. Please click the link below.', 's2member-front', 's2member');
     $custom_template = is_file(TEMPLATEPATH . '/' . $template . '-return.php') ? TEMPLATEPATH . '/' . $template . '-return.php' : '';
     $custom_template = is_file(get_stylesheet_directory() . '/' . $template . '-return.php') ? get_stylesheet_directory() . '/' . $template . '-return.php' : $custom_template;
     $custom_template = is_file(WP_CONTENT_DIR . '/' . $template . '-return.php') ? WP_CONTENT_DIR . '/' . $template . '-return.php' : $custom_template;
     $custom_template = !$custom_template && is_file(TEMPLATEPATH . '/default-return.php') ? TEMPLATEPATH . '/default-return.php' : $custom_template;
     $custom_template = !$custom_template && is_file(get_stylesheet_directory() . '/default-return.php') ? get_stylesheet_directory() . '/default-return.php' : $custom_template;
     $custom_template = !$custom_template && is_file(WP_CONTENT_DIR . '/default-return.php') ? WP_CONTENT_DIR . '/default-return.php' : $custom_template;
     $specific_template = $custom_template ? $custom_template : (is_file($_default_specific_template = dirname(dirname(__FILE__)) . '/templates/returns/' . $template . '-return.php') ? $_default_specific_template : '');
     $code = trim(file_get_contents($specific_template ? $specific_template : ($_default_template = dirname(dirname(__FILE__)) . '/templates/returns/default-return.php')));
     $code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code);
     $doctype_html_head = c_ws_plugin__s2member_utils_html::doctype_html_head(get_bloginfo('name'), 'ws_plugin__s2member_during_return_template_head_' . ($specific_template ? basename($specific_template) : 'default-return.php'));
     $code = preg_replace('/%%doctype_html_head%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_doctype_html_head', $doctype_html_head, get_defined_vars())), $code);
     $code = preg_replace('/%%header%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_header', sprintf(_x('[ %s ] <strong><em>says&hellip;</em></strong>', 's2member-front', 's2member'), esc_html($_SERVER['HTTP_HOST'])), get_defined_vars())), $code);
     $code = preg_replace('/%%response%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_response', $response, get_defined_vars())), $code);
     $code = preg_replace('/%%continue%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_continue', '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code);
     $code = preg_replace('/%%support%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_support', sprintf(_x('If you need assistance, please <a href="%s" target="_blank">contact support</a>.', 's2member-front', 's2member'), esc_attr($GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_support_link'])), get_defined_vars())), $code);
     $code = preg_replace('/%%tracking%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_tracking', c_ws_plugin__s2member_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code);
     return apply_filters('ws_plugin__s2member_return_template', $code, get_defined_vars());
 }
开发者ID:adnandot,项目名称:intenseburn,代码行数:43,代码来源:return-templates.inc.php

示例11: mmm_menu_options_array

 function mmm_menu_options_array()
 {
     global $mmm_menu_options_array;
     global $mega_main_menu;
     if (isset($mmm_menu_options_array) && $mmm_menu_options_array !== false) {
         $options = $mmm_menu_options_array;
     } else {
         /* Additional styles */
         $additional_styles_presets = $mega_main_menu->get_option('additional_styles_presets');
         $additional_styles[__('Default', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN'])] = 'default_style';
         if (is_array($additional_styles_presets)) {
             unset($additional_styles_presets['0']);
             foreach ($additional_styles_presets as $key => $value) {
                 $additional_styles[$key . '. ' . $value['style_name']] = 'additional_style_' . $key;
             }
         }
         /* Submenu types */
         $submenu_types = array(__('Standard Submenu', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'default_dropdown', __('Multicolumn Submenu', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'multicolumn_dropdown', __('Tabs Submenu', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'tabs_dropdown', __('Grid Submenu', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'grid_dropdown', __('Posts Grid Submenu', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'post_type_dropdown');
         if (is_multisite() && is_main_site()) {
             $submenu_types[__('Posts Grid Submenu (Multisite)', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN'])] = 'post_type_dropdown_multisite';
         }
         $number_of_widgets = $mega_main_menu->get_option('number_of_widgets', '1');
         if (is_numeric($number_of_widgets) && $number_of_widgets > 0) {
             for ($i = 1; $i <= $number_of_widgets; $i++) {
                 $submenu_widgets[__('Widgets area ', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) . $i] = $mega_main_menu->constant['MM_WARE_PREFIX'] . '_menu_widgets_area_' . $i;
             }
             $submenu_types = array_merge($submenu_types, $submenu_widgets);
         }
         /* options */
         $options = array(array('descr' => __('Description', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_descr', 'type' => 'textarea', 'col_width' => 2), array('descr' => __('Style of This Item', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_style', 'type' => 'select', 'values' => $additional_styles, 'default' => 'default'), array('descr' => __('Visibility Control', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_visibility', 'type' => 'select', 'values' => array(__('Always Visible', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'all', __('Visible Only to Logged Users', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'logged', __('Visible Only to Unlogged Visitors', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'visitors')), array('descr' => __('Icon of This Item (set empty to hide)', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'item_icon', 'type' => 'icons'), array('key' => 'disable_text', 'type' => 'checkbox', 'values' => array(__('Hide Text of This Item', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'true')), array('key' => 'disable_link', 'type' => 'checkbox', 'values' => array(__('Disable Link', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'true')), array('key' => 'pull_to_other_side', 'type' => 'checkbox', 'values' => array(__('Pull to the Other Side', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'true')), array('name' => __('Options of Dropdown', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('Submenu Type', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_type', 'type' => 'select', 'values' => $submenu_types), array('key' => 'submenu_post_type', 'descr' => __('Post Type for Display in Dropdown', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'type' => 'select', 'values' => mm_common::get_all_taxonomies(), 'dependency' => array('element' => 'menu-item-submenu_type[__ID__]', 'value' => array('post_type_dropdown'))), array('key' => 'submenu_drops_side', 'descr' => __('Side of Dropdown Area', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'type' => 'select', 'values' => array(__('Drop To Right Side', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'drop_to_right', __('Drop To Left Side', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'drop_to_left', __('Drop To Center', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'drop_to_center')), array('descr' => __('Submenu Columns (Not For Standard Drops)', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_columns', 'type' => 'select', 'values' => range(1, 10)), array('key' => 'submenu_enable_full_width', 'type' => 'checkbox', 'values' => array(__('Enable Full Width Dropdown (only for horizontal menu)', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']) => 'true')), array('name' => __('Dropdown Background Image', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'descr' => __('', $mega_main_menu->constant['MM_TEXTDOMAIN_ADMIN']), 'key' => 'submenu_bg_image', 'type' => 'background_image', 'default' => ''));
         $GLOBALS['mmm_menu_options_array'] = $options;
     }
     return $options;
 }
开发者ID:mazykin46,项目名称:portfolio,代码行数:34,代码来源:menu_options_array.php

示例12: 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

示例13: 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

示例14: __construct

 public function __construct()
 {
     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Pro API For Remote Operations">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-remote-operations-section">' . "\n";
         echo '<h3>Pro API For Remote Operations (PHP scripting required)</h3>' . "\n";
         echo '<p>With s2Member Pro installed, you have access to the s2Member Pro API For Remote Operations. This is made available for developers that wish to create User/Member accounts dynamically through custom scripts of their own. s2Member\'s Remote Operations API requires a secret API Key in order to POST authenticated requests to your installation of s2Member.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operations API: <strong>Your secret API Key</strong></h4>' . "\n";
         echo '<input type="text" autocomplete="off" value="' . format_to_edit(c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen()) . '" style="width:99%;" />' . "\n";
         echo '<p><em><strong class="ws-menu-page-hilite">Experimental:</strong> The Remote Operations API is currently in an experimental state. The Operations that are currently possible include: <code>auth_check_user</code>, <code>get_user</code>, <code>create_user</code>, <code>modify_user</code>, <code>delete_user</code>. In a future release of s2Member Pro, we will add further documentation and some additional Remote Operations to this API. Thanks for your patience.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>auth_check_user</code> (authenticate existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-auth-check-user.x-php"))))) . '</p>' . "\n";
         echo '<h4>Remote Operation: <code>get_user</code> (retrieve data about existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-get-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>create_user</code> (or update existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-create-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>modify_user</code> (updates existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-modify-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>delete_user</code> (deletes existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-delete-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex -› API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
     }
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:32,代码来源:scripting-api-remote-ops.inc.php

示例15: __construct

 /**
  * Set up the API module.
  *
  * @since 4.0.0
  * @internal
  */
 public function __construct()
 {
     if (WPMUDEV_CUSTOM_API_SERVER) {
         $this->server_root = trailingslashit(WPMUDEV_CUSTOM_API_SERVER);
     }
     $this->server_url = $this->server_root . $this->rest_api;
     if (defined('WPMUDEV_APIKEY') && WPMUDEV_APIKEY) {
         $this->api_key = WPMUDEV_APIKEY;
     } else {
         // If 'clear_key' is present in URL then do not load the key from DB.
         $this->api_key = get_site_option('wpmudev_apikey');
     }
     // Schedule automatic data update on the main site of the network.
     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, 'refresh_membership_data'));
     } elseif (wp_next_scheduled('wpmudev_scheduled_jobs')) {
         // In case the cron job was already installed in a sub-site...
         wp_clear_scheduled_hook('wpmudev_scheduled_jobs');
     }
     /**
      * Run custom initialization code for the API module.
      *
      * @since  4.0.0
      * @var  WPMUDEV_Dashboard_Api The dashboards API module.
      */
     do_action('wpmudev_dashboard_api_init', $this);
 }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:36,代码来源:class-wpmudev-dashboard-api.php


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