PluginProbe ʕ •ᴥ•ʔ
Shortcoder — Create Shortcodes for Anything / 5.1
Shortcoder — Create Shortcodes for Anything v5.1
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 / insert.php
shortcoder / admin Last commit date
css 6 years ago font 6 years ago images 6 years ago js 6 years ago admin.php 6 years ago edit.php 6 years ago form.php 6 years ago insert.php 6 years ago manage.php 6 years ago tools.php 6 years ago
insert.php
108 lines
1 <?php if( ! defined( 'ABSPATH' ) ) exit; ?>
2 <!DOCTYPE html>
3 <html>
4 <head>
5 <title>Insert shortcode</title>
6 <meta name="viewport" content="width=device-width, initial-scale=1" />
7 <link href="<?php echo SC_ADMIN_URL; ?>css/style-insert.css<?php echo '?ver=' . SC_VERSION; ?>" media="all" rel="stylesheet" />
8 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
9 <script src="<?php echo SC_ADMIN_URL; ?>js/script-insert.js<?php echo '?ver=' . SC_VERSION; ?>"></script>
10 </head>
11 <body>
12
13 <div class="sc_menu">
14 <input type="search" class="sc_search" placeholder="Search ..." />
15 </div>
16
17 <div class="sc_list">
18 <?php
19
20 $shortcodes = Shortcoder::get_shortcodes();
21
22 if( empty( $shortcodes ) ){
23 echo '<p class="sc_note">No shortcodes are created, go ahead create one in <a href="' . admin_url( 'post-new.php?post_type=' . SC_POST_TYPE ) . '" target="_blank">shortcoder admin page</a>.</p>';
24 }else{
25
26 foreach( $shortcodes as $name => $options ){
27 $id = $options[ 'id' ];
28 $content = $options[ 'content' ];
29 $settings = $options[ 'settings' ];
30
31 preg_match_all( '/%%[^%\s]+%%/', $content, $params );
32
33 $enclosed_sc = strpos( $content, '$$enclosed_content$$' ) !== false ? 'true' : 'false';
34
35 echo '<div class="sc_wrap" data-name="' . esc_attr( $name ) . '" data-id="' . esc_attr( $id ) . '" data-enclosed="' . $enclosed_sc . '">';
36 echo '<div class="sc_head">';
37 echo '<img src="' . SC_ADMIN_URL . '/images/arrow.svg" width="16" />';
38 echo '<h3>' . $settings[ '_sc_title' ] . '</h3>';
39 echo '<div class="sc_tools">';
40 if( current_user_can( 'edit_post', $id ) ){
41 echo '<a href="' . admin_url( 'post.php?action=edit&post=' . $id ) . '" class="button" target="_blank">' . __( 'Edit', 'shortcoder' ) . '</a>';
42 }
43 echo '<button class="button sc_copy">' . __( 'Copy', 'shortcoder' ) . '</button>';
44 echo '<button class="button sc_insert">' . __( 'Insert', 'shortcoder' ) . '</button>';
45 echo '</div>';
46 echo '</div>';
47
48 echo '<div class="sc_options">';
49
50 if( !empty( $params[0] ) ){
51 echo '<h4>' . __( 'Available parameters', 'shortcoder' ) . ': </h4>';
52 echo '<div class="sc_params_wrap">';
53 $temp = array();
54
55 foreach( $params[0] as $k => $v ){
56 $cleaned = str_replace( '%', '', $v );
57 if( !in_array( $cleaned, $temp ) ){
58 array_push( $temp, $cleaned );
59 echo '<label>' . $cleaned . ': <input type="text" class="sc_param" data-param="' . $cleaned . '"/></label> ';
60 }
61 }
62
63 echo '</div>';
64
65 }else{
66 echo '<p>' . __( 'No parameters present in this shortcode', 'shortcoder' ) . '</p>';
67 }
68
69 echo '<div class="sc_foot">';
70 echo '<button class="sc_insert button button-primary">' . __( 'Insert shortcode', 'sc' ) . '</button>';
71 if( $enclosed_sc == 'true' ){
72 echo '<span>' . __( 'Has enclosed content parameter', 'shortcoder' ) . '</span>';
73 }
74 echo '</div>';
75
76 echo '</div>';
77 echo '</div>';
78 }
79
80 echo '<p class="sc_note sc_search_none">' . __( 'No shortcodes match search term !', 'shortcoder' ) . '</p>';
81
82 }
83
84 ?>
85 </div>
86
87 <div class="cfe_box">
88 <?php
89 echo '<div class="cfe_text">';
90 echo '<img src="' . SC_ADMIN_URL . '/images/coffee.svg" />';
91 echo '<div><h2>Buy me a Coffee !</h2><p>If you like this plugin, buy me a coffee !</p></div>';
92 echo '</div>';
93 echo '<div class="cfe_form">';
94 echo '<select class="cfe_amt">';
95 for($i = 5; $i <= 15; $i++){
96 echo '<option value="' . $i . '" ' . ($i == 6 ? 'selected="selected"' : '') . '>$' . $i . '</option>';
97 }
98 echo '<option value="">Custom</option>';
99 echo '</select>';
100 echo '<a class="button button-primary cfe_btn" href="https://www.paypal.me/vaakash/6" data-link="https://www.paypal.me/vaakash/" target="_blank">Buy me coffee !</a>';
101 echo '</div>';
102 ?>
103 </div>
104
105 <div class="footer_thanks">Thanks for using <a href="https://www.aakashweb.com/wordpress-plugins/shortcoder/" target="_blank">Shortcoder</a> &bull; Please <a href="https://wordpress.org/support/plugin/shortcoder/reviews/?rate=5#new-post" target="_blank">rate 5 stars</a> and spread the word.</div>
106
107 </body>
108 </html>