: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/* Exit if accessed directly */
if ( ! defined( 'ABSPATH' ) ) {
require_once(SG_POPUP_HELPERS_PATH.'ConfigDataHelper.php');
use sgpb\PopupBuilderActivePackage;
public static function init()
self::popupDefaultOptions();
public static function conditionInit()
global $SGPB_DATA_CONFIG_ARRAY;
/*Target condition config*/
$targetData = array('param' => 'Pages', 'operator' => 'Is not', 'value' => 'Value');
$targetElementTypes = array(
'post_selected' => 'select',
'page_selected' => 'select',
'post_category' => 'select',
'page_template' => 'select',
'post_tags_ids' => 'select'
'not_rule' => __('Select rule', 'popup-builder'),
'everywhere' => __('Everywhere', 'popup-builder'),
'post_all' => __('All posts', 'popup-builder'),
'post_selected' => __('Selected posts', 'popup-builder'),
'post_type' => __('Post type', 'popup-builder'),
'post_category' => __('Post category', 'popup-builder')
'page_all' => __('All pages', 'popup-builder'),
'page_selected' => __('Selected pages', 'popup-builder'),
'page_type' => __('Page type', 'popup-builder'),
'page_template' => __('Page template', 'popup-builder')
'post_tags' => __('All tags', 'popup-builder'),
'post_tags_ids' => __('Selected tags', 'popup-builder')
$targetOperators = array(
array('operator' => 'add', 'name' => __('Add', 'popup-builder')),
array('operator' => 'delete', 'name' => __('Delete', 'popup-builder'))
$targetDataOperator = array(
'==' => __('Is', 'popup-builder'),
'!=' => __('Is not', 'popup-builder')
$targetInitialData = array(
array('param' => 'everywhere')
$targetDataParams['param'] = apply_filters('sgPopupTargetParams', $targetParams);
$targetDataParams['operator'] = apply_filters('sgPopupTargetOperator', $targetDataOperator);
$targetDataParams['post_selected'] = apply_filters('sgPopupTargetPostData', array());
$targetDataParams['page_selected'] = apply_filters('sgPopupTargetPageSelected', array());
$targetDataParams['post_type'] = apply_filters('sgPopupTargetPostType', array());
$targetDataParams['post_category'] = apply_filters('sgPopupTargetPostCategory', array());
$targetDataParams['page_type'] = apply_filters('sgPopupTargetPageType', array());
$targetDataParams['page_template'] = apply_filters('sgPopupPageTemplates', array());
$targetDataParams['post_tags_ids'] = apply_filters('sgPopupTags', array());
$targetDataParams['everywhere'] = null;
$targetDataParams['not_rule'] = null;
$targetDataParams['post_all'] = null;
$targetDataParams['page_all'] = null;
$targetDataParams['post_tags'] = null;
'class' => 'js-sg-select2 js-select-basic',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic',
'label' => 'Display rule',
'info' => __('Specify where the popup should be shown on your site.', 'popup-builder')
'class' => 'js-sg-select2 js-select-basic',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic'
'label' => 'Is or is not',
'info' => __('Allow or Disallow popup showing for the selected rule.', 'popup-builder')
'post_selected' => array(
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'ajax',
'data-value-param' => 'post',
'label' => 'Select Your Posts',
'info' => __('Select your specific posts where the popup should be shown.', 'popup-builder')
'page_selected' => array(
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'ajax',
'data-value-param' => 'page',
'label' => 'Select Your Pages',
'info' => __('Select the pages on your site where the specific popup will be shown.', 'popup-builder')
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'multiple',
'data-value-param' => 'postTypes',
'label' => 'Select Your post types',
'info' => __('Specify the post types on your site to show the popup.', 'popup-builder')
'post_category' => array(
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'ajax',
'data-value-param' => 'postCategories',
'isPostCategory' => true,
'label' => 'Select post categories',
'info' => __('Select the post categories on which the popup should be shown.', 'popup-builder')
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'multiple',
'data-value-param' => 'pageTypes',
'label' => 'Select specific page types',
'info' => __('Specify the page types where the popup will be shown.', 'popup-builder')
'page_template' => array(
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'multiple',
'data-value-param' => 'pageTemplate',
'label' => 'Select page template',
'info' => __('Select the page templates on which the popup will be shown.', 'popup-builder')
'post_tags_ids' => array(
'class' => 'js-sg-select2 js-select-ajax',
'data-select-class' => 'js-select-ajax',
'data-select-type' => 'ajax',
'data-value-param' => 'postTags',
'label' => 'Select tags',
'info' => __('Select the tags on your site for popup showing', 'popup-builder')
$popupTarget['columns'] = apply_filters('sgPopupTargetColumns', $targetData);
$popupTarget['columnTypes'] = apply_filters('sgPopupTargetTypes', $targetElementTypes);
$popupTarget['paramsData'] = apply_filters('sgPopupTargetData', $targetDataParams);
$popupTarget['initialData'] = apply_filters('sgPopupTargetInitialData', $targetInitialData);
$popupTarget['operators'] = apply_filters('sgpbPopupEventsOperators', $targetOperators);
$popupTarget['attrs'] = apply_filters('sgPopupTargetAttrs', $targetAttrs);
$SGPB_DATA_CONFIG_ARRAY['target'] = $popupTarget;
/*Target condition config*/
$eventsData = array('param' => 'Event name', 'value' => 'Delay');
$hiddenOptionData = array();
'repetitive' => 'checkbox',
'repetitivePeriod' => 'text',
SGPB_CLICK_ACTION_KEY => 'select',
'clickActionCustomClass' => 'text',
'hoverActionCustomClass' => 'text',
'defaultClickClassName' => 'conditionalText',
'defaultHoverClassName' => 'conditionalText'
SGPB_CSS_CLASS_ACTIONS_KEY => __('Set by CSS class', 'popup-builder'),
SGPB_CLICK_ACTION_KEY => __('On Click', 'popup-builder'),
SGPB_HOVER_ACTION_KEY => __('On Hover', 'popup-builder'),
'inactivity' => __('Inactivity', 'popup-builder'),
'onScroll' => __('On Scroll', 'popup-builder')
$hiddenOptionData['load'] = array(
'repetitive' => 'Repetitive popup'
$eventsDataParams['param'] = $params;
$eventsDataParams['operator'] = array();
$eventsDataParams['load'] = $onLoadData;
$eventsDataParams['clickActionCustomClass'] = '';
$eventsDataParams['hoverActionCustomClass'] = '';
$eventsDataParams['defaultClickClassName'] = 'sg-popup-id-';
$eventsDataParams['defaultHoverClassName'] = 'sg-popup-hover-';
$eventsDataParams[SGPB_CSS_CLASS_ACTIONS_KEY] = null;
$eventsDataParams[SGPB_CLICK_ACTION_KEY.'Operator'] = SGPBConfigDataHelper::getClickActionOptions();
$eventsDataParams[SGPB_HOVER_ACTION_KEY.'Operator'] = SGPBConfigDataHelper::getHoverActionOptions();
$eventsDataParams['repetitive'] = '';
$eventsDataParams['repetitivePeriod'] = 0;
array('operator' => 'add', 'name' => 'Add'),
array('operator' => 'edit', 'name' => 'Edit'),
array('operator' => 'delete', 'name' => 'Delete')
$eventsInitialData = array(
array('param' => 'load', 'value' => '', 'hiddenOption' => array())
'class' => 'js-sg-select2 js-select-basic sgpb-selectbox-settings',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic'
'info' => __('Select when the popup should appear on the page.', 'popup-builder')
'class' => 'js-sg-select2 js-select-basic',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic'
'info' => __('Select the condition for the current event.', 'popup-builder')
'htmlAttrs' => array('class' => 'js-sg-onload-text formItem__input formItem__input_select2_num_input', 'placeholder' => __('default custom delay will be used', 'popup-builder'), 'min' => 0),
'info' => __('Specify how long the popup appearance should be delayed after loading the page (in sec).', 'popup-builder')
SGPB_CLICK_ACTION_KEY => array(
'class' => 'js-sg-select2 js-select-basic formItem__input formItem__input_select2_num_input',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic'
'label' => 'Click Event',
'info' => __('Specify the part of the page, in percentages, where the popup should appear after scrolling.', 'popup-builder')
SGPB_HOVER_ACTION_KEY => array(
'class' => 'js-sg-select2 js-select-basic formItem__input formItem__input_select2_num_input',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic'
'label' => 'Hover Event',
'info' => __('Specify the part of the page, in percentages, where the popup should appear after scrolling.', 'popup-builder')
'clickActionCustomClass' => array(
'htmlAttrs' => array('class' => 'js-sg-inactivity-text formItem__input formItem__input_select2_num_input', 'min' => 0),
'label' => 'Custom Class',
'info' => __('Add the CSS class name of your HTML element which will trigger this popup after click.', 'popup-builder')
'hoverActionCustomClass' => array(
'htmlAttrs' => array('class' => 'js-sg-inactivity-text formItem__input formItem__input_select2_num_input', 'min' => 0),
'label' => 'Custom Class',
'info' => __('Add the CSS class name of your HTML element which will trigger this popup after click.', 'popup-builder')
'defaultClickClassName' => array(
'class' => 'js-sg-click-event formItem__input formItem__input_select2_num_input',
'value' => 'sg-popup-id-',
'beforeSaveLabel' => __('Please save popup to generate class name.', 'popup-builder')
'label' => 'Default Class',
'info' => __('Add the following CSS class into your HTML element.', 'popup-builder')
'defaultHoverClassName' => array(
'class' => 'js-sg-hover-event formItem__input formItem__input_select2_num_input',
'value' => 'sg-popup-hover-',
'beforeSaveLabel' => __('Please save popup to generate class name.', 'popup-builder')
'label' => 'Default Class',
'info' => __('Add the following CSS class into your HTML element.', 'popup-builder')
'class' => 'sgpb-popup-option sgpb-popup-accordion',
'data-name' => 'repetitive',
'label' => 'Repetitive open popup',
'info' => __('If this option is enabled the same popup will open up after every X seconds you have defined (after closing it).', 'popup-builder')
'childOptions' => array('repetitivePeriod')
'repetitivePeriod' => array(
'class' => 'sgpb-popup-option',
'info' => __('This is info', 'popup-builder')
$popupEvents['columns'] = apply_filters('sgPopupEventColumns', $eventsData);
$popupEvents['columnTypes'] = apply_filters('sgPopupEventTypes', $eventsRowTypes);
$popupEvents['paramsData'] = apply_filters('sgPopupEventsData', $eventsDataParams);
$popupEvents['initialData'] = apply_filters('sgPopupEventsInitialData', $eventsInitialData);
$popupEvents['operators'] = apply_filters('sgPopupEventOperators', $eventOperators);
$popupEvents['hiddenOptionData'] = apply_filters('sgEventsHiddenData', $hiddenOptionData);
$popupEvents['attrs'] = apply_filters('sgPopupEventAttrs', $eventsAttrs);
$popupEvents['specialDefaultOperator'] = apply_filters('sgPopupEventsOperators', ' ');
$popupEvents['operatorAllowInConditions'] = apply_filters('sgPopupEventsOperatorAllowInConditions', array(SGPB_CLICK_ACTION_KEY, SGPB_HOVER_ACTION_KEY));
$SGPB_DATA_CONFIG_ARRAY['events'] = $popupEvents;
/*Target condition config*/
$targetData = array('param' => 'Pages', 'operator' => 'Is not', 'value' => 'Value');
$targetElementTypes = array(
'select_role' => 'select',
'select_role' => __('Select Conditions', 'popup-builder')
$targetOperators = array(
array('operator' => 'add', 'name' => __('Add', 'popup-builder')),
array('operator' => 'delete', 'name' => __('Delete', 'popup-builder'))
$targetDataOperator = array(
'==' => __('Is', 'popup-builder'),
'!=' => __('Is not', 'popup-builder')
$targetInitialData = array(
array('param' => 'select_role', 'operator' => '==', 'value' => '')
$targetDataParams['param'] = apply_filters('sgpbPopupSpecialEventsParams', $targetParams);
$targetDataParams['operator'] = apply_filters('sgpbPopupConditionsOperator', $targetDataOperator);
$targetDataParams['select_role'] = null;
'class' => 'js-sg-select2 js-select-basic sgpb-selectbox-settings',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic',
'info' => __('Target visitors to show the popup by different conditions.', 'popup-builder')
'class' => 'js-sg-select2 js-select-basic',
'data-select-class' => 'js-select-basic',
'data-select-type' => 'basic'
'info' => __('Allow or Disallow popup showing for the selected conditions.', 'popup-builder')
$popupConditions['columns'] = apply_filters('sgPopupConditionsColumns', $targetData);
$popupConditions['columnTypes'] = apply_filters('sgPopupConditionsTypes', $targetElementTypes);
$popupConditions['paramsData'] = apply_filters('sgPopupConditionsData', $targetDataParams);
$popupConditions['initialData'] = apply_filters('sgPopupConditionsInitialData', $targetInitialData);
$popupConditions['operators'] = apply_filters('sgPopupConditionsOperators', $targetOperators);
$popupConditions['attrs'] = apply_filters('sgPopupConditionsAttrs', $targetAttrs);
$popupConditions['specialDefaultOperator'] = apply_filters('sgPopupConditionsOperators', $targetDataOperator);
$popupConditions['operatorAllowInConditions'] = apply_filters('sgPopupConditionsOperatorAllowInConditions', array());
$SGPB_DATA_CONFIG_ARRAY['conditions'] = $popupConditions;
$SGPB_DATA_CONFIG_ARRAY['behavior-after-special-events'] = self::getBehaviorAfterSpecialEventsConfig();
$SGPB_DATA_CONFIG_ARRAY = apply_filters('sgpbConfigArray', $SGPB_DATA_CONFIG_ARRAY);
/*Target condition config*/
public static function allFreeExtensionsKeys()
public static function allExtensionsKeys()
'label' => __('AdBlock', 'popup-builder'),