Title: WP error undefined variable
Last modified: December 24, 2025

---

# WP error undefined variable

 *  Resolved [swissspaceboy](https://wordpress.org/support/users/swissspaceboy/)
 * (@swissspaceboy)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/wp-error-undefined-variable/)
 * Version: 2.4.7 (local).
 * php 8.3
 * I get this error message : [24-Dec-2025 11:16:44 UTC] PHP Warning: Undefined 
   variable $link in …broken-link-checker/legacy/includes/any-post.php on line 610
 * Analysis of Claude:
 * Found it! The `$link` variable is only set inside the `if/elseif` conditions.
   If none match, `$link` is undefined on line 610.
 * **Fix:** Initialize `$link` before the conditions:
 *     ```wp-block-code
       $post_type_object = get_post_type_object( $post->post_type );if ( ! $post_type_object ) {return '';}if ( 'wp_template' === $post->post_type || 'wp_template_part' === $post->post_type ) {
       ```
   
    -  This topic was modified 5 months, 2 weeks ago by [swissspaceboy](https://wordpress.org/support/users/swissspaceboy/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/wp-error-undefined-variable/#post-18767209)
 * Hi [@swissspaceboy](https://wordpress.org/support/users/swissspaceboy/),
 * I’m bringing this to our developers’ attention to check and verify what might
   be causing the warning and what further improvements could be implemented within
   the plugin side to improve it further.
 * Thanks for bringing to our attention.
 * Regards,
 * Nithin
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [5 months, 1 week ago](https://wordpress.org/support/topic/wp-error-undefined-variable/#post-18772028)
 * Hi [@swissspaceboy](https://wordpress.org/support/users/swissspaceboy/),
 * I would like to update that this will be improved in a future update, since it’ll
   be fixed, I’ll mark it as resolved for now.
 * For any new feature updates, you can get notifications on our progress by subscribing
   to our roadmap at [https://wpmudev.com/roadmap/](https://wpmudev.com/roadmap/)
 * Once new versions are released, any pertinent changes will be described in the
   changelog, which you can find at:
 * [https://wordpress.org/plugins/broken-link-checker/#developers](https://wordpress.org/plugins/broken-link-checker/#developers)
 * Kind Regards,
 * Nithin
 *  Thread Starter [swissspaceboy](https://wordpress.org/support/users/swissspaceboy/)
 * (@swissspaceboy)
 * [5 months ago](https://wordpress.org/support/topic/wp-error-undefined-variable/#post-18773683)
 * Thanks. Didier.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwp-error-undefined-variable%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/broken-link-checker/assets/icon-256x256.png?rev=2900468)
 * [Broken Link Checker](https://wordpress.org/plugins/broken-link-checker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/broken-link-checker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/broken-link-checker/)
 * [Active Topics](https://wordpress.org/support/plugin/broken-link-checker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/broken-link-checker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/broken-link-checker/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [swissspaceboy](https://wordpress.org/support/users/swissspaceboy/)
 * Last activity: [5 months ago](https://wordpress.org/support/topic/wp-error-undefined-variable/#post-18773683)
 * Status: resolved