PluginProbe ʕ •ᴥ•ʔ
Shortcoder — Create Shortcodes for Anything / 4.3
Shortcoder — Create Shortcodes for Anything v4.3
trunk 3.0 3.0.1 3.1 3.2 3.3 3.4 3.4.1 4.0 4.0.1 4.0.2 4.0.3 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2 4.3 4.4 4.5 4.6 5.0 5.0.1 5.0.2 5.0.3 5.0.4 5.1 5.2 5.2.1 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.4 5.5 5.6 5.7 5.8 6.0 6.1 6.2 6.3 6.3.1 6.3.2 6.4 6.5 6.5.1 6.5.2 6.5.3
shortcoder / admin / sc-insert.php
shortcoder / admin Last commit date
css 7 years ago images 7 years ago js 7 years ago sc-admin.php 7 years ago sc-insert.php 7 years ago
sc-insert.php
116 lines
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Insert shortcode</title>
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
6 <link href="<?php echo SC_ADMIN_URL; ?>css/style-insert.css<?php echo '?ver=' . SC_VERSION; ?>" media="all" rel="stylesheet" />
7 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
8 <script src="<?php echo SC_ADMIN_URL; ?>js/script-insert.js<?php echo '?ver=' . SC_VERSION; ?>"></script>
9 </head>
10 <body>
11
12 <h2 class="sc_head">Insert shortcode to editor</h2>
13
14 <div class="sc_menu">
15 <input type="search" class="button search_box" placeholder="Search ..." />
16 <a href="#" class="button tags_filter_btn">Filter by tags</a>
17 <a href="#" class="button sort_btn">Sort list</a>
18 <?php
19 if( Shortcoder::can_edit_sc( 'manage_options' ) ){
20 echo '<a href="' . admin_url( 'options-general.php?page=shortcoder&action=new' ) . '" target="_blank" class="button new_btn">Create new shortcode</a>';
21 }
22 ?>
23 </div>
24
25 <ul class="sc_tags clearfix">
26 <?php
27 $all_tags = Shortcoder::get_tags();
28 foreach($all_tags as $tag){
29 echo '<li data-value="' . $tag . '">' . $tag . '</li>';
30 }
31 ?>
32 </ul>
33
34 <div class="sc_wrap">
35 <?php
36
37 $shortcodes = Shortcoder::list_all();
38
39 if( empty( $shortcodes ) ){
40 echo '<p align="center">No shortcodes are created, go ahead create one in <a href="' . admin_url( 'options-general.php?page=shortcoder' ) . '" target="_blank">shortcoder admin page</a>.</p>';
41 }else{
42
43 foreach( $shortcodes as $key=>$value ){
44 if($key != '_version_fix'){
45
46 $name = esc_attr( $key );
47 $value = wp_parse_args( $value, Shortcoder::defaults() );
48 $disabled_text = ( $value[ 'disabled' ] == '1' ) ? '<small class="disabled_text">Temporarily disabled</small>' : '';
49 $selected_tags = esc_attr( implode( ', ', $value[ 'tags' ] ) );
50
51 $options = '<span class="sc_options">';
52 $options .= '<span class="sc_tags_disp">' . $selected_tags . '</span>';
53
54 $options .= '<button class="button sc_quick_insert">Quick insert</button>';
55
56 if( Shortcoder::can_edit_sc( 'manage_options' ) ){
57 $options .= '<a href="' . esc_attr( admin_url( 'options-general.php?page=shortcoder&action=edit&id=' . base64_encode( $name ) ) ) . '" target="_blank" class="button">Edit</a>';
58 }
59
60 $options .= '</span>';
61
62 echo '<div class="sc_shortcode" data-name="' . $name . '" data-tags="' . $selected_tags . '">';
63 echo '<div class="sc_shortcode_name">' . $name . $disabled_text . $options . '</div>';
64 preg_match_all('/%%[^%\s]+%%/', $value['content'], $matches );
65
66 echo '<div class="sc_params">';
67 if(!empty($matches[0])){
68 echo '<h4>Available parameters: </h4>';
69 echo '<div class="sc_params_wrap">';
70 $temp = array();
71 foreach($matches[0] as $k=>$v){
72 $cleaned = str_replace('%', '', $v);
73 if(!in_array($cleaned, $temp)){
74 array_push($temp, $cleaned);
75 echo '<label>' . $cleaned . ': <input type="text" data-param="' . $cleaned . '"/></label> ';
76 }
77 }
78 echo '</div>';
79 echo'<hr/>';
80 }else{
81 echo 'No parameters available - ';
82 }
83 echo '<input type="button" class="sc_insert button button-primary" value="Insert Shortcode"/>';
84 echo '</div>';
85 echo '</div>';
86 }
87 }
88
89 }
90 ?>
91 </div>
92
93 <footer class="coffee_box">
94 <div class="coffee_amt_wrap">
95 <p><select class="coffee_amt">
96 <option value="2">$2</option>
97 <option value="3">$3</option>
98 <option value="4">$4</option>
99 <option value="5" selected="selected">$5</option>
100 <option value="6">$6</option>
101 <option value="7">$7</option>
102 <option value="8">$8</option>
103 <option value="9">$9</option>
104 <option value="10">$10</option>
105 <option value="11">$11</option>
106 <option value="12">$12</option>
107 <option value="">Custom</option>
108 </select></p>
109 <a class="button button-primary buy_coffee_btn" href="https://www.paypal.me/vaakash/5" data-link="https://www.paypal.me/vaakash/" target="_blank">Buy me a coffee !</a>
110 </div>
111 <h3>Buy me a coffee !</h3>
112 <p>Thank you for using Shortcoder. If you found the plugin useful buy me a coffee ! Your donation will motivate and make me happy for all the efforts. You can donate via PayPal.</p>
113 </footer>
114
115 </body>
116 </html>