INVP::settings()
Get this plugin’s option mingled with default values.
Return #Return
(array) An associative array containing this plugin’s settings
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; }
Expand full source codeCollapse full source codeView on Github
Related #Related
Uses #Uses
Uses | Description |
---|---|
: Inventory_Presser_Admin_Options::taxonomies_setting_default () |
Creates a default value for the |
Used By #Used By
Used By | Description |
---|---|
: Inventory_Presser_Admin_Options::sanitize_options () |
Santitizes the user input into the options inputs before they are saved. |
: Inventory_Presser_Admin_Options::options_page_content_taxonomies () |
Outputs the settings page HTML content for the taxonomies settings page. |
: Inventory_Presser_Admin_Options::options_page_content () |
Outputs the settings page HTML content for the primary options page. |
: Inventory_Presser_Admin_Options::callback_use_arranger_gallery () |
Outputs a checkbox and label to enable the photo arranger Gallery Block feature. |
includes/class-taxonomies.php: Inventory_Presser_Taxonomies::editor_remove_meta_boxes () |
Uses the type of the vehicle loaded into the editor to show or hide other taxonomies. |
includes/class-taxonomies.php: Inventory_Presser_Taxonomies::change_taxonomy_show_in_menu_attribute () |
Users can show and hide the taxonomies in the dashboard menu. |
inventory-presser.php: Inventory_Presser_Plugin::set_default_settings () |
Provides default values for the plugin settings stored in an option with name INVP::OPTION_NAME. |
inventory-presser.php: Inventory_Presser_Plugin::single_sections_add_form () |
Adds a contact form to single vehicle pages if a form is saved in the setting. |
includes/class-rest.php: Inventory_Presser_REST::response_settings () |
Creates the response data for the /settings/ route. |
includes/class-badges.php: Inventory_Presser_Badges::add_hooks () |
Adds hooks that power the feature. |
includes/template-tags.php: invp_get_the_inventory_sentence () |
Creates an HTML sentence like “Browse Car, SUV, Truck, or all 10 vehicles for sale.” containing links to those inventory flavors. Designed for empty search results pages. |
includes/template-tags.php: invp_get_the_price () |
Template tag. Returns the vehicle’s price. |
includes/template-tags.php: invp_get_the_carfax_url_svg () |
Returns a URL to an SVG image button that users click to view Carfax reports or empty string. Sometimes the URL points to an SVG hosted on carfax.com, sometimes it’s an SVG bundled with this plugin. |
includes/admin/class-admin-photo-arranger.php: Inventory_Presser_Admin_Photo_Arranger::is_enabled () |
Is the photo arranger via a Gallery Block feature enabled? |
includes/shortcode/class-shortcode-sort-by.php: Inventory_Presser_Shortcode_Sort_By::change_price_field_when_sorting () |
If a user wants to order vehicles by price, and the site is showing MSRP instead of price, sort by that. |
includes/shortcode/class-shortcode-sort-by.php: Inventory_Presser_Shortcode_Sort_By::content () |
Creates the HTML output that replaces the shortcode. |
includes/shortcode/class-shortcode-sort-by.php: Inventory_Presser_Shortcode_Sort_By::change_sorter_based_on_price_display () |
change_sorter_based_on_price_display |
includes/shortcode/class-shortcode-attribute-table.php: Inventory_Presser_Shortcode_Attribute_Table::content () |
Creates the string content that replaces the shortcode. |
inventory-presser.php: Inventory_Presser_Plugin::maybe_force_delete () |
Action hook callback. Prevents vehicles from lingering in the Trash after they’ve been deleted if a plugin setting dictates such behavior. |
includes/widget/class-widget-map.php: Inventory_Presser_Map_Widget::widget () |
Outputs the widget front-end HTML |
includes/widget/class-widget-map.php: Inventory_Presser_Map_Widget::form () |
Outputs the widget settings form that is shown in the dashboard. |
includes/class-invp.php: INVP::delete_attachment_orphans () |
Deletes media that is managed by this plugin but not attached to a post. |
includes/class-invp.php: INVP::delete_all_inventory_on_blog () |
Deletes all posts in the vehicle post type. |
includes/class-taxonomies.php: Inventory_Presser_Taxonomies::register_taxonomies () |
Registers all our custom taxonomies |
inventory-presser.php: Inventory_Presser_Plugin::include_scripts_and_styles () |
Registers JavaScripts and stylesheets for front-end users and dashboard users. Includes some inline styles and scripts depending on the plugin settings and page request. |
inventory-presser.php: Inventory_Presser_Plugin::add_orderby_to_query () |
Filter callback that adds an ORDER BY clause to the main query when a user requests a list of vehicles. |
includes/widget/class-widget-inventory-grid.php: Inventory_Presser_Grid::content () |
Creates HTML that renders the widget front-end. |
includes/class-taxonomies.php: Inventory_Presser_Taxonomies::maybe_exclude_sold_vehicles () |
Filter callback. Implements the “include sold vehicles” checkbox feature in vehicle archives and search results. |
includes/class-additional-listings-pages.php: Inventory_Presser_Additional_Listings_Pages::additional_listings_pages_array () |
Makes it easy to get the additional listings pages saved settings. |
includes/class-template-provider.php: Inventory_Presser_Template_Provider::maybe_provide_template () |
This method decides whether or not to add filters to the_content and has_post_thumbnail by examining the template file. If the theme does not have templates for vehicle singles and archives, the filters are added and shortcodes provide the templates instead. I stole this technique from WooCommerce, and it’s kind of beautiful. |