Custom Output of Types repeating fields

Customize the output of repeating Fields as you like.

Also, holds function to get Attachment Data from its URL.
//This allows us to grab the ID of an attachement by it's URL)
function pippin_get_image_id($image_url) {
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
return $attachment[0];
}

ShortCode callback
add_shortcode( 'my_file_name', 'my_file_name_func'); // Actually activate the shortcode
function my_file_name_func($atts) {
global $post; // So we can get the post meta later on

//define ShortCode attr prefix
$types = "wpcf-{$atts['types_field']}";

if ($types) { // if the types_field argument was provided

$urls = get_post_meta($post->ID,$types); // let's get the (potentially multiple) values

$content = ''; // Setting up a variable to hold the links so we can return it later

foreach ($urls as $fileurl) { // Let's iterate for each of the multiple values
$arr = explode('/',$fileurl); // Split it up so that we can just grab the end part, the filename
$id = pippin_get_image_id($fileurl);
$title = get_the_title($id);
$content .= $title . '
'; // Create whatever HTML and store it in the $content variable
}

return $content; // Return the content as the shortcode value

}

}

ShortCode to use:
[my_file_name types_field="toolset-file-field"]

Of course you can extend the callback ad infinitum.

Order taxonomy terms in ASC order while generating dynamic post title using CRED

To get hierarchical taxonomy terms sort in a ASC order you need to add “orderby” clause with WP function: wp_get_post_terms(). you can use term_id with orderby clause. Could you please try following code:


add_action('cred_save_data','func_custom_post_title',10,2);
function func_custom_post_title($post_id,$form_data) {
if ($form_data['id']==XXXX) {
$term_list = wp_get_post_terms($post_id, 'listing-type', array("fields" => "names","orderby"=>"term_id"));
$auctiontype = join("-",$term_list);
$auctiondate = get_post_meta($post_id, 'wpcf-auction-ending', true);
$auctiondate = date('d-m-Y',$auctiondate);

$term_list= wp_get_post_terms($post_id, 'car-brand', array("fields" => "names","orderby"=>"term_id"));
$carbrand = join("-",$term_list);

$title= $auctiontype. ': le ' . $auctiondate. ' - ' . $carbrand;
$args = array('ID' => $post_id, 'post_title' => $title);
wp_update_post($args);
}
}

Ticket URL: https://wp-types.com/forums/topic/get-custom-taxonomy-in-auto-title/#post-519488