PluginProbe ʕ •ᴥ•ʔ
Shortcoder — Create Shortcodes for Anything / 5.2.1
Shortcoder — Create Shortcodes for Anything v5.2.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
124 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 <a href="https://www.aakashweb.com/wordpress-plugins/ultimate-floating-widgets/" target="_blank" class="ufw"><i>Check out</i> : Ultimate floating widgets<span>A WordPress plugin to create floating widgets.</span></a>
16 </div>
17
18 <div class="sc_list">
19 <?php
20
21 $shortcodes = Shortcoder::get_shortcodes();
22
23 if( empty( $shortcodes ) ){
24 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>';
25 }else{
26
27 foreach( $shortcodes as $name => $options ){
28 $id = $options[ 'id' ];
29 $content = $options[ 'content' ];
30 $settings = $options[ 'settings' ];
31 $params = array();
32
33 preg_match_all( '/%%(.*?)%%/', $content, $matches );
34
35 $cp_data = $matches[1];
36
37 if( !empty( $cp_data ) ){
38 foreach( $cp_data as $data ){
39 $colon_pos = strpos( $data, ':' );
40 if( $colon_pos === false ){
41 array_push( $params, trim( $data ) );
42 }else{
43 $cp_name = substr( $data, 0, $colon_pos );
44 array_push( $params, trim( $cp_name ) );
45 }
46 }
47 }
48
49 $enclosed_sc = strpos( $content, '$$enclosed_content$$' ) !== false ? 'true' : 'false';
50
51 echo '<div class="sc_wrap" data-name="' . esc_attr( $name ) . '" data-id="' . esc_attr( $id ) . '" data-enclosed="' . $enclosed_sc . '">';
52 echo '<div class="sc_head">';
53 echo '<img src="' . SC_ADMIN_URL . '/images/arrow.svg" width="16" />';
54 echo '<h3>' . $settings[ '_sc_title' ] . '</h3>';
55 echo '<div class="sc_tools">';
56 if( current_user_can( 'edit_post', $id ) ){
57 echo '<a href="' . admin_url( 'post.php?action=edit&post=' . $id ) . '" class="button" target="_blank">' . __( 'Edit', 'shortcoder' ) . '</a>';
58 }
59 echo '<button class="button sc_copy">' . __( 'Copy', 'shortcoder' ) . '</button>';
60 echo '<button class="button sc_insert">' . __( 'Insert', 'shortcoder' ) . '</button>';
61 echo '</div>';
62 echo '</div>';
63
64 echo '<div class="sc_options">';
65
66 if( !empty( $params ) ){
67 echo '<h4>' . __( 'Available parameters', 'shortcoder' ) . ': </h4>';
68 echo '<div class="sc_params_wrap">';
69 $temp = array();
70
71 foreach( $params 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" class="sc_param" data-param="' . $cleaned . '"/></label> ';
76 }
77 }
78
79 echo '</div>';
80
81 }else{
82 echo '<p>' . __( 'No parameters present in this shortcode', 'shortcoder' ) . '</p>';
83 }
84
85 echo '<div class="sc_foot">';
86 echo '<button class="sc_insert button button-primary">' . __( 'Insert shortcode', 'sc' ) . '</button>';
87 if( $enclosed_sc == 'true' ){
88 echo '<span>' . __( 'Has enclosed content parameter', 'shortcoder' ) . '</span>';
89 }
90 echo '</div>';
91
92 echo '</div>';
93 echo '</div>';
94 }
95
96 echo '<p class="sc_note sc_search_none">' . __( 'No shortcodes match search term !', 'shortcoder' ) . '</p>';
97
98 }
99
100 ?>
101 </div>
102
103 <div class="cfe_box">
104 <?php
105 echo '<div class="cfe_text">';
106 echo '<img src="' . SC_ADMIN_URL . '/images/coffee.svg" />';
107 echo '<div><h2>Buy me a Coffee !</h2><p>If you like this plugin, buy me a coffee !</p></div>';
108 echo '</div>';
109 echo '<div class="cfe_form">';
110 echo '<select class="cfe_amt">';
111 for($i = 5; $i <= 15; $i++){
112 echo '<option value="' . $i . '" ' . ($i == 6 ? 'selected="selected"' : '') . '>$' . $i . '</option>';
113 }
114 echo '<option value="">Custom</option>';
115 echo '</select>';
116 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>';
117 echo '</div>';
118 ?>
119 </div>
120
121 <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>
122
123 </body>
124 </html>