INVP::settings()

Get this plugin’s option mingled with default values.


Return Return

(array) An associative array containing this plugin’s settings


Top ↑

Source Source

File: includes/class-invp.php

	public static function settings() {
		$defaults = array(
			'include_sold_vehicles'       => false,
			'provide_templates'           => true,
			'skip_trash'                  => true,
			'sort_vehicles_by'            => 'make',
			'sort_vehicles_order'         => 'ASC',
			'use_arranger_gallery'        => true,
			'use_carfax'                  => false,
			'use_carfax_provided_buttons' => true,
		);
		$settings = wp_parse_args( get_option( self::OPTION_NAME ), $defaults );

		/**
		 * If the taxonomies settings has never been used, grab defaults so we
		 * don't break functionality.
		 */
		if ( ! isset( $settings['taxonomies'] ) ) {
			if ( ! class_exists( 'Inventory_Presser_Admin_Options' ) ) {
				include_once plugin_dir_path( INVP_PLUGIN_FILE_PATH ) . 'includes/admin/class-admin-options.php';
			}
			$settings['taxonomies'] = Inventory_Presser_Admin_Options::taxonomies_setting_default( $settings );
		}
		return $settings;
	}