get_currentuserinfo

Definition:
function get_currentuserinfo() {}

Populate global variables with information about the currently logged in user.
Will set the current user, if the current user is not set. The current user will be set to the logged in person. If no user is logged in, then it will set the current user to 0, which is invalid and won’t have any permissions.

Return values

returns:False on XMLRPC Request and invalid auth cookie. Null when current user set

Source code

function get_currentuserinfo() {

	global $current_user;



	if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST )

		return false;



	if ( ! empty($current_user) )

		return;



	if ( ! $user = wp_validate_auth_cookie() ) {

		 if ( is_blog_admin() || is_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {

		 	wp_set_current_user(0);

		 	return false;

		 }

	}



	wp_set_current_user($user);

}

1340

get_core_updates

Definition:
function get_core_updates( $options = array() {}

Get available core updates

Parameters

  • array $options: Set $options[‘dismissed’] to true to show dismissed upgrades too, set $options[‘available’] to false to skip not-dismissed updates.

Return values

returns:Array of the update objects

Source code

function get_core_updates( $options = array() ) {

	$options = array_merge( array('available' => true, 'dismissed' => false ), $options );

	$dismissed = get_site_option( 'dismissed_update_core' );

	if ( !is_array( $dismissed ) ) $dismissed = array();

	$from_api = get_site_transient( 'update_core' );

	if ( empty($from_api) )

		return false;

	if ( !isset( $from_api->updates ) || !is_array( $from_api->updates ) ) return false;

	$updates = $from_api->updates;

	if ( !is_array( $updates ) ) return false;

	$result = array();

	foreach($updates as $update) {

		if ( array_key_exists( $update->current.'|'.$update->locale, $dismissed ) ) {

			if ( $options['dismissed'] ) {

				$update->dismissed = true;

				$result[]= $update;

			}

		} else {

			if ( $options['available'] ) {

				$update->dismissed = false;

				$result[]= $update;

			}

		}

	}

	return $result;

}

1338

get_comment_type

Definition:
function get_comment_type( $comment_ID = 0 ) {}

Retrieve the comment type of the current comment.

Parameters

  • int $comment_ID: The ID of the comment for which to get the type. Optional.

Return values

returns:The comment type

Defined filters

  • get_comment_type
    apply_filters('get_comment_type', $comment->comment_type)

Source code

function get_comment_type( $comment_ID = 0 ) {

	$comment = get_comment( $comment_ID );

	if ( '' == $comment->comment_type )

		$comment->comment_type = 'comment';



	return apply_filters('get_comment_type', $comment->comment_type);

}

1336

get_comment_to_edit

Definition:
function get_comment_to_edit( $id ) {}

Parameters

  • int $id: ID of comment to retrieve

Return values

returns:if found. False on failure.

Defined filters

  • comment_edit_pre
    apply_filters( 'comment_edit_pre', $comment->comment_content)

Source code

function get_comment_to_edit( $id ) {

	if ( !$comment = get_comment($id) )

		return false;



	$comment->comment_ID = (int) $comment->comment_ID;

	$comment->comment_post_ID = (int) $comment->comment_post_ID;



	$comment->comment_content = format_to_edit( $comment->comment_content );

	$comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content);



	$comment->comment_author = format_to_edit( $comment->comment_author );

	$comment->comment_author_email = format_to_edit( $comment->comment_author_email );

	$comment->comment_author_url = format_to_edit( $comment->comment_author_url );

	$comment->comment_author_url = esc_url($comment->comment_author_url);



	return $comment;

}

1334

get_comment_time

Definition:
function get_comment_time( $d = '', $gmt = false, $translate = true ) {}

Retrieve the comment time of the current comment.

Parameters

  • string $d: Optional. The format of the time (defaults to user’s config)
  • bool $gmt: Whether to use the GMT date
  • bool $translate: Whether to translate the time (for use in feeds)

Return values

returns:The formatted time

Defined filters

  • get_comment_time
    apply_filters('get_comment_time', $date, $d, $gmt, $translate)

Source code

function get_comment_time( $d = '', $gmt = false, $translate = true ) {

	global $comment;

	$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;

	if ( '' == $d )

		$date = mysql2date(get_option('time_format'), $comment_date, $translate);

	else

		$date = mysql2date($d, $comment_date, $translate);

	return apply_filters('get_comment_time', $date, $d, $gmt, $translate);

}

1332