This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$floor_units = $property->floor_units; | |
if ( isset($floor_units->floor_unit) ) | |
{ | |
echo '<h4>Available Area</h4>'; // WILL BECOME DESCRIPTION TITLE | |
$total_size = 0; | |
// INSTEAD OF ECHO'ING SHOULD BE STORED AS DESCRIPTION TEXT/CONTENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import AI field into custom field added using our free Template Assistant add on | |
add_action( "propertyhive_property_imported_agentsinsight_xml", 'import_custom_field', 10, 2 ); | |
function import_custom_field($post_id, $property) | |
{ | |
update_post_meta( $post_id, '_url', (string)$property->url ); | |
} | |
// Customise the fields used in the AI import | |
add_action( "propertyhive_property_imported_agentsinsight_xml", 'customise_description_fields', 10, 2 ); | |
function customise_description_fields( $post_id, $property ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'propertyhive_map_infowindow_html', 'change_map_link_target' ); | |
function change_map_link_target( $html ) | |
{ | |
$html = "<div class=\"property\"><div class=\"image\"><a href=\"' + property.link + '\" target=\"_parent\"><img src=\"' + property.image + '\" alt=\"' + property.address + '\"></a></div><div class=\"details\"><div class=\"address\"><a href=\"' + property.link + '\" target=\"_parent\">' + property.address + '</a></div><div class=\"price\">' + property.price + ' <span class=\"price-qualifier\">' + property.price_qualifier + '</span></div><div class=\"summary\">' + summary_html + '</div></div><div style=\"clear:both\"></div></div>"; | |
return $html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'propertyhive_property_map_marker_options', 'add_marker_icon' ); | |
function add_marker_icon() | |
{ | |
?> | |
marker_options.icon = 'URL HERE'; | |
<?php | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Component Usage | |
// Data for options | |
$users = \App\User::limit(6)->get()->transform(fn($user) => [ | |
'id' => $user->id, | |
'title' => $user->name, | |
'subtitle' => $user->email | |
]); | |
// Usage in view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An example script consuming an API with various throttling and 429 error | |
// handling strategies. | |
// | |
// Blog post with more context | |
// https://www.useanvil.com/blog/2021-03-29-throttling-and-consuming-apis-with-429-rate-limits | |
// | |
// License: MIT | |
import fetch from 'node-fetch' | |
import mapLimit from 'async/mapLimit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Livewire\Components; | |
use Livewire\Component; | |
class PdfViewer extends Component | |
{ | |
public $openModal = false; | |
public $titleModal = "PDF Viewer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
const $root = $( '#root' ); | |
const $stage1 = $( '.stage-1', $root ); | |
const $stage2 = $( '.stage-2', $root ); | |
// If there's no GET string, then no credentials have been passed back. Let's get them. | |
if ( ! window.location.href.includes('?') ) { | |
// Stage 1: Get the WordPress Site URL, Validate the REST API, and Send to the Authentication Flow | |
const $urlInput = $( 'input[type=url]', $stage1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Livewire; | |
use App\Models\Tag; | |
use Illuminate\View\View; | |
use Illuminate\Contracts\View\Factory; | |
use Illuminate\Contracts\Container\BindingResolutionException; | |
use Livewire\Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media screen and (max-width: 991px) { | |
/* Your responsive CSS */ | |
} | |
@media screen and (max-width: 767px) { | |
/* Your responsive CSS */ | |
} | |
@media screen and (max-width: 479px) { | |
/* Your responsive CSS */ | |
} |
NewerOlder