1

I'm just starting to have a dig around in the Wordpress codex because I'm undertaking my first simple plugin.

Can I ask, is the $content variable a reserved variable for the_content() function. The actual $content variable is all over Wordpress, but I can't seem to find any information on it? When you search in the codex it just brings up info on the_content()

Any help / pointers on what it does and its usage would be awesome.

Emily.

2

$content - is not reserved in WordPress, it can be used.

In the function the_content () - a variable is used, but it is only available in this function. The code of the function itself:

https://core.trac.wordpress.org/browser/tags/4.7/src/wp-includes/post-template.php#L230

Scope of variables in php:

http://php.net/manual/en/language.variables.scope.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.