: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'page.php' => __('Default Template', 'popup-builder')
$templates = wp_get_theme()->get_page_templates();
foreach ($templates as $key => $value) {
$pageTemplates[$key] = $value;
public static function getAllTags($search_text = '')
'name__like' => $search_text
foreach ($tags as $tag) {
$allTags[$tag->slug] = $tag->name;
public static function getTagsByIds($ids = [])
foreach ($tags as $tag) {
$allTags[$tag->slug] = $tag->name;
public static function getTagsBySlug($ids = [])
foreach ($tags as $tag) {
$allTags[$tag->slug] = $tag->name;
public static function getTermsByIds($ids = array())
$terms = get_terms(array(
foreach ($terms as $term) {
$allTags[$term->term_id] = $term->name;
public static function defaultData()
$data['contentClickOptions'] = array(
'fieldWrapperAttr' => array(
'class' => 'col-md-7 sgpb-choice-option-wrapper'
'class' => 'formItem__title'
'groupWrapperAttr' => array(
'class' => 'subFormItem sgpb-choice-wrapper formItem'
'buttonPosition' => 'right',
'name' => 'sgpb-content-click-behavior',
'name' => __('Close Popup', 'popup-builder').':'
'name' => 'sgpb-content-click-behavior',
'data-attr-href' => 'content-click-redirect',
'name' => __('Redirect', 'popup-builder').':'
'name' => 'sgpb-content-click-behavior',
'data-attr-href' => 'content-copy-to-clipboard',
'name' => __('Copy to clipboard', 'popup-builder').':'
$data['customEditorContent'] = array(
'ShouldOpen' => '<b>Opening events:</b><br><br><b>#1</b> Add the code you want to run <b>before</b> the popup opening. This will be a condition for opening the popup, that is processed and defined before the popup opening. If the return value is <b>"true"</b> then the popup will open, if the value is <b>"false"</b> the popup won\'t open.',
'WillOpen' => '<b>#2</b> Add the code you want to run <b>before</b> the popup opens. This will be the code that will work in the process of opening the popup. <b>true/false</b> conditions will not work in this phase.',
'DidOpen' => '<b>#3</b> Add the code you want to run <b>after</b> the popup opens. This code will work when the popup is already open on the page.',
'ShouldClose' => '<b>Closing events:</b><br><br><b>#1</b> Add the code that will be fired <b>before</b> the popup closes. This will be a condition for the popup closing. If the return value is <b>"true"</b> then the popup will close, if the value is <b>"false"</b> the popup won\'t close.',
'WillClose' => '<b>#2</b> Add the code you want to run <b>before</b> the popup closes. This will be the code that will work in the process of closing the popup. <b>true/false</b> conditions will not work in this phase.',
'DidClose' => '<b>#3</b> Add the code you want to run <b>after</b> the popup closes. This code will work when the popup is already closed on the page.'
'<span class="formItem__text">
'.__('If you need the popup id number in the custom code, you may use the following variable to get the ID:', 'popup-builder').'
// we need this oldDefaultValue for the backward compatibility
'oldDefaultValue' => array(
'/*popup content wrapper*/'."\n".
'.sgpb-content-popupId {'."\n\n".'}'."\n\n".
'.sgpb-popup-overlay-popupId {'."\n\n".'}'."\n\n".
'/*popup wrapper*/'."\n".
'.sgpb-popup-builder-content-popupId {'."\n\n".'}'."\n\n"
'<br>/*popup content wrapper*/',
'.sgpb-popup-overlay-popupId',
'.sgpb-popup-builder-content-popupId'
'<span class="formItem__text">
'.__('If you need the popup id number in the custom code, you may use the following variable to get the ID:', 'popup-builder').'
$data['htmlCustomButtonArgs'] = array(
'fieldWrapperAttr' => array(
'class' => 'col-md-6 sgpb-choice-option-wrapper'
'class' => 'col-md-6 sgpb-choice-option-wrapper sgpb-sub-option-label'
'groupWrapperAttr' => array(
'class' => 'row form-group sgpb-choice-wrapper'
'buttonPosition' => 'right',
'name' => 'sgpb-custom-button',
'class' => 'custom-button-copy-to-clipboard',
'data-attr-href' => 'sgpb-custom-button-copy',
'value' => 'copyToClipBoard'
'name' => __('Copy to clipboard', 'popup-builder').':'
'name' => 'sgpb-custom-button',
'class' => 'custom-button-copy-to-clipboard',
'data-attr-href' => 'sgpb-custom-button-redirect-to-URL',
'value' => 'redirectToURL'
'name' => __('Redirect to URL', 'popup-builder').':'
'name' => 'sgpb-custom-button',
'class' => 'subs-success-open-popup',
'data-attr-href' => 'sgpb-custom-button-open-popup',
'name' => __('Open popup', 'popup-builder').':'
'name' => 'sgpb-custom-button',
'class' => 'sgpb-custom-button-hide-popup',
'name' => __('Hide popup', 'popup-builder').':'
$data['popupDimensions'] = array(
'fieldWrapperAttr' => array(
'class' => 'col-md-7 sgpb-choice-option-wrapper'
'class' => 'formItem__title'
'groupWrapperAttr' => array(
'class' => 'subFormItem sgpb-choice-wrapper sgpb-display-flex sgpb-align-item-center formItem'
'buttonPosition' => 'right',
'name' => 'sgpb-popup-dimension-mode',
'data-attr-href' => 'responsive-dimension-wrapper',
'value' => 'responsiveMode'
'name' => __('Responsive mode', 'popup-builder').':',
'info' => __('The sizes of the popup will be counted automatically, according to the content size of the popup. You can select the size in percentages, with this mode, to specify the size on the screen', 'popup-builder').'.'
'name' => 'sgpb-popup-dimension-mode',
'data-attr-href' => 'custom-dimension-wrapper',
'name' => __('Custom mode', 'popup-builder').':',
'info' => __('Add your own custom dimensions for the popup to get the exact sizing for your popup', 'popup-builder').'.'
'value' => 'sgpb-theme-1',
'data-attributes' => array(
'class' => 'js-sgpb-popup-themes sgpb-popup-theme-1',
'data-popup-theme-number' => 1
'value' => 'sgpb-theme-2',
'data-attributes' => array(
'class' => 'js-sgpb-popup-themes sgpb-popup-theme-2',
'data-popup-theme-number' => 2
'value' => 'sgpb-theme-3',
'data-attributes' => array(
'class' => 'js-sgpb-popup-themes sgpb-popup-theme-3',
'data-popup-theme-number' => 3
'value' => 'sgpb-theme-4',
'data-attributes' => array(
'class' => 'js-sgpb-popup-themes sgpb-popup-theme-4',
'data-popup-theme-number' => 4
'value' => 'sgpb-theme-5',
'data-attributes' => array(
'class' => 'js-sgpb-popup-themes sgpb-popup-theme-5',
'data-popup-theme-number' => 5
'value' => 'sgpb-theme-6',
'data-attributes' => array(
'class' => 'js-sgpb-popup-themes sgpb-popup-theme-6',
'data-popup-theme-number' => 6
$data['responsiveDimensions'] = array(
'auto' => __('Auto', 'popup-builder'),
'fullScreen' => __('Full screen', 'popup-builder')
$data['freeConditionsAdvancedTargeting'] = array(
'devices' => __('Devices', 'popup-builder'),
'user-status' => __('User Status', 'popup-builder'),
'after-x' => __('After x pages visit', 'popup-builder'),
'user-role' => __('User Role', 'popup-builder'),
'detect-by-url' => __('Referral URL detection', 'popup-builder'),
'cookie-detection' => __('Cookie Detection', 'popup-builder'),
'operation-system' => __('Operating System', 'popup-builder'),
'browser-detection' => __('Web Browser', 'popup-builder'),
'query-string' => __('URL Query String', 'popup-builder')
$data['freeConditionsGeoTargeting'] = array(
'countries' => __('Countries', 'popup-builder'),
'cities' => __('Cities', 'popup-builder'),
'states' => __('States', 'popup-builder'),
'visitor-ip' => __('Visitor IP', 'popup-builder')
$data['closeButtonPositions'] = array(
'topLeft' => __('top-left', 'popup-builder'),
'topRight' => __('top-right', 'popup-builder'),
'bottomLeft' => __('bottom-left', 'popup-builder'),
'bottomRight' => __('bottom-right', 'popup-builder')
$data['closeButtonPositionsFirstTheme'] = array(
'bottomLeft' => __('bottom-left', 'popup-builder'),
'bottomRight' => __('bottom-right', 'popup-builder')
$data['pxPercent'] = array(
$data['countdownFormat'] = array(
SG_COUNTDOWN_COUNTER_SECONDS_SHOW => 'DD:HH:MM:SS',
SG_COUNTDOWN_COUNTER_SECONDS_HIDE => 'DD:HH:MM'
$data['countdownTimezone'] = self::getPopupTimeZone();
$data['countdownLanguage'] = array(
'Portuguese' => 'Português',
$data['weekDaysArray'] = array(
'Wed' => __('Wednesday'),
$data['messageResize'] = array(
'both' => __('Both', 'popup-builder'),
'horizontal' => __('Horizontal', 'popup-builder'),
'vertical' => __('Vertical', 'popup-builder'),
'none' => __('None', 'popup-builder'),
'inherit' => __('Inherit', 'popup-builder')
$data['socialShareOptions'] = array(
'fieldWrapperAttr' => array(
'class' => 'col-md-7 sgpb-choice-option-wrapper'
'class' => 'col-md-5 sgpb-choice-option-wrapper'
'groupWrapperAttr' => array(
'class' => 'row form-group sgpb-choice-wrapper'
'buttonPosition' => 'right',
'name' => 'sgpb-social-share-url-type',
'class' => 'sgpb-share-url-type',
'name' => __('Use active URL', 'popup-builder').':'
'name' => 'sgpb-social-share-url-type',
'class' => 'sgpb-share-url-type',
'data-attr-href' => 'sgpb-social-share-url-wrapper',
'name' => __('Share URL', 'popup-builder').':'
$data['countdownDateFormat'] = array(
'fieldWrapperAttr' => array(
'class' => 'col-md-5 sgpb-choice-option-wrapper'
'class' => 'col-md-5 sgpb-choice-option-wrapper sgpb-sub-option-label'
'groupWrapperAttr' => array(
'class' => 'row form-group sgpb-choice-wrapper'
'buttonPosition' => 'right',
'name' => 'sgpb-countdown-date-format',
'class' => 'sgpb-countdown-date-format-from-date',
'data-attr-href' => 'sgpb-countdown-date-format-from-date',
'name' => __('Due Date', 'popup-builder').':'
'name' => 'sgpb-countdown-date-format',
'class' => 'sgpb-countdown-date-format-from-date',
'data-attr-href' => 'sgpb-countdown-date-format-from-input',
'name' => __('Timer', 'popup-builder').':'
$data['socialShareTheme'] = array(