php – Calling a plugin function in a template


I’m using the WP-property plugin with the import addon. It imports properties from a local MLS. In the property edit screen, it displays the last import time and date in the meta box. I need to display this on the font end. (The plugin docs don’t provide a way to do this).

I found the function that displays this time and date (it is edited to suit my needs for a font-end display)

  static public function wpp_publish_box_options( $id ) {
global $post, $wp_properties;

if( !$wpp_import_schedule_id = get_post_meta( $post->ID, 'wpp_import_schedule_id', true ) ) {

//** Get time stamp from new format ( Version 2.6.0+ ) */
$import_time = get_post_meta( $post->ID, 'wpp_import_time', true );

//** Get time stamp from old meta_key ( pre-version 2.6.0 ) if new meta_key does not exist */
if( empty( $import_time ) ) {
  $import_time = get_post_meta( $post->ID, 'wpp_xml_import', true );

if( !empty( $import_time ) ) {
  $import_time = date_i18n( __( 'M j, Y @ G:i', ud_get_wpp_importer()->domain ), strtotime( $import_time ) );

  <div class="misc-pub-section xml_import_time misc-pub-section-last">
    <span class="wpp_i_time_stamp"><?php printf( __( 'Imported on: <b>%1$s</b>', ud_get_wpp_importer()->domain ), $import_time, $import_url, $import_name ); ?>


But when I add this (as a shortcode) I get a critical error. I’m using another plugin to create the shortcode easily.

I’ve also tried just using the HTML within the divs (also via shortcode) hoping that the function is firing anyhow, but no go. I’m wondering if it only fires on the backend.

Any help on this? I’ve been at it for a while and I think my brain is fried.

Rebecca Skane Carter 1 month 2021-05-06T13:06:03-05:00 0 Answers 0 views 0

Leave an answer