PluginProbe
Post Snippets – Custom WordPress Code Snippets Customizer / trunk
Post Snippets – Custom WordPress Code Snippets Customizer vtrunk
4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.1 1.7.2 1.7.3 1.8 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.8.9.1 1.8.9.2 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 All 115 releases
post-snippets / views / help / restapi.php

restapi.php in Post Snippets – Custom WordPress Code Snippets Customizer trunk, at views/help/restapi.php

142 lines 7.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3 ?>
4
5 <h2><?php _e('REST API', 'post-snippets'); ?> (<em><?php _e('for developers', 'post-snippets'); ?></em>)</h2>
6
7
8
9 <p><?php _e('Post Snippets REST API endpoints allow you to create, update, delete and get the snippet.', 'post-snippets'); ?></p>
10
11 <p style="color:red"><?php _e('Note: If any endpoint field is empty then that request will not be registered.', 'post-snippets'); ?></p>
12 <p style="color:red"><?php _e('Note: If 2 endpoint fields are identical then no requests will be registered.', 'post-snippets'); ?></p>
13
14 <h3><?php _e('Post Snippets Enable:', 'post-snippets'); ?></h3>
15 <ul>
16 <li><?php _e('Click on the checkbox to enable the post snippets REST API functionality.', 'post-snippets'); ?></li>
17 </ul>
18
19 <h3><?php _e('Post Snippets Token:', 'post-snippets'); ?></h3>
20 <ul>
21 <li><?php _e('Click on the Generate Token button.', 'post-snippets'); ?></li>
22 <li><?php _e('You will find 16 character generated token in the input field.', 'post-snippets'); ?></li>
23 <li><?php _e('Each time you click on the generate token button, it will create a unique token.', 'post-snippets'); ?></li>
24 </ul>
25
26 <h3><?php _e('Create Snippet:', 'post-snippets'); ?></h3>
27 <p style="color:red"><?php _e('Note: Do not enter any special characters [!@#$%^&*_(=+-)] into the title.', 'post-snippets'); ?></p>
28 <ul>
29 <li><?php _e('Enter the snippet title', 'post-snippets'); ?></li>
30 <li><?php _e('After entering the snippet title and saving settings, you will see the REST API URI.', 'post-snippets'); ?></li>
31 <li><?php _e('Use the following URI parameters to create a snippet', 'post-snippets'); ?>
32
33 <ul>
34 <li>{token} : (xxxxxxxxxxxxxxxx) 16 character generated token</li>
35 <li>{snippet-title} : sample-snippet</li>
36 <li>{vars}: use <strong>0</strong> for empty or enter comma separated values e.g: <strong>bob, rob, den</strong></li>
37 <li>{shortcode}: <strong>1</strong> for enable or <strong>0</strong> for disable/empty </li>
38 <li>{php} : <strong>1</strong> or <strong>0</strong></li>
39 <li>{wptexturize} : <strong>1</strong> or <strong>0</strong></li>
40 <li>{snippet-code}: write <strong>simple/plain</strong> text, <strong>HTML, PHP</strong> etc.</li>
41 <li>{snippet-description}: lorem ipsum is simply dummy text</li>
42 </ul>
43 </li>
44 <li><?php _e('Response result should look like this:', 'post-snippets'); ?>
45 <ul>
46 <li style="list-style-type: none;"><img src="<?php echo plugins_url('assets/img/help/create-snippet-success.png', \PostSnippets::FILE); ?>" /></li>
47 </ul>
48 </li>
49 </ul>
50
51 <h3><?php _e('Update Snippet:', 'post-snippets'); ?></h3>
52 <p style="color:red"><?php _e('Note: Do not enter any special characters [!@#$%^&*_(=+-)] into the title.', 'post-snippets'); ?></p>
53 <ul>
54 <li><?php _e('Enter the snippet title', 'post-snippets'); ?></li>
55 <li><?php _e('After entering the snippet title and saving settings, you will see the REST API URI.', 'post-snippets'); ?></li>
56 <li><?php _e('Use the following URI parameters to update a snippet', 'post-snippets'); ?>
57
58 <ul>
59 <li>{token} : (xxxxxxxxxxxxxxxx) 16 character generated token</li>
60 <li>{snippet-title} : sample-snippet (The title of snippet to update)</li>
61 <li>{vars}: use <strong>0</strong> for empty or enter comma separated values e.g: <strong>bob, rob, den</strong></li>
62 <li>{shortcode}: <strong>1</strong> for enable or <strong>0</strong> for disable/empty </li>
63 <li>{php} : <strong>1</strong> or <strong>0</strong></li>
64 <li>{wptexturize} : <strong>1</strong> or <strong>0</strong></li>
65 <li>{snippet-code}: write <strong>simple/plain</strong> text, <strong>HTML, PHP</strong> etc.</li>
66 <li>{snippet-description}: lorem ipsum is simply dummy text</li>
67 </ul>
68 </li>
69 <li><?php _e('Response result should look like this:', 'post-snippets'); ?>
70 <ul>
71 <li style="list-style-type: none;"><img src="<?php echo plugins_url('assets/img/help/update-snippet-success.png', \PostSnippets::FILE); ?>" /></li>
72 </ul>
73 </li>
74 </ul>
75
76
77 <h3><?php _e('Get Particular Snippet:', 'post-snippets'); ?></h3>
78 <ul>
79 <li><?php _e('Enter the snippet title', 'post-snippets'); ?></li>
80 <li><?php _e('After entering the snippet title and saving settings, you will see the REST API URI.', 'post-snippets'); ?></li>
81 <li><?php _e('Use the following URI parameters to get a particular snippet', 'post-snippets'); ?>
82 <ul>
83 <li>{token} : (xxxxxxxxxxxxxxxx) 16 character generated token</li>
84 <li>{snippet-title} : sample-snippet (The title of snippet to get)</li>
85 </ul>
86 </li>
87 <li><?php _e('Response result should look like this:', 'post-snippets'); ?>
88 <ul>
89 <li style="list-style-type: none;"><img src="<?php echo plugins_url('assets/img/help/get-a-snippet-success.png', \PostSnippets::FILE); ?>" /></li>
90 </ul>
91 </li>
92 </ul>
93
94 <h3><?php _e('Get all Snippets:', 'post-snippets'); ?></h3>
95 <ul>
96 <li><?php _e('Enter the snippet title e.g: get-all-snippets', 'post-snippets'); ?></li>
97 <li><?php _e('After entering the snippet title and saving settings, you will see the REST API URI.', 'post-snippets'); ?></li>
98 <li><?php _e('Use the following URI parameters to get all snippets', 'post-snippets'); ?>
99 <ul>
100 <li>{token} : (xxxxxxxxxxxxxxxx) 16 character generated token</li>
101 </ul>
102 </li>
103 <li><?php _e('Response result should look like this:', 'post-snippets'); ?>
104 <ul>
105 <li style="list-style-type: none;"><img src="<?php echo plugins_url('assets/img/help/get-all-snippets-success.png', \PostSnippets::FILE); ?>" /></li>
106 </ul>
107 </li>
108 </ul>
109
110 <h3><?php _e('Delete a particular snippet:', 'post-snippets'); ?></h3>
111 <ul>
112 <li><?php _e('Enter the snippet title e.g: del-snippet', 'post-snippets'); ?></li>
113 <li><?php _e('After entering the snippet title and saving settings, you will see the REST API URI.', 'post-snippets'); ?></li>
114 <li><?php _e('Use the following URI parameters to delete a particular snippet', 'post-snippets'); ?>
115 <ul>
116 <li>{token} : (xxxxxxxxxxxxxxxx) 16 character generated token</li>
117 <li>{snippet-title} : sample-snippet (The title of snippet to delete)</li>
118 </ul>
119 </li>
120 <li><?php _e('Response result should look like this:', 'post-snippets'); ?>
121 <ul>
122 <li style="list-style-type: none;"><img src="<?php echo plugins_url('assets/img/help/delete-a-snippet-success.png', \PostSnippets::FILE); ?>" /></li>
123 </ul>
124 </li>
125 </ul>
126
127 <h3><?php _e('Delete multiple snippets:', 'post-snippets'); ?></h3>
128 <ul>
129 <li><?php _e('Enter the snippet title e.g: del-multiple-snippets', 'post-snippets'); ?></li>
130 <li><?php _e('After entering the snippet title and saving settings, you will see the REST API URI.', 'post-snippets'); ?></li>
131 <li><?php _e('Use the following URI parameters to delete snippets', 'post-snippets'); ?>
132 <ul>
133 <li>{token} : (xxxxxxxxxxxxxxxx) 16 character generated token</li>
134 <li>{snippet1-title}, {snippet2-title}, {snippet3-title}: first-snippet, second-snippet, third-snippet</li>
135 </ul>
136 </li>
137 <li><?php _e('Response result should look like this:', 'post-snippets'); ?>
138 <ul>
139 <li style="list-style-type: none;"><img src="<?php echo plugins_url('assets/img/help/delete-multiple-snippets-success.png', \PostSnippets::FILE); ?>" /></li>
140 </ul>
141 </li>
142 </ul>