Created
March 11, 2014 22:25
-
-
Save solepixel/9496395 to your computer and use it in GitHub Desktop.
Helpers file in MIni Loops Plugin
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 | |
# ... | |
function miniloops_shortcoder( $input ) { | |
$input = wp_filter_post_kses( $input ); | |
//give our shortcodes the correct prefix | |
$input = str_replace( '[', '[ml_', $input ); | |
$input = str_replace( '[/', '[/ml_', $input ); | |
//make sure we haven't doubled-up | |
$input = str_replace( '[ml_ml_', '[ml_', $input ); | |
$input = str_replace( '[/ml_ml_', '[/ml_', $input ); | |
$input = str_replace( '[ml_ba_', '[ba_', $input ); | |
$input = str_replace( '[/ml_ba_', '[/ba_', $input ); | |
$input = str_replace( '[ml_/ml_', '[/ml_', $input ); | |
//a hack: 2 shortcodes touching has issues | |
//%%%%% is a placeholder to be removed during output | |
$input = str_replace( '][', ']%%%%%[', $input ); | |
$input = stripslashes( $input ); | |
return $input; | |
} | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment