Skip to content

Commit

Permalink
2.0.0.43
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Dec 21, 2018
1 parent aff329d commit 241e1f6
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 59 deletions.
2 changes: 1 addition & 1 deletion assets/css/block_editor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/block_editor.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/css/gd_core_frontend.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/gd_core_frontend.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/partials/_helpers.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.gd-hide{
.gd-hide,i.gd-hide,svg.gd-hide{
display: none;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions assets/js/geodirectory.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ jQuery(function($) {
geodir_fix_marker_pos(data.canvas);
});
$('.gd-badge-meta .gd-badge').each(function(){
var badge = $(this).data('badge');
var badge = $(this).data('badge');
var badge_condition = $(this).data('badge-condition');
if (badge && $(this).closest('.post-' + $(this).data('id')).length) {
badge = 'geodir-badge-' + badge;
$(this).closest('.post-' + $(this).data('id')).removeClass(badge).addClass(badge);
badge_class = 'geodir-badge-' + badge; // name
badge_class += ' geodir-badge-' + badge + '-'+ badge_condition; // name and condition
$(this).closest('.post-' + $(this).data('id')).removeClass(badge_class).addClass(badge_class);
}
});

Expand Down
4 changes: 2 additions & 2 deletions assets/js/geodirectory.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.0.0.43
Post badge and is_empty check not working in some cases - FIXED
Post badge post_class now also adds class with condition - ADDED
Permalinks category base now required to keep permalinks to WordPress standards and avoid conflicts - CHANGED

v2.0.0.42
Selecting detail custom page template shows comment box twice - FIXED
Added editor styles to help Gutenberg Blocks UI - ADDED
Expand Down
4 changes: 2 additions & 2 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.42
* Version: 2.0.0.43
* 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.42';
public $version = '2.0.0.43';

/**
* GeoDirectory instance.
Expand Down
23 changes: 13 additions & 10 deletions includes/admin/class-geodir-admin-permalink-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class="button button-secondary"
<h2 class="title"><?php _e('GeoDirectory Taxonomies'); ?></h2>
<p><?php
/* translators: %s: placeholder that must come at the start of the URL */
printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/attractions/</code>. Tags can not be blank, category slug can only be blank if the GD permalinks are using more than one tag.','geodirectory' ), home_url() . '/' . $base_slug ); ?></p>
printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/attractions/</code>. Tags and category can not be blank.','geodirectory' ), home_url() . '/' . $base_slug ); ?></p>

<table class="form-table">
<tr>
Expand Down Expand Up @@ -352,16 +352,19 @@ function gdChangeStructureTagButtonState(button) {
// check category base
if(jQuery('#geodirectory_category_base').val()==''){


alert("<?php _e('GeoDirectory category base can not be blank, please check and try again.','geodirectory'); ?>");
$return = false;

if($permalink_structure==''){
$return = false;
}else if($permalink_structure.split("/").length-1 < 3){
$return = false;
}

if(!$return){
alert("<?php _e('GeoDirectory category base can only be blank if the GeoDirectory permalinks use more than one tag, please check and try again.','geodirectory'); ?>");
}
// if($permalink_structure==''){
// $return = false;
// }else if($permalink_structure.split("/").length-1 < 3){
// $return = false;
// }
//
// if(!$return){
// alert("<?php //_e('GeoDirectory category base can only be blank if the GeoDirectory permalinks use more than one tag, please check and try again.','geodirectory'); ?>//");
// }
}

return $return;
Expand Down
28 changes: 14 additions & 14 deletions includes/class-geodir-permalinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,20 @@ public function __construct() {

//add_action( 'registered_post_type', array( __CLASS__, 'register_post_type_rules' ), 10, 2 );

// add_action('init', array( $this, 'temp_check_rules'),10000000000);
//add_action('init', array( $this, 'temp_check_rules'),10000000000);
}

// @todo remove after testing
public function temp_check_rules($rules){

if(is_admin()){return;}
global $wp_rewrite;
//print_r( $wp_rewrite );
print_r(get_option( 'rewrite_rules' ));

echo '###';exit;

return $rules;
}

public function maybe_404(){
Expand Down Expand Up @@ -256,19 +269,6 @@ public function get_term_parent_info($term_id, $taxonomy,$slug='' ){
return $term;
}

// @todo remove after testing
public function temp_check_rules($rules){

if(is_admin()){return;}
global $wp_rewrite;
print_r( $wp_rewrite );
//print_r(get_option( 'rewrite_rules' ));

echo '###';exit;

return $rules;
}

public function insert_rewrite_rules(){

// print_r($this->rewrite_rules);
Expand Down
16 changes: 9 additions & 7 deletions includes/post-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,11 +760,13 @@ function geodir_get_post_badge( $post_id, $args = array() ) {
if ( $until_time >= $now_time ) {
$match_found = true;
}
} elseif ( $match_field == 'featured' ) {
if ( ! empty( $find_post->{$match_field} ) ) {
$match_found = true;
}
} else {
}
// elseif ( $match_field == 'featured' ) {
// if ( ! empty( $find_post->{$match_field} ) ) {
// $match_found = true;
// }
// }
else {
switch ( $args['condition'] ) {
case 'is_equal':
$match_found = (bool) ( $search != '' && $match_value == $search );
Expand All @@ -779,7 +781,7 @@ function geodir_get_post_badge( $post_id, $args = array() ) {
$match_found = (bool) ( $search != '' && is_float( $search ) && is_float( $match_value ) && $match_value < $search );
break;
case 'is_empty':
$match_found = (bool) ( $match_value === '' || $match_value === false && $match_value === '0' || is_null( $match_value ) );
$match_found = (bool) ( $match_value === '' || $match_value === false || $match_value === '0' || is_null( $match_value ) );
break;
case 'is_not_empty':
$match_found = (bool) ( $match_value !== '' && $match_value !== false && $match_value !== '0' && ! is_null( $match_value ) );
Expand Down Expand Up @@ -830,7 +832,7 @@ function geodir_get_post_badge( $post_id, $args = array() ) {
$output = '<div class="gd-badge-meta ' . trim( $class ) . '">';
if(!empty($args['link'])){$output .= "<a href='".esc_url($args['link'])."' $new_window>";}
// we escape the user input from $match_value but we don't escape the user badge input so they can use html like font awesome.
$output .= '<div data-id="' . $find_post->ID . '" class="gd-badge" data-badge="' . esc_attr($match_field) . '" style="background-color:' . esc_attr( $args['bg_color'] ) . ';color:' . esc_attr( $args['txt_color'] ) . ';">' . __( $badge, 'geodirectory' ) . '</div>';
$output .= '<div data-id="' . $find_post->ID . '" class="gd-badge" data-badge="' . esc_attr($match_field) . '" data-badge-condition="' . esc_attr($args['condition']) . '" style="background-color:' . esc_attr( $args['bg_color'] ) . ';color:' . esc_attr( $args['txt_color'] ) . ';">' . __( $badge, 'geodirectory' ) . '</div>';
if(!empty($args['link'])){$output .= "</a>";}
$output .= '</div>';
}
Expand Down
2 changes: 1 addition & 1 deletion includes/widgets/class-geodir-widget-post-badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function set_arguments() {
),
'key' => array(
'type' => 'select',
'title' => __('Feild Key:', 'geodirectory'),
'title' => __('Field Key:', 'geodirectory'),
'desc' => __('This is the custom field key.', 'geodirectory'),
'placeholder' => '',
'options' => $this->get_custom_field_keys(),
Expand Down
Binary file modified languages/geodirectory-en_US.mo
Binary file not shown.
20 changes: 9 additions & 11 deletions languages/geodirectory-en_US.po
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
msgid ""
msgstr ""
"Project-Id-Version: GeoDirectory 2.0.0.42\n"
"Project-Id-Version: GeoDirectory 2.0.0.43\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-20 15:50+0000\n"
"PO-Revision-Date: 2018-12-20 15:50+0000\n"
"POT-Creation-Date: 2018-12-21 19:10+0000\n"
"PO-Revision-Date: 2018-12-21 19:10+0000\n"
"Last-Translator: \n"
"Language-Team: AyeCode Ltd <[email protected]>\n"
"Language: en_US\n"
Expand Down Expand Up @@ -1465,9 +1465,8 @@ msgstr ""
msgid ""
"If you like, you may enter custom structures for your category and tag URLs "
"here. For example, using <code>topics</code> as your category base would "
"make your category links like <code>%s/topics/attractions/</code>. Tags can "
"not be blank, category slug can only be blank if the GD permalinks are using "
"more than one tag."
"make your category links like <code>%s/topics/attractions/</code>. Tags and "
"category can not be blank."
msgstr ""

#: includes/admin/class-geodir-admin-permalink-settings.php:207
Expand All @@ -1488,10 +1487,9 @@ msgstr ""
msgid "GeoDirectory tag base can not be blank, please check and try again."
msgstr ""

#: includes/admin/class-geodir-admin-permalink-settings.php:363
#: includes/admin/class-geodir-admin-permalink-settings.php:356
msgid ""
"GeoDirectory category base can only be blank if the GeoDirectory permalinks "
"use more than one tag, please check and try again."
"GeoDirectory category base can not be blank, please check and try again."
msgstr ""

#: includes/admin/class-geodir-admin-post-view.php:81
Expand Down Expand Up @@ -9791,7 +9789,7 @@ msgstr ""
msgid "in %s"
msgstr ""

#: includes/post-functions.php:810
#: includes/post-functions.php:812
msgid "NEW"
msgstr ""

Expand Down Expand Up @@ -10790,7 +10788,7 @@ msgid "Leave blank to use current post id."
msgstr ""

#: includes/widgets/class-geodir-widget-post-badge.php:52
msgid "Feild Key:"
msgid "Field Key:"
msgstr ""

#: includes/widgets/class-geodir-widget-post-badge.php:53
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tags: directory plugin, business directory, listings, classifieds, real estate
Requires at least: 4.5
Requires PHP: 5.3
Tested up to: 5.0
Stable tag: 2.0.0.42
Stable tag: 2.0.0.43


Create huge location-based business directories with this fully-featured directory plugin. In a few clicks you could be the next Yelp or Tripadvisor.
Expand Down

0 comments on commit 241e1f6

Please sign in to comment.