• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_guess_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了wp_guess_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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' => '[email protected]', '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' => '[email protected]', '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


示例16: wp_cookie_constants

/**
 * Defines cookie related WordPress constants
 *
 * Defines constants after multisite is loaded.
 * @since 3.0.0
 */
function wp_cookie_constants()
{
    /**
     * Used to guarantee unique hash cookies
     *
     * @since 1.5.0
     */
    if (!defined('COOKIEHASH')) {
        $siteurl = get_site_option('siteurl');
        if ($siteurl) {
            define('COOKIEHASH', md5($siteurl));
        } else {
            define('COOKIEHASH', md5(wp_guess_url()));
        }
    }
    /**
     * @since 2.0.0
     */
    if (!defined('USER_COOKIE')) {
        define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
    }
    /**
     * @since 2.0.0
     */
    if (!defined('PASS_COOKIE')) {
        define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
    }
    /**
     * @since 2.5.0
     */
    if (!defined('AUTH_COOKIE')) {
        define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
    }
    /**
     * @since 2.6.0
     */
    if (!defined('SECURE_AUTH_COOKIE')) {
        define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
    }
    /**
     * @since 2.6.0
     */
    if (!defined('LOGGED_IN_COOKIE')) {
        define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
    }
    /**
     * @since 2.3.0
     */
    if (!defined('TEST_COOKIE')) {
        define('TEST_COOKIE', 'wordpress_test_cookie');
    }
    /**
     * @since 1.2.0
     */
    if (!defined('COOKIEPATH')) {
        define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/'));
    }
    /**
     * @since 1.5.0
     */
    if (!defined('SITECOOKIEPATH')) {
        define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/'));
    }
    /**
     * @since 2.6.0
     */
    if (!defined('ADMIN_COOKIE_PATH')) {
        define('ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin');
    }
    /**
     * @since 2.6.0
     */
    if (!defined('PLUGINS_COOKIE_PATH')) {
        define('PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL));
    }
    /**
     * @since 2.0.0
     */
    if (!defined('COOKIE_DOMAIN')) {
        define('COOKIE_DOMAIN', false);
    }
}
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:88,代码来源:default-constants.php


示例17: fuzzyHrefMatch

 /**
  * Try to determine if a URL is pointing to internal content.
  *
  * @param $url
  * @param string $type front-matter, part, chapter, back-matter, ...
  * @param int $pos (optional) position of content, used when creating filenames like: chapter-001, chapter-002, ...
  *
  * @return bool|string
  */
 protected function fuzzyHrefMatch($url, $type, $pos)
 {
     if (!$pos) {
         return false;
     }
     $url = trim($url);
     $url = rtrim($url, '/');
     $last_part = explode('/', $url);
     $last_pos = count($last_part) - 1;
     $anchor = '';
     // Look for #anchors
     if ($last_pos > 0 && '#' == substr(trim($last_part[$last_pos]), 0, 1)) {
         $anchor = trim($last_part[$last_pos]);
         $last_part = trim($last_part[$last_pos - 1]);
     } elseif (false !== strpos($last_part[$last_pos], '#')) {
         list($last_part, $anchor) = explode('#', $last_part[$last_pos]);
         $anchor = trim("#{$anchor}");
         $last_part = trim($last_part);
     } else {
         $last_part = trim($last_part[$last_pos]);
     }
     if (!$last_part) {
         return false;
     }
     $lookup = \PressBooks\Book::getBookStructure();
     $lookup = $lookup['__export_lookup'];
     if (!isset($lookup[$last_part])) {
         return false;
     }
     $domain = parse_url($url);
     $domain = @$domain['host'];
     if ($domain) {
         $domain2 = parse_url(wp_guess_url());
         if ($domain != @$domain2['host']) {
             return false;
         }
     }
     // Seems legit...
     $new_type = $lookup[$last_part];
     $new_pos = 0;
     foreach ($lookup as $p => $t) {
         if ($t == $new_type) {
             ++$new_pos;
         }
         if ($p == $last_part) {
             break;
         }
     }
     $new_url = "{$new_type}-" . sprintf("%03s", $new_pos) . "-{$last_part}.{$this->filext}";
     if ($anchor) {
         $new_url .= $anchor;
     }
     return $new_url;
 }
开发者ID:Emaratilicious,项目名称:oddibooks,代码行数:63,代码来源:class-pb-epub201.php


示例18: wp_guess_url

?>
>
			Yes, please hide WP Admin from the user when they aren't logged in.</label>
		<br />
		<br />
		<h3>WordPress Login URL</h3>
		<label> Change the WordPress Login URL? <?php 
echo wp_guess_url() . '/';
?>
			<input type="text" name="login_base" value="<?php 
echo $this->login_base;
?>
" />
			<br />
			<em>This will change it from <?php 
echo wp_guess_url();
?>
/wp-login.php to whatever you put in this box. If you leave it <strong>blank</strong>, it will be disabled.<br />
			Say if you put "<strong>login</strong>" into the box, your new login URL will be <?php 
echo home_url();
?>
/login/.</em></label>
		<?php 
global $auth_obj;
$url = home_url() . '/' . $this->login_base;
?>
		<p>Your current login URL is <code><a href="<?php 
echo $url;
?>
"><?php 
echo $url;
开发者ID:navetisyan,项目名称:asatryans,代码行数:31,代码来源:admin.php


示例19: wp_guess_url

<?php

if (!($guessurl = site_url())) {
    $guessurl = wp_guess_url();
}
$baseuri = $guessurl;
$exhibituri = $baseuri . '/wp-content/plugins/datapress';
?>
<p><b>A <i>List Facet</i> lets you browse through buckets of items in you Exhibit data.</b></p>
<table>
	<tr>
	    <td><i>Facet Title</i></td>
	    <td><input id="exhibit-facet-list-label" type="text" size="30" /></td>
	    <td></td>
	</tr>
	<tr class="help">
	    <td colspan=3>
	    </td>
	<tr>
	    <td><i>Use Field</i></td>
	    <td><select id="exhibit-facet-list-field" class="allpropbox"></select></td>
	    <td></td>
	</tr>
    <tr>
		<td>Facet Location Relative to View</td>	
		<td>
		  <select id="exhibit-facet-list-location">
		    <option value="left">Left</option>
		    <option value="right">Right</option>
    		<option value="top">Top</option>
    		<option selected value="bottom">Bottom</option>
开发者ID:a-newman,项目名称:datapress_alyssa,代码行数:31,代码来源:exhibit-inputbox-facet-list.php


示例20: elseif

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_handle_sideload函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_get_widget_defaults函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap