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 | |
// Fixing Google Maps error "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." | |
function geodirectory_fix_multiple_google_maps_api() { | |
$dequeue_handle = 'google-maps'; // script handle to dequeue script | |
if ( wp_script_is( 'geodirectory-googlemap-script', 'enqueued' ) && wp_script_is( $dequeue_handle, 'enqueued' ) ) { | |
wp_dequeue_script( $dequeue_handle ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'geodirectory_fix_multiple_google_maps_api', 101 ); |
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 // YOU MOST LIKELY DON'T NEED THIS LINE, SO DON'T COPY PASTE THIS LINE WITH BELOW CODE | |
/***** CODE STARTS HERE *****/ | |
// Display the event date in more info tab on event detail page. | |
function gd_event_date_in_more_info_tab() { | |
// The $post var contains all the listing info so we can add conditions. | |
global $post; | |
// Only show if the post type is "gd_event". |
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 // YOU MOST LIKELY DON'T NEED THIS LINE, SO DON'T COPY PASTE THIS LINE WITH BELOW CODE | |
/***** CODE STARTS HERE *****/ | |
// Display all business listings in businesses dropdown list on event add/edit page. | |
function geodirectory_event_show_business_fields_html() { | |
global $wpdb, $post, $current_user, $post_info, $gd_session; | |
$package_info = array(); | |
$package_info = geodir_post_package_info( $package_info , $post ); |
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 // YOU MOST LIKELY DON'T NEED THIS LINE, SO DON'T COPY PASTE THIS LINE WITH BELOW CODE | |
/***** CODE STARTS HERE *****/ | |
// Filter the linked cpt layout. | |
function geodirectory_cpt_linked_listing_view( $layout ) { | |
$layout = 'gridview_onehalf'; // one of gridview_onehalf, gridview_onethird, gridview_onefourth, gridview_onefifth, listview | |
return $layout; | |
} |
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
if (!function_exists('gd_geodir_booster_exclude_js')) { | |
// Fix HTML 5 Map and GD booster caching | |
function gd_geodir_booster_exclude_js( $continue, $content ) { | |
if (strpos($content, "uscanadahtml5map_js_data=true") !== false || strpos($content, "var BPLA_data = {") !== false || strpos($content, "callback=bp_location_profile.initMap") !== false || strpos($content, "/bp-location-autocomplete.min.js") !== false || strpos($content, "/jquery.js") !== false || (strpos($content, "new FlaShopUSCanadaMap(") !== false && strpos($content, "html5map_onclick(") !== false)) { | |
$continue = true; | |
} | |
return $continue; | |
} | |
} |
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
/** | |
* Adding a custom field to the Invoicing checkout form. | |
* | |
* Covers: | |
* | |
* Adding the alternate phone & company short description fields to the checkout. | |
* Making the alternate phone field mandatory. | |
* Setting an error when the alternate phone field is empty. | |
* Storing the alternate phone & company short description fields into the invoice payment meta. | |
* Adding the alternate phone & company short description to the invoice view/print page. |
OlderNewer