The wp-admin interfaces for Store Locator Plus settings are primarily built using PHP code.

Updating the interface to migrate to JavaScript with more modern interface elements such as React is going to require an intelligent solution due to the complex nature of the PHP-based settings UI infrastructure.

These articles included here span multiple date ranges for the SLP Settings wp-admin user interface. They may not all be current.

Settings UI React Header

This article describes some of the initial work to start moving toward a React interface. It mostly focuses on using the React top-of-page title bar and submenu interface. Much of the rest of the interface is still PHP based.

Smart Options

The Smart Options is designed as an object/array-based system that describes an SLP Setting in a way that allows the store-locator-plus application to handle the various elements of managing settings:

  • How and where to store the data (wp_options table in various option_name keys, prior to December 2026. After 2026 Unified Settings are in place and all options are stored in a serialized option_name slp_settings_0001.)
  • Organizes the layout for the Settings User Interface via a set of properties associated with a setting.

The SLP_Settings Classes

The SmartOptions related to the \SLP_SmartOptions class use the attributes of the SmartOption setting to interface with the SLP_Settings classes.

Most SLP Settings are managed with SmartOptions that follow a pattern similar to the structure in \SLP_SmartOptions::experience_map_appearance. This appears in plugins such as slp-experience, slp-power, and slp-premier.

Legacy SLP Settings UI Interface

The SLP_SmartOptions interface replaced most, but not all, of the legacy interfaces to setup SLP Settings.

The legacy settings that have not been updated yet, utilize a methodology similar to \SLP_Experience_Admin_Settings::modify_map_functionality

	/**
	 * Map / Functionality
	 */
	private function modify_map_functionality() {
		$this->group_params['group_slug'] = 'functionality';

		$this->Settings->add_ItemToGroup( array(
			'group_params' => $this->group_params,
			'type'         => 'checkbox',
			'label'        => __( 'Use Scrollwheel To Zoom', 'slp-experience' ),
			'description'  => __( 'When checked, using the scrollwheel will zoom the map.', 'slp-experience' ),
			'option'       => 'map_options_scrollwheel',
		) );
	}

Rendering A Setting

Regardless of whether the legacy SLP Settings UI interface or the Smart Options interface was used, the output is rendered by the \SLP_Settings class or one of its child classes that extend it.

Leave a Reply