Tag Info

Hot answers tagged

2

You can look to the code WordPress uses for parsing Shortcodes to get some ideas about how to do this. There are a couple of helpful core functions to simplify things. // our callback function to check for the shortcode. // this is where you'd put code to set a flag for rendering the shortcode elsewhere // the complete tag is in $tag[0], which can be passed ...


1

I would recommend using this plugin instead: https://wordpress.org/plugins/cpt-bootstrap-carousel/ It works well with the built-in Twitter Boostrap 3 in Roots.oi theme (Responsive) and it comes along with a CPT named carousel. Looking in your code: The get_post_gallery_images() function only returns the url and it doesn't contain any Gallery Image Title ...


1

You can use do_shortcode() echo do_shortcode($post_customs["project_items_".$i."_edit_proposal_item"][0]); More : http://codex.wordpress.org/Function_Reference/do_shortcode


1

Your sort of right, the Wordpress editor saves content thru a filter called the_content. This filter is used to filter the content of the post after it is retrieved from the database and before it is printed to the screen. Apply this filter to simulate TinyMCE formatting. <?php echo apply_filters( 'the_content', $options['textarea_input']); ?>


1

Transients are probably not the way to go here. From what I understand: You want to know if a post has a shortcode by doing some form of look up You want to be able to get a list of permalinks / posts that have this shortcode. Here's what I suggest. /** * Checks for calender shortcode and flags the post with post meta. * @param integer $post_id * ...


1

I have worked it out and here are the steps to what I did to get it working created a custom table in the wordpress database (called it wp-products) this table had the following fields: id, make, model, price Created a shortcode to retrieve the price. Shortcode looks like this [product_price id=2] where id=2 is the price value for item 2 in the table. ...


1

add_filter( 'the_content', 'wpse168789_shortcode_checker' ); function wpse168789_shortcode_checker( $content ) { // 1. Does the shortcode exist? if( has_shortcode( $content, 'content_block' ) ) { // 2. Is it using position='top'? $regex = '/\[content_block[^\]]*position=[\'"]?top[\'"]?[^\]]*\]/'; if( preg_match( $regex, ...



Only top voted, non community-wiki answers of a minimum length are eligible