1 | <?php |
---|
2 | class test35770 { |
---|
3 | private $_counter = 0; |
---|
4 | public function __construct() { |
---|
5 | add_action( 'init', array( $this, 'init' ) ); |
---|
6 | add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
---|
7 | } |
---|
8 | |
---|
9 | public function init() { |
---|
10 | add_shortcode( 'content_with_image', function( $atts, $shortcode_content = '' ){ |
---|
11 | |
---|
12 | $options = shortcode_atts( array( |
---|
13 | 'image_position' => 'left', |
---|
14 | 'image_size' => 'medium', |
---|
15 | 'image_id' => '', |
---|
16 | 'image_link' => '', |
---|
17 | 'content_margin_top' => '0', |
---|
18 | 'title' => '', |
---|
19 | 'title_tag' => 'h3', |
---|
20 | 'allow_content_below_image' => 'no', |
---|
21 | 'margin' => '40px 0', |
---|
22 | ), $atts ); |
---|
23 | |
---|
24 | return 'shortcode content'; |
---|
25 | |
---|
26 | }); |
---|
27 | } |
---|
28 | |
---|
29 | public function admin_notices() { |
---|
30 | echo '<div class="notice notice-success"><h2>Testing 35770</h2><p>'; |
---|
31 | echo do_shortcode( '[content_with_image image_position="left" image_id="198" content_margin_top="0" title="EXPERIENCED GUIDES" allow_content_below_image="no"] |
---|
32 | |
---|
33 | Shortcode content |
---|
34 | |
---|
35 | [/content_with_image]' ); |
---|
36 | echo '</p></div>'; |
---|
37 | } |
---|
38 | } |
---|
39 | |
---|
40 | new test35770; |
---|