: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'<div class="popup-type" data-popup-type="center-popup"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/center-popup.png" alt="' . __( 'Center Popup', 'popup-maker' ) . '"/><button class="button">' . __( 'Center Popup', 'popup-maker' ) . '</button></div>',
'<div class="popup-type" data-popup-type="right-bottom-slidein"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/right-bottom-slidein.png" alt="' . __( 'Right Bottom Slide-in', 'popup-maker' ) . '"/><button class="button">' . __( 'Right Bottom Slide-in', 'popup-maker' ) . '</button></div>',
'<div class="popup-type" data-popup-type="top-bar"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/top-bar.png" alt="' . __( 'Top Bar', 'popup-maker' ) . '"/><button class="button">' . __( 'Top Bar', 'popup-maker' ) . '</button></div>',
'<div class="popup-type" data-popup-type="left-bottom-notice"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/left-bottom-notice.png" alt="' . __( 'Left Bottom Notice', 'popup-maker' ) . '"/><button class="button">' . __( 'Left Bottom Notice', 'popup-maker' ) . '</button></div>',
'label' => __( 'Popup Theme', 'popup-maker' ),
'dynamic_desc' => sprintf( '%1$s<br/><a id="edit_theme_link" href="%3$s">%2$s</a>', __( 'Choose a theme for this popup.', 'popup-maker' ), __( 'Customize This Theme', 'popup-maker' ), admin_url( 'post.php?action=edit&post={{data.value}}' ) ),
'options' => pum_is_popup_editor() ? PUM_Helpers::popup_theme_selectlist() : null,
'std' => pum_get_default_theme_id(),
'label' => __( 'Size', 'popup-maker' ),
'desc' => __( 'Select the size of the popup.', 'popup-maker' ),
__( 'Responsive Sizes', 'popup-maker' ) => [
'nano' => __( 'Nano - 10%', 'popup-maker' ),
'micro' => __( 'Micro - 20%', 'popup-maker' ),
'tiny' => __( 'Tiny - 30%', 'popup-maker' ),
'small' => __( 'Small - 40%', 'popup-maker' ),
'medium' => __( 'Medium - 60%', 'popup-maker' ),
'normal' => __( 'Normal - 70%', 'popup-maker' ),
'large' => __( 'Large - 80%', 'popup-maker' ),
'xlarge' => __( 'X Large - 95%', 'popup-maker' ),
__( 'Other Sizes', 'popup-maker' ) => [
'auto' => __( 'Auto', 'popup-maker' ),
'custom' => __( 'Custom', 'popup-maker' ),
'responsive_min_width' => [
'label' => __( 'Min Width', 'popup-maker' ),
'desc' => __( 'Set a minimum width for the popup.', 'popup-maker' ),
'size' => [ 'nano', 'micro', 'tiny', 'small', 'medium', 'normal', 'large', 'xlarge' ],
'responsive_max_width' => [
'label' => __( 'Max Width', 'popup-maker' ),
'desc' => __( 'Set a maximum width for the popup.', 'popup-maker' ),
'size' => [ 'nano', 'micro', 'tiny', 'small', 'medium', 'normal', 'large', 'xlarge' ],
'label' => __( 'Width', 'popup-maker' ),
'desc' => __( 'Set a custom width for the popup.', 'popup-maker' ),
'custom_height_auto' => [
'label' => __( 'Auto Adjusted Height', 'popup-maker' ),
'desc' => __( 'Checking this option will set height to fit the content.', 'popup-maker' ),
'label' => __( 'Height', 'popup-maker' ),
'desc' => __( 'Set a custom height for the popup.', 'popup-maker' ),
'custom_height_auto' => false,
'scrollable_content' => [
'label' => __( 'Scrollable Content', 'popup-maker' ),
'desc' => __( 'Checking this option will add a scroll bar to your content.', 'popup-maker' ),
'custom_height_auto' => false,
'label' => __( 'Animation Type', 'popup-maker' ),
'desc' => __( 'Select an animation type for your popup.', 'popup-maker' ),
'none' => __( 'None', 'popup-maker' ),
'slide' => __( 'Slide', 'popup-maker' ),
'fade' => __( 'Fade', 'popup-maker' ),
'fadeAndSlide' => __( 'Fade and Slide', 'popup-maker' ),
// 'grow' => __( 'Grow', 'popup-maker' ),
// 'growAndSlide' => __( 'Grow and Slide', 'popup-maker' ),
'label' => __( 'Animation Speed', 'popup-maker' ),
'desc' => __( 'Set the animation speed for the popup.', 'popup-maker' ),
'unit' => __( 'ms', 'popup-maker' ),
'animation_type' => [ 'slide', 'fade', 'fadeAndSlide', 'grow', 'growAndSlide' ],
'label' => __( 'Animation Origin', 'popup-maker' ),
'desc' => __( 'Choose where the animation will begin.', 'popup-maker' ),
'top' => __( 'Top', 'popup-maker' ),
'left' => __( 'Left', 'popup-maker' ),
'bottom' => __( 'Bottom', 'popup-maker' ),
'right' => __( 'Right', 'popup-maker' ),
'left top' => __( 'Top Left', 'popup-maker' ),
'center top' => __( 'Top Center', 'popup-maker' ),
'right top' => __( 'Top Right', 'popup-maker' ),
'left center' => __( 'Middle Left', 'popup-maker' ),
'center center' => __( 'Middle Center', 'popup-maker' ),
'right center' => __( 'Middle Right', 'popup-maker' ),
'left bottom' => __( 'Bottom Left', 'popup-maker' ),
'center bottom' => __( 'Bottom Center', 'popup-maker' ),
'right bottom' => __( 'Bottom Right', 'popup-maker' ),
'animation_type' => [ 'slide', 'fadeAndSlide', 'grow', 'growAndSlide' ],
'label' => __( 'Opening Sound', 'popup-maker' ),
'desc' => __( 'Select a sound to play when the popup opens.', 'popup-maker' ),
'none' => __( 'None', 'popup-maker' ),
'beep.mp3' => __( 'Beep', 'popup-maker' ),
'beep-two.mp3' => __( 'Beep 2', 'popup-maker' ),
'beep-up.mp3' => __( 'Beep Up', 'popup-maker' ),
'chimes.mp3' => __( 'Chimes', 'popup-maker' ),
'correct.mp3' => __( 'Correct', 'popup-maker' ),
'custom' => __( 'Custom Sound', 'popup-maker' ),
'label' => __( 'Custom Sound URL', 'popup-maker' ),
'desc' => __( 'Enter URL to sound file.', 'popup-maker' ),
'open_sound' => [ 'custom' ],
'label' => __( 'Location', 'popup-maker' ),
'desc' => __( 'Choose where the popup will be displayed.', 'popup-maker' ),
'left top' => __( 'Top Left', 'popup-maker' ),
'center top' => __( 'Top Center', 'popup-maker' ),
'right top' => __( 'Top Right', 'popup-maker' ),
'left center' => __( 'Middle Left', 'popup-maker' ),
'center' => __( 'Middle Center', 'popup-maker' ),
'right center' => __( 'Middle Right', 'popup-maker' ),
'left bottom' => __( 'Bottom Left', 'popup-maker' ),
'center bottom' => __( 'Bottom Center', 'popup-maker' ),
'right bottom' => __( 'Bottom Right', 'popup-maker' ),
'label' => __( 'Top', 'popup-maker' ),
'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Top', 'popup-maker' ) ) ),
'location' => [ 'left top', 'center top', 'right top' ],
'label' => __( 'Bottom', 'popup-maker' ),
'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Bottom', 'popup-maker' ) ) ),
'location' => [ 'left bottom', 'center bottom', 'right bottom' ],
'label' => __( 'Left', 'popup-maker' ),
'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Left', 'popup-maker' ) ) ),
'location' => [ 'left top', 'left center', 'left bottom' ],
'label' => __( 'Right', 'popup-maker' ),
'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Right', 'popup-maker' ) ) ),
'location' => [ 'right top', 'right center', 'right bottom' ],
'position_from_trigger' => [
'label' => __( 'Position from Trigger', 'popup-maker' ),
'desc' => sprintf( __( 'This will position the popup in relation to the %1$sClick Trigger%2$s.', 'popup-maker' ), '<a target="_blank" href="https://docs.wppopupmaker.com/article/395-trigger-click-open-overview-methods?utm_campaign=contextual-help&utm_medium=inline-doclink&utm_source=plugin-popup-editor&utm_content=position-from-trigger">', '</a>' ),
'label' => __( 'Fixed Postioning', 'popup-maker' ),
'desc' => __( 'Checking this sets the positioning of the popup to fixed.', 'popup-maker' ),
'label' => __( 'Disable Overlay', 'popup-maker' ),
'desc' => __( 'Checking this will disable and hide the overlay for this popup.', 'popup-maker' ),
'label' => __( 'Stackable', 'popup-maker' ),
'desc' => __( 'This enables other popups to remain open.', 'popup-maker' ),
'disable_reposition' => [
'label' => __( 'Disable Repositioning', 'popup-maker' ),
'desc' => __( 'This will disable automatic repositioning of the popup on window resizing.', 'popup-maker' ),
'label' => __( 'Popup Z-Index', 'popup-maker' ),
'desc' => __( 'Change the z-index layer level for the popup.', 'popup-maker' ),
'close' => apply_filters(
'pum_popup_close_settings_fields',
'label' => __( 'Close Text', 'popup-maker' ),
'placeholder' => __( 'Close', 'popup-maker' ),
'desc' => __( 'Override the default close text. To use a Font Awesome icon instead of text, enter the CSS classes such as "fas fa-camera".', 'popup-maker' ),
'close_button_delay' => [
'label' => __( 'Close Button Delay', 'popup-maker' ),
'desc' => __( 'This delays the display of the close button.', 'popup-maker' ),
'unit' => __( 'ms', 'popup-maker' ),
'close_on_form_submission' => [
'label' => __( 'Close on Form Submission', 'popup-maker' ),
'desc' => __( 'Close the popup automatically after integrated form plugin submissions.', 'popup-maker' ),
'close_on_form_submission_delay' => [
'label' => __( 'Delay', 'popup-maker' ),
'desc' => __( 'The delay before the popup will close after submission (in milliseconds).', 'popup-maker' ),
'close_on_form_submission' => true,
'close_on_overlay_click' => [
'label' => __( 'Click Overlay to Close', 'popup-maker' ),
'desc' => __( 'Checking this will cause popup to close when user clicks on overlay.', 'popup-maker' ),
'close_on_esc_press' => [
'label' => __( 'Press ESC to Close', 'popup-maker' ),
'desc' => __( 'Checking this will cause popup to close when user presses ESC key.', 'popup-maker' ),
'label' => __( 'Press F4 to Close', 'popup-maker' ),
'desc' => __( 'Checking this will cause popup to close when user presses F4 key.', 'popup-maker' ),
'advanced' => apply_filters(
'pum_popup_advanced_settings_fields',
'disable_form_reopen' => [
'label' => __( 'Disable automatic re-triggering of popup after non-ajax form submission.', 'popup-maker' ),
'disable_accessibility' => [
'label' => __( 'Disable accessibility features.', 'popup-maker' ),
'desc' => __( 'This includes trapping the tab key & focus inside popup while open, force focus the first element when popup open, and refocus last click trigger when closed.', 'popup-maker' ),
$tabs = PUM_Admin_Helpers::parse_tab_fields(
'name' => 'popup_settings[%s]',
public static function get_field( $id ) {
foreach ( $tabs as $tab => $sections ) {
if ( PUM_Admin_Helpers::is_field( $sections ) ) {
foreach ( $sections as $section => $fields ) {
foreach ( $fields as $key => $args ) {
* Sanitizes fields after submission.
* Also handles pre save manipulations for some field types (measure/license).
public static function sanitize_settings( $settings = [] ) {
$fields = self::fields();
$fields = PUM_Admin_Helpers::flatten_fields_array( $fields );
foreach ( $fields as $field_id => $field ) {
switch ( $field['type'] ) {
if ( ! isset( $settings[ $field_id ] ) ) {
$settings[ $field_id ] = false;
foreach ( $settings as $key => $value ) {
$field = self::get_field( $key );
// Sanitize every string value.
if ( is_string( $value ) ) {
$settings[ $key ] = sanitize_text_field( $value );
switch ( $field['type'] ) {
$settings[ $key ] = is_string( $value ) ? trim( $value ) : $value;
$settings[ $key ] .= $settings[ $key . '_unit' ];
// Some custom field types include multiple additional fields that do not need to be saved, strip out any non-whitelisted fields.
unset( $settings[ $key ] );
public static function defaults() {
foreach ( $tabs as $tab_id => $sections ) {
foreach ( $sections as $section_id => $fields ) {
foreach ( $fields as $key => $field ) {
$defaults[ $key ] = isset( $field['std'] ) ? $field['std'] : ( 'checkbox' === $field['type'] ? false : null );