ACF_Admin_Field_Groups::get_action_notice_textpublicACF 6.1

Gets the translated action notice text for list table actions (activate, deactivate, sync, etc.).

Метод класса: ACF_Admin_Field_Groups{}

Хуков нет.

Возвращает

Строку.

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

$ACF_Admin_Field_Groups = new ACF_Admin_Field_Groups();
$ACF_Admin_Field_Groups->get_action_notice_text( $action, $count );
$action(строка) (обязательный)
The action being performed.
$count(int)
The number of items the action was performed on.
По умолчанию: 1

Список изменений

С версии 6.1 Введена.

Код ACF_Admin_Field_Groups::get_action_notice_text() ACF 6.4.2

public function get_action_notice_text( $action, $count = 1 ) {
	$text  = '';
	$count = (int) $count;

	switch ( $action ) {
		case 'acfactivatecomplete':
			$text = sprintf(
				/* translators: %s number of field groups activated */
				_n( 'Field group activated.', '%s field groups activated.', $count, 'acf' ),
				$count
			);
			break;
		case 'acfdeactivatecomplete':
			$text = sprintf(
				/* translators: %s number of field groups deactivated */
				_n( 'Field group deactivated.', '%s field groups deactivated.', $count, 'acf' ),
				$count
			);
			break;
		case 'acfduplicatecomplete':
			$text = sprintf(
				/* translators: %s number of field groups duplicated */
				_n( 'Field group duplicated.', '%s field groups duplicated.', $count, 'acf' ),
				$count
			);
			break;
		case 'acfsynccomplete':
			$text = sprintf(
				/* translators: %s number of field groups synchronized */
				_n( 'Field group synchronized.', '%s field groups synchronized.', $count, 'acf' ),
				$count
			);
			break;
	}

	return $text;
}