Good evening, I’m sorry for English.
I have worked in a small CRM solution trying to automate the way the pages are built
Basically, in the user profile, list all forms that he has linked data.
And here it was okay. BUT….
I would like to organize my layouts with forms being displayed by their functions
So, I have two questions:
First:
Adding a custom field option in group settings?
Second:
How to recover the information saved in the settings field group?
I got here, but I need help to interpret the information returned:
// Get data from post
$postmeta = get_post_meta( 35 );
print_r($postmeta);
echo '<br><br><br>';
// Get used fields in post
if (!empty($postmeta)){
$filter='field_';
foreach($postmeta as $metafields){
if(strpos($metafields[0],$filter)!==false){
$usedfileds[] .= $metafields[0];
}
}}
print_r($usedfileds);
echo '<br><br><br>';
// Get Relational Meta
foreach($usedfileds as $filde){
global $wpdb;
$post = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type='acf-field'", $filde ));
$metaid[] .= $post;
}
print_r($metaid);
echo '<br><br><br>';
// GET ID GROUPS
foreach($metaid as $groupfield){
global $wpdb;
$groupid[] .= $wpdb->get_var( $wpdb->prepare( "SELECT post_parent FROM $wpdb->posts WHERE ID = %s", $groupfield ));
}
print_r($groupid);
$groupid = array_unique($groupid);
echo '<br><br><br>';
// GET Groups option
foreach($groupid as $groupa){
global $wpdb;
echo $groupa = $wpdb->get_var( $wpdb->prepare( "SELECT post_content FROM $wpdb->posts WHERE ID = %s", $groupa ));
}
print_r($groupa);
Thank you in advance any help and grateful for any suggestion.