Index: wp-includes/class-wp-post.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/class-wp-post.php	(revision 703d5bdc8deb17781e9c6d8f0dd7e2c6b6353885)
+++ wp-includes/class-wp-post.php	(revision )
@@ -337,4 +337,276 @@
 
 		return $post;
 	}
+
+	/**
+	 * Retrieve post meta field for a post.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @param string $key Optional. The meta key to retrieve. By default, returns
+	 *                        data for all keys. Default empty.
+	 * @param bool $single Optional. Whether to return a single value. Default false.
+	 *
+	 * @return mixed Will be an array if $single is false. Will be value of meta data
+	 *               field if $single is true.
+	 */
+	public function get_meta( $key = '', $single = false ) {
+		return get_post_meta( $this->ID, $key, $single );
+	}
+
+	/**
+	 * Retrieve post thumbnail ID.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @return string|int Post thumbnail ID or empty string.
+	 */
+	public function get_post_thumbnail_id() {
+		return $this->get_meta( '_thumbnail_id', true );
+	}
+
+	/**
+	 * Check if post has an image attached.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @return bool Whether the post has an image attached.
+	 */
+	public function has_post_thumbnail(){
+		return (bool)$this->get_post_thumbnail_id();
+	}
+
+	/**
+	 * Retrieve the post thumbnail.
+	 *
+	 * When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size
+	 * is registered, which differs from the 'thumbnail' image size managed via the
+	 * Settings > Media screen.
+	 *
+	 * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image
+	 * size is used by default, though a different size can be specified instead as needed.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @param string|array $size Optional. Image size to use. Accepts any valid image size, or
+	 *                           an array of width and height values in pixels (in that order).
+	 *                           Default 'post-thumbnail'.
+	 * @param string|array $attr Optional. Query string or array of attributes. Default empty.
+	 * @return string The post thumbnail image tag.
+	 */
+	function get_the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
+
+		$post_thumbnail_id = $this->get_post_thumbnail_id();
+
+		/**
+		 * Filter the post thumbnail size.
+		 *
+		 * @since 2.9.0
+		 *
+		 * @param string|array $size The post thumbnail size. Image size or array of width and height
+		 *                           values (in that order). Default 'post-thumbnail'.
+		 */
+		$size = apply_filters( 'post_thumbnail_size', $size );
+
+		if ( $post_thumbnail_id ) {
+
+			/**
+			 * Fires before fetching the post thumbnail HTML.
+			 *
+			 * Provides "just in time" filtering of all filters in wp_get_attachment_image().
+			 *
+			 * @since 2.9.0
+			 *
+			 * @param int          $post_id           The post ID.
+			 * @param string       $post_thumbnail_id The post thumbnail ID.
+			 * @param string|array $size              The post thumbnail size. Image size or array of width
+			 *                                        and height values (in that order). Default 'post-thumbnail'.
+			 */
+			do_action( 'begin_fetch_post_thumbnail_html', $this->ID, $post_thumbnail_id, $size );
+			if ( in_the_loop() )
+				update_post_thumbnail_cache();
+			$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
+
+			/**
+			 * Fires after fetching the post thumbnail HTML.
+			 *
+			 * @since 2.9.0
+			 *
+			 * @param int          $post_id           The post ID.
+			 * @param string       $post_thumbnail_id The post thumbnail ID.
+			 * @param string|array $size              The post thumbnail size. Image size or array of width
+			 *                                        and height values (in that order). Default 'post-thumbnail'.
+			 */
+			do_action( 'end_fetch_post_thumbnail_html', $this->ID, $post_thumbnail_id, $size );
+
+		} else {
+			$html = '';
+		}
+		/**
+		 * Filter the post thumbnail HTML.
+		 *
+		 * @since 2.9.0
+		 *
+		 * @param string       $html              The post thumbnail HTML.
+		 * @param int          $post_id           The post ID.
+		 * @param string       $post_thumbnail_id The post thumbnail ID.
+		 * @param string|array $size              The post thumbnail size. Image size or array of width and height
+		 *                                        values (in that order). Default 'post-thumbnail'.
+		 * @param string       $attr              Query string of attributes.
+		 */
+		return apply_filters( 'post_thumbnail_html', $html, $this->ID, $post_thumbnail_id, $size, $attr );
+	}
+
+	/**
+	 * Return the post thumbnail URL.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @param string|array $size Optional. Registered image size to retrieve the source for or a flat
+	 *                           array of height and width dimensions. Default 'post-thumbnail'.
+	 * @return string|false Post thumbnail URL or false if no URL is available.
+	 */
+	function get_the_post_thumbnail_url($size = 'post-thumbnail' ) {
+		$post_thumbnail_id = $this->get_post_thumbnail_id( );
+		if ( ! $post_thumbnail_id ) {
+			return false;
+		}
+		return wp_get_attachment_image_url( $post_thumbnail_id, $size );
+	}
+
+	/**
+	 * Retrieve the Post Global Unique Identifier (guid).
+	 *
+	 * The guid will appear to be a link, but should not be used as an link to the
+	 * post. The reason you should not use it as a link, is because of moving the
+	 * blog across domains.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @return string
+	 */
+	function get_the_guid( ) {
+		/**
+		 * Filter the Global Unique Identifier (guid) of the post.
+		 *
+		 * @since 1.5.0
+		 *
+		 * @param string $guid Global Unique Identifier (guid) of the post.
+		 * @param int    $id   The post ID.
+		 */
+		return apply_filters( 'get_the_guid', $this->guid, $this->ID );
+	}
+
+	/**
+	 * Retrieve the post content.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @global int   $page
+	 * @global int   $more
+	 * @global bool  $preview
+	 * @global array $pages
+	 * @global int   $multipage
+	 *
+	 * @param string $more_link_text Optional. Content for when there is more text.
+	 * @param bool   $strip_teaser   Optional. Strip teaser content before the more text. Default is false.
+	 * @return string
+	 */
+	function get_the_content( $more_link_text = null, $strip_teaser = false ) {
+		global $page, $more, $preview, $pages, $multipage;
+
+		if ( null === $more_link_text )
+			$more_link_text = __( '(more&hellip;)' );
+
+		$output = '';
+		$has_teaser = false;
+
+		// If post password required and it doesn't match the cookie.
+		if ( post_password_required( $this ) )
+			return get_the_password_form( $this );
+
+		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] ) ) );
+
+			$has_teaser = true;
+		} else {
+			$content = array( $content );
+		}
+
+		if ( false !== strpos( $this->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
+			$strip_teaser = true;
+
+		$teaser = $content[0];
+
+		if ( $more && $strip_teaser && $has_teaser )
+			$teaser = '';
+
+		$output .= $teaser;
+
+		if ( count( $content ) > 1 ) {
+			if ( $more ) {
+				$output .= '<span id="more-' . $this->ID . '"></span>' . $content[1];
+			} else {
+				if ( ! empty( $more_link_text ) )
+
+					/**
+					 * Filter the Read More link text.
+					 *
+					 * @since 2.8.0
+					 *
+					 * @param string $more_link_element Read More link element.
+					 * @param string $more_link_text    Read More text.
+					 */
+					$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$this->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
+				$output = force_balance_tags( $output );
+			}
+		}
+
+		if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
+			$output =	preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output );
+
+		return $output;
+	}
+
+	/**
+	 * Retrieves the post excerpt.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @return string Post excerpt.
+	 */
+	function get_the_excerpt( ) {
+
+		if ( post_password_required( $this ) ) {
+			return __( 'There is no excerpt because this is a protected post.' );
+		}
+
+		/**
+		 * Filter the retrieved post excerpt.
+		 *
+		 * @since 1.2.0
+		 * @since 4.5.0 Introduced the `$post` parameter.
+		 *
+		 * @param string $post_excerpt The post excerpt.
+		 * @param WP_Post $post Post object.
+		 */
+		return apply_filters( 'get_the_excerpt', $this->post_excerpt, $this );
+	}
+
+	/**
+	 * Whether post has excerpt.
+	 *
+	 * @since 4.6.0
+	 *
+	 * @return bool
+	 */
+	function has_excerpt() {
+		return ( !empty( $this->post_excerpt ) );
+	}
 }
Index: wp-includes/post-thumbnail-template.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/post-thumbnail-template.php	(revision 703d5bdc8deb17781e9c6d8f0dd7e2c6b6353885)
+++ wp-includes/post-thumbnail-template.php	(revision )
@@ -19,9 +19,13 @@
  * @return bool Whether the post has an image attached.
  */
 function has_post_thumbnail( $post = null ) {
-	return (bool) get_post_thumbnail_id( $post );
+	if ( $post = get_post( $post ) ) {
+		return $post->has_post_thumbnail();
-}
+	}
 
+	return false;
+}
+
 /**
  * Retrieve post thumbnail ID.
  *
@@ -32,12 +36,12 @@
  * @return string|int Post thumbnail ID or empty string.
  */
 function get_post_thumbnail_id( $post = null ) {
-	$post = get_post( $post );
-	if ( ! $post ) {
+	if ( $post = get_post( $post ) ) {
+		return $post->get_post_thumbnail_id();
+	}
+
-		return '';
-	}
+	return '';
+}
-	return get_post_meta( $post->ID, '_thumbnail_id', true );
-}
 
 /**
  * Display the post thumbnail.
@@ -112,70 +116,12 @@
  * @return string The post thumbnail image tag.
  */
 function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' ) {
-	$post = get_post( $post );
-	if ( ! $post ) {
-		return '';
+	if ( $post = get_post( $post ) ) {
+		return $post->get_the_post_thumbnail( $size, $attr );
 	}
-	$post_thumbnail_id = get_post_thumbnail_id( $post );
 
-	/**
-	 * Filter the post thumbnail size.
-	 *
-	 * @since 2.9.0
-	 *
-	 * @param string|array $size The post thumbnail size. Image size or array of width and height
-	 *                           values (in that order). Default 'post-thumbnail'.
-	 */
-	$size = apply_filters( 'post_thumbnail_size', $size );
-
-	if ( $post_thumbnail_id ) {
-
-		/**
-		 * Fires before fetching the post thumbnail HTML.
-		 *
-		 * Provides "just in time" filtering of all filters in wp_get_attachment_image().
-		 *
-		 * @since 2.9.0
-		 *
-		 * @param int          $post_id           The post ID.
-		 * @param string       $post_thumbnail_id The post thumbnail ID.
-		 * @param string|array $size              The post thumbnail size. Image size or array of width
-		 *                                        and height values (in that order). Default 'post-thumbnail'.
-		 */
-		do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
-		if ( in_the_loop() )
-			update_post_thumbnail_cache();
-		$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
-
-		/**
-		 * Fires after fetching the post thumbnail HTML.
-		 *
-		 * @since 2.9.0
-		 *
-		 * @param int          $post_id           The post ID.
-		 * @param string       $post_thumbnail_id The post thumbnail ID.
-		 * @param string|array $size              The post thumbnail size. Image size or array of width
-		 *                                        and height values (in that order). Default 'post-thumbnail'.
-		 */
-		do_action( 'end_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
-
-	} else {
-		$html = '';
+	return '';
-	}
+}
-	/**
-	 * Filter the post thumbnail HTML.
-	 *
-	 * @since 2.9.0
-	 *
-	 * @param string       $html              The post thumbnail HTML.
-	 * @param int          $post_id           The post ID.
-	 * @param string       $post_thumbnail_id The post thumbnail ID.
-	 * @param string|array $size              The post thumbnail size. Image size or array of width and height
-	 *                                        values (in that order). Default 'post-thumbnail'.
-	 * @param string       $attr              Query string of attributes.
-	 */
-	return apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );
-}
 
 /**
  * Return the post thumbnail URL.
@@ -188,11 +134,11 @@
  * @return string|false Post thumbnail URL or false if no URL is available.
  */
 function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) {
-	$post_thumbnail_id = get_post_thumbnail_id( $post );
-	if ( ! $post_thumbnail_id ) {
-		return false;
+	if ( $post = get_post( $post ) ) {
+		return $post->get_the_post_thumbnail_url( $size );
 	}
-	return wp_get_attachment_image_url( $post_thumbnail_id, $size );
+
+	return false;
 }
 
 /**
Index: wp-includes/post-template.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/post-template.php	(revision 703d5bdc8deb17781e9c6d8f0dd7e2c6b6353885)
+++ wp-includes/post-template.php	(revision )
@@ -203,20 +203,11 @@
  * @return string
  */
 function get_the_guid( $post = 0 ) {
-	$post = get_post( $post );
+	if ( $post = get_post( $post ) ) {
+		return $post->get_the_guid();
+	}
 
-	$guid = isset( $post->guid ) ? $post->guid : '';
-	$id   = isset( $post->ID ) ? $post->ID : 0;
-
-	/**
-	 * Filter the Global Unique Identifier (guid) of the post.
-	 *
-	 * @since 1.5.0
-	 *
-	 * @param string $guid Global Unique Identifier (guid) of the post.
-	 * @param int    $id   The post ID.
-	 */
-	return apply_filters( 'get_the_guid', $guid, $id );
+	return '';
 }
 
 /**
@@ -258,70 +249,10 @@
  * @return string
  */
 function get_the_content( $more_link_text = null, $strip_teaser = false ) {
-	global $page, $more, $preview, $pages, $multipage;
-
-	$post = get_post();
-
-	if ( null === $more_link_text )
-		$more_link_text = __( '(more&hellip;)' );
-
-	$output = '';
-	$has_teaser = false;
-
-	// If post password required and it doesn't match the cookie.
-	if ( post_password_required( $post ) )
-		return get_the_password_form( $post );
-
-	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] ) ) );
-
-		$has_teaser = true;
-	} else {
-		$content = array( $content );
+	return  get_post()->get_the_content( $more_link_text, $strip_teaser );
-	}
+}
 
-	if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
-		$strip_teaser = true;
-
-	$teaser = $content[0];
-
-	if ( $more && $strip_teaser && $has_teaser )
-		$teaser = '';
-
-	$output .= $teaser;
-
-	if ( count( $content ) > 1 ) {
-		if ( $more ) {
-			$output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
-		} else {
-			if ( ! empty( $more_link_text ) )
-
-				/**
+/**
-				 * Filter the Read More link text.
-				 *
-				 * @since 2.8.0
-				 *
-				 * @param string $more_link_element Read More link element.
-				 * @param string $more_link_text    Read More 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 );
-		}
-	}
-
-	if ( $preview ) // Preview fix for JavaScript bug with foreign languages.
-		$output =	preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output );
-
-	return $output;
-}
-
-/**
  * Preview fix for JavaScript bug with foreign languages.
  *
  * @since 3.1.0
@@ -367,28 +298,14 @@
 		_deprecated_argument( __FUNCTION__, '2.3' );
 	}
 
-	$post = get_post( $post );
-	if ( empty( $post ) ) {
-		return '';
+	if ( $post = get_post( $post ) ) {
+		return $post->get_the_excerpt();
 	}
 
-	if ( post_password_required( $post ) ) {
-		return __( 'There is no excerpt because this is a protected post.' );
+	return '';
-	}
+}
 
-	/**
+/**
-	 * Filter the retrieved post excerpt.
-	 *
-	 * @since 1.2.0
-	 * @since 4.5.0 Introduced the `$post` parameter.
-	 *
-	 * @param string $post_excerpt The post excerpt.
-	 * @param WP_Post $post Post object.
-	 */
-	return apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );
-}
-
-/**
  * Whether post has excerpt.
  *
  * @since 2.3.0
@@ -397,8 +314,11 @@
  * @return bool
  */
 function has_excerpt( $id = 0 ) {
-	$post = get_post( $id );
-	return ( !empty( $post->post_excerpt ) );
+	if ( $post = get_post( $id ) ) {
+		return $post->has_excerpt();
+	}
+
+	return '';
 }
 
 /**
