Unique Headers - Version 1.3.9

Version Description

Download this release

Release Info

Developer ryanhellyer
Plugin Icon wp plugin Unique Headers
Version 1.3.9
Comparing to
See all releases

Code changes from version 1.3.8 to 1.3.9

inc/class-custom-image-meta-box.php CHANGED
@@ -120,8 +120,8 @@ class Custom_Image_Meta_Box {
120
  $attachment_id = get_post_meta( $post_id, '_' . $name . '_id', true );
121
 
122
  // Check for fallback images
123
- if ( '' == $attachment_id ) {
124
- $attachment_id = apply_filters( $name . '_fallback_images', $post_id );
125
  }
126
 
127
  return $attachment_id;
@@ -148,7 +148,7 @@ class Custom_Image_Meta_Box {
148
  * Registers the JavaScript for handling the media uploader.
149
  *
150
  * @since 1.3
151
- * @access static This method is static so that front-end scripts can access the attachments title
152
  * @param int $attachment_id The attachment ID
153
  * @return string $title The attachment title
154
  */
120
  $attachment_id = get_post_meta( $post_id, '_' . $name . '_id', true );
121
 
122
  // Check for fallback images
123
+ if ( ! $attachment_id ) {
124
+ $attachment_id = apply_filters( 'unique_header_fallback_images', $post_id );
125
  }
126
 
127
  return $attachment_id;
148
  * Registers the JavaScript for handling the media uploader.
149
  *
150
  * @since 1.3
151
+ * @access static This method is static so that front-end scripts can access the attachments title
152
  * @param int $attachment_id The attachment ID
153
  * @return string $title The attachment title
154
  */
inc/class-unique-headers-taxonomy-header-images.php CHANGED
@@ -114,7 +114,6 @@ class Unique_Header_Taxonomy_Header_Images {
114
 
115
  }
116
 
117
- // Add filter for category image (uses reduced priority to ensure that single post thumbnails override it)
118
  add_filter( 'theme_mod_header_image', array( $this, 'header_image_filter' ), 5 );
119
 
120
  }
114
 
115
  }
116
 
 
117
  add_filter( 'theme_mod_header_image', array( $this, 'header_image_filter' ), 5 );
118
 
119
  }
inc/legacy.php CHANGED
@@ -15,7 +15,7 @@
15
  * @param int $post_id The current post ID
16
  * @param int $attachment_id The attachment ID
17
  */
18
- function unique_headers_legacy( $post_id ) {
19
  $attachment_id = '';
20
 
21
  // Loop through the legacy meta keys, looking for header images
@@ -24,7 +24,10 @@ function unique_headers_legacy( $post_id ) {
24
  'page_custom-header_thumbnail_id',
25
  'kd_custom-header_post_id',
26
  'kd_custom-header_page_id',
 
 
27
  );
 
28
  foreach( $keys as $key ) {
29
  if ( '' == $attachment_id ) {
30
  $attachment_id = get_post_meta( $post_id, $key, true );
@@ -40,7 +43,7 @@ function unique_headers_legacy( $post_id ) {
40
  } else {
41
 
42
  // Update to use new meta key
43
- update_post_meta( $post_id, '_unique_header_id', $attachment_id );
44
 
45
  // Delete unused meta keys
46
  foreach( $keys_to_remove as $key ) {
@@ -50,4 +53,4 @@ function unique_headers_legacy( $post_id ) {
50
 
51
  return $attachment_id;
52
  }
53
- add_filter( 'unique_header_fallback_images', 'unique_headers_legacy' );
15
  * @param int $post_id The current post ID
16
  * @param int $attachment_id The attachment ID
17
  */
18
+ function unique_header_fallback_images( $post_id ) {
19
  $attachment_id = '';
20
 
21
  // Loop through the legacy meta keys, looking for header images
24
  'page_custom-header_thumbnail_id',
25
  'kd_custom-header_post_id',
26
  'kd_custom-header_page_id',
27
+ '_unique_header_id', // This is due to version 1.3.8 which shouldn't have been released
28
+ '_custom_header_image', // temporary
29
  );
30
+
31
  foreach( $keys as $key ) {
32
  if ( '' == $attachment_id ) {
33
  $attachment_id = get_post_meta( $post_id, $key, true );
43
  } else {
44
 
45
  // Update to use new meta key
46
+ update_post_meta( $post_id, '_custom_header_image_id', $attachment_id );
47
 
48
  // Delete unused meta keys
49
  foreach( $keys_to_remove as $key ) {
53
 
54
  return $attachment_id;
55
  }
56
+ add_filter( 'unique_header_fallback_images', 'unique_header_fallback_images' );
index.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: Unique Headers
4
- Plugin URI: http://geek.ryanhellyer.net/products/unique-headers/
5
  Description: Unique Headers
6
- Version: 1.3.8
7
  Author: Ryan Hellyer
8
- Author URI: http://geek.ryanhellyer.net/
9
  Text Domain: unique-headers
10
 
11
  ------------------------------------------------------------------------
1
  <?php
2
  /*
3
  Plugin Name: Unique Headers
4
+ Plugin URI: https://geek.hellyer.kiwi/products/unique-headers/
5
  Description: Unique Headers
6
+ Version: 1.3.9
7
  Author: Ryan Hellyer
8
+ Author URI: https://geek.hellyer.kiwi/
9
  Text Domain: unique-headers
10
 
11
  ------------------------------------------------------------------------
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: custom-header, header, headers, image, header-image, header-images, taxono
4
  Donate link: https://geek.hellyer.kiwi/donate/
5
  Requires at least: 4.1
6
  Tested up to: 4.2
7
- Stable tag: 1.3.8
8
  Text Domain: unique-headers
9
 
10
 
@@ -128,6 +128,7 @@ No, I'm too busy. Having said that, if you are willing to pay me a small fortune
128
 
129
  == Changelog ==
130
 
 
131
  Version 1.3.8: Modification translation system to work with changes on WordPress.org.<br />
132
  Version 1.3.7: Addition of Spanish translation<br />
133
  Version 1.3.1: Adjustment to match post meta key to other plugins, for compatibilty reasons.<br />
4
  Donate link: https://geek.hellyer.kiwi/donate/
5
  Requires at least: 4.1
6
  Tested up to: 4.2
7
+ Stable tag: 1.3.9
8
  Text Domain: unique-headers
9
 
10
 
128
 
129
  == Changelog ==
130
 
131
+ Version 1.3.9: Fixing error which caused header images to disappear on upgrading (data was still available just not accessed correctly).<br />
132
  Version 1.3.8: Modification translation system to work with changes on WordPress.org.<br />
133
  Version 1.3.7: Addition of Spanish translation<br />
134
  Version 1.3.1: Adjustment to match post meta key to other plugins, for compatibilty reasons.<br />