wp_get_linksbyname

Definition:
function wp_get_linksbyname($category, $args = '') {}

Gets the links associated with the named category.

Parameters

  • string $category: The category to use.
  • string $args

Source code

function wp_get_linksbyname($category, $args = '') {

	_deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()');



	$defaults = array(

		'after' => '<br />',

		'before' => '',

		'categorize' => 0,

		'category_after' => '',

		'category_before' => '',

		'category_name' => $category,

		'show_description' => 1,

		'title_li' => '',

	);



	$r = wp_parse_args( $args, $defaults );



	return wp_list_bookmarks($r);

}

3709

wp_get_links

Definition:
function wp_get_links($args = '') {}

Gets the links associated with category.

Parameters

  • string $args: a query string

Source code

function wp_get_links($args = '') {

	_deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' );



	if ( strpos( $args, '=' ) === false ) {

		$cat_id = $args;

		$args = add_query_arg( 'category', $cat_id, $args );

	}



	$defaults = array(

		'after' => '<br />',

		'before' => '',

		'between' => ' ',

		'categorize' => 0,

		'category' => '',

		'echo' => true,

		'limit' => -1,

		'orderby' => 'name',

		'show_description' => true,

		'show_images' => true,

		'show_rating' => false,

		'show_updated' => true,

		'title_li' => '',

	);



	$r = wp_parse_args( $args, $defaults );



	return wp_list_bookmarks($r);

}

3707

wp_get_http_headers

Definition:
function wp_get_http_headers( $url, $deprecated = false ) {}

Retrieve HTTP Headers from URL.

Parameters

  • string $url
  • bool $deprecated: Not Used.

Return values

returns:False on failure, headers on success.

Source code

function wp_get_http_headers( $url, $deprecated = false ) {

	if ( !empty( $deprecated ) )

		_deprecated_argument( __FUNCTION__, '2.7' );



	$response = wp_remote_head( $url );



	if ( is_wp_error( $response ) )

		return false;



	return wp_remote_retrieve_headers( $response );

}

3705

wp_get_http

Definition:
function wp_get_http( $url, $file_path = false, $red = 1 ) {}

Perform a HTTP HEAD or GET request.
If $file_path is a writable filename, this will do a GET request and write the file to that path.

Parameters

  • string $url: URL to fetch.
  • string|bool $file_path: Optional. File path to write request to.
  • int $red: (private) The number of Redirects followed, Upon 5 being hit, returns false.

Return values

returns:False on failure and string of headers if HEAD request.

Source code

function wp_get_http( $url, $file_path = false, $red = 1 ) {

	@set_time_limit( 60 );



	if ( $red > 5 )

		return false;



	$options = array();

	$options['redirection'] = 5;



	if ( false == $file_path )

		$options['method'] = 'HEAD';

	else

		$options['method'] = 'GET';



	$response = wp_remote_request($url, $options);



	if ( is_wp_error( $response ) )

		return false;



	$headers = wp_remote_retrieve_headers( $response );

	$headers['response'] = wp_remote_retrieve_response_code( $response );



	// WP_HTTP no longer follows redirects for HEAD requests.

	if ( 'HEAD' == $options['method'] && in_array($headers['response'], array(301, 302)) && isset( $headers['location'] ) ) {

		return wp_get_http( $headers['location'], $file_path, ++$red );

	}



	if ( false == $file_path )

		return $headers;



	// GET request - write it to the supplied filename

	$out_fp = fopen($file_path, 'w');

	if ( !$out_fp )

		return $headers;



	fwrite( $out_fp,  wp_remote_retrieve_body( $response ) );

	fclose($out_fp);

	clearstatcache();



	return $headers;

}

3703

wp_get_current_user

Definition:
function wp_get_current_user() {}

Retrieve the current user object.

Return values

returns:Current user WP_User object

Source code

function wp_get_current_user() {

	global $current_user;



	get_currentuserinfo();



	return $current_user;

}

3701