recipe

The Jetpack by WordPress.com recipe shortcode.


Usage

  1. // basic usage 
  2. echo do_shortcode('[recipe]'); 
  1. // variable usage 
  2. $result = do_shortcode('[recipe]'); 
  3. echo $result;  

Defined (2)

The shortcode is defined in the following location(s).

/modules/shortcodes/recipe.php  
  1. function action_init() { 
  2. // Enqueue styles if [recipe] exists 
  3. add_action( 'wp_head', array( $this, 'add_scripts' ), 1 ); 
  4.  
  5. // Render [recipe] 
  6. add_shortcode( 'recipe', array( $this, 'recipe_shortcode' ) ); 
  7.  
  8. /** 
  9. * Enqueue scripts and styles 
  10. */ 
  1. // Close it up 
  2. $html .= '</div>'; 
  3.  
  4. // If there is a recipe within a recipe, remove the shortcode 
  5. if ( has_shortcode( $html, 'recipe' ) ) { 
  6. remove_shortcode( 'recipe' ); 
  7.  
  8. // Sanitize html 
  9. $html = wp_kses_post( $html ); 
  10.