lp__render_field_group_form_fields( $term = null, $taxonomy = null, $args = [] )
Reads the content of a file and returns it as a string with a line limit. You can specify whether to limit from the first or last lines and provide additional text to indicate truncated content.
Plugin
Namespace
Launchpad
Parameters
string
$file_path
The path of the file.
array
$limit_args
Array containing line, type, and text keys.
Return
string
The content of the file or an error message.
Source
File: \includes\lp-field-group-functions.php
function lp__render_field_group_form_fields( $term = null, $taxonomy = null, $args = [] ){
if( $args ){
$tabs = lp__fields_query( array(
'parent' => lp__array_key_value( 'id', $args ),
'type' => 'tab',
) );
$first_tab_placement = 'top';
$tab_count = count( $tabs );
if( $tab_count && isset( $tabs[0]['placement'] ) ){
$first_tab_placement = $tabs[0]['placement'];
}
$template_args = array(
'tabs' => array(
'count' => $tab_count,
'placement' => $first_tab_placement,
'fields' => $tabs,
),
'field_group' => $args
);
if( $term instanceof WP_Term ){
$template_args['data'] = $term;
$template_args['context'] = 'term';
} else {
$template_args['data'] = $taxonomy;
$template_args['context'] = 'taxonomy';
}
lp__get_template_part( 'admin/partials/lp-field', 'group-fields', $args['active'], false, $template_args );
}
}