Default featured image - Version 1.4

Version Description

  • Added plugin images both the plugin header as the thumbnail. Based on the boat WP.org uses in it's theme previews
  • Fixed a bug where the ajax calls didn't return the DFI forum thread

=

Download this release

Release Info

Developer janw.oostendorp
Plugin Icon 128x128 Default featured image
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

Files changed (2) hide show
  1. readme.txt +6 -2
  2. set-default-featured-image.php +5 -5
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: janwoostendorp
3
  Tags: media, image
4
  Requires at least: 3.5
5
- Tested up to: 4.1
6
- Stable tag: 1.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -119,6 +119,10 @@ yes you can with the filter `dfi_thumbnail_html`.
119
  = 1.3 =
120
  * Filter `dfi_thumbnail_id` now also returns the post ID of the post (or any postype) that is being called. See the FAQ for new examples
121
 
 
 
 
 
122
  == Upgrade Notice ==
123
 
124
  = 1.0 =
2
  Contributors: janwoostendorp
3
  Tags: media, image
4
  Requires at least: 3.5
5
+ Tested up to: 4.4.2
6
+ Stable tag: 1.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
119
  = 1.3 =
120
  * Filter `dfi_thumbnail_id` now also returns the post ID of the post (or any postype) that is being called. See the FAQ for new examples
121
 
122
+ = 1.4 =
123
+ * Added plugin images both the plugin header as the thumbnail. Based on the boat WP.org uses in it's theme previews
124
+ * Fixed a bug where the ajax calls didn't return the DFI [forum thread](https://wordpress.org/support/topic/dfi-woocommerce-facetwp?replies=10)
125
+
126
  == Upgrade Notice ==
127
 
128
  = 1.0 =
set-default-featured-image.php CHANGED
@@ -3,7 +3,7 @@
3
  * plugin name: Default featured image
4
  * Plugin URI: http://wordpress.org/extend/plugins/default-featured-image/
5
  * Description: Allows users to select a default feartured image in the media settings
6
- * Version: 1.3
7
  * Author: Jan Willem Oostendorp
8
  * License: GPLv2 or later
9
  */
@@ -58,8 +58,8 @@ class default_featured_image
58
  * @return string|array Single metadata value, or array of values
59
  */
60
  function set_dfi_meta_key( $null = null, $object_id, $meta_key, $single ) {
61
- // only affect thumbnails on the frontend
62
- if ( is_admin() || '_thumbnail_id' != $meta_key )
63
  return $null;
64
 
65
  $meta_type = 'post';
@@ -120,7 +120,7 @@ class default_featured_image
120
  <input id="dfi_id" type="hidden" value="<?php echo esc_attr( $value ); ?>" name="dfi_image_id"/>
121
 
122
  <a id="dfi-set-dfi" class="button" title="<?php _e( 'Select default featured image', self::L10n ) ?>" href="#">
123
- <span class="icon16 icon-media"></span>
124
  <?php _e( 'Select default featured image', self::L10n ) ?>
125
  </a>
126
  <div style="margin-top:5px;">
@@ -218,4 +218,4 @@ class default_featured_image
218
  }
219
  }
220
  //run the plugin class
221
- new default_featured_image();
3
  * plugin name: Default featured image
4
  * Plugin URI: http://wordpress.org/extend/plugins/default-featured-image/
5
  * Description: Allows users to select a default feartured image in the media settings
6
+ * Version: 1.4
7
  * Author: Jan Willem Oostendorp
8
  * License: GPLv2 or later
9
  */
58
  * @return string|array Single metadata value, or array of values
59
  */
60
  function set_dfi_meta_key( $null = null, $object_id, $meta_key, $single ) {
61
+ // only affect thumbnails on the frontend, do allow ajax calls
62
+ if ( ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) || '_thumbnail_id' != $meta_key )
63
  return $null;
64
 
65
  $meta_type = 'post';
120
  <input id="dfi_id" type="hidden" value="<?php echo esc_attr( $value ); ?>" name="dfi_image_id"/>
121
 
122
  <a id="dfi-set-dfi" class="button" title="<?php _e( 'Select default featured image', self::L10n ) ?>" href="#">
123
+ <span style="margin-top: 3px;" class="dashicons dashicons-format-image"></span>
124
  <?php _e( 'Select default featured image', self::L10n ) ?>
125
  </a>
126
  <div style="margin-top:5px;">
218
  }
219
  }
220
  //run the plugin class
221
+ new default_featured_image();