WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

WPCF7_ConstantContact::update_contact_lists() public CF7 1.0

{} Это метод класса: WPCF7_ConstantContact{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WPCF7_ConstantContact = new WPCF7_ConstantContact();
$WPCF7_ConstantContact->update_contact_lists( $selection );
$selection **
-
По умолчанию: array()

Код WPCF7_ConstantContact::update_contact_lists() CF7 5.4.1

<?php
public function update_contact_lists( $selection = array() ) {
	$contact_lists = array();
	$contact_lists_on_api = $this->get_contact_lists();

	if ( false !== $contact_lists_on_api ) {
		foreach ( (array) $contact_lists_on_api as $list ) {
			if ( isset( $list['list_id'] ) ) {
				$list_id = trim( $list['list_id'] );
			} else {
				continue;
			}

			if ( isset( $this->contact_lists[$list_id]['selected'] ) ) {
				$list['selected'] = $this->contact_lists[$list_id]['selected'];
			} else {
				$list['selected'] = array();
			}

			$contact_lists[$list_id] = $list;
		}
	} else {
		$contact_lists = $this->contact_lists;
	}

	foreach ( (array) $selection as $key => $ids_or_names ) {
		foreach( $contact_lists as $list_id => $list ) {
			if ( in_array( $list['list_id'], (array) $ids_or_names, true )
			or in_array( $list['name'], (array) $ids_or_names, true ) ) {
				$contact_lists[$list_id]['selected'][$key] = true;
			} else {
				unset( $contact_lists[$list_id]['selected'][$key] );
			}
		}
	}

	$this->contact_lists = $contact_lists;

	if ( $selection ) {
		$this->save_data();
	}

	return $this->contact_lists;
}