name = esc_html__( 'Property Floorplans', 'propertyhive' ); $this->icon = '|'; } public function get_fields() { $fields = array(); return $fields; } public function render( $attrs, $content, $render_slug ) { $post_id = get_the_ID(); $property = new PH_Property($post_id); if ( !isset($property->id) ) { return; } ob_start(); if ( get_option('propertyhive_floorplans_stored_as', '') == 'urls' ) { $floorplan_urls = $property->_floorplan_urls; if ( is_array($floorplan_urls) && !empty( $floorplan_urls ) ) { echo '
'; echo '

' . esc_html(__( 'Floorplans', 'propertyhive' )) . '

'; foreach ($floorplan_urls as $floorplan) { echo ''; } echo '
'; } } else { $floorplan_attachment_ids = $property->get_floorplan_attachment_ids(); if ( !empty($floorplan_attachment_ids) ) { echo '
'; echo '

' . esc_html(__( 'Floorplans', 'propertyhive' )) . '

'; foreach ( $floorplan_attachment_ids as $attachment_id ) { if ( wp_attachment_is_image($attachment_id) ) { echo ''; } else { echo '' . esc_html(__( 'View Floorplan', 'propertyhive' )) . ''; } } echo '
'; } } return $this->_render_module_wrapper( ob_get_clean(), $render_slug ); } }