| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class Shortcode { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Add Shortcode |
||
| 18 | * |
||
| 19 | * @return Void |
||
| 20 | */ |
||
| 21 | public function __construct() { |
||
| 22 | |||
| 23 | add_shortcode( 'shortcode_name', array( $this, 'cb' ) ); |
||
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Shortcode callback |
||
| 28 | * |
||
| 29 | * @param Array $atts |
||
| 30 | * |
||
| 31 | * @return Html |
||
| 32 | */ |
||
| 33 | public function cb($atts) { |
||
| 34 | |||
| 35 | $data = shortcode_atts( array( |
||
| 36 | 'type' => 'zip', |
||
| 37 | ), $atts ); |
||
| 38 | |||
| 39 | return $this->html(); |
||
| 40 | } |
||
| 41 | |||
| 42 | |||
| 43 | /** |
||
| 44 | * Shortcode Display |
||
| 45 | * |
||
| 46 | * @return Html |
||
| 47 | */ |
||
| 48 | public function html() { ?> |
||
| 50 | <div class="class"> |
||
| 51 | Some text. |
||
| 52 | </div> |
||
| 57 |