當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wp_guess_url函數代碼示例

本文整理匯總了PHP中wp_guess_url函數的典型用法代碼示例。如果您正苦於以下問題:PHP wp_guess_url函數的具體用法?PHP wp_guess_url怎麽用?PHP wp_guess_url使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了wp_guess_url函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: wp_install

function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
{
    global $wpdb;
    $base = '/';
    $domain = JQUERY_STAGING_PREFIX . 'jquery.com';
    wp_check_mysql_version();
    wp_cache_flush();
    make_db_current_silent();
    populate_options();
    populate_roles();
    $user_id = wp_create_user($user_name, trim($user_password), $user_email);
    $user = new WP_User($user_id);
    $user->set_role('administrator');
    $guess_url = wp_guess_url();
    foreach ($wpdb->tables('ms_global') as $table => $prefixed_table) {
        $wpdb->{$table} = $prefixed_table;
    }
    install_network();
    populate_network(1, $domain, $user_email, 'jQuery Network', $base, false);
    update_site_option('site_admins', array($user->user_login));
    update_site_option('allowedthemes', array());
    $wpdb->insert($wpdb->blogs, array('site_id' => 1, 'domain' => $domain, 'path' => $base, 'registered' => current_time('mysql')));
    $blog_id = $wpdb->insert_id;
    update_user_meta($user_id, 'source_domain', $domain);
    update_user_meta($user_id, 'primary_blog', $blog_id);
    if (!($upload_path = get_option('upload_path'))) {
        $upload_path = substr(WP_CONTENT_DIR, strlen(ABSPATH)) . '/uploads';
        update_option('upload_path', $upload_path);
    }
    update_option('fileupload_url', get_option('siteurl') . '/' . $upload_path);
    jquery_install_remaining_sites($user);
    wp_new_blog_notification($blog_title, $guess_url, $user_id, $message = __('The password you chose during the install.'));
    wp_cache_flush();
    return array('url' => $guess_url, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
開發者ID:ravasthi,項目名稱:web-base-template,代碼行數:35,代碼來源:install.php

示例2: wp_install

 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '')
 {
     global $wp_rewrite;
     wp_check_mysql_version();
     wp_cache_flush();
     make_db_current_silent();
     populate_options();
     populate_roles();
     update_option('blogname', $blog_title);
     update_option('admin_email', $user_email);
     update_option('blog_public', $public);
     $guessurl = wp_guess_url();
     update_option('siteurl', $guessurl);
     // If not a public blog, don't ping.
     if (!$public) {
         update_option('default_pingback_flag', 0);
     }
     // Create default user.  If the user already exists, the user tables are
     // being shared among blogs.  Just set the role in that case.
     $user_id = username_exists($user_name);
     if (!$user_id) {
         $random_password = wp_generate_password();
         $user_id = wp_create_user($user_name, $random_password, $user_email);
     } else {
         $random_password = __('User already exists.  Password inherited.');
     }
     $user = new WP_User($user_id);
     $user->set_role('administrator');
     wp_install_defaults($user_id);
     $wp_rewrite->flush_rules();
     wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);
     wp_cache_flush();
     return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password);
 }
開發者ID:alx,項目名稱:blogsfera,代碼行數:34,代碼來源:upgrade.php

示例3: wp_install

 /**
  * Installs the blog
  *
  * {@internal Missing Long Description}}
  *
  * @since 2.1.0
  *
  * @param string $blog_title Blog title.
  * @param string $user_name User's username.
  * @param string $user_email User's email.
  * @param bool $public Whether blog is public.
  * @param string $deprecated Optional. Not used.
  * @param string $user_password Optional. User's chosen password. Will default to a random password.
  * @param string $language Optional. Language chosen.
  * @return array Array keys 'url', 'user_id', 'password', 'password_message'.
  */
 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '')
 {
     if (!empty($deprecated)) {
         _deprecated_argument(__FUNCTION__, '2.6');
     }
     wp_check_mysql_version();
     wp_cache_flush();
     make_db_current_silent();
     populate_options();
     populate_roles();
     update_option('blogname', $blog_title);
     update_option('admin_email', $user_email);
     update_option('blog_public', $public);
     if ($language) {
         update_option('WPLANG', $language);
     }
     $guessurl = wp_guess_url();
     update_option('siteurl', $guessurl);
     // If not a public blog, don't ping.
     if (!$public) {
         update_option('default_pingback_flag', 0);
     }
     /*
      * Create default user. If the user already exists, the user tables are
      * being shared among blogs. Just set the role in that case.
      */
     $user_id = username_exists($user_name);
     $user_password = trim($user_password);
     $email_password = false;
     if (!$user_id && empty($user_password)) {
         $user_password = wp_generate_password(12, false);
         $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
         $user_id = wp_create_user($user_name, $user_password, $user_email);
         update_user_option($user_id, 'default_password_nag', true, true);
         $email_password = true;
     } else {
         if (!$user_id) {
             // Password has been provided
             $message = '<em>' . __('Your chosen password.') . '</em>';
             $user_id = wp_create_user($user_name, $user_password, $user_email);
         } else {
             $message = __('User already exists. Password inherited.');
         }
     }
     $user = new WP_User($user_id);
     $user->set_role('administrator');
     wp_install_defaults($user_id);
     flush_rewrite_rules();
     wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
     wp_cache_flush();
     /**
      * Fires after a site is fully installed.
      *
      * @since 3.9.0
      *
      * @param WP_User $user The site owner.
      */
     do_action('wp_install', $user);
     return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
 }
開發者ID:sb-xs,項目名稱:que-pour-elle,代碼行數:76,代碼來源:upgrade.php

示例4: wp_install

 /**
  * Installs the blog
  *
  * {@internal Missing Long Description}}
  *
  * @since 2.1.0
  *
  * @param string $blog_title Blog title.
  * @param string $user_name User's username.
  * @param string $user_email User's email.
  * @param bool $public Whether blog is public.
  * @param null $deprecated Optional. Not used.
  * @param string $user_password Optional. User's chosen password. Will default to a random password.
  * @return array Array keys 'url', 'user_id', 'password', 'password_message'.
  */
 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
 {
     if (!empty($deprecated)) {
         _deprecated_argument(__FUNCTION__, '2.6');
     }
     wp_check_mysql_version();
     wp_cache_flush();
     make_db_current_silent();
     if (!is_file(ABSPATH . 'wp-admin/install.sql')) {
         //[ysd]如果有install.sql不設置默認options數據
         populate_options();
     } else {
         validate_active_plugins();
         //[ysd] 禁用 不可用的插件
     }
     populate_roles();
     update_option('blogname', $blog_title);
     update_option('admin_email', $user_email);
     update_option('blog_public', $public);
     $guessurl = isset($_SERVER['HTTP_APPNAME']) ? 'http://' . substr($_SERVER['HTTP_APPNAME'], 5) . '.1kapp.com' : wp_guess_url();
     //[ysd] 固定了guessurl
     update_option('siteurl', $guessurl);
     update_option('home', $guessurl);
     get_option('siteurl');
     // If not a public blog, don't ping.
     if (!$public) {
         update_option('default_pingback_flag', 0);
     }
     // Create default user. If the user already exists, the user tables are
     // being shared among blogs. Just set the role in that case.
     $user_id = username_exists($user_name);
     $user_password = trim($user_password);
     $email_password = false;
     if (!$user_id && empty($user_password)) {
         $user_password = wp_generate_password(12, false);
         $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
         $user_id = wp_create_user($user_name, $user_password, $user_email);
         update_user_option($user_id, 'default_password_nag', true, true);
         $email_password = true;
     } else {
         if (!$user_id) {
             // Password has been provided
             $message = '<em>' . __('Your chosen password.') . '</em>';
             $user_id = wp_create_user($user_name, $user_password, $user_email);
         } else {
             $message = __('User already exists. Password inherited.');
         }
     }
     $user = new WP_User($user_id);
     $user->set_role('administrator');
     if (!file_exists(ABSPATH . 'wp-admin/without_default')) {
         wp_install_defaults($user_id);
     }
     //[ysd],如果打包時設置了默認數據,才會設置默認數據
     flush_rewrite_rules();
     wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
     wp_cache_flush();
     return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
 }
開發者ID:ramo01,項目名稱:1kapp,代碼行數:74,代碼來源:upgrade.php

示例5: populate_options

/**
 * Create WordPress options and set the default values.
 *
 * @since 1.5.0
 * @uses $wpdb
 * @uses $wp_db_version
 */
function populate_options()
{
    global $wpdb, $wp_db_version, $current_site;
    $guessurl = wp_guess_url();
    do_action('populate_options');
    if (ini_get('safe_mode')) {
        // Safe mode can break mkdir() so use a flat structure by default.
        $uploads_use_yearmonth_folders = 0;
    } else {
        $uploads_use_yearmonth_folders = 1;
    }
    $options = array('siteurl' => $guessurl, 'blogname' => __('My Site'), 'blogdescription' => __('Just another WordPress site'), 'users_can_register' => 0, 'admin_email' => 'you@example.com', 'start_of_week' => 1, 'use_balanceTags' => 0, 'use_smilies' => 0, 'require_name_email' => 1, 'comments_notify' => 1, 'posts_per_rss' => 10, 'rss_use_excerpt' => 0, 'mailserver_url' => 'mail.example.com', 'mailserver_login' => 'login@example.com', 'mailserver_pass' => 'password', 'mailserver_port' => 110, 'default_category' => 1, 'default_comment_status' => 'open', 'default_ping_status' => 'open', 'default_pingback_flag' => 1, 'default_post_edit_rows' => 10, 'posts_per_page' => 10, 'date_format' => __('F j, Y'), 'time_format' => __('g:i a'), 'links_updated_date_format' => __('F j, Y g:i a'), 'links_recently_updated_prepend' => '<em>', 'links_recently_updated_append' => '</em>', 'links_recently_updated_time' => 120, 'comment_moderation' => 0, 'moderation_notify' => 1, 'permalink_structure' => '', 'gzipcompression' => 0, 'hack_file' => 0, 'blog_charset' => 'UTF-8', 'moderation_keys' => '', 'active_plugins' => array(), 'home' => $guessurl, 'category_base' => '', 'ping_sites' => 'http://rpc.pingomatic.com/', 'advanced_edit' => 0, 'comment_max_links' => 2, 'gmt_offset' => date('Z') / 3600, 'default_email_category' => 1, 'recently_edited' => '', 'template' => WP_DEFAULT_THEME, 'stylesheet' => WP_DEFAULT_THEME, 'comment_whitelist' => 1, 'blacklist_keys' => '', 'comment_registration' => 0, 'rss_language' => 'en', 'html_type' => 'text/html', 'use_trackback' => 0, 'default_role' => 'subscriber', 'db_version' => $wp_db_version, 'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders, 'upload_path' => '', 'blog_public' => '1', 'default_link_category' => 2, 'show_on_front' => 'posts', 'tag_base' => '', 'show_avatars' => '1', 'avatar_rating' => 'G', 'upload_url_path' => '', 'thumbnail_size_w' => 150, 'thumbnail_size_h' => 150, 'thumbnail_crop' => 1, 'medium_size_w' => 300, 'medium_size_h' => 300, 'avatar_default' => 'mystery', 'enable_app' => 0, 'enable_xmlrpc' => 0, 'large_size_w' => 1024, 'large_size_h' => 1024, 'image_default_link_type' => 'file', 'image_default_size' => '', 'image_default_align' => '', 'close_comments_for_old_posts' => 0, 'close_comments_days_old' => 14, 'thread_comments' => 1, 'thread_comments_depth' => 5, 'page_comments' => 0, 'comments_per_page' => 50, 'default_comments_page' => 'newest', 'comment_order' => 'asc', 'sticky_posts' => array(), 'widget_categories' => array(), 'widget_text' => array(), 'widget_rss' => array(), 'timezone_string' => '', 'embed_autourls' => 1, 'embed_size_w' => '', 'embed_size_h' => 600, 'page_for_posts' => 0, 'page_on_front' => 0);
    // 3.0 multisite
    if (is_multisite()) {
        /* translators: blog tagline */
        $options['blogdescription'] = sprintf(__('Just another %s site'), $current_site->site_name);
        $options['permalink_structure'] = '/%year%/%monthnum%/%day%/%postname%/';
    }
    // Set autoload to no for these options
    $fat_options = array('moderation_keys', 'recently_edited', 'blacklist_keys');
    $existing_options = $wpdb->get_col("SELECT option_name FROM {$wpdb->options}");
    $insert = '';
    foreach ($options as $option => $value) {
        if (in_array($option, $existing_options)) {
            continue;
        }
        if (in_array($option, $fat_options)) {
            $autoload = 'no';
        } else {
            $autoload = 'yes';
        }
        $option = $wpdb->escape($option);
        if (is_array($value)) {
            $value = serialize($value);
        }
        $value = $wpdb->escape($value);
        if (!empty($insert)) {
            $insert .= ', ';
        }
        $insert .= "('{$option}', '{$value}', '{$autoload}')";
    }
    if (!empty($insert)) {
        $wpdb->query("INSERT INTO {$wpdb->options} (option_name, option_value, autoload) VALUES " . $insert);
    }
    // in case it is set, but blank, update "home"
    if (!__get_option('home')) {
        update_option('home', $guessurl);
    }
    // Delete unused options
    $unusedoptions = array('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page');
    foreach ($unusedoptions as $option) {
        delete_option($option);
    }
    // delete obsolete magpie stuff
    $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?\$'");
}
開發者ID:laiello,項目名稱:cartonbank,代碼行數:63,代碼來源:schema.php

示例6: wp_install

/**
 * This function overrides wp_install() in wp-admin/includes/upgrade.php
 */
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.6');
    }
    wp_check_mysql_version();
    wp_cache_flush();
    /* changes */
    require_once PDODIR . 'schema.php';
    make_db_sqlite();
    /* changes */
    populate_options();
    populate_roles();
    update_option('blogname', $blog_title);
    update_option('admin_email', $user_email);
    update_option('blog_public', $public);
    $guessurl = wp_guess_url();
    update_option('siteurl', $guessurl);
    if (!$public) {
        update_option('default_pingback_flag', 0);
    }
    $user_id = username_exists($user_name);
    $user_password = trim($user_password);
    $email_password = false;
    if (!$user_id && empty($user_password)) {
        $user_password = wp_generate_password(12, false);
        $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
        $user_id = wp_create_user($user_name, $user_password, $user_email);
        update_user_option($user_id, 'default_password_nag', true, true);
        $email_password = true;
    } else {
        if (!$user_id) {
            $message = '<em>' . __('Your chosen password.') . '</em>';
            $user_id = wp_create_user($user_name, $user_password, $user_email);
        }
    }
    $user = new WP_User($user_id);
    $user->set_role('administrator');
    wp_install_defaults($user_id);
    flush_rewrite_rules();
    wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
    wp_cache_flush();
    if (isset($_SERVER['SERVER_SOFTWARE']) && stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) {
        // Your server is Apache. Nothing to do more.
    } else {
        $server_message = sprintf('Your webserver doesn\'t seem to be Apache. So the database directory access restriction by the .htaccess file may not function. We strongly recommend that you should restrict the access to the directory %s in some other way.', FQDBDIR);
        echo '<div style="position: absolute; margin-top: 350px; width: 700px; border: .5px dashed rgb(0, 0, 0);"><p style="margin: 10px;">';
        echo $server_message;
        echo '</p></div>';
    }
    return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
開發者ID:pthiep,項目名稱:pthiepwordpress,代碼行數:55,代碼來源:install.php

示例7: get_inline_exhibit

 static function get_inline_exhibit($exhibit)
 {
     global $wp_query;
     if (!($guessurl = site_url())) {
         $guessurl = wp_guess_url();
     }
     $baseuri = $guessurl;
     $exhibituri = $baseuri . '/wp-content/plugins/datapress';
     $exhibitid = $exhibit->get('id');
     $postid = $wp_query->post->ID;
     $height = $exhibit->get('height');
     $exhibit_html = "<iframe src='{$exhibituri}/wp-exhibit-only.php?iframe&exhibitid={$exhibitid}&postid={$postid}&currentview=inline' width='100%' height='{$height}' scrolling='auto' frameborder='0'>\n                                      <p>Your browser does not support iframes.</p>\n                                      </iframe>";
     return $exhibit_html;
 }
開發者ID:a-newman,項目名稱:datapress_alyssa,代碼行數:14,代碼來源:wp-exhibit-insert-exhibit.php

示例8: thatcamp_newer_posts_link

function thatcamp_newer_posts_link($link_text, $max_pages)
{
    $paged = thatcamp_get_paged();
    if (1 === $paged) {
        return;
    }
    $p = $paged - 1;
    if (false !== strpos(wp_guess_url(), '/page/')) {
        $url = preg_replace('|/page/[0-9]+/|', '/page/' . $p . '/', wp_guess_url());
    } else {
        $url = add_query_arg('paged', $p, wp_guess_url());
    }
    echo '<a href="' . $url . '">' . $link_text . '</a>';
}
開發者ID:kosir,項目名稱:thatcamp-org,代碼行數:14,代碼來源:functions.php

示例9: wp_install

/**
 * this function overrides the built in wordpress  variant
 * 
 * @param object $blog_title
 * @param object $user_name
 * @param object $user_email
 * @param object $public
 * @param object $deprecated [optional]
 * @return 
 */
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '')
{
    global $wp_rewrite, $wpdb;
    //wp_check_mysql_version();
    wp_cache_flush();
    /**** changes start here ***/
    switch (DB_TYPE) {
        case 'sqlite':
            require PDODIR . '/driver_sqlite/schema.php';
            installdb();
            break;
        case 'mysql':
            make_db_current_silent();
            break;
    }
    /**** changes end ***/
    $wpdb->suppress_errors();
    populate_options();
    populate_roles();
    update_option('blogname', $blog_title);
    update_option('admin_email', $user_email);
    update_option('blog_public', $public);
    $guessurl = wp_guess_url();
    update_option('siteurl', $guessurl);
    // If not a public blog, don't ping.
    if (!$public) {
        update_option('default_pingback_flag', 0);
    }
    // Create default user.  If the user already exists, the user tables are
    // being shared among blogs.  Just set the role in that case.
    $user_id = username_exists($user_name);
    if (!$user_id) {
        $random_password = wp_generate_password();
        $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.<br><br>���' . $random_password);
        $user_id = wp_create_user($user_name, $random_password, $user_email);
        update_usermeta($user_id, 'default_password_nag', true);
    } else {
        $random_password = '';
        $message = __('User already exists.  Password inherited.');
    }
    $user = new WP_User($user_id);
    $user->set_role('administrator');
    wp_install_defaults($user_id);
    $wp_rewrite->flush_rules();
    wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);
    wp_cache_flush();
    return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password, 'password_message' => $message);
}
開發者ID:nottrobin,項目名稱:blog.robinwinslow.co.uk,代碼行數:58,代碼來源:wp_install.php

示例10: jb_add_script

 /**
  * Load script to your site
  *
  * @param string $load
  * @return string js code
  * @since 0.9.0
  * @author: Tambh
  *
  */
 public function jb_add_script(&$scripts)
 {
     if (!defined('SCRIPT_DEBUG')) {
         define('SCRIPT_DEBUG', $develop_src);
     }
     if (!($guessurl = site_url())) {
         $guessed_url = true;
         $guessurl = wp_guess_url();
     }
     $scripts->base_url = $guessurl;
     do_action('jb_load_script', $scripts);
     if (current_user_can('manage_options')) {
         do_action('jb_load_admin_script', $scripts);
     }
     do_action('jb_after_load_script', $scripts);
 }
開發者ID:jackbui2014,項目名稱:JB-Onepage-Simple-theme,代碼行數:25,代碼來源:class-load-scripts.php

示例11: wp_install

/**
 * This function overrides wp_install() in wp-admin/includes/upgrade.php
 */
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '')
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.6');
    }
    wp_check_mysql_version();
    wp_cache_flush();
    /* changes */
    require_once PDODIR . 'schema.php';
    make_db_sqlite();
    /* changes */
    populate_options();
    populate_roles();
    update_option('blogname', $blog_title);
    update_option('admin_email', $user_email);
    update_option('blog_public', $public);
    $guessurl = wp_guess_url();
    update_option('siteurl', $guessurl);
    if (!$public) {
        update_option('default_pingback_flag', 0);
    }
    $user_id = username_exists($user_name);
    $user_password = trim($user_password);
    $email_password = false;
    if (!$user_id && empty($user_password)) {
        $user_password = wp_generate_password(12, false);
        $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
        $user_id = wp_create_user($user_name, $user_password, $user_email);
        update_user_option($user_id, 'default_password_nag', true, true);
        $email_password = true;
    } else {
        if (!$user_id) {
            $message = '<em>' . __('Your chosen password.') . '</em>';
            $user_id = wp_create_user($user_name, $user_password, $user_email);
        }
    }
    $user = new WP_User($user_id);
    $user->set_role('administrator');
    wp_install_defaults($user_id);
    flush_rewrite_rules();
    wp_new_blog_notification($blog_title, $guessurl, $user_id, $email_password ? $user_password : __('The password you chose during the install.'));
    wp_cache_flush();
    if (isset($_SERVER['SERVER_SOFTWARE']) && stripos($_SERVER['SERVER_SOFTWARE'], 'apache') !== false || isset($_SERVER['SERVER_SIGNATURE']) && stripos($_SERVER['SERVER_SIGNATURE'], 'apache') !== false) {
        // Your server is Apache. Nothing to do more.
    }
    return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
}
開發者ID:daniel-marklund,項目名稱:sqlite-plugin-wordpress,代碼行數:50,代碼來源:install.php

示例12: bootstrap_admin_wp_default_styles

function bootstrap_admin_wp_default_styles(&$styles)
{
    if (!($guessurl = site_url())) {
        $guessurl = wp_guess_url();
    }
    $styles->base_url = $guessurl;
    $styles->content_url = defined('WP_CONTENT_URL') ? WP_CONTENT_URL : '';
    $styles->default_version = get_bloginfo('version');
    $styles->text_direction = function_exists('is_rtl') && is_rtl() ? 'rtl' : 'ltr';
    $styles->default_dirs = array('/wp-admin/', '/wp-includes/css/');
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    $rtl_styles = array('wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls', 'media-views', 'wp-color-picker');
    // Any rtl stylesheets that don't have a .min version
    $no_suffix = array('farbtastic');
    $styles->add('wp-admin', "/wp-admin/css/wp-admin{$suffix}.css");
    $styles->add('ie', "/wp-admin/css/ie{$suffix}.css");
    $styles->add_data('ie', 'conditional', 'lte IE 7');
    // Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.
    $styles->add('colors', true, array('wp-admin', 'buttons'));
    // do not refer to these directly, the right one is queued by the above "meta" colors handle
    // $styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array('wp-admin', 'buttons') );
    // $styles->add( 'colors-classic', "/wp-admin/css/colors-classic$suffix.css", array('wp-admin', 'buttons') );
    $styles->add('media', "/wp-admin/css/media{$suffix}.css");
    $styles->add('install', "/wp-admin/css/install{$suffix}.css", array('buttons'));
    $styles->add('thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20121105');
    $styles->add('farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1');
    $styles->add('wp-color-picker', "/wp-admin/css/color-picker{$suffix}.css");
    $styles->add('jcrop', "/wp-includes/js/jcrop/jquery.Jcrop.min.css", array(), '0.9.10');
    $styles->add('imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8');
    $styles->add('admin-bar', "/wp-includes/css/admin-bar{$suffix}.css");
    $styles->add('wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog{$suffix}.css");
    $styles->add('editor-buttons', "/wp-includes/css/editor{$suffix}.css");
    $styles->add('wp-pointer', "/wp-includes/css/wp-pointer{$suffix}.css");
    $styles->add('customize-controls', "/wp-admin/css/customize-controls{$suffix}.css", array('wp-admin', 'colors', 'ie'));
    $styles->add('media-views', "/wp-includes/css/media-views{$suffix}.css", array('buttons'));
    // $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" );
    $styles->add('buttons', plugins_url('assets/css/buttons.css', __FILE__));
    foreach ($rtl_styles as $rtl_style) {
        $styles->add_data($rtl_style, 'rtl', true);
        if ($suffix && !in_array($rtl_style, $no_suffix)) {
            $styles->add_data($rtl_style, 'suffix', $suffix);
        }
    }
}
開發者ID:klebercarvalho,項目名稱:demo,代碼行數:44,代碼來源:bootstrap-admin.php

示例13: htmlContent

 function htmlContent()
 {
     $kind = $this->get('kind');
     $uri = $this->get('uri');
     $sourcename = $this->get('sourcename');
     if ($kind == 'google-spreadsheet') {
         return "<link rel=\"exhibit/data\" type=\"application/jsonp\" href=\"{$uri}\" ex:converter=\"googleSpreadsheets\" alt=\"{$sourcename}\"/>";
     } else {
         if ($kind == 'application/json') {
             if ($this->get('data_location') == 'local') {
                 return "<link href=\"{$uri}\" type\"application/json\" rel=\"exhibit/data\" alt=\"{$sourcename}\" />";
             } else {
                 if (!($guessurl = site_url())) {
                     $guessurl = wp_guess_url();
                 }
                 $baseuri = $guessurl;
                 $exhibituri = $baseuri . '/wp-content/plugins/datapress';
                 $parrotbase = $exhibituri . '/proxy/parrot.php';
                 return "<link href=\"{$parrotbase}" . '?url=' . urlencode($uri) . "\" type=\"application/json\" rel=\"exhibit/data\" alt=\"{$sourcename}\" />";
             }
         }
     }
 }
開發者ID:a-newman,項目名稱:datapress_alyssa,代碼行數:23,代碼來源:datasource.php

示例14: bp_members_admin_bar_my_account_menu

/**
 * Add the "My Account" menu and all submenus.
 *
 * @since BuddyPress (1.6)
 * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support
 */
function bp_members_admin_bar_my_account_menu()
{
    global $bp, $wp_admin_bar;
    // Bail if this is an ajax request
    if (defined('DOING_AJAX')) {
        return;
    }
    // Logged in user
    if (is_user_logged_in()) {
        // Stored in the global so we can add menus easily later on
        $bp->my_account_menu_id = 'my-account-buddypress';
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'group' => true, 'title' => __('Edit My Profile', 'buddypress'), 'href' => bp_loggedin_user_domain(), 'meta' => array('class' => 'ab-sub-secondary')));
        // Show login and sign-up links
    } elseif (!empty($wp_admin_bar)) {
        add_filter('show_admin_bar', '__return_true');
        // Create the main 'My Account' menu
        $wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url(wp_guess_url())));
        // Sign up
        if (bp_get_signup_allowed()) {
            $wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
        }
    }
}
開發者ID:danielcoats,項目名稱:schoolpress,代碼行數:30,代碼來源:bp-members-adminbar.php

示例15: get_bloginfo

 function get_bloginfo()
 {
     return wp_guess_url();
 }
開發者ID:unisexx,項目名稱:drtooth,代碼行數:4,代碼來源:setup-config.php


注:本文中的wp_guess_url函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。