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.