ACF_Admin_Internal_Post_Type_List::render_admin_table_column_local_statuspublicACF 5.9.0

Displays the local JSON status of an ACF post.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ACF_Admin_Internal_Post_Type_List = new ACF_Admin_Internal_Post_Type_List();
$ACF_Admin_Internal_Post_Type_List->render_admin_table_column_local_status( $post );
$post(массив) (обязательный)
The main ACF post array.

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

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

Код ACF_Admin_Internal_Post_Type_List::render_admin_table_column_local_status() ACF 6.4.2

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