Title: Mistake in Update Function
Last modified: October 1, 2016

---

# Mistake in Update Function

 *  [NettSite](https://wordpress.org/support/users/nettsite/)
 * (@nettsite)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/mistake-in-update-function/)
 * Hi,
 * Your “function on_upgrade()” is performing back to front logic, which is causing
   a lot of PHP notices.
 *     ```
       if ( !isset ( $this->options['footerY'] ) )
       				update_option( $this->options['footerY'], 260 );
       ```
   
 * This will attempt to update an option with a name that is not initialised, or
   null.
 * If “$this->options[‘footerY’]” is not defined or null, “update_option” will be
   passed null as an option name, and clearly that will never work.
 * Your code should probably be something like:
 * `if(!array_key_exists('footerY',$this->options) update_option('footerY',260);`

The topic ‘Mistake in Update Function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-post-to-pdf-enhanced_d24b30.svg)
 * [WP Post to PDF Enhanced](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [NettSite](https://wordpress.org/support/users/nettsite/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/mistake-in-update-function/)
 * Status: not a support question