: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'pum-sub-form--provider-' . $atts['provider'],
'pum-form--layout-' . $atts['form_layout'],
'pum-form--style-' . $atts['form_style'],
'pum-form--alignment-' . $atts['form_alignment'],
<form class="<?php echo esc_attr( $classes ); ?>" data-settings="<?php echo esc_attr( PUM_Utils_Array::safe_json_encode( $data_attr ) ); ?>">
<?php do_action( 'pum_sub_form_before', $atts ); ?>
if ( 'disabled' !== $atts['name_field_type'] ) :
$required = ! $atts['name_optional'] ? 'required' : '';
switch ( $atts['name_field_type'] ) {
<div class="pum-form__field pum-form__field--name pum-sub-form-field pum-sub-form-field--name">
<?php if ( ! $atts['disable_labels'] ) : ?>
<label class="pum-form__label pum-sub-form-label"><?php echo esc_html( $atts['label_name'] ); ?></label>
<input type="text" name="name" <?php echo esc_attr( $required ); ?> placeholder="<?php echo esc_attr( $atts['placeholder_name'] ); ?>" />
<div class="pum-form__field pum-form__field--fname pum-sub-form-field pum-sub-form-field--fname">
<?php if ( ! $atts['disable_labels'] ) : ?>
<label class="pum-form__label pum-sub-form-label"><?php echo esc_html( $atts['label_fname'] ); ?></label>
<input type="text" name="fname" <?php echo esc_attr( $required ); ?> placeholder="<?php echo esc_attr( $atts['placeholder_fname'] ); ?>" />
<div class="pum-form__field pum-form__field--fname pum-sub-form-field pum-sub-form-field--fname">
<?php if ( ! $atts['disable_labels'] ) : ?>
<label class="pum-form__label pum-sub-form-label"><?php echo esc_html( $atts['label_fname'] ); ?></label>
<input type="text" name="fname" <?php echo esc_attr( $required ); ?> placeholder="<?php echo esc_attr( $atts['placeholder_fname'] ); ?>" />
<div class="pum-form__field pum-form__field--lname pum-sub-form-field pum-sub-form-field--lname">
<?php if ( ! $atts['disable_labels'] ) : ?>
<label class="pum-form__label pum-sub-form-label"><?php echo esc_html( $atts['label_lname'] ); ?></label>
<input type="text" name="lname" <?php echo esc_attr( $required ); ?> placeholder="<?php echo esc_attr( $atts['placeholder_lname'] ); ?>" />
<div class="pum-form__field pum-form__field--email pum-sub-form-field pum-sub-form-field--email">
<?php if ( ! $atts['disable_labels'] ) : ?>
<label class="pum-form__label pum-sub-form-label"><?php echo esc_html( $atts['label_email'] ); ?></label>
<input type="email" name="email" required placeholder="<?php echo esc_attr( $atts['placeholder_email'] ); ?>" />
<?php do_action( 'pum_sub_form_fields', $atts ); ?>
<?php do_action( 'pum_newsletter_fields', $atts ); ?>
<input type="hidden" name="provider" value="<?php echo esc_attr( $atts['provider'] ); ?>" />
if ( 'yes' === $atts['privacy_consent_enabled'] ) :
$consent_text = trim( $atts['privacy_consent_label'] );
'required' => isset( $atts['privacy_consent_required'] ) && $atts['privacy_consent_required'],
'text' => ! empty( $consent_text ) ? $consent_text : ( ! empty( $atts['privacy_consent_yes_label'] ) ? $atts['privacy_consent_yes_label'] : '' ),
<input type="hidden" name="consent_args" value="<?php echo esc_attr( PUM_Utils_Array::safe_json_encode( $consent_args ) ); ?>" />
<div class="pum-form__field pum-form__field--<?php echo esc_attr( $atts['privacy_consent_type'] ); ?> pum-form__field--consent pum-sub-form-field">
switch ( $atts['privacy_consent_type'] ) {
<label class="pum-form__label pum-sub-form-label">
<input type="checkbox" value="yes" name="consent" <?php echo $consent_args['required'] ? 'required="required"' : ''; ?> /> <?php echo wp_kses( $consent_text, [] ); ?>
<?php if ( ! empty( $consent_text ) ) : ?>
<label class="pum-form__label pum-sub-form-label"><?php echo esc_html( wp_kses( $consent_text, [] ) ); ?></label>
<div class="pum-form__consent-radios pum-form__consent-radios--<?php echo esc_attr( $atts['privacy_consent_radio_layout'] ); ?>">
<label class="pum-form__label pum-sub-form-label">
<input type="radio" value="yes" name="consent" <?php echo $consent_args['required'] ? 'required="required"' : ''; ?> /> <?php echo esc_html( wp_kses( $atts['privacy_consent_yes_label'], [] ) ); ?>
<label class="pum-form__label pum-sub-form-label">
<input type="radio" value="no" name="consent" /> <?php echo esc_html( wp_kses( $atts['privacy_consent_no_label'], [] ) ); ?>
if ( ! empty( $atts['privacy_usage_text'] ) ) :
$usage_text = trim( $atts['privacy_usage_text'] );
if ( strpos( $usage_text, '{{privacy_link' ) !== false && function_exists( 'get_privacy_policy_url' ) && get_privacy_policy_url() !== '' ) {
preg_match_all( '/{{privacy_link:?(.*)}}/', $usage_text, $matches );
$link = '<a href="' . get_privacy_policy_url() . '" target="_blank">%s</a>';
foreach ( $matches[0] as $key => $value ) {
$usage_text = str_replace( $matches[0][ $key ], sprintf( $link, $matches[1][ $key ] ), $usage_text );
<div class="pum-form__field pum-form__field--submit pum-sub-form-field pum-sub-form-field--submit">
<button class="pum-form__submit pum-sub-form-submit"><?php echo esc_html( $atts['label_submit'] ); ?></button>
<?php do_action( 'pum_sub_form_after', $atts ); ?>
* Process shortcode attributes.
* Also remaps and cleans old ones.
public function shortcode_atts( $atts ) {
$atts = parent::shortcode_atts( $atts );
if ( empty( $atts['provider'] ) ) {
$atts['provider'] = pum_get_option( 'newsletter_default_provider' );
if ( ! empty( $atts['layout'] ) ) {
$atts['form_layout'] = $atts['layout'];
if ( ! empty( $atts['style'] ) ) {
$atts['form_style'] = $atts['style'];
if ( ! empty( $atts['name_text'] ) ) {
$atts['label_name'] = $atts['name_text'];
if ( ! empty( $atts['email_text'] ) ) {
$atts['label_email'] = $atts['email_text'];
if ( ! empty( $atts['button_text'] ) ) {
$atts['label_submit'] = $atts['button_text'];
unset( $atts['layout'], $atts['style'], $atts['name_text'], $atts['email_text'], $atts['button_text'] );
* Remap v1.7 core shortcode attributes starting here.
if ( ! empty( $atts['name_disabled'] ) && $atts['name_disabled'] ) {
$atts['name_field_type'] = 'disabled';
unset( $atts['name_disabled'] );
* Returns array of fields & values that will be passed into data attr of the form.
public function data_attr( $atts = [] ) {
$data_attr_fields = $this->data_attr_fields();
foreach ( $atts as $key => $value ) {
if ( in_array( $key, $data_attr_fields ) ) {
if ( 'redirect' === $key ) {
$data[ $key ] = base64_encode( esc_url( $value ) );
* Returns array of fields that will be passed into data attr of the form.
public function data_attr_fields() {
'pum_sub_form_data_attr_fields',
public function template() {
<p class="pum-sub-form-desc">
<?php _e( 'Subscription Form Placeholder', 'popup-maker' ); ?>