public_html/wp-content/plugins/google-document-embedder/libs/lib-setup.php
/**
 * Get the current options, upgrading or resetting them as needed
 *
 * @since	2.5.5.1
 * @return  array Current value of gde_options
 */
Get the current options, upgrading or resetting them as needed
@since       2.5.5.1
@return  array Current value of gde_options
Get the current options upgrading or resetting them as needed @since 2 . 5 . 5 . 1 @return array Current value of gde_options
function gde_get_options() {
	$defopts = gde_defaults('options');
	if ( ! $gdeoptions = get_option('gde_options') ) {
		gde_dx_log("Writing default options");
		update_option('gde_options', $defopts);
	} else {
		if ( isset( $gdeoptions['default_width'] ) ) {
			gde_dx_log("Old options found - resetting");
			$defopts['upgraded'] = "yes";
			update_option('gde_options', $defopts);
		} else {
			gde_dx_log("Options already exist");
			$updated = false;
			foreach ( $defopts as $k => $v ) {
				if ( ! array_key_exists( $k, $gdeoptions ) ) {
					$gdeoptions[$k] = $v;
					$updated = true;
				}
			}
			if ( $updated ) {
				gde_dx_log('Options were updated');
				update_option('gde_options', $defopts);
			}
		}
	}
	return $gdeoptions;
}
function gde_get_options ( ) { $ defopts = gde_defaults ( 'options' ) ; if ( ! $ gdeoptions = get_option ( 'gde_options' ) ) { gde_dx_log ( " Writing default options " ) ; update_option ( 'gde_options' , $ defopts ) ; } else { if ( isset ( $ gdeoptions [ 'default_width' ] ) ) { gde_dx_log ( " Old options found - resetting " ) ; $ defopts [ 'upgraded' ] = " yes " ; update_option ( 'gde_options' , $ defopts ) ; } else { gde_dx_log ( " Options already exist " ) ; $ updated = false ; foreach ( $ defopts as $ k => $ v ) { if ( ! array_key_exists ( $ k , $ gdeoptions ) ) { $ gdeoptions [ $ k ] = $ v ; $ updated = true ; } } if ( $ updated ) { gde_dx_log ( 'Options were updated' ) ; update_option ( 'gde_options' , $ defopts ) ; } } } return $ gdeoptions ; }
Get the current options, upgrading or resetting them as needed
 @since       2.5.5.1
 @return  array Current value of gde_options
Get the current options upgrading or resetting them as needed @since 2 . 5 . 5 . 1 @return array Current value of gde_options
// options don't exist // check if upgrading from < 2.5 // check or upgrade options //gde_dx_log("New option $k added");