Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function azc_bbcode_div_color($atts, $content = null) {
- if (empty($atts)){
- $bg = 'black';
- }else{
- $attribs = implode('',$atts);
- $bg = str_replace("'", '', str_replace('"', '', substr ( $attribs, 1)));
- if(ctype_xdigit($bg)) {
- $bg = $bg;
- }
- }
- return "<div class='".$bg."'>".do_shortcode($content)."</div>";
- }
- add_shortcode( 'Class', 'azc_bbcode_div_color' );
- add_shortcode( 'CLASS', 'azc_bbcode_div_color' );
- add_shortcode( 'class', 'azc_bbcode_div_color' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement