Permalink
Browse files

Allow developers to overwrite the random backgrounds set.

  • Loading branch information...
1 parent 6d039ab commit 53a93e47c52c7da2a3cf907a6873b382389cc90b @justintadlock committed Sep 5, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 extensions/random-custom-background.php
@@ -146,8 +146,14 @@ public function generate_random_background() {
/* Get the theme-supported random background array. */
$supports = get_theme_support( 'random-custom-background' );
+ /* Get the random backgrounds set. */
+ $backgrounds = isset( $supports[0] ) ? $supports[0] : array();
+
+ /* Allow developers to overwrite the backgrounds. */
+ $backgrounds = apply_filters( 'random_custom_backgrounds', $backgrounds );
+
/* If no backgrounds are set, return. */
- if ( !isset( $supports[0] ) || !is_array( $supports[0] ) )
+ if ( empty( $backgrounds ) )
return;
/* Set the backgrounds to the $backgrounds variable. */

0 comments on commit 53a93e4

Please sign in to comment.