Lego2012
12/13/2016 - 2:32 PM

Copy variables from one scope to another

Copy variables from one scope to another

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

add_action( 'genesis_header', 'my_test_callback' );
function my_test_callback() {
    $array = array(
        'one',
        'two',
        'three'
    );

    add_action( 'genesis_footer', function () use ( $array ) {
        var_dump( $array );
    } );
}