Title: [Plugin: Gallery] bug here?
Last modified: August 20, 2016

---

# [Plugin: Gallery] bug here?

 *  Resolved [Peidong Hu](https://wordpress.org/support/users/zhouyibhic/)
 * (@zhouyibhic)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-gallery-bug-here/)
 * if ( ! function_exists ( ‘gllr_save_postdata’ ) ) {
    function gllr_save_postdata(
   $post_id, $post ) { global $post, $wpdb;
 * =============================================
    Hi above code seems buggy because
   the function input param already has a $post variable here, but in the following
   statement, it declares another ‘global $post’ which will override the input param
   $post.
 * xmlrpc call will get error here since the global $post is uninitialized in the
   xmlrpc call context.
 * zhouyi
 * [http://wordpress.org/extend/plugins/gallery-plugin/](http://wordpress.org/extend/plugins/gallery-plugin/)

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

 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-gallery-bug-here/#post-2815585)
 * Hello,
 * Both of these variables have the same value.
    Could you please describe this 
   bug?
 * Regards,
    Oksana
 *  Thread Starter [Peidong Hu](https://wordpress.org/support/users/zhouyibhic/)
 * (@zhouyibhic)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-gallery-bug-here/#post-2815590)
 * the scenario of the bug is happened when I invoke xmlrpc call remotely to edit
   a custom type post (gallery type). global $post is empty when code executes here.
   it will replace the function parameter $post.
 * zhouyi.
 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-gallery-bug-here/#post-2815603)
 * Please remove word ‘$post’ from string below:
 *  global $post, $wpdb
 * And we will remove it from the plugin.
 * Best regards,
    Oksana

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

The topic ‘[Plugin: Gallery] bug here?’ is closed to new replies.

 * ![](https://ps.w.org/gallery-plugin/assets/icon-256x256.gif?rev=2580845)
 * [Gallery by BestWebSoft - Customizable Image and Photo Galleries for WordPress](https://wordpress.org/plugins/gallery-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gallery-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gallery-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/gallery-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gallery-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gallery-plugin/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-gallery-bug-here/#post-2815603)
 * Status: resolved