wpcf7_sendinblue_editor_lists()
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wpcf7_sendinblue_editor_lists( $lists_selected, $options );
- $lists_selected(обязательный)
- .
- $options
- .
По умолчанию:''
Код wpcf7_sendinblue_editor_lists() wpcf7 sendinblue editor lists CF7 6.2.4.1
function wpcf7_sendinblue_editor_lists( $lists_selected, $options = '' ) {
$options = wp_parse_args( $options, array(
'clear_cache' => false,
'run_query' => true,
) );
$formatter = new WPCF7_HTMLFormatter();
$formatter->append_start_tag( 'fieldset' );
$lists = wpcf7_sendinblue_get_lists( $options );
if ( ! isset( $lists ) ) {
$formatter->append_start_tag( 'legend' );
$formatter->append_preformatted(
esc_html( __( 'Loading…', 'contact-form-7' ) )
);
$formatter->end_tag( 'legend' );
foreach ( $lists_selected as $list ) {
$formatter->append_start_tag( 'input', array(
'type' => 'hidden',
'name' => 'wpcf7-sendinblue[contact_lists][]',
'value' => $list,
) );
}
} elseif ( $lists ) {
$formatter->append_start_tag( 'legend' );
$formatter->append_preformatted(
esc_html( __( 'Select lists to which contacts are added:', 'contact-form-7' ) )
);
$formatter->end_tag( 'legend' );
$formatter->append_start_tag( 'ul' );
foreach ( $lists as $list ) {
$formatter->append_start_tag( 'li' );
$formatter->append_start_tag( 'label' );
$formatter->append_start_tag( 'input', array(
'type' => 'checkbox',
'name' => 'wpcf7-sendinblue[contact_lists][]',
'value' => $list['id'],
'checked' => in_array( $list['id'], $lists_selected ),
) );
$formatter->append_whitespace();
$formatter->append_preformatted( esc_html( $list['name'] ) );
$formatter->end_tag( 'li' );
}
$formatter->end_tag( 'ul' );
} else {
$formatter->append_start_tag( 'legend' );
$formatter->append_preformatted(
esc_html( __( 'You have no contact list yet.', 'contact-form-7' ) )
);
$formatter->end_tag( 'legend' );
}
$formatter->end_tag( 'fieldset' );
$formatter->append_start_tag( 'p' );
$formatter->append_start_tag( 'a', array(
'href' => 'https://my.sendinblue.com/lists',
) );
$formatter->append_preformatted(
esc_html( __( 'Manage your contact lists', 'contact-form-7' ) )
);
$formatter->end_tag( 'p' );
$formatter->print();
}