Plugin Directory

Changeset 2597157


Ignore:
Timestamp:
09/11/2021 05:31:43 AM (5 years ago)
Author:
passionui
Message:

update version

Location:
listar-directory-listing/trunk/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • listar-directory-listing/trunk/models/class-listar-category-model.php

    r2389195 r2597157  
    4646
    4747                        // Image sizes
    48                         if($key == 'featured_image' && $term->featured_image) {
    49                             $term->image = [
    50                                 'full' => ['url' => wp_get_attachment_url($term->featured_image)],
    51                                 'thumb' => ['url' => wp_get_attachment_thumb_url($term->featured_image)],
    52                             ];
     48                        if($key == 'featured_image') {
     49                            if($term->featured_image) {
     50                                $term->image = [
     51                                    'full' => ['url' => wp_get_attachment_url($term->featured_image)],
     52                                    'thumb' => ['url' => wp_get_attachment_thumb_url($term->featured_image)],
     53                                ];
     54                            } else {
     55                                $term->image = [
     56                                    'full' => ['url' => Listar_Setting_Model::default_image()],
     57                                    'thumb' => ['url' => Listar_Setting_Model::default_image()],
     58                                ];
     59                            }
    5360                        }   
    5461                    } else {
  • listar-directory-listing/trunk/models/class-listar-location-model.php

    r2571251 r2597157  
    4040
    4141                        // Image sizes
    42                         if($key == 'featured_image' && $term->featured_image) {
    43                             $term->image = [
    44                                 'full' => ['url' => wp_get_attachment_url($term->featured_image)],
    45                                 'thumb' => ['url' => wp_get_attachment_thumb_url($term->featured_image)],
    46                             ];
     42                        if($key == 'featured_image') {
     43                            if($term->featured_image) {
     44                                $term->image = [
     45                                    'full' => ['url' => wp_get_attachment_url($term->featured_image)],
     46                                    'thumb' => ['url' => wp_get_attachment_thumb_url($term->featured_image)],
     47                                ];
     48                            } else {
     49                                $term->image = [
     50                                    'full' => ['url' => Listar_Setting_Model::default_image()],
     51                                    'thumb' => ['url' => Listar_Setting_Model::default_image()],
     52                                ];
     53                            }
    4754                        }   
    4855                    } else {
Note: See TracChangeset for help on using the changeset viewer.