Title: [Plugin: WP Gallery Custom Links] error notices
Last modified: August 20, 2016

---

# [Plugin: WP Gallery Custom Links] error notices

 *  Resolved [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/)
 * please turn wp_debug true
 * Notice: Undefined variable: order in /var/www/vhosts/money.cz/httpdocs/wp-content/
   plugins/wp-gallery-custom-links/wp-gallery-custom-links.php on line 105
 * Notice: Undefined variable: orderby in /var/www/vhosts/money.cz/httpdocs/wp-content/
   plugins/wp-gallery-custom-links/wp-gallery-custom-links.php on line 105
 * [http://wordpress.org/extend/plugins/wp-gallery-custom-links/](http://wordpress.org/extend/plugins/wp-gallery-custom-links/)

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

 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/#post-2795634)
 * Removed two undefined order parameters and added an isset() around $attr[‘link’].
   The above should now be resolved in version 1.0.2. Thanks!
 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/#post-2795650)
 * great, you got five stars from me 😉
    there is also one more error notice in 
   some special cases
 * Notice: Trying to get property of non-object in /var/www/vhosts/money.cz/httpdocs/
   wp-content/plugins/wp-gallery-custom-links/wp-gallery-custom-links.php on line
   104
 * (sometimes $post is not populated, so you should do something like
    75: if (!
   $post) return;
 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/#post-2795668)
 * Thanks for the rating! 😀 Can you give me an example of when $post is not populated
   so I can test that scenario? I looked at WordPress’s default gallery shortcode
   function, and it also appears to assume $post is set, so I’ve been trying to 
   think of how/when that error might occur.
 *  Thread Starter [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/#post-2795671)
 * actually i do not know exactly where, but it definitely is 😉 e.g. when you use
   relevanssi search or probably when you are using [gallery] in widget etc.
 * i will test it for you if you will make this change (i have allready done – i
   hardcode it to your plugin)
 * I know it is wrong even in core wordpress, i have allready reported this bug 
   [http://core.trac.wordpress.org/ticket/20870](http://core.trac.wordpress.org/ticket/20870)
 * I got even quickfix for wordpress:
 *     ```
       add_filter( 'post_gallery', 'mc_post_gallery_fix', 1000, 2 );
       function mc_post_gallery_fix () {
       global $post;
       if (!$post) return ' ';
       }
       ```
   
 *  [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * (@fourlightsweb)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/#post-2795676)
 * I added:
 * `if ( ! $post ) return ' ';`
 * in 1.0.3, let me know if that works. 🙂

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

The topic ‘[Plugin: WP Gallery Custom Links] error notices’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-gallery-custom-links_d3d5d9.svg)
 * [WP Gallery Custom Links](https://wordpress.org/plugins/wp-gallery-custom-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-gallery-custom-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-gallery-custom-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-gallery-custom-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-gallery-custom-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-gallery-custom-links/reviews/)

## Tags

 * [error notices](https://wordpress.org/support/topic-tag/error-notices/)

 * 5 replies
 * 2 participants
 * Last reply from: [fourlightsweb](https://wordpress.org/support/users/fourlightsweb/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-gallery-custom-links-error-notices/#post-2795676)
 * Status: resolved