' . do_shortcode($content) . '';
}
add_shortcode('one_third', 'brussels_webtreats_one_third');
function brussels_webtreats_one_third_last( $atts, $content = null ) {
return '
' . do_shortcode($content) . '
';
}
add_shortcode('one_third_last', 'brussels_webtreats_one_third_last');
function brussels_webtreats_two_third( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('two_third', 'brussels_webtreats_two_third');
function brussels_webtreats_two_third_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('two_third_last', 'brussels_webtreats_two_third_last');
function brussels_webtreats_one_half( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_half', 'brussels_webtreats_one_half');
function brussels_webtreats_one_half_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_half_last', 'brussels_webtreats_one_half_last');
function brussels_webtreats_one_fourth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_fourth', 'brussels_webtreats_one_fourth');
function brussels_webtreats_one_fourth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_fourth_last', 'brussels_webtreats_one_fourth_last');
function brussels_webtreats_three_fourth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('three_fourth', 'brussels_webtreats_three_fourth');
function brussels_webtreats_three_fourth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('three_fourth_last', 'brussels_webtreats_three_fourth_last');
function brussels_webtreats_one_fifth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_fifth', 'brussels_webtreats_one_fifth');
function brussels_webtreats_one_fifth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_fifth_last', 'brussels_webtreats_one_fifth_last');
function brussels_webtreats_two_fifth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('two_fifth', 'brussels_webtreats_two_fifth');
function brussels_webtreats_two_fifth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('two_fifth_last', 'brussels_webtreats_two_fifth_last');
function brussels_webtreats_three_fifth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('three_fifth', 'brussels_webtreats_three_fifth');
function brussels_webtreats_three_fifth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('three_fifth_last', 'brussels_webtreats_three_fifth_last');
function brussels_webtreats_four_fifth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('four_fifth', 'brussels_webtreats_four_fifth');
function brussels_webtreats_four_fifth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('four_fifth_last', 'brussels_webtreats_four_fifth_last');
function brussels_webtreats_one_sixth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_sixth', 'brussels_webtreats_one_sixth');
function brussels_webtreats_one_sixth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('one_sixth_last', 'brussels_webtreats_one_sixth_last');
function brussels_webtreats_five_sixth( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('five_sixth', 'brussels_webtreats_five_sixth');
function brussels_webtreats_five_sixth_last( $atts, $content = null ) {
return '' . do_shortcode($content) . '
';
}
add_shortcode('five_sixth_last', 'brussels_webtreats_five_sixth_last');
// Disabling WordPress wpautop and wptexturize filters
function brussels_webtreats_formatter($content) {
$new_content = '';
/* Matches the contents and the open and closing tags */
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
/* Matches just the contents */
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
/* Divide content into pieces */
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);
/* Loop over pieces */
foreach ($pieces as $piece) {
/* Look for presence of the shortcode */
if (preg_match($pattern_contents, $piece, $matches)) {
/* Append to content (no formatting) */
$new_content .= $matches[1];
} else {
/* Format and append to content */
$new_content .= wptexturize(wpautop($piece));
}
}
return $new_content;
}
// Remove the 2 main auto-formatters
remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
// Before displaying for viewing, apply this function
add_filter('the_content', 'brussels_webtreats_formatter', 99);
add_filter('widget_text', 'brussels_webtreats_formatter', 99);
//Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553
// @ini_set('pcre.backtrack_limit', 500000);
/* ------- Boxes - Alert ( Yellow ) --------*/
function brussels_alertbox($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('alert' , 'brussels_alertbox' );
/* ------- Boxes - News ( Grey ) --------*/
function brussels_newsbox($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('news' , 'brussels_newsbox' );
/* ------- Boxes - Info ( Blue ) --------*/
function brussels_infobox($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('info' , 'brussels_infobox' );
/* ------- Boxes - Warning ( Red ) --------*/
function brussels_warningbox($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('warning' , 'brussels_warningbox' );
/* ------- Boxes - Download ( Green ) --------*/
function brussels_downloadbox($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('download' , 'brussels_downloadbox' );
/* ------- Drop Cap Small --------*/
function brussels_dropcap($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('dropcap-small' , 'brussels_dropcap' );
/* ------- Drop Cap Large --------*/
function brussels_dropcap2($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('dropcap-big' , 'brussels_dropcap2' );
/* ------- Drop Cap Square --------*/
function brussels_dropcap3($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('dropcap-square' , 'brussels_dropcap3' );
/* ------- Drop Cap Circle --------*/
function brussels_dropcap4($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('dropcap-circle' , 'brussels_dropcap4' );
/* ------- Sticky Note Left Aligned --------*/
function brussels_stickyleft($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('stickyleft' , 'brussels_stickyleft' );
/* ------- Sticky Note Right Aligned --------*/
function brussels_stickyright($atts, $content=null, $code="") {
$return = '';
$return .= $content;
$return .= '
';
return $return;
}
add_shortcode('stickyright' , 'brussels_stickyright' );