Noptin_Abstract_Integration::add_checkbox_position_option( array $options, string $title = null, string $description = null, string $placeholder = null )
Adds a checkbox position select box.
Parameters Parameters
- $options
(array) (Required) An array of Noptin options.
- $title
(string) (Optional) The option title
Default value: null
- $description
(string) (Optional) The option description.
Default value: null
- $placeholder
(string) (Optional) The select box placeholder.
Default value: null
Return Return
(array) an updated array of Noptin options.
Source Source
File: includes/integrations/class-noptin-abstract-integration.php
public function add_checkbox_position_option( $options, $title = null, $description = null, $placeholder = null ) { // Abort early if no checkbox positions are registered. $checkbox_positions = $this->checkbox_positions(); if ( empty( $checkbox_positions ) ) { return $options; } if ( is_null( $title ) ) { $title = __( 'Checkbox position', 'newsletter-optin-box' ); } if ( is_null( $description ) ) { $description = __( 'Where should we add a newsletter subscription checkbox?', 'newsletter-optin-box' ); } if ( is_null( $placeholder ) ) { $placeholder = sprintf( __( 'Do not subscribe new %s', 'newsletter-optin-box' ), $this->context ); } $option_name = $this->get_checkbox_position_option_name(); $options[ $option_name ] = array( 'el' => 'select', 'section' => 'integrations', 'label' => $title, 'description' => $description, 'restrict' => sprintf( '%s && %s', $this->get_enable_integration_option_name(), $this->get_autosubscribe_integration_option_name() ), 'options' => $checkbox_positions, 'placeholder' => $placeholder, ); return $options; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.2.6 | Introduced. |