Created
          February 7, 2018 07:31 
        
      - 
      
- 
        Save salehahmadbabu/c34ca17038e1c69f33d467265d7c8a1c to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | <?php | |
| /* | |
| Plugin Name: Stock Toolkit | |
| */ | |
| // test shortcode | |
| function stock_alert_shortcode($atts, $content = '') { | |
| extract(shortcode_atts( | |
| // array( | |
| // 'value' => '', | |
| // 'color' => '', | |
| // 'text' => '' | |
| // ), | |
| array( | |
| 'btn_text' => '', | |
| 'p_text' => '', | |
| 'id' => '' | |
| ), | |
| $atts | |
| )); | |
| $image_src = wp_get_attachment_image_src( $id, 'large' ); | |
| return '<div class="row"> | |
| <div class="col-sm-6 col-md-8"> | |
| <div class="thumbnail"> | |
| <img src="'.$image_src[0].'" alt="..."> | |
| <div class="caption"> | |
| <h3>Thumbnail label</h3> | |
| <p>'.$p_text.'</p> | |
| <p><a href="#" class="btn btn-primary" role="button">'.$btn_text.'</a> <a href="#" class="btn btn-default" role="button">'.$btn_text.'</a></p> | |
| </div> | |
| </div> | |
| </div> | |
| </div>'; | |
| // return '<div class="progress"> | |
| // <div class="progress-bar" role="progressbar" aria-valuenow="'.$value.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$value.'%;"> | |
| // <span class="sr-only" style="color:'.$color.'">70% Complete</span> | |
| // </div> | |
| // </div>'; | |
| // return '<'.$head.'>'.$text.' <span class="label label-default">'.$label_text.'</span></'.$head.'>'; | |
| } | |
| add_shortcode( 'alert', 'stock_alert_shortcode' ); | |
| ?> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment