WordPress.org

Ready to get started?Download WordPress

Forums

Redundant code in post.php (1 post)

  1. webpit.com
    Member
    Posted 6 years ago #

    I just wanted to point out a redundant call to fetching a post from the db. In post.php line 51:

    $post = get_post($post_ID);

    Then later we do this:

    $post = get_post_to_edit($post_ID);

    The get_post_to_edit function also calls get_post, so it's doing the same thing twice. While not a huge issue (i mean how many users could be editing a post at once?), it would be better coding to not perform redundant trips to the db.

    Mark

Topic Closed

This topic has been closed to new replies.

About this Topic