ACF_Admin_Post_Types::render_admin_table_column_field_groups
Renders the field groups attached to the post type in the list table.
Метод класса: ACF_Admin_Post_Types{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ACF_Admin_Post_Types = new ACF_Admin_Post_Types(); $ACF_Admin_Post_Types->render_admin_table_column_field_groups( $post_type );
- $post_type(массив) (обязательный)
- The main post type array.
Список изменений
| С версии 6.1 | Введена. |
Код ACF_Admin_Post_Types::render_admin_table_column_field_groups() ACF Admin Post Types::render admin table column field groups ACF 6.4.2
public function render_admin_table_column_field_groups( $post_type ) {
$field_groups = acf_get_field_groups( array( 'post_type' => $post_type['post_type'] ) );
if ( empty( $field_groups ) ) {
echo '<span class="acf-emdash" aria-hidden="true">—</span>';
echo '<span class="screen-reader-text">' . esc_html__( 'No field groups', 'acf' ) . '</span>';
return;
}
$labels = wp_list_pluck( $field_groups, 'title' );
$limit = 3;
$shown_labels = array_slice( $labels, 0, $limit );
$hidden_labels = array_slice( $labels, $limit );
$text = implode( ', ', $shown_labels );
if ( ! empty( $hidden_labels ) ) {
$text .= ', <span class="acf-more-items acf-js-tooltip" title="' . implode( ', ', $hidden_labels ) . '">+' . count( $hidden_labels ) . '</span>';
}
echo acf_esc_html( $text );
}