Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: wiredmedia/WordPress-MultipleHeaderImagesPlugin
base: 229d98f84d
...
head fork: wiredmedia/WordPress-MultipleHeaderImagesPlugin
compare: 1b44a7152b
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 9 additions and 4 deletions.
  1. +0 −3  js/main.js
  2. +9 −1 multiple-header-images.php
View
3  js/main.js
@@ -74,9 +74,6 @@ var multipleHeaderImages = function() {
el.selected.append(item);
});
-
- // now remove binded click event, this stops this event being fired again if user closes modal and opens it again without a page refresh
- el.launchbtn.unbind('click');
},
'json'
);
View
10 multiple-header-images.php
@@ -26,7 +26,15 @@ public function get_header_images($post_id = null, $size = null){
if (is_404()) {
$images = self::get_default_header_images();
} else {
- $images = self::get_header_images_post_meta($post_id ? $post_id : get_the_ID());
+ if (!$post_id) {
+ $post_id = get_the_ID();
+ }
+
+ $post_ids = array_merge(array($post_id), get_post_ancestors($post_id));
+
+ while (!$images && $post_ids) {
+ $images = self::get_header_images_post_meta(array_shift($post_ids));
+ }
}
// if no header images attached to this post get the default header images

No commit comments for this range

Something went wrong with that request. Please try again.