'names' ] ); $community = get_post_meta( $post_id, 'abddir_community', true ); $country = get_post_meta( $post_id, 'abddir_country', true ); // Per-directory settings for address format and type labels $listing_dir_id = intval( get_post_meta( $post_id, 'abddir_directory_id', true ) ); $_listing_dir_s = abddir_get_directory_settings( $listing_dir_id ); $_listing_dir_type = $_listing_dir_s['type'] ?? 'business'; $_addr_fmt = $_listing_dir_s['address_format'] ?? 'us'; $addr_line1 = implode( ', ', array_filter( [ $address, $address2 ] ) ); if ( $_addr_fmt === 'international' ) { $addr_line2 = implode( ', ', array_filter( [ $city, $state, $zip, $country ] ) ); } else { $addr_line2 = implode( ', ', array_filter( [ $city, $state ? $state . ' ' . $zip : $zip ] ) ); } $socials = array_filter( [ 'facebook' => $facebook, 'instagram' => $instagram, 'twitter' => $twitter, 'linkedin' => $linkedin, 'youtube' => $youtube, 'tiktok' => $tiktok, 'pinterest' => $pinterest, ] ); // Find the directory page for the back link — match by directory ID $directory_url = ''; $fallback_url = ''; foreach ( get_pages() as $page ) { if ( ! has_shortcode( $page->post_content, 'abddir_directory' ) ) continue; if ( ! $fallback_url ) $fallback_url = get_permalink( $page->ID ); if ( $listing_dir_id ) { preg_match_all( '/\[abddir_directory[^\]]*\bid=["\']?(\d+)["\']?/i', $page->post_content, $m ); if ( ! empty( $m[1] ) && in_array( (string) $listing_dir_id, $m[1] ) ) { $directory_url = get_permalink( $page->ID ); break; } } } if ( ! $directory_url ) $directory_url = $fallback_url; ?>
Back to Directory

Contact Information

'; ?>