Skip to content

Commit

Permalink
GD events widgets not showing in elementor - FIXED
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed May 3, 2022
1 parent 7825b6a commit e3a57bb
Show file tree
Hide file tree
Showing 70 changed files with 2,942 additions and 2,798 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= 2.2.6 =
* Float value parsing shows comma with pl_PL locale - FIXED
* Elementor custom tag shows country name untranslated - FIXED
* GD events widgets not showing in elementor - FIXED
* Option added to hide search & near inputs in search form - ADDED

= 2.2.4 =
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/views/html-admin-settings-cpt-cf.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="container_general" class="container p-0">
<div id="container_general" class="container-fluid p-0">

<input type="hidden" name="gd_new_field_nonce" id="gd_new_field_nonce" value="<?php echo wp_create_nonce( 'gd_new_field_nonce' );?>"/>
<input type="hidden" name="listing_type" id="gd_new_post_type" value="<?php echo self::$post_type;?>"/>
Expand Down
2 changes: 1 addition & 1 deletion includes/class-geodir-elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static function alter_widget_config( $config ){

if ( ! empty( $config['initial_document']['widgets'] ) ) {
foreach( $config['initial_document']['widgets'] as $key => $widget){
if(substr( $key, 0, 13 ) === "wp-widget-gd_"){
if(substr( $key, 0, 13 ) === "wp-widget-gd_" || substr( $key, 0, 17 ) === "wp-widget-geodir_" ){
$config['initial_document']['widgets'][$key]['categories'][] = 'geodirectory';
$config['initial_document']['widgets'][$key]['hide_on_search'] = false;
$config['initial_document']['widgets'][$key]['icon'] = 'eicon-globe'; //@todo if no icons use on page then font-awesome is not loaded, wif we can fifure out how to force load we can use icons. <i class="fas fa-globe-americas"></i><i class="fa-solid fa-earth-americas"></i>
Expand Down
56 changes: 56 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Only scans for security issues</description>

<rule ref="WordPress-Extra" />

<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>

<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>

<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/index.php</exclude-pattern>
<exclude-pattern>*/includes/libraries/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>

<rule ref="Internal.NoCodeFound">
<exclude-pattern>*</exclude-pattern>
</rule>

<rule ref="Squiz.Commenting">
<exclude-pattern>*</exclude-pattern>
</rule>

<rule ref="Generic.Commenting.DocComment">
<exclude-pattern>*</exclude-pattern>
</rule>

<rule ref="Generic.Formatting">
<exclude-pattern>*</exclude-pattern>
</rule>

<rule ref="Generic.WhiteSpace">
<exclude-pattern>*</exclude-pattern>
</rule>

<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>*</exclude-pattern>
</rule>

<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase">
<exclude-pattern>*</exclude-pattern>
</rule>

<config name="minimum_supported_wp_version" value="4.9" />

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="geodirectory" />
</properties>
</rule>

</ruleset>
143 changes: 99 additions & 44 deletions upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,23 @@
* @global object $wpdb WordPress Database object.
*/



// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

global $wpdb;

if (get_option('geodirectory_db_version') != GEODIRECTORY_VERSION) {
/**
* Include custom database table related functions.
*
* @since 1.0.0
* @package GeoDirectory
*/
add_action('plugins_loaded', 'geodir_upgrade_all', 10);

add_action('init', 'geodir_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
if ( get_option( 'geodirectory_db_version' ) !== GEODIRECTORY_VERSION ) {
/**
* Include custom database table related functions.
*
* @since 1.0.0
* @package GeoDirectory
*/
add_action( 'plugins_loaded', 'geodir_upgrade_all', 10 );

//update_option('geodirectory_db_version', GEODIRECTORY_VERSION); // @todo is this required?
add_action( 'init', 'geodir_fix_cpt_rewrite_slug', 11 );// this needs to be kept for a few versions.

}

Expand Down Expand Up @@ -54,16 +52,16 @@ function geodir_upgrade_200() {
* @package GeoDirectory
*/
function geodir_fix_cpt_rewrite_slug() {
// flush the rewrite rules
flush_rewrite_rules();
// flush the rewrite rules.
flush_rewrite_rules();
}

/**
* Update DB Version.
*/
function geodir_upgrade_20013() {
global $wpdb;
$wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET type='post_images' WHERE type='post_image'");
global $wpdb;
$wpdb->query( 'UPDATE ' . GEODIR_ATTACHMENT_TABLE . " SET type='post_images' WHERE type='post_image'" );
}

function geodir_update_200_settings() {
Expand Down Expand Up @@ -97,25 +95,25 @@ function geodir_upgrade_20060() {

// Archive page
$archive_page_id = geodir_archive_page_id();
if($archive_page_id){
$archive_page_content = get_post_field('post_content', $archive_page_id);
if (strpos($archive_page_content, '[gd_loop layout=1]') !== false) {
if ( $archive_page_id ) {
$archive_page_content = get_post_field( 'post_content', $archive_page_id );
if ( strpos( $archive_page_content, '[gd_loop layout=1]' ) !== false ) {
$my_post = array(
'ID' => $archive_page_id,
'post_content' => str_replace('[gd_loop layout=1]','[gd_loop layout=0]',$archive_page_content),
'post_content' => str_replace( '[gd_loop layout=1]', '[gd_loop layout=0]', $archive_page_content ),
);
wp_update_post( $my_post );
}
}

// Search page
$search_page_id = geodir_search_page_id();
if($search_page_id){
$search_page_content = get_post_field('post_content', $search_page_id);
if (strpos($search_page_content, '[gd_loop layout=1]') !== false) {
if ( $search_page_id ) {
$search_page_content = get_post_field( 'post_content', $search_page_id );
if ( strpos( $search_page_content, '[gd_loop layout=1]' ) !== false ) {
$my_post = array(
'ID' => $search_page_id,
'post_content' => str_replace('[gd_loop layout=1]','[gd_loop layout=0]',$search_page_content),
'post_content' => str_replace( '[gd_loop layout=1]', '[gd_loop layout=0]', $search_page_content ),
);
wp_update_post( $my_post );
}
Expand All @@ -130,9 +128,9 @@ function geodir_upgrade_20064() {

$post_types = geodir_get_posttypes();

$search_country = 'Russian Federation';
$replace_country = 'Russia';
$search_country_slug = 'russian-federation';
$search_country = 'Russian Federation';
$replace_country = 'Russia';
$search_country_slug = 'russian-federation';
$replace_country_slug = 'russia';

// Default Country
Expand All @@ -150,24 +148,80 @@ function geodir_upgrade_20064() {
continue;
}

$wpdb->query( $wpdb->prepare( "UPDATE {$table} SET country = %s WHERE country LIKE %s", array( $replace_country, $search_country ) ) );
$wpdb->query(
$wpdb->prepare(
"UPDATE {$table} SET country = %s WHERE country LIKE %s",
array(
$replace_country,
$search_country,
)
)
);
}
}

// Reviews
$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_REVIEW_TABLE . " SET country = %s WHERE country LIKE %s", array( $replace_country, $search_country ) ) );

$wpdb->query(
$wpdb->prepare(
'UPDATE ' . GEODIR_REVIEW_TABLE . ' SET country = %s WHERE country LIKE %s',
array(
$replace_country,
$search_country,
)
)
);

if ( class_exists( 'GeoDir_Location' ) ) {
// Locations
$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_LOCATIONS_TABLE . " SET country = %s WHERE country LIKE %s", array( $replace_country, $search_country ) ) );
$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_LOCATIONS_TABLE . " SET country_slug = %s WHERE country_slug LIKE %s", array( $replace_country_slug, $search_country_slug ) ) );
$wpdb->query(
$wpdb->prepare(
'UPDATE ' . GEODIR_LOCATIONS_TABLE . ' SET country = %s WHERE country LIKE %s',
array(
$replace_country,
$search_country,
)
)
);
$wpdb->query(
$wpdb->prepare(
'UPDATE ' . GEODIR_LOCATIONS_TABLE . ' SET country_slug = %s WHERE country_slug LIKE %s',
array(
$replace_country_slug,
$search_country_slug,
)
)
);

// Location SEO
$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_LOCATION_SEO_TABLE . " SET country_slug = %s WHERE country_slug LIKE %s", array( $replace_country_slug, $search_country_slug ) ) );

$wpdb->query(
$wpdb->prepare(
'UPDATE ' . GEODIR_LOCATION_SEO_TABLE . ' SET country_slug = %s WHERE country_slug LIKE %s',
array(
$replace_country_slug,
$search_country_slug,
)
)
);

// Location Term Meta
$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_LOCATION_TERM_META . " SET country_slug = %s WHERE country_slug LIKE %s", array( $replace_country_slug, $search_country_slug ) ) );
$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_LOCATION_TERM_META . " SET location_name = %s WHERE location_name LIKE %s", array( $replace_country_slug, $search_country_slug ) ) );
$wpdb->query(
$wpdb->prepare(
'UPDATE ' . GEODIR_LOCATION_TERM_META . ' SET country_slug = %s WHERE country_slug LIKE %s',
array(
$replace_country_slug,
$search_country_slug,
)
)
);
$wpdb->query(
$wpdb->prepare(
'UPDATE ' . GEODIR_LOCATION_TERM_META . ' SET location_name = %s WHERE location_name LIKE %s',
array(
$replace_country_slug,
$search_country_slug,
)
)
);
}
}

Expand Down Expand Up @@ -197,21 +251,22 @@ function geodir_upgrade_20096() {
$table = $wpdb->prefix . 'geodir_business_hours';

if ( $wpdb->get_var( "SHOW TABLES LIKE '{$table}'" ) && ! geodir_column_exist( $table, 'open_utc' ) ) {
$wpdb->query( "ALTER TABLE `{$table}`
$wpdb->query(
"ALTER TABLE `{$table}`
ADD open_utc int(9) UNSIGNED NOT NULL,
ADD close_utc int(9) UNSIGNED NOT NULL,
ADD open_dst int(9) UNSIGNED NOT NULL,
ADD close_dst int(9) UNSIGNED NOT NULL,
ADD timezone_string varchar(100) NOT NULL,
ADD has_dst tinyint(1) NOT NULL DEFAULT '0',
ADD is_dst tinyint(1) NOT NULL DEFAULT '0'"
ADD is_dst tinyint(1) NOT NULL DEFAULT '0'"
);
}

// Update timezone to timezone string.
if ( ! geodir_get_option( 'default_location_timezone_string' ) ) {
$country = geodir_get_option( 'default_location_country' );
$timezone = geodir_get_option( 'default_location_timezone' );
$country = geodir_get_option( 'default_location_country' );
$timezone = geodir_get_option( 'default_location_timezone' );
$timezone_string = geodir_offset_to_timezone_string( $timezone, $country );
geodir_update_option( 'default_location_timezone_string', $timezone_string );
}
Expand All @@ -227,4 +282,4 @@ function geodir_upgrade_20096() {
function geodir_upgrade_21016() {
// Disable beta addons setting.
geodir_update_option( 'admin_enable_beta', '' );
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/ayecode/wp-ayecode-ui/assets/css/ayecode-ui-rtl.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions vendor/ayecode/wp-ayecode-ui/assets/css/ayecode-ui.css

Large diffs are not rendered by default.

Loading

0 comments on commit e3a57bb

Please sign in to comment.