Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Fixed issue where individual page settings were ignore if the page wa…
Browse files Browse the repository at this point in the history
…s used as Posts Page (in Reading)
  • Loading branch information
Moqume committed May 15, 2012
1 parent ee5df3b commit 34bc73a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
21 changes: 12 additions & 9 deletions README.md
@@ -1,17 +1,17 @@
Background Manager
==================

_Background Manager_ is a powerful replacement for the default _[WordPress](http://wordpress.org)_ background manager.
_Background Manager_ is a powerful replacement for the default _[WordPress](http://wordpress.org)_ background manager.

It allows you to create multiple image sets, from which a random image is selected and displayed as the website background. The images can be uploaded from your local computer, selected from images available in your Media Library, or import them from other plugins and third-party sources.
It allows you to create multiple image sets, from which an image is selected and displayed as the website background. The images can be uploaded from your local computer, selected from the images available in your Media Library, or import them from other plugins and third-party sources.

With an easy to use menu, you can also define how the background image is displayed, such as full-screen (with ratio correction), tiled, fixed or scrolling, and define where the image is positioned.
With an easy to use menu, you can also define how the background image is displayed, such as full-screen (with ratio correction), tiled, fixed or scrolling, define where the image is positioned and how a background image is selected (random or in sequential order).

You also have the ability to add an overlay to the background images with a choice of pre-defined patterns. And of course it is also possible to add a background color.

Where supported, in full-screen mode the the background image is "eased in" when it is ready to be displayed. No longer will visitors with slower Internet connections have to endure watching a background image load from top down.

You can also limit the background images to certain parts of WordPress, for example only on the front page or a full-page post. And for each individual page or post, you can also override the images and overlay used as the background, which allows you to have pages or posts with a different background theme.
You can also limit the background images to certain parts of WordPress, for example only on the front page or a full-page post. And for each individual page, post, category or tag, you can also override the images, overlay or color used as the background, which allows you to have pages or posts with a different background theme.

Each individual background image can also be linked to a specific URL, which allows a visitor to click anywhere on the background and be redirected to another page or website.

Expand All @@ -28,6 +28,7 @@ Features
--------

* Integration with WordPress Media Library
* Full support for the WordPress Theme Customizer
* Full-screen background images
* Full control over position for images in normal display mode (tiling, positioning, scrolling and stretching)
* "Ease in" of a full-screen background image
Expand All @@ -38,19 +39,21 @@ Features
* Fade-in/Fade-out (Crossfade)
* Slide (Top, bottom, left or right)
* Cover (Top, bottom, left or right)
* Fade-in and Zoom
* 18 pre-defined background overlays
* Enable or disable the background images on the Front page, Error pages, Custom post types, etc.
* Optional thumbnail/information tab for the visitor to learn more about the background
* Import from various sources, such as:
* Flickr (including license and ownership)
* NextGEN Gallery Plugin
* WP Flickr Background Plugin
* [Flickr](http://www.flickr.com) (including license and ownership)
* [NextGEN Gallery](http://wordpress.org/extend/plugins/nextgen-gallery/) Plugin
* [GRAND FlAGallery](http://wordpress.org/extend/plugins/flash-album-gallery/) Plugin
* [WP Flickr Background](http://wordpress.org/extend/plugins/wp-flickr-background/) Plugin
* A directory (and optionally its sub-directories) on the web server
* Define the background opacity (available in Full Screen only)
* Background image links (click-able backgrounds)
* Uses AJAX to load background images, keeping the website's footprint small and improve caching
* Uses AJAX to load background images, keeping the website's footprint small and improves caching
* Graceful degradation for visitors without JavaScript
* Option to add a "Pin It" Pinterest button
* Option to add a "Pin It" [Pinterest](http://www.pinterest.com) button

License
-------
Expand Down
20 changes: 18 additions & 2 deletions app/Myatu/WordPress/BackgroundManager/Meta/Single.php
Expand Up @@ -177,10 +177,26 @@ public function onSave($id)
*/
protected function getOverrideID($meta, $orig_data)
{
if ((!is_single() && !is_page()) || !($post = wp_get_single_post()))
global $post, $wp_query;

$id = false;
$post_as_page_id = get_option('page_for_posts');

// Is this page being used as the post_as_page?
if ($wp_query->is_posts_page) {
$id = (isset($wp_query->query_vars['page_id']) && $wp_query->query_vars['page_id']) ? $wp_query->query_vars['page_id'] : $wp_query->queried_object_id;
}

// Otherwise, if it's just a regular page/post or the home
if (!$id && is_singular())
$id = $post->ID;

// Still nothing, then don't bother
if (!$id)
return $orig_data;

$post_specific_data = get_post_meta($post->ID, $meta, true);
$post_specific_data = get_post_meta($id, $meta, true);

if ($post_specific_data == -1) {
return 0; // Disable
Expand Down
2 changes: 1 addition & 1 deletion background-manager.php
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Background Manager
Plugin URI: http://j.mp/bgmwp
Description: Background Manager allows you to display a random image as the website background at each visit or as a timed slideshow, without the need to edit the theme.
Version: 1.0.25-dev41
Version: 1.0.25-dev42
Author: Mike Green (Myatu)
Author URI: http://www.myatus.co.uk/
*/
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Expand Up @@ -88,7 +88,7 @@ with PHP versions older than 5.3.

== Changelog ==

= 1.0.41 (1.1) =
= 1.0.42 (1.1) =
* __Added:__ Support for WordPress 3.4 Theme Customizer
* __Added:__ Automatically detects 3rd party categories for _Category Override_ meta option, ie. [WP e-Commerce](http://wordpress.org/extend/plugins/wp-e-commerce/)
* __Added:__ Ability to re-adjust and optionally center large images to fit the browser window, whilst maintaining ratio
Expand All @@ -105,6 +105,7 @@ with PHP versions older than 5.3.
* Changed: Background image details are now loaded asynchronous, to prevent browser "blocking"
* Changed: Background image is now rendered by JS directly, unless JS is disabled, to avoid "flicker"
* Fixed: Minimum background image change interval was not added to Javascript
* Fixed: Individual page settings were ignored if the page was used as a Posts Page (in Reading)

= 1.0.25 (March 18, 2012) =
* Fixed: Resolved the "flickering" before each transition
Expand Down

0 comments on commit 34bc73a

Please sign in to comment.