How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
WP UI style within shortcode – Any Suggestions?
Based on my own experience, I’ve used a combination of method 1 & 2 – the architecture and footer scripts of 1, and the ‘look-ahead’ technique of 2. For the look-ahead though, I use regex in place of stripos; personal preference, faster, and can check for ‘malformed’ shortcode; preg_match( ‘#\[ *shortcode([^\]])*\]#i’, $content ); If you’re … Read more
each time you call the shortcode function, you overwrite the previous script var with the current version. make it an array instead of a string: self::$var[] = $script; and then output with foreach: public static function footer() { foreach( self::$var as $script ){ echo $script; } }
Widget not displaying in WMPU sites
Thanks, i got it now; indeed with meta_query. function my_recent_posts_shortcode( $atts ) { global $post; $currenttime = current_time(“mysql”); $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘newsbox-date’, ‘value’ => $currenttime, ‘compare’ => ‘>’ ) ) ); $newsbox = new WP_Query( $args ); if ( $newsbox->have_posts() ) : $list=”<div class=”newsbox-posts”>”; while ( … Read more
do_shortcode via ajax
Shortcode in posts called by ajax is not working
Shortcode default attributes over-riding non-default attributes
AFAIK that sort of hook does not exists. You have 2 choiches: use ‘post_class’ filter hook, check if in admin and if the query string contain a shortcode and if so and if the post has not that shortcode add hidden class that via core admin CSS is set to display: none. In this way … Read more