Created
November 9, 2015 15:39
-
-
Save MjHead/1aae0be289a05480cd94 to your computer and use it in GitHub Desktop.
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
<?php | |
add_filter( 'cherry_shortcodes_output', 'themeXXXX_row_add_tags', 10, 3 ); | |
/** | |
* Add custom markup inside row shortcode. | |
* | |
* @param string $output shortcode content. | |
* @param array $atts attributes array. | |
* @param string $shortcode shortcode name. | |
* @return string | |
*/ | |
function themeXXXX_row_add_tags( $output, $atts, $shortcode ) { | |
if ( 'row' !== $shortcode ) { | |
return $output; | |
} | |
if ( ! isset( $atts['style'] ) || 'light' !== $atts['style'] ) { | |
return $output; | |
} | |
$tags = '<div class="test-1"></div><div class="test-2"></div>'; | |
$output = preg_replace( '/(<\/div>)$/', $tags . '$1', $output ); | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment