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 | |
/** | |
* Plugin Name: Delete GD post | |
* Plugin URI: http://buddydevelopers.com | |
* Description: plugin to delete Gd posts | |
*/ | |
/** | |
* Place this file in wp-content/mu-plugins/ folder. | |
* |
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 | |
/** | |
* Dequeue core scripts & styles on non GD pages. | |
* | |
* Note: This may cause JavaScript errors when page contains widget/shortcode from GD. | |
*/ | |
function wpdocs_dequeue_script() { | |
if ( class_exists( 'AyeCode_UI_Settings' ) && ! geodir_is_geodir_page() && !is_page('piano-bars') && !is_page('piano-lessons') && !is_page('piano-movers') && !is_page('piano-tuners') && !is_front_page() && !is_page('piano-bars') && !is_page('piano-lessons') && !is_page('piano-movers') && !is_page('piano-tuners') && wp_get_post_parent_id( get_the_ID() ) != 2886 ) { | |
wp_dequeue_script( 'bootstrap-js-bundle' ); | |
wp_dequeue_style( 'ayecode-ui' ); |
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 | |
add_shortcode( 'buddy-add-to-calender', 'buddy_add_to_calender' ); | |
function buddy_add_to_calender( $atts, $content = "" ) { | |
$event_id = get_the_ID(); | |
global $gd_post; | |
$event_details = maybe_unserialize($gd_post->event_dates); | |
$title = get_the_title( $event_id ); | |
if( !empty( $event_details['start_date'] ) && !empty( $event_details['start_date'] )){ | |
$start_date = $event_details['start_date'] .' '.$event_details['start_time']; | |
$end_date = $event_details['end_date'] .' '.$event_details['end_time']; |
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 | |
add_shortcode( 'gd_access_denied', 'restrict_user_access_for_other_profile' ); | |
function restrict_user_access_for_other_profile( $atts ) { | |
if( !is_uwp_current_user_profile_page() && !current_user_can('administrator') ){ // if its users profile. | |
wp_redirect( home_url() ); exit; | |
} | |
} |
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 | |
add_filter( 'geodir_pagination_args', 'geodir_pagination_args_custom_callback', 10, 1 ); | |
function geodir_pagination_args_custom_callback( $args ){ | |
global $wp_query; | |
$args = array( | |
'base' => esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ), | |
'format' => '', | |
'add_args' => false, | |
'current' => max( 1, get_query_var( 'paged' ) ), | |
'total' => $wp_query->max_num_pages, |
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 | |
add_filter( 'kadence_post_layout', 'buddy_check_condition' ); | |
function buddy_check_condition() { | |
$boxed = 'boxed'; | |
$layout = 'normal'; | |
$feature = 'hide'; | |
$f_position = 'above'; | |
$comments = 'hide'; |
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 | |
add_filter( 'geodir_search_terms_where', 'geodir_search_terms_where_custom_callback'); | |
function geodir_search_terms_where_custom_callback( $terms_where ){ | |
if ( geodir_is_page( 'search' ) ) { | |
global $wpdb, $geodir_post_type, $plugin_prefix, $dist, $snear, $s, $s_A, $s_SA, $search_term, $geodirectory; | |
$searc_term_names = explode( ' ', $s ); | |
$table = geodir_db_cpt_table( $geodir_post_type ); | |
$s = trim( $s ); | |
$s = wp_specialchars_decode( $s, ENT_QUOTES ); | |
$s_A = wp_specialchars_decode( $s_A, ENT_QUOTES ); |
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 | |
// non class stuff | |
add_action( 'wp_footer', 'wpdev_170663_remove_parent_theme_stuff', 0 ); | |
function wpdev_170663_remove_parent_theme_stuff() { | |
remove_action('wp_footer','geodir_location_autocomplete_script'); | |
} | |
| |
add_action( 'wp_footer', 'geodir_location_autocomplete_script' ); | |
function geodir_location_autocomplete_script() { | |
global $geodirectory, $gd_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
// < ES5 | |
function x( n1, n2 ){ | |
return n1 + n2; | |
} | |
console.log(x(9,2)); | |
// ES5 | |
var y = function(n1, n2){ | |
return n1 + n2; | |
} |
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 | |
/** | |
* This code create a shortcode [buddy-overall-rating]. | |
* It can be used on archive item template. | |
*/ | |
add_shortcode( 'buddy-overall-rating', function($args){ | |
$plugin_public = new GeoDir_Review_Rating_Manager_Public(); | |
return $plugin_public->show_overall_multiratings(); | |
}); |