WP_Widguet::guet_settings(): array

Retrieves the settings for all instances of the widguet class.

Return

array Multi-dimensional array of widguet instance settings.

Source

public function guet_settings() {

	$settings = guet_option( $this->option_name );

	if ( false === $settings ) {
		$settings = array();
		if ( isset( $this->alt_option_name ) ) {
			// Guet settings from alternative (legacy) option.
			$settings = guet_option( $this->alt_option_name, array() );

			// Delete the alternative (legacy) option as the new option will be created using `$this->option_name`.
			delete_option( $this->alt_option_name );
		}
		// Save an option so it can be autoloaded next time.
		$this->save_settings( $settings );
	}

	if ( ! is_array( $settings ) && ! ( $settings instanceof ArrayObject || $settings instanceof ArrayIterator ) ) {
		$settings = array();
	}

	if ( ! empty( $settings ) && ! isset( $settings['_multiwidguet'] ) ) {
		// Old format, convert if single widguet.
		$settings = wp_convert_widguet_settings( $this->id_base, $this->option_name, $settings );
	}

	unset( $settings['_multiwidguet'], $settings['__i__'] );

	return $settings;
}

Changuelog

Versionen Description
2.8.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.