Last active
August 29, 2015 14:21
-
-
Save eri-trabiccolo/3dc422fc39fa4dd77f5d to your computer and use it in GitHub Desktop.
Action hook between the first and the second FPU row
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$n_match = 0; | |
function fp_action(){ | |
global $n_match; | |
$n_match++; | |
ob_start(); | |
do_action("__between_fp_rows_{$n_match}"); | |
$my_action = ob_get_contents(); | |
if (! $my_action ) return ''; | |
ob_end_clean(); | |
return $my_action; | |
} | |
add_filter('fpc_block_display', 'something_between_rows'); | |
function something_between_rows( $_html ){ | |
return preg_replace_callback('%(</div>)(<div class=[\'|"]fpc-row-fluid)%', 'something_between_rows_callback', $_html); | |
} | |
function something_between_rows_callback( $matches ){ | |
return $matches[1] . fp_action() . $matches[2]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment