in the process of self learning from the official wordpress theme developement handbook
this page shows how to create headers and two different functions were used:
both return a string, which is the image URL.
is this just another confusing redundency ? or is there an actual difference between the two.
Semantic
dis·play
Make a prominent exhibition of (something) in a place where it can be easily seen.
re·trieve
get or bring (something) back; regain possession of.
How
While
header_image()
will echo out the header image URL,get_header_image()
will not.header_image()
is a wrapper forget_header_image()
. Mainly used on the front-end, the role is to escape and echo out get_header_image().A practical use case of
get_header_image()
would be inside a function.WordPress use that
get_ ...
distinction for most of it's default functions, eg:get_the_title()
andthe_title()
.get_the_post_thumbnail()
andthe_post_thumbnail()
.get_the_content()
andthe_content()
. ... etc.