Skip to content

Commit

Permalink
Merge pull request #2583 from kprajapatii/master
Browse files Browse the repository at this point in the history
Add "id" as reserved field to prevent custom field with id key - CHANGED
  • Loading branch information
kprajapatii authored May 9, 2024
2 parents 439d8d9 + c987372 commit ad2064f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions includes/admin/settings/class-geodir-settings-cpt-cf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2500,6 +2500,7 @@ public static function system_fields( $post_type ) {
*/
public static function reserved_fields( $post_type ) {
$fields = array(
'id',
'post_id',
'_search_title',
'post_status',
Expand Down
23 changes: 19 additions & 4 deletions includes/widgets/class-geodir-widget-post-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,14 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
}

/**
* Output the imae slider.
* Output the image slider.
*
* @global bool $geodir_carousel_open Check whether carousel already open.
*
* @param $options
*/
public function output_images( $options ) {
global $post, $gd_post, $geodir_carousel_open;
global $post, $gd_post, $geodir_carousel_open, $aui_bs5;

// options
$defaults = array(
Expand Down Expand Up @@ -462,9 +462,24 @@ public function output_images( $options ) {
$lightbox_image_size = apply_filters( 'geodir_post_images_lightbox_image_size', $lightbox_image_size );
$main_wrapper_class .= " geodir-image-sizes-" . $image_size;

if ( !empty( $options ) ) {
if ( ! empty( $options ) ) {
// rounded & rounded_size don't work together.
if ( ! empty( $options['rounded_size'] ) && in_array( $options['rounded_size'], array( 'sm', 'lg' ) ) ) {
if ( $aui_bs5 ) {
if ( $options['rounded_size'] == 'sm' ) {
$options['rounded_size'] = '1';
} elseif ( $options['rounded_size'] == 'lg' ) {
$options['rounded_size'] = '3';
}
}

if ( ! empty( $options['rounded'] ) && in_array( $options['rounded'], array( 'rounded', 'rounded-top', 'rounded-right', 'rounded-bottom', 'rounded-left', 'rounded-circle', 'rounded-pill', 'rounded-0' ) ) ) {
$options['rounded_size'] = '';
}
}

// Wrap class
$main_wrapper_class .= " overflow-hidden " . sd_build_aui_class( $options );
$main_wrapper_class .= " " . sd_build_aui_class( $options );
}

if ( $options['type'] == 'slider' ) {
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ __WARNING: GDv2 is a significant update over GDv1 and may require manual work, s
= GeoDirectory v2.3.52 - TBD =
* AUI radio set should skip showing optgroup from option values - FIXED
* PHP Warning: Undefined array key "heading_tag" - FIXED
* Add "id" as reserved field to prevent custom field with id key - CHANGED

= GeoDirectory v2.3.51 - 2024-05-02 =
* Switching the package looses login user name & email - CHANGED
Expand Down

0 comments on commit ad2064f

Please sign in to comment.