Permalink
Browse files

Fix bug in wfx_background_divs()

Fix bug where it was not assigning correct ID’s and counters for multiple wrappers.
  • Loading branch information...
Jonnyauk committed Aug 15, 2018
1 parent 58854e5 commit 5092df99a989c11c3f03a538d246d39cd0b3ade8
Showing with 17 additions and 14 deletions.
  1. +17 −14 wf-includes/wf-theme-core.php
@@ -217,27 +217,30 @@ function wf_background_divs($args) {
// Remove create_function() for PHP 7.2 compat
//add_action( $open_hook, create_function( '', "echo '<div class=\"$container_type\" id=\"' . '$this->wfx_count_bg_divs_hook' . '-bg-' . '$this->wfx_count_bg_divs' . '\">' . \"\n\";" ), 1);
add_action(
$open_hook,
function() use ( $container_type ) {
echo '<div class="'
. $container_type
$div_counter = $this->wfx_count_bg_divs;
add_action(
$open_hook,
function() use ( $container_type, $location_out, $div_counter ) {
echo '<div class="'
. $container_type
. '" id="'
. $this->wfx_count_bg_divs_hook
. '-bg-'
. $this->wfx_count_bg_divs
. '">'
. "\n";
. $location_out
. '-bg-'
. $div_counter
. '">'
. "\n";
}
, 1
);
// Remove create_function() for PHP 7.2 compat
//add_action( $close_hook, create_function( '', 'echo "</div>";' ), 12 );
add_action(
$close_hook,
function() { echo "</div>"; }
, 12
add_action(
$close_hook,
function() { echo "</div>"; }
, 12
);
}

0 comments on commit 5092df9

Please sign in to comment.