get_post_format_link

Definition:
function get_post_format_link( $format ) {}

Returns a link to a post format index.

Parameters

  • string $format: Post format

Return values

returns:Link

Source code

function get_post_format_link( $format ) {

	$term = get_term_by('slug', 'post-format-' . $format, 'post_format' );

	if ( ! $term || is_wp_error( $term ) )

		return false;

	return get_term_link( $term );

}

9587

get_post_format

Definition:
function get_post_format( $post = null ) {}

Retrieve the format slug for a post

Parameters

  • int|object $post: A post

Return values

returns:The format if successful. False if no format is set. WP_Error if errors.

Source code

function get_post_format( $post = null ) {

	$post = get_post($post);



	if ( ! post_type_supports( $post->post_type, 'post-formats' ) )

		return false;



	$_format = get_the_terms( $post->ID, 'post_format' );



	if ( empty( $_format ) )

		return false;



	$format = array_shift( $_format );



	return ( str_replace('post-format-', '', $format->slug ) );

}

9585

get_others_unpublished_posts

Definition:
function get_others_unpublished_posts($user_id, $type='any') {}

Retrieve editable posts from other users.

Parameters

  • int $user_id: User ID to not retrieve posts from.
  • string $type: Optional, defaults to ‘any’. Post type to retrieve, can be ‘draft’ or ‘pending’.

Return values

returns:List of posts from others.

Defined filters

  • get_others_drafts
    apply_filters('get_others_drafts', $other_unpubs)

Source code

function get_others_unpublished_posts($user_id, $type='any') {

	_deprecated_function( __FUNCTION__, '3.1' );



	global $wpdb;



	$editable = get_editable_user_ids( $user_id );



	if ( in_array($type, array('draft', 'pending')) )

		$type_sql = " post_status = '$type' ";

	else

		$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";



	$dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';



	if ( !$editable ) {

		$other_unpubs = '';

	} else {

		$editable = join(',', $editable);

		$other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );

	}



	return apply_filters('get_others_drafts', $other_unpubs);

}

9548

get_others_pending

Definition:
function get_others_pending($user_id) {}

Retrieve pending review posts from other users.

Parameters

  • int $user_id: User ID.

Return values

returns:List of posts with pending review post type from other users.

Source code

function get_others_pending($user_id) {

	_deprecated_function( __FUNCTION__, '3.1' );



	return get_others_unpublished_posts($user_id, 'pending');

}

9546

get_others_drafts

Definition:
function get_others_drafts($user_id) {}

Retrieve drafts from other users.

Parameters

  • int $user_id: User ID.

Return values

returns:List of drafts from other users.

Source code

function get_others_drafts($user_id) {

	_deprecated_function( __FUNCTION__, '3.1' );



	return get_others_unpublished_posts($user_id, 'draft');

}

9544