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


PHP signup_another_blog函数代码示例

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


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

示例1: validate_another_blog_signup

/**
 * Validate a new blog signup
 *
 * @since MU
 *
 * @return null|boolean True if blog signup was validated, false if error.
 *                      The function halts all execution if the user is not logged in.
 */
function validate_another_blog_signup() {
	global $wpdb, $blogname, $blog_title, $errors, $domain, $path;
	$current_user = wp_get_current_user();
	if ( ! is_user_logged_in() ) {
		die();
	}

	$result = validate_blog_form();

	// Extracted values set/overwrite globals.
	$domain = $result['domain'];
	$path = $result['path'];
	$blogname = $result['blogname'];
	$blog_title = $result['blog_title'];
	$errors = $result['errors'];

	if ( $errors->get_error_code() ) {
		signup_another_blog($blogname, $blog_title, $errors);
		return false;
	}

	$public = (int) $_POST['blog_public'];

	$blog_meta_defaults = array(
		'lang_id' => 1,
		'public'  => $public
	);

	/**
	 * Filter the new site meta variables.
	 *
	 * @since MU
	 * @deprecated 3.0.0 Use the 'add_signup_meta' filter instead.
	 *
	 * @param array $blog_meta_defaults An array of default blog meta variables.
	 */
	$meta_defaults = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults );
	/**
	 * Filter the new default site meta variables.
	 *
	 * @since 3.0.0
	 *
	 * @param array $meta {
	 *     An array of default site meta variables.
	 *
	 *     @type int $lang_id     The language ID.
	 *     @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false.
	 * }
	 */
	$meta = apply_filters( 'add_signup_meta', $meta_defaults );

	wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
	confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
	return true;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:63,代码来源:wp-signup.php

示例2: xtec_signup

function xtec_signup()
{
    $limit = get_site_option('xtec_signup_maxblogsday');
    /* xtec_current_user_can() is defined in XTEC Users plugin */
    if (is_user_logged_in() && xtec_current_user_can('create_blogs', $limit)) {
        /* xtec_current_user_can() is defined in XTEC Users plugin */
        $blogs = xtec_current_user_can('create_blog_today', $limit);
        if ($blogs) {
            ?>
			<h2>Limit de creació excedit</h2>
			<p>El limit de creació de blocs diari és <strong><?php 
            echo $limit;
            ?>
</strong>. Si voleu crear-ne més avui, abans n'haureu d'eliminar algun.</p>
			
			<p>Blocs creats en les darreres 24h:</p>
			<ul>
				<?php 
            foreach ($blogs as $idblog) {
                $siteurl = get_blog_option($idblog, 'siteurl');
                $blogname = get_blog_option($idblog, 'blogname');
                echo "<li><a href='{$siteurl}'\\>{$blogname}</a></li>";
            }
            ?>
			</ul>
			<?php 
        } else {
            signup_another_blog();
        }
    } else {
        echo "<p class=\"notAllowed\">No teniu autorització per crear blocs nous.</p>\n";
    }
    ?>
	
	</div>
	</div>

	<?php 
    /** @todo Use 'show_admin_bar' function. */
    //get_footer();
    die;
}
开发者ID:ignacioabejaro,项目名称:xtecblocs,代码行数:42,代码来源:xtec-signup.php

示例3: validate_another_blog_signup

function validate_another_blog_signup()
{
    global $wpdb, $blogname, $blog_title, $errors, $domain, $path;
    $current_user = wp_get_current_user();
    if (!is_user_logged_in()) {
        die;
    }
    $result = validate_blog_form();
    extract($result);
    if ($errors->get_error_code()) {
        signup_another_blog($blogname, $blog_title, $errors);
        return false;
    }
    $public = (int) $_POST['blog_public'];
    $meta = apply_filters('signup_create_blog_meta', array('lang_id' => 1, 'public' => $public));
    // deprecated
    $meta = apply_filters('add_signup_meta', $meta);
    wpmu_create_blog($domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid);
    confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
    return true;
}
开发者ID:google-code-backups,项目名称:pumpmyvote,代码行数:21,代码来源:wp-signup.php

示例4: validate_another_blog_signup

     }
     break;
 case 'gimmeanotherblog':
     validate_another_blog_signup();
     break;
 case 'default':
 default:
     $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : '';
     /**
      * Fires when the site sign-up form is sent.
      *
      * @since 3.0.0
      */
     do_action('preprocess_signup_form');
     if (is_user_logged_in() && ('all' === $active_signup || 'blog' === $active_signup)) {
         signup_another_blog($newblogname);
     } else {
         if (false === is_user_logged_in() && ('all' === $active_signup || 'user' === $active_signup)) {
             signup_user($newblogname, $user_email);
         } else {
             if (false === is_user_logged_in() && 'blog' === $active_signup) {
                 _e('Sorry, new registrations are not allowed at this time.');
             } else {
                 _e('You are logged in already. No need to register again!');
             }
         }
     }
     if ($newblogname) {
         $newblog = get_blogaddress_by_name($newblogname);
         if ('blog' === $active_signup || 'all' === $active_signup) {
             printf('<p><em>' . __('The site you were looking for, <strong>%s</strong>, does not exist, but you can create it now!') . '</em></p>', $newblog);
开发者ID:aaronholbrook,项目名称:ms-custom-signup,代码行数:31,代码来源:signup.php


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