Skip to content

Instantly share code, notes, and snippets.

View wpflippercode's full-sized avatar

Sandeep Kumar wpflippercode

View GitHub Profile
@wpflippercode
wpflippercode / gist:6c9aa8d02d52201fc63b87b6c7dffd85
Created December 2, 2016 13:30
Remove Profile Picture section on Edit Profile Page
add_action('admin_head','fc_remove_profile_image');
function fc_remove_profile_image(){
echo '<script>
jQuery(document).ready(function(){
jQuery("tr.user-profile-picture").remove();
});
</script>';
@wpflippercode
wpflippercode / gist:41ad368360d2d140da4a253d11e7cd28
Created April 25, 2017 09:34
Show All Locations on The Map
add_filter('wpgmp_location_criteria','wpgmp_location_criteria',1,2 );
function wpgmp_location_criteria($criteria,$map) {
$criteria['show_all_locations'] = true;
return $criteria;
}
@wpflippercode
wpflippercode / gist:18f9b3a1205af57b7e7d92b9a0d0fdd8
Created June 16, 2017 11:55
Set Minimum Age By Category in Age Gate WordPress Plugin
add_filter('agp_current_settings', 'agp_current_settings',1,1);
function agp_current_settings($options) {
if(is_category('beer')) {
$options['min_age'] = 16;
} elseif(is_category('spirits')) {
$options['min_age'] = 18;
}
@wpflippercode
wpflippercode / gist:b2a88cdfd88b7332112e2f650f86439b
Created June 20, 2017 04:41
Show Single Post's Location on the Map on single post page.
<?php
$CURRENTPOST_LAT = get_post_meta(get_the_ID(),'_wpgmp_metabox_latitude',true);
$CURRENTPOST_LON = get_post_meta(get_the_ID(),'_wpgmp_metabox_longitude',true);
echo do_shortcode("[display_map marker1='$CURRENTPOST_LAT | $CURRENTPOST_LON | hello world | Bla Bla | category']");
?>
@wpflippercode
wpflippercode / gist:d59d0e7d8986b7f008acb484c8628477
Last active September 8, 2017 05:38
Show Locations by Category on the google maps
add_filter('wpgmp_location_criteria', 'wpgmp_location_criteria',1,2 );
function wpgmp_location_criteria($location_criteria,$map) {
//This will apply for map id 1.
if( $map->map_id == 1) {
$location_criteria['show_all_locations'] = true;
$location_criteria['category__in'] = array(1,2,3); // You can use category name as well.
}
return $location_criteria;
@wpflippercode
wpflippercode / gist:bc2eb104cc0250a2b66187e54f5327ad
Created July 3, 2017 12:15
Change Google Maps Zoom Level According to Page
add_filter('wpgmp_maps_options','wpgmp_maps_options',2,1);
function wpgmp_maps_options($options,$map) {
//Here You can change zoom level according to the page.
if(is_home()) {
$options['zoom'] = 10;
} else if ( is_page('map-locator') ) {
$options['zoom'] = 15;
}
return $options;
}
@wpflippercode
wpflippercode / gist:90ec9cfb90784dca85726c669a339967
Created September 8, 2017 05:43
Show all Locations on the google maps without assigning them to the map manually.
add_filter('wpgmp_location_criteria', 'wpgmp_location_criteria',1,2 );
function wpgmp_location_criteria($location_criteria,$map) {
//This will apply for map id 1.
if( $map->map_id == 1) {
$location_criteria['show_all_locations'] = true;
}
return $location_criteria;
@wpflippercode
wpflippercode / gist:4bb2cd13c6a26a08ec2a642a3c96b872
Created September 8, 2017 05:49
Show Locations on the maps by exlcuding certain categories.
add_filter('wpgmp_location_criteria', 'wpgmp_location_criteria',1,2 );
function wpgmp_location_criteria($location_criteria,$map) {
//This will apply for map id 1.
if( $map->map_id == 1) {
$location_criteria['show_all_locations'] = true;
$location_criteria['category__not_in'] = array(1,2); // You can use category name as well.
}
return $location_criteria;
@wpflippercode
wpflippercode / gist:f94dee4927d24e771e2c8670cea84b32
Created September 8, 2017 06:35
Limit Number of Markers on the google maps
add_filter('wpgmp_location_criteria', 'wpgmp_location_criteria',1,2 );
function wpgmp_location_criteria($location_criteria,$map) {
//This will apply for map id 1.
if( $map->map_id == 1) {
$location_criteria['limit'] = 5;
}
return $location_criteria;
@wpflippercode
wpflippercode / gist:8f7700f850a891cfc4c491fc3e568aed
Created September 8, 2017 06:47
Modify Info Window Message Page Wise.
add_filter('wpgmp_infowindow_message', 'wpgmp_infowindow_message',1,2 );
function wpgmp_infowindow_message($message,$map) {
global $post;
if( $post->ID == 1) {
$message = "<h1>{marker_title}</h1>";
}
if( $post->ID == 2) {