PluginProbe
Advanced Excerpt / trunk
Advanced Excerpt vtrunk
trunk 0.2.2 3.0 3.1 4.0 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 All 30 releases
advanced-excerpt / template / options.php

options.php in Advanced Excerpt trunk, at template/options.php

278 lines 13.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="wrap advanced-excerpt">
2 <h2><?php _e( "Advanced Excerpt Options", 'advanced-excerpt' ); ?></h2>
3 <?php if ( isset( $_GET['settings-updated'] ) ) : ?>
4 <div id="message" class="updated fade"><p><?php _e( 'Options saved.', 'advanced-excerpt' ); ?></p></div>
5 <?php endif; ?>
6
7 <div class="advanced-excerpt-container">
8
9 <div class="advanced-excerpt-main">
10
11 <form method="post" action="" autocomplete="off">
12 <?php if ( function_exists( 'wp_nonce_field' ) ) wp_nonce_field( 'advanced_excerpt_update_options' ); ?>
13 <table class="form-table">
14 <tr valign="top">
15 <th scope="row">
16 <label for="length">
17 <?php _e( "Excerpt Length:", 'advanced-excerpt' ); ?>
18 </label>
19 </th>
20 <td>
21 <input name="length" type="text" id="length" value="<?php echo esc_attr( $length ); ?>" size="2" />
22 <select name="length_type">
23 <option value="characters"<?php echo ( 'characters' == $length_type ) ? ' selected="selected"' : ''; ?>><?php _e( "Characters", 'advanced-excerpt' ); ?></option>
24 <option value="words"<?php echo ( 'words' == $length_type ) ? ' selected="selected"' : ''; ?>><?php _e( "Words", 'advanced-excerpt' ); ?></option>
25 </select>
26 </td>
27 </tr>
28 <tr valign="top">
29 <th scope="row">
30 <label for="ellipsis">
31 <?php _e( "Ellipsis:", 'advanced-excerpt' ); ?>
32 </label>
33 </th>
34 <td>
35 <p>
36 <input name="ellipsis" type="text" id="ellipsis" value="<?php echo esc_attr( $ellipsis ); ?>" size="5" />
37 <?php printf( __( '(use <a href="%s" target="_blank">HTML entities</a>)', 'advanced-excerpt' ), 'http://entitycode.com' ); ?>
38 </p>
39 <p class="description"><?php _e( "Will substitute the part of the post that is omitted in the excerpt.", 'advanced-excerpt' ); ?></p>
40 </td>
41 </tr>
42 <tr valign="top">
43 <th scope="row">
44 <?php _e( "Finish:", 'advanced-excerpt' ); ?>
45 </th>
46 <td>
47 <p>
48 <label for="finish-none">
49 <input type="radio" id="finish-none" name="finish" value="exact"<?php echo ( 'exact' == $finish ) ? ' checked="checked"' : ''; ?> />
50 <?php _e( "Exact", 'advanced-excerpt' ); ?>
51 </label><br />
52 <input type="radio" id="finish-exact-2" name="finish" value="exact_w_spaces"<?php echo ( 'exact_w_spaces' == $finish ) ? ' checked="checked"' : ''; ?> />
53 <?php _e( "Exact <small>(count spaces as well)</small>", 'advanced-excerpt' ); ?>
54 </label><br />
55 <label for="finish-word">
56 <input type="radio" id="finish-word" name="finish" value="word"<?php echo ( 'word' == $finish ) ? ' checked="checked"' : ''; ?> />
57 <?php _e( "Word", 'advanced-excerpt' ); ?>
58 </label><br />
59 <label for="finish-sentence">
60 <input type="radio" id="finish-sentence" name="finish" value="sentence"<?php echo ( 'sentence' == $finish ) ? ' checked="checked"' : ''; ?> />
61 <?php _e( "Sentence", 'advanced-excerpt' ); ?>
62 </label>
63 </p>
64
65 <p class="description"><?php _e( "Prevents cutting a word or sentence at the end of an excerpt. This option can result in (slightly) longer excerpts.", 'advanced-excerpt' ); ?></p>
66 </td>
67 </tr>
68 <tr valign="top">
69 <th scope="row">
70 <?php _e( "Read More Link:", 'advanced-excerpt' ); ?>
71 </th>
72 <td>
73
74 <label for="add-link">
75 <input name="add_link" type="checkbox" id="add-link" value="on" <?php echo ( 1 == $add_link ) ? 'checked="checked"' : ''; ?> />
76 <?php _e( "Add read more link to excerpt", 'advanced-excerpt' ); ?>
77 </label><br />
78
79 <input name="read_more" type="text" id="read-more" value="<?php echo esc_attr( $read_more ); ?>" <?php echo ( 1 !== $add_link ) ? 'disabled="disabled"' : ''; ?> /><br>
80
81 <ul class="sub-options">
82 <li>
83 <label for="link-new-tab">
84 <input name="link_new_tab" type="checkbox" id="link-new-tab" value="on" <?php echo ( 1 == $link_new_tab ) ? 'checked="checked"' : ''; ?> />
85 <?php _e( "Open read more link in new tab", 'advanced-excerpt' ); ?>
86 </label>
87 </li>
88 <li>
89 <label for="link-screen-reader">
90 <input name="link_screen_reader" type="checkbox" id="link-screen-reader" value="on" <?php echo ( 1 == $link_screen_reader ) ? 'checked="checked"' : ''; ?> />
91 <?php _e( "Screen readers compatibility", 'advanced-excerpt' ); ?> <span class="description"><?php _e( '(appends post title with class .screen-reader-text to the link)', 'advanced-excerpt' ); ?></span>
92 </label><br />
93 </li>
94 <li>
95 <label for="link-exclude-length">
96 <input name="link_exclude_length" type="checkbox" id="link-exclude-length" value="on" <?php echo ( 1 == $link_exclude_length ) ? 'checked="checked"' : ''; ?> />
97 <?php _e( "Remove link if the whole post content shown", 'advanced-excerpt' ); ?>
98 </label><br />
99 </li>
100 <li>
101 <label for="link-on-custom-excerpt">
102 <input name="link_on_custom_excerpt" type="checkbox" id="link-on-custom-excerpt" value="on" <?php echo ( 1 == $link_on_custom_excerpt ) ? 'checked="checked"' : ''; ?> />
103 <?php _e( "Add the link even if a custom excerpt is shown.", 'advanced-excerpt' ); ?>
104 </label><br />
105 </li>
106 </ul>
107
108 </td>
109 </tr>
110 <tr valign="top">
111 <th scope="row">
112 <label for="no-custom">
113 <?php _e( "No Custom Excerpts:", 'advanced-excerpt' ); ?>
114 </label>
115 </th>
116 <td>
117 <p>
118 <label for="no-custom">
119 <input name="no_custom" type="checkbox" id="no-custom" value="on" <?php echo ( 1 == $no_custom ) ? 'checked="checked"' : ''; ?> />
120 <?php _e( "Generate excerpts even if a post has a custom excerpt attached.", 'advanced-excerpt' ); ?>
121 </label>
122 </p>
123 <p>
124 <ul class="sub-options">
125 <li>
126 <label id="no-custom-from-custom-label" for="no-custom-from-custom" <?php echo ( 1 !== $no_custom ) ? 'class="disabled"' : ''; ?>>
127 <input name="no_custom_from_custom" type="checkbox" id="no-custom-from-custom" value="on" <?php echo ( 1 == $no_custom_from_custom ) ? 'checked="checked"' : ''; ?> <?php echo ( 1 !== $no_custom ) ? 'disabled="disabled"' : ''; ?> />
128 <small><?php _e( "Use the custom excerpt (if disabled the excerpt is generated from the content)", 'advanced-excerpt' ); ?></small>
129 </label>
130 </li>
131 </ul>
132 </p>
133 </td>
134 </tr>
135 <tr valign="top">
136 <th scope="row">
137 <label for="link-excerpt">
138 <?php _e( "Link Whole Excerpt:", 'advanced-excerpt' ); ?>
139 </label>
140 </th>
141 <td>
142 <label for="link-excerpt">
143 <input name="link_excerpt" type="checkbox" id="link-excerpt" value="on" <?php echo ( 1 == $link_excerpt ) ? 'checked="checked"' : ''; ?> />
144 <?php _e( "Makes the whole excerpt be a link to the post. If this is enabled it's advised to turn on the Strip Tags option.", 'advanced-excerpt' ); ?>
145 </label>
146 </td>
147 </tr>
148 <tr valign="top">
149 <th scope="row">
150 <label for="no-shortcode">
151 <?php _e( "Strip Shortcodes:", 'advanced-excerpt' ); ?>
152 </label>
153 </th>
154 <td>
155 <label for="no-shortcode">
156 <input name="no_shortcode" type="checkbox" id="no-shortcode" value="on" <?php echo ( 1 == $no_shortcode ) ? 'checked="checked"' : ''; ?> />
157 <?php _e( "Remove shortcodes from the excerpt. <em>(recommended)</em>", 'advanced-excerpt' ); ?>
158 </label>
159 </td>
160 </tr>
161 <tr valign="top">
162 <th scope="row">
163 <?php _e( "Filter:", 'advanced-excerpt' ); ?>
164 </th>
165 <td>
166 <p>
167 <label for="the-excerpt">
168 <input name="the_excerpt" type="checkbox" id="the-excerpt" value="on" <?php echo ( 1 == $the_excerpt ) ? 'checked="checked"' : ''; ?> />
169 <span class='monospaced'>the_excerpt()</span>
170 </label><br />
171 <label for="the-content">
172 <input name="the_content" type="checkbox" id="the-content" value="on" <?php echo ( 1 == $the_content ) ? 'checked="checked"' : ''; ?> />
173 <span class='monospaced'>the_content()</span>
174 </label>
175 </p>
176 <ul class="sub-options">
177 <li>
178 <label id="the-content-no-break-label" for="the-content-no-break" <?php echo ( 1 !== $the_content ) ? 'class="disabled"' : ''; ?>>
179 <input name="the_content_no_break" type="checkbox" id="the-content-no-break" value="on" <?php echo ( 1 == $the_content_no_break && 1 == $the_content ) ? 'checked="checked"' : ''; ?> <?php echo ( 1 !== $the_content ) ? 'disabled="disabled"' : ''; ?> />
180 <small><?php _e( "Only filter <span class='monospaced'>the_content()</span> when there's no break (&lt;!--more--&gt;) tag in the post content", 'advanced-excerpt' ); ?></small>
181 </label>
182 </li>
183 </ul>
184
185 <p class="description">
186 <?php _e( 'Themes may use <code>the_excerpt()</code> for some pages (e.g. search results) and <code>the_content()</code> on others (e.g. blog archives). Depending on your theme and what pages you want this plugin to affect, you may need to adjust these settings.', 'advanced-excerpt' ); ?>
187 </p>
188 </td>
189 </tr>
190 <tr valign="top">
191 <th scope="row">
192 <?php _e( "Disable On:", 'advanced-excerpt' ); ?>
193 </th>
194 <td>
195 <p>
196 <?php foreach ( $exclude_pages_list as $key => $label ) :
197 $key_dashed = str_replace( '_', '-', $key ); ?>
198 <label for="<?php echo $key_dashed; ?>">
199 <input name="exclude_pages[]" type="checkbox" id="<?php echo $key_dashed; ?>" value="<?php echo $key; ?>" <?php echo ( in_array( $key, $exclude_pages ) ) ? 'checked="checked"' : ''; ?> />
200 <?php echo $label; ?>
201 </label><br />
202 <?php endforeach; ?>
203 <p>
204
205 <p class="description">
206 <?php _e( 'Disables excerpt filtering for certain page types.', 'advanced-excerpt' ); ?>
207 </p>
208 </td>
209 </tr>
210 <tr valign="top">
211 <th scope="row">
212 <?php _e( "Strip Tags:", 'advanced-excerpt' ); ?>
213 </th>
214 <td>
215 <table id="tags-table">
216 <tr>
217 <td colspan="<?php echo $tag_cols; ?>">
218 <p>
219 <label for="dont-remove-any-tags">
220 <input name="allowed_tags_option" type="radio" id="dont-remove-any-tags" value="dont_remove_any" <?php echo ( 'dont_remove_any' == $allowed_tags_option ) ? 'checked="checked"' : ''; ?> />
221 <?php _e( "Don't remove any tags", 'advanced-excerpt' ); ?>
222 </label><br />
223 <label for="remove-all-tags-except">
224 <input name="allowed_tags_option" type="radio" id="remove-all-tags-except" value="remove_all_tags_except" <?php echo ( 'remove_all_tags_except' == $allowed_tags_option ) ? 'checked="checked"' : ''; ?> />
225 <?php _e( "Remove all tags except the following", 'advanced-excerpt' ); ?>
226 </label>
227 </p>
228 </td>
229 </tr>
230 <?php
231 $i = 0;
232 foreach ( $tag_list as $tag ) :
233 if ( 0 == $i % $tag_cols ) : ?>
234 <tr<?php echo ( 'dont_remove_any' == $allowed_tags_option ) ? ' style="display: none;"' : '' ?>>
235 <?php endif; $i++; ?>
236 <td>
237 <label for="<?php echo 'ae-' . $tag; ?>">
238 <input name="allowed_tags[]" type="checkbox" id="<?php echo 'ae-' . $tag; ?>" value="<?php echo $tag; ?>" <?php echo ( in_array( $tag, $allowed_tags ) ) ? 'checked="checked" ' : ''; ?> />
239 <code><?php echo $tag; ?></code>
240 </label>
241 </td>
242 <?php
243 if ( 0 == $i % $tag_cols ):
244 $i = 0;
245 echo '</tr>';
246 endif;
247 endforeach;
248 if ( 0 != $i % $tag_cols ): ?>
249 <td colspan="<?php echo $tag_cols - $i; ?>">&nbsp;</td>
250 </tr>
251 <?php endif; ?>
252 </table>
253
254 <div class="tags-control"<?php echo ( 'dont_remove_any' == $allowed_tags_option ) ? ' style="display: none;"' : '' ?>>
255 <a href="" id="select-all"><?php _e( "Select all", 'advanced-excerpt' ); ?></a> / <a href="" id="select-none"><?php _e( "Select none", 'advanced-excerpt' ); ?></a><br />
256 <?php _e( "More tags", 'advanced-excerpt' ); ?>
257 <select name="more_tags" id="more-tags">
258 <?php foreach ( array_diff( $this->options_all_tags, $this->options_basic_tags ) as $tag ) : ?>
259 <option value="<?php echo $tag; ?>"><?php echo $tag; ?></option>
260 <?php endforeach; ?>
261 </select>
262
263 <input type="button" name="add_tag" id="add-tag" class="button" value="<?php _e( "Add tag", 'advanced-excerpt' ); ?>" />
264 </div>
265
266 </td>
267 </tr>
268 </table>
269 <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save Changes", 'advanced-excerpt' ); ?>" /></p>
270 </form>
271
272 </div>
273
274 <?php require_once $this->plugin_dir_path . 'template/sidebar.php'; ?>
275
276 </div>
277
278 </div>