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 custom field to the custom field list. | |
* | |
* @param array $custom_fields { | |
* The custom fields array to be filtered. | |
* | |
* @type string $field_type The type of field, eg: text, datepicker, textarea, time, checkbox, phone, radio, email, select, multiselect, url, html, file. | |
* @type string $class The class for the field in backend. |
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_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_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 | |
/** | |
* 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
<?xml version="1.0"?> | |
<ruleset name="WordPress Develop"> | |
<rule ref="WordPress" /> | |
</ruleset> |
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 | |
// og:title | |
add_filter('wpseo_opengraph_title', 'wpseo_opengraph_title_callback'); | |
function wpseo_opengraph_title_callback( $title ){ | |
// do something here. | |
return $title; | |
} | |
// og:description | |
add_filter('wpseo_opengraph_desc', 'wpseo_opengraph_desc_callback'); | |
function wpseo_opengraph_desc_callback( $ogdesc ){ |
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 | |
/** | |
* I am changing map popup layout of gd_places here. | |
*/ | |
add_filter('geodir_get_template_part', 'geodir_get_template_part_callback', 10, 3); | |
function geodir_get_template_part_callback( $template, $slug, $name ){ | |
global $gd_post; | |
if( 'gd_place' === $gd_post->post_type ){ | |
?> |
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 | |
/** | |
* code to trigger comment email on comment submission. | |
*/ | |
add_action( 'init', 'gd_custom_comment_post' ); | |
function gd_custom_comment_post() { | |
remove_action( 'comment_post', 'geodir_new_comment_notify_postauthor', 99999, 1 ); | |
add_filter( 'geodir_should_notify_comment_author', 'geodir_should_notify_comment_author_custom_callback', 10, 2); | |
add_filter( 'geodir_should_notify_listing_author', 'geodir_should_notify_listing_author_custom_callback', 10, 2 ); | |
add_action( 'comment_post', 'geodir_custom_notify_on_comment_approved', 99999, 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
/** | |
* code to trigger comment email on comment submission. | |
*/ | |
add_action( 'init', 'gd_custom_comment_post' ); | |
function gd_custom_comment_post() { | |
remove_action( 'comment_post', 'geodir_new_comment_notify_postauthor', 99999, 1 ); | |
add_filter( 'geodir_should_notify_comment_author', 'geodir_should_notify_comment_author_custom_callback', 10, 2); | |
add_filter( 'geodir_should_notify_listing_author', 'geodir_should_notify_listing_author_custom_callback', 10, 2 ); | |
add_action( 'comment_post', 'geodir_custom_notify_on_comment_approved', 99999, 1 ); | |
} |