• in version 1.5.1.3 in library wp-include/functions-post.php line 349 there is call of function get_post(). That function is not defined anywhere. In previous version on that place it was call of get_postdata().

Viewing 3 replies - 1 through 3 (of 3 total)
  • It’s defined in wp-includes/functions.php

    Thread Starter prokurator

    (@prokurator)

    It is not defined there. You can find function get_posts() and get_postdata(). But there is no get_post()

    $ cd wordpress/wp-includes
    $ grep "function &get_post" *
    classes.php: function &get_posts() {
    functions.php:function &get_post(&$post, $output = OBJECT) {

    https://trac.www.ads-software.com/file/tags/1.5.1.3/wp-includes/functions.php

    // Retrieves post data given a post ID or post object.
    // Handles post caching.
    function &get_post(&$post, $output = OBJECT) {
    global $post_cache, $wpdb;

    if ( empty($post) ) {
    if ( isset($GLOBALS['post']) )
    $post = & $GLOBALS['post'];
    else
    $post = null;
    } elseif (is_object($post) ) {
    if (! isset($post_cache[$post->ID]))
    $post_cache[$post->ID] = &$post;
    $post = & $post_cache[$post->ID];
    } else {
    if (isset($post_cache[$post]))
    $post = & $post_cache[$post];
    else {
    $query = "SELECT * FROM $wpdb->posts WHERE ID=$post";
    $post_cache[$post] = & $wpdb->get_row($query);
    $post = & $post_cache[$post];
    }
    }

    if ( $output == OBJECT ) {
    return $post;
    } elseif ( $output == ARRAY_A ) {
    return get_object_vars($post);
    } elseif ( $output == ARRAY_N ) {
    return array_values(get_object_vars($post));
    } else {
    return $post;
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘undefined function call on wp-include/functions-post.php’ is closed to new replies.