get_profile

Definition:
function get_profile( $field, $user = false ) {}

Retrieve user data based on field.

Parameters

  • $field
  • $user

Source code

function get_profile( $field, $user = false ) {

	_deprecated_function( __FUNCTION__, '3.0', 'get_the_author_meta()' );

	if ( $user ) {

		$user = get_user_by( 'login', $user );

		$user = $user->ID;

	}

	return get_the_author_meta( $field, $user );

}

1649

get_private_posts_cap_sql

Definition:
function get_private_posts_cap_sql( $post_type ) {}

Retrieve the private post SQL based on capability.
This function provides a standardized way to appropriately select on the post_status of a post type. The function will return a piece of SQL code that can be added to a WHERE clause; this SQL is constructed to allow all published posts, and all private posts to which the user has access.

Parameters

  • string $post_type: currently only supports ‘post’ or ‘page’.

Return values

returns:SQL code that can be added to a where clause.

Source code

function get_private_posts_cap_sql( $post_type ) {

	return get_posts_by_author_sql( $post_type, false );

}

1647

get_previous_posts_page_link

Definition:
function get_previous_posts_page_link() {}

Retrieve previous posts page link.
Will only return string, if not on a single page or post.

Source code

function get_previous_posts_page_link() {

	global $paged;



	if ( !is_single() ) {

		$nextpage = intval($paged) - 1;

		if ( $nextpage < 1 )

			$nextpage = 1;

		return get_pagenum_link($nextpage);

	}

}

1645

get_previous_posts_link

Definition:
function get_previous_posts_link( $label = null ) {}

Return the previous posts page link.

Parameters

  • string $label: Optional. Previous page link text.

Defined filters

  • previous_posts_link_attributes
    apply_filters( 'previous_posts_link_attributes', '' )

Source code

function get_previous_posts_link( $label = null ) {

	global $paged;



	if ( null === $label )

		$label = __( '&laquo; Previous Page' );



	if ( !is_single() && $paged > 1 ) {

		$attr = apply_filters( 'previous_posts_link_attributes', '' );

		return '<a href="' . previous_posts( false ) . "\" $attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/', '&$1', $label ) .'</a>';

	}

}

1643

get_previous_post

Definition:
function get_previous_post($in_same_cat = false, $excluded_categories = '') {}

Retrieve previous post that is adjacent to current post.

Parameters

  • bool $in_same_cat: Optional. Whether post should be in a same category.
  • array|string $excluded_categories: Optional. Array or comma-separated list of excluded category IDs.

Return values

returns:Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.

Source code

function get_previous_post($in_same_cat = false, $excluded_categories = '') {

	return get_adjacent_post($in_same_cat, $excluded_categories);

}

1641