Title: [PATCH] Undefined variable: $r
Last modified: August 20, 2016

---

# [PATCH] Undefined variable: $r

 *  [flynsarmy](https://wordpress.org/support/users/flynsarmy/)
 * (@flynsarmy)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/patch-undefined-variable-r/)
 * In some posts I get the following warning with WP_DEBUG turned on:
 * > Notice: Undefined variable: r in /path/to/wp-content/plugins/better-related/
   > inc/frontend.php on line 169
 * Method get_the_related() should either define $r at the top and use $r .= everywhere
   else or change
    `return $r;` to `return isset($r) ? $r : '';` at the end of the
   function.
 * [http://wordpress.org/extend/plugins/better-related/](http://wordpress.org/extend/plugins/better-related/)

The topic ‘[PATCH] Undefined variable: $r’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/better-related.svg)
 * [Better Related Posts](https://wordpress.org/plugins/better-related/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-related/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-related/)
 * [Active Topics](https://wordpress.org/support/plugin/better-related/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-related/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-related/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [flynsarmy](https://wordpress.org/support/users/flynsarmy/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/patch-undefined-variable-r/)
 * Status: not resolved