get_userdatabylogin

Definition:
function get_userdatabylogin($user_login) {}

Retrieve user info by login name.

Parameters

  • string $user_login: User’s username

Return values

returns:on failure, User DB row object

Source code

function get_userdatabylogin($user_login) {

	return get_user_by('login', $user_login);

}

1879

get_userdata

Definition:
function get_userdata( $user_id ) {}

Retrieve user info by user ID.

Parameters

  • int $user_id: User ID

Return values

returns:on failure, WP_User object on success

Source code

function get_userdata( $user_id ) {

	return get_user_by( 'id', $user_id );

}

1877

get_upload_space_available

Definition:
function get_upload_space_available() {}

Determines if there is any upload space left in the current blog’s quota.

Return values

returns:of upload space available in bytes

Source code

function get_upload_space_available() {

	$space_allowed = get_space_allowed() * 1024 * 1024;

	if ( get_site_option( 'upload_space_check_disabled' ) )

		return $space_allowed;



	$dir_name = trailingslashit( BLOGUPLOADDIR );

	if ( !( is_dir( $dir_name) && is_readable( $dir_name ) ) )

		return $space_allowed;



  	$dir = dir( $dir_name );

   	$size = 0;



	while ( $file = $dir->read() ) {

		if ( $file != '.' && $file != '..' ) {

			if ( is_dir( $dir_name . $file) ) {

				$size += get_dirsize( $dir_name . $file );

			} else {

				$size += filesize( $dir_name . $file );

			}

		}

	}

	$dir->close();



	if ( ( $space_allowed - $size ) <= 0 )

		return 0;



	return $space_allowed - $size;

}

1875

get_upload_iframe_src

Definition:
function get_upload_iframe_src($type) {}

Parameters

  • $type

Defined filters

  • $type_upload_iframe_src
    apply_filters($type . '_upload_iframe_src', $upload_iframe_src)

Source code

function get_upload_iframe_src($type) {

	global $post_ID, $temp_ID;

	$uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);

	$upload_iframe_src = add_query_arg('post_id', $uploading_iframe_ID, 'media-upload.php');



	if ( 'media' != $type )

		$upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src);

	$upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src);



	return add_query_arg('TB_iframe', true, $upload_iframe_src);

}

1873

get_udims

Definition:
function get_udims( $width, $height) {}

Calculated the new dimensions for a downsampled image.

Parameters

  • int $width: Current width of the image
  • int $height: Current height of the image

Return values

returns:Array(height,width) of shrunk dimensions.

Source code

function get_udims( $width, $height) {

	return wp_constrain_dimensions( $width, $height, 128, 96 );

}

1871