Hi, I need to output a custom function via ACF fields. I didnt really get yet how this works:
add_filter('e2pdf_model_shortcode_e2pdf_wp_response', 'e2pdf_model_shortcode_e2pdf_wp_response_imodatens', 10, 3);
function e2pdf_model_shortcode_e2pdf_wp_response_imodatens($response, $atts, $value) {
if (isset($atts['key']) && $atts['key'] == 'imodatens') {
$id = isset($atts['id']) ? $atts['id'] : false;
if ($id) { // Getting Post ID
$wohnflaeche = get_field('wohnflache', $id);
$grundstuecksflaeche = get_field('grundstuecksflaeche', $id);
$schlafzimmer = get_field('schlafzimmer', $id);
$badezimmer = get_field('badezimmer', $id);
}
}
$response = '<strong>Grundstücksfläche:</strong> '.$grundstuecksflaeche.' <strong>Wohnfläche: </strong>'.$wohnflaeche.' <strong>Schlafzimmer:</strong> '.$schlafzimmer.'<strong> Badezimmer:</strong> '.$badezimmer;
return $response;
}
My template shortcode "[e2pdf-wp key="imodatens"]" is working, but all the other shortcodes are messed up - they all show my $response content now. But i only want the $response output there where i put the shortcode in.
Thanks four your help