ACF_Admin_UI_Options_Pages::get_action_notice_textpublicACF 6.1

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

Method of the class: ACF_Admin_UI_Options_Pages{}

No Hooks.

Returns

String.

Usage

$ACF_Admin_UI_Options_Pages = new ACF_Admin_UI_Options_Pages();
$ACF_Admin_UI_Options_Pages->get_action_notice_text( $action, $count );
$action(string) (required)
The action being performed.
$count(int)
The number of items the action was performed on.
Default: 1

Changelog

Since 6.1 Introduced.

ACF_Admin_UI_Options_Pages::get_action_notice_text() code ACF 6.8.8

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

	return $text;
}