This file contains 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
[flickrbadge count="4" layout="h" display="latest" size="t" source="all_tag" tag="fish"]Here’s the latest fish[/flickrbadge] |
This file contains 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
function donate_shortcode( $atts ) { | |
extract(shortcode_atts(array( | |
'text' => 'Make a donation', | |
'account' => 'REPLACE ME', | |
'for' => '', | |
), $atts)); | |
global $post; | |
if (!$for) $for = str_replace(" ","+",$post->post_title); | |
return '<a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$account.'&item_name=Donation+for+'.$for.'">'.$text.'</a>'; | |
} |
This file contains 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
function fn_googleMaps($atts, $content = null) { | |
extract(shortcode_atts(array( | |
"width" => '640', | |
"height" => '480', | |
"src" => '' | |
), $atts)); | |
return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'"></iframe>'; | |
} | |
add_shortcode("googlemap", "fn_googleMaps"); |
This file contains 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
function sc_note( $atts, $content = null ) { | |
if ( current_user_can( 'publish_posts' ) ) | |
return '<div class="note">'.$content.'</div>'; | |
return ''; | |
} | |
add_shortcode( 'note', 'sc_note' ); |
This file contains 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
add_shortcode( 'member', 'member_check_shortcode' ); | |
function member_check_shortcode( $atts, $content = null ) { | |
if ( is_user_logged_in() && !is_null( $content ) && !is_feed() ) | |
return $content; | |
return ''; | |
} |
This file contains 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
function my_formatter($content) { | |
$new_content = ''; | |
$pattern_full = '{(\[raw\].*?\[/raw\])}is'; | |
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; | |
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); | |
foreach ($pieces as $piece) { | |
if (preg_match($pattern_contents, $piece, $matches)) { | |
$new_content .= $matches[1]; | |
} else { | |
$new_content .= wptexturize(wpautop($piece)); |
This file contains 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
function chart_shortcode( $atts ) { | |
extract(shortcode_atts(array( | |
'data' => '', | |
'colors' => '', | |
'size' => '400x200', | |
'bg' => 'ffffff', | |
'title' => '', | |
'labels' => '', | |
'advanced' => '', | |
'type' => 'pie' |
This file contains 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
include_once(ABSPATH.WPINC.'/rss.php'); | |
function readRss($atts) { | |
extract(shortcode_atts(array( | |
"feed" => 'http://', | |
"num" => '1', | |
), $atts)); | |
return wp_rss($feed, $num); | |
} | |
add_shortcode('rss', 'readRss'); |
OlderNewer