ACF_Admin_Internal_Post_Type_List::render_admin_table_column_local_status
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 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>';
}
}