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. |
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
// Change load add listing map language in current WPML language. | |
function gd_wpml_default_map_language( $language ) { | |
if ( defined( 'ICL_LANGUAGE_CODE' ) ) { | |
$wpml_language = ICL_LANGUAGE_CODE; | |
if ( $wpml_language == 'en' ) { | |
$language = 'en'; | |
} else if ( $wpml_language == 'fr' ) { | |
$language = 'fr'; | |
} |
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 | |
function gd_success_page_msg_show_upgrade_link( $message, $post, $user_info ) { | |
if ( !empty( $post ) && defined( 'GEODIRPAYMENT_VERSION' ) && is_user_logged_in() && $post->post_author == get_current_user_id() ) { | |
if ( strpos( $message, '[#show_upgrade_link#]' ) !== false ) { | |
$post_id = $post->ID; | |
$package_id = geodir_get_post_meta( $post_id, 'package_id', true ); | |
if ( !empty( $_REQUEST['pid'] ) ) { | |
$post_id = (int)$_REQUEST['pid']; | |
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 | |
// Show listing description on bubble map ( before custom fields ) | |
function gd_profile_description_on_map_bubble_before( $post_id, $post_info, $post_preview ) { | |
if ( !empty( $post_info->post_id ) ) { | |
global $post; | |
$temp_post = $post; | |
$post = get_post( $post_info->post_id ); | |
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 | |
/* START */ | |
// GeoDirectory: Display event schedule as a tab on event detail page. | |
function gd_show_event_schedule_as_tab( $template ) { | |
if ( has_filter( 'geodir_detail_page_sidebar_content', 'geodir_event_detail_page_sitebar_content' ) ) { | |
remove_filter( 'geodir_detail_page_sidebar_content', 'geodir_event_detail_page_sitebar_content', 2 ); | |
add_filter( 'geodir_detail_page_tab_list_extend', 'gd_detail_page_tab_event_schedule', 10, 1 ); | |
add_action( 'geodir_after_tab_content', 'gd_detail_page_tab_content_event_schedule', 10, 1 ); |
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
// Display price packages as a select list | |
function gd_build_payment_select_list() { | |
global $post, $package_id; | |
$listing_type = !empty( $_REQUEST['listing_type'] ) ? sanitize_text_field( $_REQUEST['listing_type'] ) : ''; | |
$listing_type = empty( $listing_type ) && !empty( $post->post_type ) ? $post->post_type : $listing_type; | |
if ( isset( $_REQUEST['package_id'] ) ) { | |
$package_id = $_REQUEST['package_id']; | |
} else if ( !empty( $post->package_id ) ) { |
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
// Change 'Everywhere' text in location description. | |
function gd_custom_location_description_everywhere_text( $everywhere_text ) { | |
$everywhere_text = __( 'Kimberley & The Northern Cape', 'geodirectory' ); // Change text here. | |
return $everywhere_text; | |
} | |
add_filter( 'geodir_location_description_everywhere_text', 'gd_custom_location_description_everywhere_text', 10, 1 ); | |
// Add custom text in meta title/description when full location is empty. | |
function gd_custom_meta_description_location_empty_text( $location_text, $location_array, $gd_page, $sep ) { |
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
// Website url as a label | |
function _gd_custom_website_url_as_label( $title, $website, $post_ID ) { | |
//$website = str_replace( array( 'https://', 'http://' ), '', $website ); // Remove comment to hide https:// & http:// from label | |
$website = trim( $website, '/' ); | |
return $website; | |
} | |
add_filter( 'geodir_custom_field_website_name', '_gd_custom_website_url_as_label', 10, 3 ); |
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 | |
function _gd_custom_create_event_from_data() { | |
global $wpdb, $gd_session; | |
$gd_post = array(); | |
$gd_post['post_type'] = 'gd_event'; | |
$gd_post['status'] = 'publish'; | |
$gd_post['title'] = 'Italian Market Festival'; | |
$gd_post['content'] = 'There is so much great eating in and around the Italian Market that you will want to return again and again.'; |