WordPress Code Reference
WordPress Code Reference is a website where developers can go to learn more about the different functions, classes, hooks, and more that make up the WordPress core code. Currently it initially starts with newest and latest updated information but is searchable so a developer could look up any specific method, hook, class or function. There is also an API reference.
WordPress the_date() Function
The main purpose of the_date() function is to output the date a post was published. It will only list the same date once, even if multiple posts are published on that date.
Format Parameters for the_date() Function
The parameters include:
- $format – the PHP format of the date. It will default to the date_format option.
- $before – what is the output or is displayed before the date. It will default to ' '.
- $after – what is the output or is displayed after the date. It will default to ' '.
- $display – a Boolean field that will either echo the date or return it. It defaults to True, and will echo the date.
Summary
In summary, the WordPress Code Reference offers developers a way to research and learn more about the code within the WordPress core code. I imagine this will be a very helpful resource as we dive deeper into the WordPress core code in this class to create our own theme within WordPress. Since I did not know what it meant to "echo" or "return" something in PHP, I did a little more research and learned that the "echo" keyword will result in the output of two or more strings. The "return" keyword will not show the results of a function and will instead assign the results to a variable to be used somewhere else in the code.