WordPress.org

Ready to get started?Download WordPress

Ideas

Display flag for API calls

  1. bweaver
    Member

    12345

    There should be an option on all API calls to simply return the text instead of outputting the text. Of course, optional and defaults to true to not break existing functionality. Don't make me query the db to get something simple like this.

    Posted: 7 years ago #
  2. Tobias Jordans
    Member

    12345

    But there are functions for this, arent there?
    wp_somthing() -> returns something
    the_something() -> echo wp_something()

    That at least the convention as far as I understood it by reading the (undocumented) code...

    I think you idea is good but should be solved with seperate function-calls instead of parameters! (better coding)

    Posted: 7 years ago #
  3. bweaver
    Member

    12345

    I don't think it's consistent across all items. Example, the_author() exists but either wp_author() doesn't (or is not documented and I missed it). If it is consistent then that's great, if not, make it so. Parameter or separate (but consistent) API calls.

    Posted: 7 years ago #
  4. John Blackbourn
    Member

    12345

    I partly agree with what you say, bweaver. What we need though is consistency, either in function names or with a boolean 'return' parameter on every function.

    Posted: 7 years ago #
  5. crazy4bass
    Member

    12345

    I never saw the point of two functions when the only difference was whether one output the result or returned the result. That just seems like so much to keep up with, when a simply 0 or 1 could make the determination.

    Posted: 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    88 Votes
  • Status

    Sorry, not right now