Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Last active August 29, 2015 14:21
Show Gist options
  • Save eri-trabiccolo/3dc422fc39fa4dd77f5d to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/3dc422fc39fa4dd77f5d to your computer and use it in GitHub Desktop.
Action hook between the first and the second FPU row
$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