• Why does get_permalink($postid) immediately load the post from the database even though fancy URLs aren’t in use and the only parameter required for a standard permalink is the ID? Same with pages and categories.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m not sure, but how else would WP know if a post with that ID existed without querying the database?

    You’d probably be better served asking this and your other database access questions on the WP-Hackers mailing list or IRC since more (all?) core-devs are there.

    Thread Starter mikoder

    (@mikoder)

    I’m not sure, but how else would WP know if a post with that ID existed without querying the database?

    Because I passed it an ID?

    So this isn’t support as the forum title suggests?

    Because I passed it an ID?

    — so if you know that the post id will return a post then why not just hard code the link (<?php bloginfo('url'); ?>/?p=$ID) instead of calling get_permalink()?

    So this isn't support as the forum title suggests?

    — It is, but after reading your other questions it seemed like you were investigating the design decisions behind how WP queries the database (‘More superfluous database access’)…and for that I’d recommend the WP-hackers list since your more apt to hear back from the core developers who made those design decisions

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Preventing get_permalink from loading the post’ is closed to new replies.