Skip to content

Commit

Permalink
2.0.0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Sep 11, 2018
1 parent 118c03c commit e921461
Show file tree
Hide file tree
Showing 11 changed files with 477 additions and 400 deletions.
9 changes: 3 additions & 6 deletions geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: GeoDirectory
* Plugin URI: https://wpgeodirectory.com/
* Description: GeoDirectory plugin for WordPress.
* Version: 2.0.0.27
* Version: 2.0.0.28
* Author: AyeCode Ltd
* Author URI: https://wpgeodirectory.com
* Text Domain: geodirectory
Expand Down Expand Up @@ -60,7 +60,7 @@ final class GeoDirectory {
*
* @var string
*/
public $version = '2.0.0.27';
public $version = '2.0.0.28';

/**
* GeoDirectory instance.
Expand Down Expand Up @@ -461,7 +461,4 @@ function GeoDir() {
return GeoDirectory::instance();
}
// Global for backwards compatibility.
$GLOBALS['geodirectory'] = GeoDir();

//$post_types = geodir_get_option( 'post_types', array() );
//print_r($post_types);exit;
$GLOBALS['geodirectory'] = GeoDir();
7 changes: 4 additions & 3 deletions includes/admin/class-geodir-admin-dummy-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ public static function add_dummy_address($post_info = array()){
*/
public static function create_dummy_posts( $request ) {


global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$dummy_post_index,$dummy_image_url,$plugin_prefix, $dummy_categories, $dummy_custom_fields, $dummy_posts;
global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$dummy_post_index,$dummy_image_url,$plugin_prefix, $dummy_categories, $dummy_custom_fields, $dummy_posts,$dummy_sort_fields;
// $city_bound_lat1 = geodir_is_valid_lat($request['city_bound_lat1']) ? $request['city_bound_lat1'] : '';
// $city_bound_lng1 = geodir_is_valid_lon($request['city_bound_lng1']) ? $request['city_bound_lng1'] : '';
// $city_bound_lat2 = geodir_is_valid_lat($request['city_bound_lat2']) ? $request['city_bound_lat2'] : '';
Expand Down Expand Up @@ -332,7 +331,7 @@ public static function create_dummy_posts( $request ) {
*/
do_action( 'geodir_insert_dummy_data_loop', $post_type, $data_type, $item_index );
}

// Do the data insert
if($dummy_post_index === 0){

Expand All @@ -351,6 +350,8 @@ public static function create_dummy_posts( $request ) {
foreach ($dummy_sort_fields as $field_index => $field) {
GeoDir_Settings_Cpt_Sorting::save_custom_field($field);
}


}

// insert categories
Expand Down
8 changes: 4 additions & 4 deletions includes/admin/class-geodir-admin-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public static function insert_default_tabs($post_type = 'gd_place'){
'tab_layout' => 'post',
'tab_type' => 'meta',
'tab_name' => __('Profile','geodirectory'),
'tab_icon' => 'fa-home',
'tab_icon' => 'fas fa-home',
'tab_key' => 'post_content',
'tab_content' => '',
'sort_order' => '1',
Expand All @@ -261,7 +261,7 @@ public static function insert_default_tabs($post_type = 'gd_place'){
'tab_layout' => 'post',
'tab_type' => 'standard',
'tab_name' => __('Photos','geodirectory'),
'tab_icon' => 'fa-image',
'tab_icon' => 'fas fa-image',
'tab_key' => 'post_images',
'tab_content' => '[gd_post_images type="gallery" ajax_load="1" slideshow="1" show_title="1" animation="slide" controlnav="1" link_to="lightbox"]',
'sort_order' => '2',
Expand All @@ -274,7 +274,7 @@ public static function insert_default_tabs($post_type = 'gd_place'){
'tab_layout' => 'post',
'tab_type' => 'standard',
'tab_name' => __('Map','geodirectory'),
'tab_icon' => 'fa-globe',
'tab_icon' => 'fas fa-globe-americas',
'tab_key' => 'post_map',
'tab_content' => '[gd_map width="100%" height="325px" maptype="ROADMAP" zoom="0" map_type="post" map_directions="1"]',
'sort_order' => '3',
Expand All @@ -287,7 +287,7 @@ public static function insert_default_tabs($post_type = 'gd_place'){
'tab_layout' => 'post',
'tab_type' => 'standard',
'tab_name' => __('Reviews','geodirectory'),
'tab_icon' => 'fa-comments',
'tab_icon' => 'fas fa-comments',
'tab_key' => 'reviews',
'tab_content' => '',
'sort_order' => '4',
Expand Down
1 change: 1 addition & 0 deletions includes/admin/settings/data_fontawesome.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ function geodir_font_awesome_array() {
'fas fa-glass-martini' => 'f000',
'fas fa-glasses' => 'f530',
'fas fa-globe' => 'f0ac',
'fas fa-globe-americas' => 'f57d',
'fas fa-golf-ball' => 'f450',
'fas fa-graduation-cap' => 'f19d',
'fas fa-greater-than' => 'f531',
Expand Down
4 changes: 2 additions & 2 deletions includes/admin/views/html-admin-page-addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
<div class="clearfix" ></div>

<?php if($current_tab =='addons'){?>
<p><?php printf( __( 'All of our GeoDirectory Addons can be found on GeoDirectory.com here: <a href="%s">GeoDirectory Addons</a>', 'geodirectory' ), 'https://wpgeodirectory.com/downloads/category/addons/' ); ?></p>
<p><?php printf( __( 'All of our GeoDirectory Addons can be found on WPGeoDirectory.com here: <a href="%s">GeoDirectory Addons</a>', 'geodirectory' ), 'https://wpgeodirectory.com/downloads/category/addons/' ); ?></p>
<?php }elseif($current_tab =='themes'){?>
<p><?php printf( __( 'All of our GeoDirectory Themes can be found on GeoDirectory.com here: <a href="%s">GeoDirectory Themes</a>', 'geodirectory' ), 'https://wpgeodirectory.com/downloads/category/themes/' ); ?></p>
<p><?php printf( __( 'All of our GeoDirectory Themes can be found on WPGeoDirectory.com here: <a href="%s">GeoDirectory Themes</a>', 'geodirectory' ), 'https://wpgeodirectory.com/downloads/category/themes/' ); ?></p>
<?php }?>

<div id="gd-wpeu-required-activation" class="lity-hide "><span class="gd-notification "><?php printf( __("The plugin <a href='https://wpeasyupdates.com/' target='_blank'>WP Easy Updates</a> is required to check for and update some installed plugins/themes, please <a href='%s'>activate</a> it now.","geodirectory"),wp_nonce_url(admin_url('plugins.php?action=activate&plugin=wp-easy-updates/external-updates.php'), 'activate-plugin_wp-easy-updates/external-updates.php'));?></span></div>
Expand Down
5 changes: 3 additions & 2 deletions includes/class-geodir-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ public static function insert_attachment($post_id,$type = 'file',$url,$title = '
$file_type = wp_check_filetype(basename($url));
$upload_dir = wp_upload_dir();
$file = array(
'file' => $upload_dir['subdir'].'/'.basename($metadata['file']),
'file' => $upload_dir['path'].'/'.basename($metadata['file']),
'type' => $file_type['type']
);

// only set the featured image if its approved
if($is_approved && !wp_is_post_revision( absint($post_id) ) ){
set_post_thumbnail($post_id, $attachment_id);
Expand All @@ -291,6 +291,7 @@ public static function insert_attachment($post_id,$type = 'file',$url,$title = '
return $file;
}


if(isset($file['type']) && $file['type']){
if(self::is_image($file['type'])){
// create the different image sizes and get the image meta data
Expand Down
9 changes: 8 additions & 1 deletion includes/class-geodir-post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,19 @@ public static function supports( $post_type, $feature, $default = true ) {
* @return bool Whether the post type supports the given feature.
*/
public static function default_supports( $value, $post_type, $feature ) {
$post_types = geodir_get_posttypes('array');
// print_r($post_types );exit;
switch ( $feature ) {
case 'events':
$value = defined( 'GEODIR_EVENT_VERSION' ) ? true : false;
if(isset($post_types[$post_type]) && isset($post_types[$post_type]['supports_events']) && $post_types[$post_type]['supports_events']){
$value = defined( 'GEODIR_EVENT_VERSION' ) ? true : false;
}else{
$value = false;
}
break;
}


return $value;
}

Expand Down
3 changes: 2 additions & 1 deletion includes/class-geodir-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ public static function replace_variable($string = '',$gd_page = ''){
}

if ( strpos( $string, '%%excerpt%%' ) !== false ) {
$string = str_replace( "%%excerpt%%", strip_tags( wp_trim_excerpt($post->post_content) ), $string );
$post_content = !empty($post->post_content) ? strip_tags( wp_trim_excerpt($post->post_content) ) : '';
$string = str_replace( "%%excerpt%%",$post_content , $string );
}

if ( strpos( $string, '%%id%%' ) !== false ) {
Expand Down
Binary file modified languages/geodirectory-en_US.mo
Binary file not shown.
Loading

0 comments on commit e921461

Please sign in to comment.