Hi Masikonis,
I recently installed your plugin and very much like the simplicity. During implementation I saw the need of multi country display/hide, so I would like to suggest add to the plugin repo 2 new functions or modification of the existent ones.
Here are the new functions:
add_shortcode( 'geolocator_multi_show', array( $this, 'geolocatorMultipleShowShortcode' ) );
add_shortcode( 'geolocator_multi_hide', array( $this, 'geolocatorMultipleHideShortcode' ) );
function geolocatorMultipleShowShortcode( $attributes, $content = null ) {
$location = $this->location;
if( ! empty( $location ) && array_key_exists( 'for', $attributes ) ) {
$for = trim( $attributes['for'] ); // Country 2-letter ISO code
if ( strpos($for,',') !== FALSE ) {
if ( in_array( $location['country'], explode(',', $for) ) ) {
return $start_tags . $content . $end_tags;
}
} else {
if( $location['country'] == $for ) {
return $start_tags . $content . $end_tags;
}
}
}
return '';
}
function geolocatorMultipleHideShortcode( $attributes, $content = null ) {
$location = $this->location;
if( ! empty( $location ) && array_key_exists( 'for', $attributes ) ) {
$for = trim( $attributes['for'] ); // Country 2-letter ISO code
if ( strpos($for,',') !== FALSE ) {
if ( ! in_array( $location['country'], explode(',', $for) ) ) {
return $start_tags . $content . $end_tags;
}
} else {
if( $location['country'] !== $for ) {
return $start_tags . $content . $end_tags;
}
}
}
return '';
}
Hope this helps extending the functionality ??
]]>Hi, I am unable to delete after deactivating. Rename in plugin directory and reinstall results in two instances of Geolocators…
Please help.
thanks,
andy
Hello,
I installed and see this page:
wp-admin/options-general.php?page=geolocator_options
Please explain how to install this plugin in a WordPress page or post.
Where is the output? What page does the location of the user show up on?
]]>