layers_map_widget_design_bar_components

The Layers layers map widget design bar components hook.

Description

apply_filters( 'layers_map_widget_design_bar_components', (callback) $instance_show_google_map ); 

Parameters (1)

0. $instance_show_google_map — Optional. (callback) => array( 'layout', 'display' => array( 'icon-css' => 'icon-display', 'label' => __( 'Display', 'layerswp' ), 'elements' => array( 'show_google_map' => array( 'type' => 'checkbox', 'name' => $this->get_layers_field_name( 'show_google_map' ) , 'id' => $this->get_layers_field_id( 'show_google_map' ) , 'value' => ( isset( $instance['show_google_map'] ) ) ? $instance['show_google_map'] : NULL, 'label' => __( 'Show Google Map' , 'layerswp' ), ), 'map_height' => array( 'type' => 'number', 'name' => $this->get_layers_field_name( 'map_height' ) , 'id' => $this->get_layers_field_id( 'map_height' ) , 'min' => 150, 'max' => 1600, 'value' => ( isset( $instance['map_height'] ) ) ? $instance['map_height'] : NULL, 'label' => __( 'Map Height' , 'layerswp' ), 'data' => array( 'show-if-selector' => '#' . $this->get_layers_field_id( 'show_google_map' ), 'show-if-value' => 'true', ), ), 'google_maps_zoom' => array( 'type' => 'select', 'name' => $this->get_layers_field_name( 'google_maps_zoom' ) , 'id' => $this->get_layers_field_id( 'google_maps_zoom' ) , 'value' => ( isset( $instance['google_maps_zoom'] ) ) ? $instance['google_maps_zoom'] : NULL, 'label' => __( 'Google Map Zoom Level' , 'layerswp' ), 'options' => array( '16' => __( 'Close', 'layerswp' ), '14' => __( 'Default', 'layerswp' ), '12' => __( 'Far', 'layerswp' ), ), 'data' => array( 'show-if-selector' => '#' . $this->get_layers_field_id( 'show_google_map' ), 'show-if-value' => 'true', ), ), 'show_address' => array( 'type' => 'checkbox', 'name' => $this->get_layers_field_name( 'show_address' ) , 'id' => $this->get_layers_field_id( 'show_address' ) , 'value' => ( isset( $instance['show_address'] ) ) ? $instance['show_address'] : NULL, 'label' => __( 'Show Address' , 'layerswp' ), ), 'show_contact_form' => array( 'type' => 'checkbox', 'name' => $this->get_layers_field_name( 'show_contact_form' ) , 'id' => $this->get_layers_field_id( 'show_contact_form' ) , 'value' => ( isset( $instance['show_contact_form'] ) ) ? $instance['show_contact_form'] : NULL, 'label' => __( 'Show Contact Form' , 'layerswp' ), ), ), ), 'background', 'advanced' )
The array.

Usage

To run the hook, copy the example below.
  1. $instance_show_google_map = apply_filters( 'layers_map_widget_design_bar_components', $instance_show_google_map ); 
  2.  
  3. if ( !empty( $instance_show_google_map ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the layers_map_widget_design_bar_components callback 
  2. function filter_layers_map_widget_design_bar_components( $instance_show_google_map ) { 
  3. // make filter magic happen here... 
  4. return $instance_show_google_map
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'layers_map_widget_design_bar_components', 'filter_layers_map_widget_design_bar_components', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'layers_map_widget_design_bar_components', 'filter_layers_map_widget_design_bar_components', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/core/widgets/modules/contact.php  
  1. apply_filters( 'layers_map_widget_design_bar_components' , array( // Components