ACF_Admin_Post_Types::get_action_notice_textpublicACF 6.1

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

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

Хуков нет.

Возвращает

Строку.

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

$ACF_Admin_Post_Types = new ACF_Admin_Post_Types();
$ACF_Admin_Post_Types->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_Post_Types::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 post types activated */
				_n( 'Post type activated.', '%s post types activated.', $count, 'acf' ),
				$count
			);
			break;
		case 'acfdeactivatecomplete':
			$text = sprintf(
				/* translators: %s number of post types deactivated */
				_n( 'Post type deactivated.', '%s post types deactivated.', $count, 'acf' ),
				$count
			);
			break;
		case 'acfduplicatecomplete':
			$text = sprintf(
				/* translators: %s number of post types duplicated */
				_n( 'Post type duplicated.', '%s post types duplicated.', $count, 'acf' ),
				$count
			);
			break;
		case 'acfsynccomplete':
			$text = sprintf(
				/* translators: %s number of post types synchronized */
				_n( 'Post type synchronized.', '%s post types synchronized.', $count, 'acf' ),
				$count
			);
			break;
	}

	return $text;
}