Plugin function to Call WCK Custom Field not Working
-
Hi! I have a question about whether or not the function below should work – it’s loaded into the functions.php file, and the idea would be that it calls a custom field (which is successfully called elsewhere) into an infobox on a map. Here is what the plugin author starts with:
function cspm_custom_infobox_description($default_description, $post_id){ $custom_content = "YOUR CUSTOM CONTENT HERE."; return (!empty($custom_content)) ? $custom_content : $default_description; } add_filter("cspm_custom_infobox_description", "cspm_custom_infobox_description", 10, 2); add_filter("cspm_large_infobox_content", "cspm_custom_infobox_description", 10, 2);
And this is what I would like to work:
function cspm_custom_infobox_description($default_description, $post_id){ $custom_content = "<?php get_cfc_field('locations','web-address');" ; return (!empty($custom_content)) ? $custom_content : $default_description; } add_filter("cspm_custom_infobox_description", "cspm_custom_infobox_description", 10, 2); add_filter("cspm_large_infobox_content", "cspm_custom_infobox_description", 10, 2);
So, essentially just dropping in a call to the function, which when I use it in html works fine, but here it’s a PHP variable. Can anyone please tell me what I’m doing wrong here?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Plugin function to Call WCK Custom Field not Working’ is closed to new replies.