Title: E_WARNING: Undefined variable $content
Last modified: April 26, 2022

---

# E_WARNING: Undefined variable $content

 *  [EliW](https://wordpress.org/support/users/eliw/)
 * (@eliw)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/e_warning-undefined-variable-content/)
 * In file: plugins/job-postings/include/class-pdf-export.php
    Line 406
 * We have a case of:
    `$content .= ....`
 * However it’s possible for $content to not be defined at this point, causing an
   error to the thrown into the error logs. As a simple fix just adding the following
   line above it works:
    `$content = $content ?? '';`
 * But there may be a better solution, that was just a quick one I did to stop having
   my error log be filled.

The topic ‘E_WARNING: Undefined variable $content’ is closed to new replies.

 * ![](https://ps.w.org/job-postings/assets/icon-256x256.jpg?rev=1702382)
 * [Job Postings](https://wordpress.org/plugins/job-postings/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/job-postings/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/job-postings/)
 * [Active Topics](https://wordpress.org/support/plugin/job-postings/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/job-postings/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/job-postings/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [EliW](https://wordpress.org/support/users/eliw/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/e_warning-undefined-variable-content/)
 * Status: not resolved