I am trying to save a page that contains shortcodes that I developed using types_render_field
Part of the code:
function uvt_show_adsl() {
ob_start();
$args = array(
'post_type' => 'internet-connection',
'post_status' => 'publish',
'suppress_filters' => TRUE,
'posts_per_page' => '4',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'service-type',
'field' => 'slug',
'terms' => 'adsl'
),
array(
'taxonomy' => 'service-type',
'field' => 'slug',
'terms' => 'annex-m'
)
)
);
$services = array();
$results = new WP_Query($args);
if ($results->have_posts()) {
while ($results->have_posts()) {
$results->the_post();
$services[types_render_field('service-order', array())] =
array('daisy-product-code' => types_render_field('daisy-product-code', array()),
'service-name' => get_the_title(),
'installation-charge' => types_render_field('installation-charge', array()),
'installation-charge-tip' => types_render_field('installation-charge-tip', array()),
'migration-charge' => types_render_field('migration-charge', array()),
'migration-charge-tip' => types_render_field('migration-charge-tip', array()),
'termination-charge' => types_render_field('termination-charge', array()),
'usage' => types_render_field('usage', array()),
'static-ip-address-included' => types_render_field('static-ip-address-included', array()),
'30-days-price' => types_render_field('30-days-price', array()),
'12-months-price' => types_render_field('12-months-price', array()),
'24-months-price' => types_render_field('24-months-price', array()),
'download-speed' => types_render_field('download-speed', array()),
'upload-speed' => types_render_field('upload-speed', array())
);
}
}
The code works and show all the information: hidden link but I can't update the page because it returns 500 error and when I check the error log, this is what is in there:
AH01071: Got error 'PHP message: PHP Fatal error: Call to undefined function types_render_field() in /var/www/vhosts/ultraview.net/httpdocs/wp-content/themes/ultraview-telecom/inc/shortcodes/shortcodes.inc on line 115\n', referer: hidden link