Skip to content

Commit

Permalink
Fixing the thumbnail featured images.
Browse files Browse the repository at this point in the history
  • Loading branch information
krugazul committed Jan 15, 2021
1 parent 513101c commit 0b37879
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions includes/classes/legacy/class-placeholders.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ public function default_post_thumbnail( $meta, $post_id, $meta_key ) {

$post_type = get_post_field( 'post_type', $post_id );

if ( isset( $_GET['debug'] ) ) {
print_r('<pre>');
print_r($options);
print_r('</pre>');
}

//If the post types posts placeholder has been disabled then skip.
if ( 'post' === $post_type && isset( $options['general'] ) && isset( $options['general']['disable_blog_placeholder'] ) ) {
return $meta;
Expand All @@ -209,7 +215,7 @@ public function default_post_thumbnail( $meta, $post_id, $meta_key ) {
$this->checking_for_thumb = true;
$image = get_post_meta( $post_id, '_thumbnail_id', true );
$this->checking_for_thumb = false;
if ( ! empty( $image ) ) {
if ( ! empty( $image ) && 'lsx-placeholder' !== $image ) {
return $meta;
}

Expand Down Expand Up @@ -512,7 +518,7 @@ public function placeholder_settings( $post_type = false, $tab = false ) {

<tr class="form-field featured-placeholder-wrap">
<th scope="row">
<label for="featured_placeholder"><?php esc_html_e( 'Archive Image', 'tour-operator' ); ?></label>
<label for="featured_placeholder"><?php esc_html_e( 'Archive Placeholder', 'tour-operator' ); ?></label>
</th>
<td>
<input class="input_image_id" type="hidden" {{#if featured_placeholder_id}} value="{{featured_placeholder_id}}" {{/if}}
Expand Down

0 comments on commit 0b37879

Please sign in to comment.