Understanding the Includes
When you activate a plugin, the name of the file containing the information header is stored in the WordPress database. Each time a page is requested, WordPress goes through a laundry list of PHP files it needs to load, so activating a plugin ensures that your own files are on that list. To help illustrate this concept, let's break WordPress again.
Exercise – parse errors
Try the following exercise:
- Ensure that the "Hello Dolly" plugin is active.
- Open the
/wp-content/plugins/hello.php
file in your text editor. - Immediately before the line that contains function hello_dolly_get_lyric, type in some gibberish text, such as "asdfasdf" and save the file.
- Reload the plugins page in your browser.
- This should generate a parse error, ...
Get WordPress 3 Plugin Development Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.