: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Integrations for ninja-forms actions open popup
* @copyright Copyright (c) 2023, Code Atlantic LLC
if ( ! defined( 'ABSPATH' ) ) {
* Class NF_Action_SuccessMessage
final class NF_PUM_Actions_OpenPopup extends NF_Abstracts_Action {
protected $_name = 'openpopup';
protected $_timing = 'late';
protected $_priority = 10;
public function __construct() {
$this->_nicename = __( 'Open Popup', 'popup-maker' );
'label' => __( 'Popup ID', 'popup-maker' ),
'options' => isset( $_GET['page'] ) && 'ninja-forms' === $_GET['page'] && ! empty( $_GET['form_id'] ) ? $this->get_popup_list() : [],
$this->_settings = array_merge( $this->_settings, $settings );
public function save( $action_settings ) {
public function process( $action_settings, $form_id, $data ) {
if ( ! isset( $data['actions'] ) || ! isset( $data['actions']['openpopup'] ) ) {
$data['actions']['openpopup'] = false;
if ( isset( $action_settings['popup'] ) ) {
$data['actions']['openpopup'] = intval( $action_settings['popup'] );
public function get_popup_list() {
'label' => __( 'Select a popup', 'popup-maker' ),
$popups = pum_get_all_popups();
foreach ( $popups as $popup ) {
'label' => $popup->post_title,