ACF_Admin_Field_Groups::render_admin_table_column_local_status()publicACF 5.9.0

Displays the local JSON status of a field group.

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

Хуков нет.

Возвращает

type. Description.

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

$ACF_Admin_Field_Groups = new ACF_Admin_Field_Groups();
$ACF_Admin_Field_Groups->render_admin_table_column_local_status( $field_group );
$field_group (обязательный)
-

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

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

Код ACF_Admin_Field_Groups::render_admin_table_column_local_status() ACF 6.0.4

public function render_admin_table_column_local_status( $field_group ) {
	$json = acf_get_local_json_files();
	if ( isset( $json[ $field_group['key'] ] ) ) {
		$file = $json[ $field_group['key'] ];
		if ( isset( $this->sync[ $field_group['key'] ] ) ) {
			$url = $this->get_admin_url( '&acfsync=' . $field_group['key'] . '&_wpnonce=' . wp_create_nonce( 'bulk-posts' ) );
			echo '<strong>' . __( 'Sync available', 'acf' ) . '</strong>';
			if ( $field_group['ID'] ) {
				echo '<div class="row-actions">
				<span class="sync"><a href="' . esc_url( $url ) . '">' . __( 'Sync', 'acf' ) . '</a> | </span>
				<span class="review"><a href="#" data-event="review-sync" data-id="' . esc_attr( $field_group['ID'] ) . '" data-href="' . esc_url( $url ) . '">' . __( 'Review changes', 'acf' ) . '</a></span>
			</div>';
			} else {
				echo '<div class="row-actions">
				<span class="sync"><a href="' . esc_url( $url ) . '">' . __( 'Import', 'acf' ) . '</a></span>
			</div>';
			}
		} else {
			echo __( 'Saved', 'acf' );
		}
	} else {
		echo '<span class="acf-secondary-text">' . __( 'Awaiting save', 'acf' ) . '</span>';
	}
}