portfolio

The Jetpack by WordPress.com portfolio shortcode.


Usage

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

Defined (2)

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

/modules/custom-post-types/portfolios.php  
  1.  
  2. add_image_size( 'jetpack-portfolio-admin-thumb', 50, 50, true ); 
  3. add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) ); 
  4.  
  5. // registerjetpack_portfolioshortcode and portfolio shortcode (legacy) 
  6. add_shortcode( 'portfolio', array( $this, 'portfolio_shortcode' ) ); 
  7. add_shortcode( jetpack_portfolio, array( $this, 'portfolio_shortcode' ) ); 
  8.  
  9. // Adjust CPT archive and custom taxonomies to obey CPT reading setting 
  10. add_filter( 'pre_get_posts', array( $this, 'query_reading_setting' ) ); 
  11.  
  1. $html = ob_get_clean(); 
  2.  
  3. // If there is a [portfolio] within a [portfolio], remove the shortcode 
  4. if ( has_shortcode( $html, 'portfolio' ) ) { 
  5. remove_shortcode( 'portfolio' ); 
  6.  
  7. // Return the HTML block 
  8. return $html;