Make WordPress Core

Ticket #45505: 45505.patch

File 45505.patch, 5.9 KB (added by vishalpadhariya, 7 months ago)
  • src/wp-includes/feed.php

    diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php
    index 8a6d256068..468360365c 100644
    a b function html_type_rss() { 
    465465 * the user has the password for the post. If not then it will return before
    466466 * displaying.
    467467 *
    468  * Also uses the function get_post_custom() to get the post's 'enclosure'
     468 * Also uses the function get_post_meta(get_the_ID()) to get the post's 'enclosure'
    469469 * metadata field and parses the value to display the enclosure(s). The
    470470 * enclosure(s) consist of enclosure HTML tag(s) with a URI and other
    471471 * attributes.
    function rss_enclosure() { 
    477477                return;
    478478        }
    479479
    480         foreach ( (array) get_post_custom() as $key => $val ) {
     480        foreach ( (array) get_post_meta(get_the_ID()) as $key => $val ) {
    481481                if ( 'enclosure' === $key ) {
    482482                        foreach ( (array) $val as $enc ) {
    483483                                $enclosure = explode( "\n", $enc );
    function rss_enclosure() { 
    510510 * the user has the password for the post. If not then it will return before
    511511 * displaying.
    512512 *
    513  * Also uses the function get_post_custom() to get the post's 'enclosure'
     513 * Also uses the function get_post_meta(get_the_ID()) to get the post's 'enclosure'
    514514 * metadata field and parses the value to display the enclosure(s). The
    515515 * enclosure(s) consist of link HTML tag(s) with a URI and other attributes.
    516516 *
    function atom_enclosure() { 
    521521                return;
    522522        }
    523523
    524         foreach ( (array) get_post_custom() as $key => $val ) {
     524        foreach ( (array) get_post_meta(get_the_ID()) as $key => $val ) {
    525525                if ( 'enclosure' === $key ) {
    526526                        foreach ( (array) $val as $enc ) {
    527527                                $enclosure = explode( "\n", $enc );
  • src/wp-includes/post-template.php

    diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php
    index 4f3bfbef0c..bba230247a 100644
    a b function _wp_link_page( $i ) { 
    10971097 *                            False if the key does not exist.
    10981098 */
    10991099function post_custom( $key = '' ) {
    1100         $custom = get_post_custom();
     1100        $custom = get_post_meta(get_the_ID());
    11011101
    11021102        if ( ! isset( $custom[ $key ] ) ) {
    11031103                return false;
  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    index eb90e762f5..704465ef6e 100644
    a b function get_post_custom_values( $key = '', $post_id = 0 ) { 
    27562756                return null;
    27572757        }
    27582758
    2759         $custom = get_post_custom( $post_id );
     2759        $custom = get_post_meta( absint($post_id ));
    27602760
    27612761        return isset( $custom[ $key ] ) ? $custom[ $key ] : null;
    27622762}
    function add_ping( $post, $uri ) { 
    58405840 * @return string[] Array of enclosures for the given post.
    58415841 */
    58425842function get_enclosed( $post_id ) {
    5843         $custom_fields = get_post_custom( $post_id );
     5843        $custom_fields = get_post_meta( absint($post_id) );
    58445844        $pung          = array();
    58455845        if ( ! is_array( $custom_fields ) ) {
    58465846                return $pung;