Don't use deprecated functions. Fixes #12377 props filosofo.

git-svn-id: http://svn.automattic.com/wordpress/trunk@13423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-02-26 00:41:23 +00:00
parent 0b66fc91e0
commit 1409dcca90
4 changed files with 5 additions and 5 deletions

View File

@ -2628,7 +2628,7 @@ function the_attachment_links( $id = false ) {
if ( $post->post_type != 'attachment' ) if ( $post->post_type != 'attachment' )
return false; return false;
$icon = get_attachment_icon( $post->ID ); $icon = wp_get_attachment_image( $post->ID, 'thumbnail', true );
$attachment_data = wp_get_attachment_metadata( $id ); $attachment_data = wp_get_attachment_metadata( $id );
$thumb = isset( $attachment_data['thumb'] ); $thumb = isset( $attachment_data['thumb'] );
?> ?>

View File

@ -555,7 +555,7 @@ switch ( $_GET['action'] ) {
wp_die( __('Missing email.') ); wp_die( __('Missing email.') );
$password = wp_generate_password(); $password = wp_generate_password();
$user_id = wpmu_create_user(wp_specialchars( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) ); $user_id = wpmu_create_user(esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
if ( false == $user_id ) if ( false == $user_id )
wp_die( __('Duplicated username or email address.') ); wp_die( __('Duplicated username or email address.') );

View File

@ -292,7 +292,7 @@ switch ( $action ) {
<?php <?php
reset( $editblog_roles ); reset( $editblog_roles );
foreach ( $editblog_roles as $role => $role_assoc ){ foreach ( $editblog_roles as $role => $role_assoc ){
$name = translate_with_context($role_assoc['name']); $name = translate_user_role( $role_assoc['name'] );
$selected = ( $role == $editblog_default_role ) ? 'selected="selected"' : ''; $selected = ( $role == $editblog_default_role ) ? 'selected="selected"' : '';
echo "<option {$selected} value=\"" . esc_attr($role) . "\">{$name}</option>"; echo "<option {$selected} value=\"" . esc_attr($role) . "\">{$name}</option>";
} }

View File

@ -83,11 +83,11 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
$add_user_errors = $user_details[ 'errors' ]; $add_user_errors = $user_details[ 'errors' ];
} else { } else {
$new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true));
if ( isset( $_POST[ 'noconfirmation' ] ) && is_site_admin() ) { if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin(get_current_user_id()) ) {
add_filter( 'wpmu_signup_user_notification', create_function('', '{return false;}') ); // Disable confirmation email add_filter( 'wpmu_signup_user_notification', create_function('', '{return false;}') ); // Disable confirmation email
} }
wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) ); wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) );
if ( isset( $_POST[ 'noconfirmation' ] ) && is_site_admin() ) { if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin(get_current_user_id()) ) {
$key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $_REQUEST[ 'email' ] ) ); $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $_REQUEST[ 'email' ] ) );
wpmu_activate_signup( $key ); wpmu_activate_signup( $key );
$redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' );