get_the_excerpt

Definition:
function get_the_excerpt( $deprecated = '' ) {}

Retrieve the post excerpt.

Parameters

  • mixed $deprecated: Not used.

Defined filters

  • get_the_excerpt
    apply_filters('get_the_excerpt', $output)

Source code

function get_the_excerpt( $deprecated = '' ) {

	if ( !empty( $deprecated ) )

		_deprecated_argument( __FUNCTION__, '2.3' );



	global $post;

	$output = $post->post_excerpt;

	if ( post_password_required($post) ) {

		$output = __('There is no excerpt because this is a protected post.');

		return $output;

	}



	return apply_filters('get_the_excerpt', $output);

}

1829

get_the_date

Definition:
function get_the_date( $d = '' ) {}

Retrieve the date the current $post was written.
Unlike the_date() this function will always return the date. Modify output with ‘get_the_date’ filter.

Parameters

  • string $d: Optional. PHP date format defaults to the date_format option if not specified.

Return values

returns:Null if displaying, string if retrieving.

Defined filters

  • get_the_date
    apply_filters('get_the_date', $the_date, $d)

Source code

function get_the_date( $d = '' ) {

	global $post;

	$the_date = '';



	if ( '' == $d )

		$the_date .= mysql2date(get_option('date_format'), $post->post_date);

	else

		$the_date .= mysql2date($d, $post->post_date);



	return apply_filters('get_the_date', $the_date, $d);

}

1827

get_the_content_feed

Definition:
function get_the_content_feed($feed_type = null) {}

Retrieve the post content for feeds.

Parameters

  • string $feed_type: The type of feed. rss2 | atom | rss | rdf

Defined filters

  • the_content
    apply_filters('the_content', get_the_content()
  • the_content_feed
    apply_filters('the_content_feed', $content, $feed_type)

Source code

function get_the_content_feed($feed_type = null) {

	if ( !$feed_type )

		$feed_type = get_default_feed();



	$content = apply_filters('the_content', get_the_content());

	$content = str_replace(']]>', ']]>', $content);

	return apply_filters('the_content_feed', $content, $feed_type);

}

1825

get_the_content

Definition:
function get_the_content($more_link_text = null, $stripteaser = false) {}

Retrieve the post content.

Parameters

  • string $more_link_text: Optional. Content for when there is more text.
  • bool $stripteaser: Optional. Strip teaser content before the more text. Default is false.

Defined filters

  • the_content_more_link
    apply_filters( 'the_content_more_link', ' <a href="' . get_permalink()

Source code

function get_the_content($more_link_text = null, $stripteaser = false) {

	global $post, $more, $page, $pages, $multipage, $preview;



	if ( null === $more_link_text )

		$more_link_text = __( '(more...)' );



	$output = '';

	$hasTeaser = false;



	// If post password required and it doesn't match the cookie.

	if ( post_password_required($post) ) {

		$output = get_the_password_form();

		return $output;

	}



	if ( $page > count($pages) ) // if the requested page doesn't exist

		$page = count($pages); // give them the highest numbered page that DOES exist



	$content = $pages[$page-1];

	if ( preg_match('/<!--more(.*?)?-->/', $content, $matches) ) {

		$content = explode($matches[0], $content, 2);

		if ( !empty($matches[1]) && !empty($more_link_text) )

			$more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));



		$hasTeaser = true;

	} else {

		$content = array($content);

	}

	if ( (false !== strpos($post->post_content, '<!--noteaser-->') && ((!$multipage) || ($page==1))) )

		$stripteaser = true;

	$teaser = $content[0];

	if ( $more && $stripteaser && $hasTeaser )

		$teaser = '';

	$output .= $teaser;

	if ( count($content) > 1 ) {

		if ( $more ) {

			$output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];

		} else {

			if ( ! empty($more_link_text) )

				$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );

			$output = force_balance_tags($output);

		}



	}

1823

get_the_category_rss

Definition:
function get_the_category_rss($type = null) {}

Retrieve all of the post categories, formatted for use in feeds.
All of the categories for the current post in the feed loop, will be retrieved and have feed markup added, so that they can easily be added to the RSS2, Atom, or RSS1 and RSS0.91 RDF feeds.

Parameters

  • string $type: Optional, default is the type returned by get_default_feed().

Return values

returns:All of the post categories for displaying in the feed.

Defined filters

  • get_bloginfo_rss
    apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' )
  • the_category_rss
    apply_filters('the_category_rss', $the_list, $type)

Source code

function get_the_category_rss($type = null) {

	if ( empty($type) )

		$type = get_default_feed();

	$categories = get_the_category();

	$tags = get_the_tags();

	$the_list = '';

	$cat_names = array();



	$filter = 'rss';

	if ( 'atom' == $type )

		$filter = 'raw';



	if ( !empty($categories) ) foreach ( (array) $categories as $category ) {

		$cat_names[] = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);

	}



	if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {

		$cat_names[] = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);

	}



	$cat_names = array_unique($cat_names);



	foreach ( $cat_names as $cat_name ) {

		if ( 'rdf' == $type )

			$the_list .= "\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";

		elseif ( 'atom' == $type )

			$the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', esc_attr( apply_filters( 'get_bloginfo_rss', get_bloginfo( 'url' ) ) ), esc_attr( $cat_name ) );

		else

			$the_list .= "\t\t<category><![CDATA[" . @html_entity_decode( $cat_name, ENT_COMPAT, get_option('blog_charset') ) . "]]></category>\n";

	}



	return apply_filters('the_category_rss', $the_list, $type);

}

1821