ACF_Admin_Notice{}ACF 1.0

Хуков нет.

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

$ACF_Admin_Notice = new ACF_Admin_Notice();
// use class methods

Методы

  1. public render()

Код ACF_Admin_Notice{} ACF 6.0.4

class ACF_Admin_Notice extends ACF_Data {

	/** @var array Storage for data. */
	var $data = array(

		/** @type string Text displayed in notice. */
		'text'        => '',

		/** @type string The type of notice (warning, error, success, info). */
		'type'        => 'info',

		/** @type bool If the notice can be dismissed. */
		'dismissible' => true,
	);

	/**
	 *  render
	 *
	 *  Renders the notice HTML.
	 *
	 *  @date    27/12/18
	 *  @since   5.8.0
	 *
	 *  @param   void
	 *  @return  void
	 */
	function render() {
		$notice_text    = $this->get( 'text' );
		$notice_type    = $this->get( 'type' );
		$is_dismissible = $this->get( 'dismissible' );

		printf(
			'<div class="acf-admin-notice notice notice-%s %s">%s</div>',
			esc_attr( $notice_type ),
			$is_dismissible ? 'is-dismissible' : '',
			acf_esc_html( wpautop( acf_punctify( $notice_text ) ) )
		);
	}
}