Ready to get started?Download WordPress


Safe Function Call
[resolved] Does it use 'echo' or '_e'? (2 posts)

  1. Clifford Paulick
    Posted 2 years ago #

    Does it use 'echo' or '_e'?
    P.S. How much more overhead does this add compared to doing the condition checks myself, say 25 times (i.e. 25 different conditionals, possibly more actual functions)?

    Thank you.


  2. Scott Reilly
    WordPress & Plugin Dev
    Plugin Author

    Posted 2 years ago #

    It uses echo. _e() is only really useful if it is utilized in conjunction with a textdomain, which can't be parameterized.

    It technically adds a slight bit more overhead. It essentially does the condition checks you'd do, but in order to accommodate passing along arbitrary arguments (making it flexible), it also uses func_get_args(). The extra overhead is quite minuscule and shouldn't be noticeable. Even if being done 25+ times in a page.

    With the plugin, you save in time writing the code, you write/see less code, and have some flexibility afforded by some of the various methods provided by the plugin. But everyone's perception of that value will vary.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic