Changeset 2947913
- Timestamp:
- 08/04/2023 11:23:42 PM (2 years ago)
- Location:
- show-posts
- Files:
-
- 12 edited
- 1 copied
-
tags/1.8.1 (copied) (copied from show-posts/trunk)
-
tags/1.8.1/atw-show-posts.php (modified) (2 diffs)
-
tags/1.8.1/includes/atw-admin-lib.php (modified) (2 diffs)
-
tags/1.8.1/includes/atw-posts-filters-admin.php (modified) (2 diffs)
-
tags/1.8.1/includes/atw-runtime-lib.php (modified) (1 diff)
-
tags/1.8.1/includes/downloader.php (modified) (1 diff)
-
tags/1.8.1/readme.txt (modified) (3 diffs)
-
trunk/atw-show-posts.php (modified) (2 diffs)
-
trunk/includes/atw-admin-lib.php (modified) (2 diffs)
-
trunk/includes/atw-posts-filters-admin.php (modified) (2 diffs)
-
trunk/includes/atw-runtime-lib.php (modified) (1 diff)
-
trunk/includes/downloader.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
show-posts/tags/1.8.1/atw-show-posts.php
r2900851 r2947913 6 6 Author: wpweaver 7 7 Author URI: http://weavertheme.com/about/ 8 Version: 1.8 8 Version: 1.8.1 9 9 10 10 License: GPL … … 31 31 */ 32 32 33 const WEAVER_SHOWPOSTS_VERSION = '1.8 ';33 const WEAVER_SHOWPOSTS_VERSION = '1.8.1'; 34 34 const WEAVER_SHOWPOSTS_MINIFY = '.min'; // '' for dev, '.min' for production 35 35 const WEAVER_SHOWPOSTS_TEMPLATE = false; // future feature -
show-posts/tags/1.8.1/includes/atw-admin-lib.php
r2891911 r2947913 45 45 function atw_posts_restore_filter() { 46 46 if (!(isset($_POST['uploadit']) && $_POST['uploadit'] == 'yes')) return; 47 48 if (!atw_posts_allow_file_read()) { 49 atw_posts_save_msg( 'File Read Access problem. File not restored.' ); 50 return; 51 } 47 52 48 53 // upload theme from users computer … … 99 104 100 105 function atw_posts_set_to_serialized_values($contents) { 106 if (!atw_posts_allow_file_read()) { 107 return false; 108 } 101 109 102 110 $restore = unserialize($contents); -
show-posts/tags/1.8.1/includes/atw-posts-filters-admin.php
r2213242 r2947913 1 1 <?php 2 2 // ======================================================== filters admin =============================== 3 function atw_posts_filters_admin() { 4 ?> 3 function atw_posts_filters_admin() 4 { 5 ?> 5 6 <h2 style="color:blue;">Create and Define Filters</h2> 6 7 <form method="post" enctype="multipart/form-data"> 7 <input type="hidden" name="atw_posts_save_filter_opts" value="Filter Options Saved" />8 <input type="hidden" name="atw_posts_save_filter_opts" value="Filter Options Saved"/> 8 9 <input style="display:none;" type="submit" name="atw_stop_enter" value="Ignore Enter"/> 9 10 10 <?php 11 //settings_fields( 'atw_posts_opt_group' ); 12 //atw_posts_delete_all_options(); // @@@@@@ for debugging 13 14 atw_posts_select_filter(); // select filter box 15 atw_posts_save_filter_button(); 16 17 atw_posts_define_display(); // define content display options 18 atw_posts_save_filter_button(); 19 ?> 20 <h3><u>Define Content Selection Filter Options</u></h3> 21 22 <style> 23 .filter-section {padding:10px;border:2px solid #aaa;margin-bottom:5px;} 24 .filter-title {font-size:110%;font-weight:bold;color:blue;margin-bottom:5px;} 25 .filter-title-description {padding-left:40px;font-size:90%;font-weight:normal;font-style:italic;color:#444;} 26 .filter-opts {margin:0 0 5px 15px;} 27 .filter-description {padding-left:1%;font-size:90%;} 28 .filter-select {} 29 .filter-text {margin-left:20px;} 30 .filter-button{} 31 </style> 32 33 <?php 34 atw_posts_filter_basic(); // basic filter options box 35 36 atw_posts_set_post_type(); // set post type 37 38 atw_posts_set_slider_group(); // the slider group 39 40 atw_posts_save_filter_button(); 41 42 atw_posts_set_post_cats(); // set post categories 43 44 atw_posts_set_post_tags(); // tag filters 45 46 atw_posts_set_by_posts(); // set by post id 47 48 atw_posts_set_post_slug(); // by post slug 49 50 atw_posts_save_filter_button(); 51 52 atw_posts_set_author(); // select the author 53 54 atw_posts_set_date(); // select by date 55 56 atw_posts_set_taxonomy(); // select by custom taxonomy 57 58 atw_posts_set_custom_wpq(); // set custom WP_Query args 59 60 atw_posts_save_filter_button(); 61 62 if (WEAVER_SHOWPOSTS_TEMPLATE) 63 atw_posts_set_custom_template(); 64 65 atw_posts_nonce_field('atw_posts_save_filter_opts'); 66 67 ?> 11 <?php 12 //settings_fields( 'atw_posts_opt_group' ); 13 //atw_posts_delete_all_options(); // @@@@@@ for debugging 14 15 atw_posts_select_filter(); // select filter box 16 atw_posts_save_filter_button(); 17 18 atw_posts_define_display(); // define content display options 19 atw_posts_save_filter_button(); 20 ?> 21 <h3><u>Define Content Selection Filter Options</u></h3> 22 23 <style> 24 .filter-section { 25 padding: 10px; 26 border: 2px solid #aaa; 27 margin-bottom: 5px; 28 } 29 30 .filter-title { 31 font-size: 110%; 32 font-weight: bold; 33 color: blue; 34 margin-bottom: 5px; 35 } 36 37 .filter-title-description { 38 padding-left: 40px; 39 font-size: 90%; 40 font-weight: normal; 41 font-style: italic; 42 color: #444; 43 } 44 45 .filter-opts { 46 margin: 0 0 5px 15px; 47 } 48 49 .filter-description { 50 padding-left: 1%; 51 font-size: 90%; 52 } 53 54 .filter-select { 55 } 56 57 .filter-text { 58 margin-left: 20px; 59 } 60 61 .filter-button { 62 } 63 </style> 64 65 <?php 66 atw_posts_filter_basic(); // basic filter options box 67 68 atw_posts_set_post_type(); // set post type 69 70 atw_posts_set_slider_group(); // the slider group 71 72 atw_posts_save_filter_button(); 73 74 atw_posts_set_post_cats(); // set post categories 75 76 atw_posts_set_post_tags(); // tag filters 77 78 atw_posts_set_by_posts(); // set by post id 79 80 atw_posts_set_post_slug(); // by post slug 81 82 atw_posts_save_filter_button(); 83 84 atw_posts_set_author(); // select the author 85 86 atw_posts_set_date(); // select by date 87 88 atw_posts_set_taxonomy(); // select by custom taxonomy 89 90 atw_posts_set_custom_wpq(); // set custom WP_Query args 91 92 atw_posts_save_filter_button(); 93 94 if (WEAVER_SHOWPOSTS_TEMPLATE) 95 atw_posts_set_custom_template(); 96 97 atw_posts_nonce_field('atw_posts_save_filter_opts'); 98 99 ?> 68 100 69 101 </form> 70 <hr /> 71 <?php 72 } 73 74 function atw_posts_save_filter_button() { 75 ?> 76 <input style="margin-bottom:5px;" class="button-primary" type="submit" name="atw_posts_save_options" value="Save Filter Options"/> 77 <?php 102 <hr/> 103 <?php 104 } 105 106 function atw_posts_save_filter_button() 107 { 108 ?> 109 <input style="margin-bottom:5px;" class="button-primary" type="submit" name="atw_posts_save_options" 110 value="Save Filter Options"/> 111 <?php 78 112 } 79 113 80 114 // ========================================= >>> atw_posts_select_filter <<< =============================== 81 115 82 function atw_posts_select_filter() { 116 function atw_posts_select_filter() 117 { 83 118 84 119 $current_filter = atw_posts_getopt('current_filter'); 85 ?> 86 87 <h3><u>Select Filter</u></h3> 88 89 90 <!-- ** Current Filter ** --> 91 92 <div class="filter-section"> 93 <div class="filter-title">• Current Filter: <em style="font-size:150%;color:#CC2323;"><?php echo atw_posts_get_filter_opt('name'); ?></em> 94 <span class="filter-title-description">Select a filter to define or edit </span></div> 95 <?php 96 97 $filters = atw_posts_getopt('filters'); 98 $cur_slug = ''; 99 $cur_name = ''; 100 101 echo '<table><tr><td><strong>Select Filter: </strong></td><td><select name="selected_filter" onchange="this.form.submit()">'; 102 foreach ($filters as $filter => $val) { // display dropdown of available filters 103 if ($filter == $current_filter) { 104 $cur_slug = $filter; 105 $cur_name = $val['name']; 106 echo '<option value="'. $filter . '" selected="selected">' . $val['name'] . ' (' . $filter . ')</option>'; 107 } else { 108 echo '<option value="'. $filter . '">' . $val['name'] . ' (' . $filter . ')</option>'; 120 ?> 121 122 <h3><u>Select Filter</u></h3> 123 124 125 <!-- ** Current Filter ** --> 126 127 <div class="filter-section"> 128 <div class="filter-title">• Current Filter: <em 129 style="font-size:150%;color:#CC2323;"><?php echo atw_posts_get_filter_opt('name'); ?></em> 130 <span class="filter-title-description">Select a filter to define or edit </span></div> 131 <?php 132 133 $filters = atw_posts_getopt('filters'); 134 $cur_slug = ''; 135 $cur_name = ''; 136 137 echo '<table><tr><td><strong>Select Filter: </strong></td><td><select name="selected_filter" onchange="this.form.submit()">'; 138 foreach ($filters as $filter => $val) { // display dropdown of available filters 139 if ($filter == $current_filter) { 140 $cur_slug = $filter; 141 $cur_name = $val['name']; 142 echo '<option value="' . $filter . '" selected="selected">' . $val['name'] . ' (' . $filter . ')</option>'; 143 } else { 144 echo '<option value="' . $filter . '">' . $val['name'] . ' (' . $filter . ')</option>'; 145 } 109 146 } 147 echo '</select>'; 148 ?> 149 150 ← <input class="button" type="submit" 151 onclick="return confirm('This will clear all current filter settings. The filter will also be deleted unless it is the Default filter. Are you sure?');" 152 name="atw_posts_delete_filter" value="Clear/Delete Current Filter"/></td></tr> 153 <tr> 154 <td> </td> 155 <td><span style="padding-left:20px;"></span></span><textarea cols=32 rows=1 156 placeholder="Enter name for new/duplicate filter" 157 maxlength=64 name="filter_name"></textarea> 158 ← <input class="button" type="submit" name="atw_posts_new_filter" 159 value="Create New Filter"/> 160 <em>-or-</em> <input class="button" type="submit" name="atw_posts_duplicate_filter" 161 value="Duplicate Current Filter"/></td> 162 </tr> 163 </table> 164 <?php 165 166 $time = date('Y-m-d-Hi'); 167 168 echo "<div style='margin-top:6px;'>\n"; 169 170 atw_posts_download_link('<strong>Save Settings</strong> for current filter <strong>' . $cur_name . '</strong>.', 171 $cur_slug, 'filter', $time); 172 173 ?> 174 </div> 175 <?php 176 if (atw_posts_allow_file_read()) { 177 ?> 178 <div> 179 <input style="margin-left:8em;" class="download-link" type="submit" name="atw_posts_restore_filter" 180 value="Restore Filter"/> 181 <span style="border:1px solid #CCC;width:400px;padding:2px;"><input name="post_uploaded" 182 type="file"/></span> 183 <input type="hidden" name="uploadit" value="yes"/>- Upload file to restore a filter 184 </div> 185 <?php 186 } else { 187 ?> 188 <div style="margin-left:8em;"> 189 <span style="font-weight: bold; color:red;">File Upload Access Restriction: </span> 190 Sorry, you must be a Multi-Site Super Admin or have the <em>install_plugins</em> capability set for your 191 account by a Super Admin to read settings files. (e.g., with the <em>User Role Editor</em> plugin.)</strong> 192 </div> 193 <?php 110 194 } 111 echo '</select>'; 112 ?> 113 114 ← <input class="button" type="submit" onclick="return confirm('This will clear all current filter settings. The filter will also be deleted unless it is the Default filter. Are you sure?');" 115 name="atw_posts_delete_filter" value="Clear/Delete Current Filter"/></td></tr> 116 <tr><td> </td><td><span style="padding-left:20px;"></span></span><textarea cols=32 rows=1 placeholder="Enter name for new/duplicate filter" maxlength=64 name="filter_name"></textarea> 117 ← <input class="button" type="submit" name="atw_posts_new_filter" value="Create New Filter"/> 118 <em>-or-</em> <input class="button" type="submit" name="atw_posts_duplicate_filter" value="Duplicate Current Filter"/></td></tr></table> 119 <?php 120 121 $time = date('Y-m-d-Hi'); 122 123 echo "<div style='margin-top:6px;'>\n"; 124 125 atw_posts_download_link('<strong>Save Settings</strong> for current filter <strong>' . $cur_name . '</strong>.', 126 $cur_slug, 'filter', $time ); 127 128 ?> 129 </div> 130 <input style="margin-left:8em;" class="download-link" type="submit" name="atw_posts_restore_filter" value="Restore Filter" /> 131 <span style="border:1px solid #CCC;width:400px;padding:2px;"><input name="post_uploaded" type="file" /></span> 132 <input type="hidden" name="uploadit" value="yes" />- Upload file to restore a filter 133 <br /><br /> 195 ?> 196 <br/><br/> 134 197 <div style="clear:both;"></div> 135 <div class="filter-title">• Native Theme Support <span class="filter-title-description">Interaction with native theme. Options apply to all filters, but not to image sliders.</span></div> 198 <div class="filter-title">• Native Theme Support <span class="filter-title-description">Interaction with native theme. Options apply to all filters, but not to image sliders.</span> 199 </div> 136 200 <div class="filter-opts"> 137 201 138 <?php202 <?php 139 203 $native = false; 140 if ( !atw_posts_is_generic()) {141 atw_posts_form_checkbox('ignore_aspen_weaver', 'Disable automatic post display integration with Weaver Themes.');204 if (!atw_posts_is_generic()) { 205 atw_posts_form_checkbox('ignore_aspen_weaver', 'Disable automatic post display integration with Weaver Themes.'); 142 206 $native = true; 143 207 } 144 208 $has_templates = atw_posts_theme_has_templates(); 145 if ( $has_templates) {209 if ($has_templates) { 146 210 atw_posts_form_checkbox('use_native_theme_templates', 147 "<strong>Use Current Theme's Native Post Display</strong> - Native post display capability detected.211 "<strong>Use Current Theme's Native Post Display</strong> - Native post display capability detected. 148 212 You will need to try this option to see if it works or properly or not.<br />"); 149 213 $native = true; 150 214 } 151 if ( !$native ) { 152 ?> 153 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 154 <em>Sorry, your theme does not seem to have native support for displaying posts from this plugin.</em> You 155 can add custom CSS rules on the "Style" tab to make posts better match your current theme.<br /><br /> 156 <?php 215 if (!$native) { 216 ?> 217 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 218 <em>Sorry, your theme does not seem to have native support for displaying posts from this plugin.</em> You 219 can add custom CSS rules on the "Style" tab to make posts better match your current theme. 220 <br/><br/> 221 <?php 157 222 } 158 ?>223 ?> 159 224 </div> 160 225 161 226 162 227 <div class="filter-title">• [show_posts] Shortcode 163 <span class="filter-title-description">Copy/Paste either of these shortcodes to display posts in your content</span></div> 164 165 <table> 166 <tr><td>Shortcode using filter name: </td><td><strong>[show_posts filter=<?php echo $current_filter; ?>]</strong> 167 - You can also use the "Add [show_posts]" button on the Page/Post Editor.</td></tr> 168 <tr><td>Shortcode using parameters: </td><td><strong>[show_posts 169 <?php 170 $params = atw_posts_get_filter_params(); // define in atw-runtime-lib.php 171 echo $params; 172 ?> 173 ]</strong></td></tr></table> 174 </div> 175 176 <?php 177 atw_posts_nonce_field('atw_posts_set_to_filter'); 178 atw_posts_nonce_field('atw_posts_delete_filter'); 179 atw_posts_nonce_field('atw_posts_new_filter'); 180 atw_posts_nonce_field('atw_posts_duplicate_filter'); 181 atw_posts_nonce_field('atw_posts_restore_filter'); 228 <span class="filter-title-description">Copy/Paste either of these shortcodes to display posts in your content</span> 229 </div> 230 231 <table> 232 <tr> 233 <td>Shortcode using filter name: </td> 234 <td><strong>[show_posts filter=<?php echo $current_filter; ?>]</strong> 235 - You can also use the "Add [show_posts]" button on the Page/Post Editor. 236 </td> 237 </tr> 238 <tr> 239 <td>Shortcode using parameters: </td> 240 <td><strong>[show_posts 241 <?php 242 $params = atw_posts_get_filter_params(); // define in atw-runtime-lib.php 243 echo $params; 244 ?> 245 ]</strong></td> 246 </tr> 247 </table> 248 </div> 249 250 <?php 251 atw_posts_nonce_field('atw_posts_set_to_filter'); 252 atw_posts_nonce_field('atw_posts_delete_filter'); 253 atw_posts_nonce_field('atw_posts_new_filter'); 254 atw_posts_nonce_field('atw_posts_duplicate_filter'); 255 atw_posts_nonce_field('atw_posts_restore_filter'); 182 256 183 257 } … … 185 259 // ========================================= >>> atw_posts_define_display <<< =============================== 186 260 187 function atw_posts_define_display() { 261 function atw_posts_define_display() 262 { 188 263 // define display filter options 189 ?>264 ?> 190 265 191 266 <h3><u>Define Post Display Filter Options</u></h3> 192 267 <div class="filter-section"> 193 <div class="filter-title">• Post Display <span class="filter-title-description">When displaying posts, use these display options. Don't apply to image sliders.</span></div> 194 195 <div class="filter-opts"> 196 <?php 197 $has_templates = atw_posts_theme_has_templates(); 198 if ($has_templates && atw_posts_is_generic() && atw_posts_getopt('use_native_theme_templates') ) { 199 ?> 200 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 201 <em>Post Display Options not available when using your theme's content display as checked in the option above.</em><br /><br /> 202 <?php 203 } else { 204 atw_posts_filter_checkbox('hide_title','Hide Post Title',''); 205 atw_posts_filter_checkbox('show_avatar','Show Author Avatar'); 206 207 atw_posts_filter_checkbox('hide_top_info','Hide Top Post Meta Info (date, author)',''); 208 atw_posts_filter_checkbox('hide_bottom_info','Hide Bottom Post Meta Info (category, tag, comment link)'); 209 210 atw_posts_filter_checkbox('hide_featured_image','Hide Featurd Image in post (default: show; or theme defaults)', ''); 211 212 echo '<br />'; 213 atw_posts_filter_textarea('more_msg','"Continue Reading..." message for excerpts.'); 214 215 $cur_show = atw_posts_get_filter_opt('show'); 216 ?> 217 218 219 <div style="padding:1em 0 .5em 4em;text-indent:-1.7em;">Display posts as: 220 <select name="show"> 221 <option value="" <?php selected( $cur_show == '' );?>></option> 222 <option value="full" <?php selected( $cur_show == 'full');?>>Full post</option> 223 <option value="excerpt" <?php selected( $cur_show == 'excerpt');?>>Excerpt</option> 224 <option value="title" <?php selected( $cur_show == 'title');?>>Title + Top Meta Line</option> 225 <option value="titlelist" <?php selected( $cur_show == 'titlelist');?>>Title only as list</option> 226 <option value="title_featured" <?php selected( $cur_show == 'title_featured');?>>Title + Featured Image</option> 227 </select> How to display posts - (Default: full post; Weaver theme settings) 268 <div class="filter-title">• Post Display <span class="filter-title-description">When displaying posts, use these display options. Don't apply to image sliders.</span> 269 </div> 270 271 <div class="filter-opts"> 272 <?php 273 $has_templates = atw_posts_theme_has_templates(); 274 if ($has_templates && atw_posts_is_generic() && atw_posts_getopt('use_native_theme_templates')) { 275 ?> 276 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 277 <em>Post Display Options not available when using your theme's content display as checked in the option 278 above.</em><br/><br/> 279 <?php 280 } else { 281 atw_posts_filter_checkbox('hide_title', 'Hide Post Title', ''); 282 atw_posts_filter_checkbox('show_avatar', 'Show Author Avatar'); 283 284 atw_posts_filter_checkbox('hide_top_info', 'Hide Top Post Meta Info (date, author)', ''); 285 atw_posts_filter_checkbox('hide_bottom_info', 'Hide Bottom Post Meta Info (category, tag, comment link)'); 286 287 atw_posts_filter_checkbox('hide_featured_image', 'Hide Featurd Image in post (default: show; or theme defaults)', ''); 288 289 echo '<br />'; 290 atw_posts_filter_textarea('more_msg', '"Continue Reading..." message for excerpts.'); 291 292 $cur_show = atw_posts_get_filter_opt('show'); 293 ?> 294 295 296 <div style="padding:1em 0 .5em 4em;text-indent:-1.7em;">Display posts as: 297 <select name="show"> 298 <option value="" <?php selected($cur_show == ''); ?>></option> 299 <option value="full" <?php selected($cur_show == 'full'); ?>>Full post</option> 300 <option value="excerpt" <?php selected($cur_show == 'excerpt'); ?>>Excerpt</option> 301 <option value="title" <?php selected($cur_show == 'title'); ?>>Title + Top Meta Line</option> 302 <option value="titlelist" <?php selected($cur_show == 'titlelist'); ?>>Title only as list 303 </option> 304 <option value="title_featured" <?php selected($cur_show == 'title_featured'); ?>>Title + 305 Featured Image 306 </option> 307 </select> How to display posts - (Default: full post; Weaver theme settings) 308 </div> 309 310 311 <?php 312 } // else not getting from gallery 313 ?> 314 </div> 315 316 <div style="clear:both;"></div> 317 318 <div class="filter-description"> 319 <p> 320 Use this section to define how each post is to be displayed - title, excerpted, etc. These options apply 321 to how each post is displayed when 322 using the plugin's built-in post layout, or when used with native Weaver Xtreme or Weaver II layout. Use 323 the Content Selection Filter to define which posts 324 will be displayed. The Slider Image Show options can be used to define how images are used in a image 325 only slide show. (Note: when using the 326 Weaver Slider plugin to display an image slider, these Post Display options do not apply.) 327 </p> 328 </div> 228 329 </div> 229 230 231 <?php 232 } // else not getting from gallery 233 ?> 330 <?php 331 } 332 333 // ========================================= >>> atw_posts_filter_basic <<< =============================== 334 335 function atw_posts_filter_basic() 336 { 337 // **** basic options **** 338 ?> 339 340 <div class="filter-section"> 341 <div class="filter-title">• Basic Options <span class="filter-title-description">Some basic options for selecting posts </span> 342 </div> 343 <div class="filter-opts"> 344 345 <?php 346 347 atw_posts_filter_checkbox('show_sticky_posts', 'Show Sticky Posts at beginning of displayed posts', ''); 348 349 atw_posts_filter_checkbox('use_paging', 'Use Paging (posts will be paged using Number of Posts per page)'); 350 351 atw_posts_filter_checkbox('no_top_clear', 'Do not clear:both at start of posts. (allows posts to be inline)'); 352 353 atw_posts_filter_val('posts_per_page', 'Number of Posts to Show (Use -1 for all. Default: Settings->Reading value)'); 354 355 atw_posts_filter_val('offset', 'Number of posts to skip over'); 356 357 358 atw_posts_filter_val('excerpt_length', 'Excerpt length (words)', '<span style="padding-left:70px"></span>'); 359 360 atw_posts_filter_val('cols', 'Display posts in columns (1-3)') 361 ?> 362 <?php $cur_order = atw_posts_get_filter_opt('orderby'); ?> 363 <br/> 364 <strong>Display posts ordered by:</strong> 365 <select name='orderby'> 366 <option value="date" <?php selected($cur_order == 'date'); ?>>Date</option> 367 <option value="title" <?php selected($cur_order == 'title'); ?>>Post Title</option> 368 <option value="modified" <?php selected($cur_order == 'modified'); ?>>Last Modified Date</option> 369 <option value="rand" <?php selected($cur_order == 'rand'); ?>>Random order</option> 370 <option value="comment_count" <?php selected($cur_order == 'comment_count'); ?>>Number of comments 371 </option> 372 <option value="author" <?php selected($cur_order == 'author'); ?>>Author</option> 373 <option value="ID" <?php selected($cur_order == 'ID'); ?>>Post ID</option> 374 <option value="menu_order" <?php selected($cur_order == 'menu_order'); ?>>Menu/Custom Post Order 375 </option> 376 <option value="none" <?php selected($cur_order == 'none'); ?>>No order</option> 377 </select> 378 379 <?php $cur_order = atw_posts_get_filter_opt('order'); ?> 380 <strong style="padding-left:25px">Sort order:</strong> 381 <select name='order'> 382 <option value="DESC" <?php selected($cur_order == 'DESC'); ?>>Descending (3,2,1) (default)</option> 383 <option value="ASC" <?php selected($cur_order == 'ASC'); ?>>Ascending (1,2,3)</option> 384 </select> 385 </div> 386 387 <div style="clear:both;"></div> 388 389 </div><!-- end filter-section --> 390 <?php 391 } 392 393 // ========================================= >>> atw_posts_set_post_type <<< =============================== 394 395 function atw_posts_set_post_type() 396 { 397 // **** post_type **** 398 ?> 399 <div class="filter-section"> 400 <div class="filter-title">• Post Type <span class="filter-title-description">Include posts with this post type. (WP_Query: post_type - Default: post) </span> 401 </div> 402 <div class="filter-opts"> 403 <table> 404 <tr> 405 <td><select class="filter-select" name="post_type_selection"> 406 <?php 407 $post_types = get_post_types(array(), 'names'); 408 foreach ($post_types as $post_type) { 409 if ($post_type != 'page' 410 && $post_type != 'nav_menu_item' 411 && $post_type != 'revision' 412 && $post_type != 'attachment') 413 echo '<option value="' . $post_type . '">' . $post_type . '</option>'; 414 } 415 ?> 416 </select></td> 417 <td><input class="button filter-button" type="submit" name="atw_posts_add_post_type" 418 value="Add Post Type"/></td> 419 <td><textarea class="filter-text" cols=40 rows=1 placeholder="post_type=list" maxlength=128 420 name="post_type"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_type')); ?></textarea> 421 </td> 422 </tr> 423 </table> 424 425 <?php 426 atw_posts_nonce_field('atw_posts_add_post_type'); 427 ?> 428 </div> 429 <div class="filter-description"> 430 Specify the <em>post_type</em> used to select posts. If you just want standard posts, you don't need to 431 define this setting. 432 Include a post type by selecting the type from the drop-down list, 433 and clicking the "Add Post Type" button. This list includes any <em>Custom Post Types</em> that may be 434 defined by 435 plugins you have installed. These custom post types may or may not display useful content depending how they 436 are 437 used by the plugin. You may add more than one post type. You can edit the query 438 string displayed in the text area directly, and then save by clicking "Save Filter Options". 439 </div> 440 <div style="clear:both;"></div> 441 442 </div><!-- end filter-section --> 443 <?php 444 } 445 446 447 // ========================================= >>> atw_posts_set_post_cats <<< =============================== 448 449 function atw_posts_set_post_cats() 450 { 451 //<!-- **** Post Categories **** --> 452 ?> 453 <div class="filter-section"> 454 <div class="filter-title">• Categories <span class="filter-title-description">Include posts with these categories. (WP_Query: category_name - Default: all) </span> 455 </div> 456 <div class="filter-opts"> 457 <table> 458 <tr> 459 <td><select class="filter-select" name="category_name_selection"> 460 <?php 461 $cats = get_categories(); 462 463 foreach ($cats as $cat => $val) { 464 echo '<option value="' . $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 465 } 466 ?> 467 </select></td> 468 <td><input class="button" type="submit" name="atw_posts_add_category_name" value="Add Category"/> 469 </td> 470 <td><input class="button" type="submit" name="atw_posts_hide_category_name" value="Hide Category"/> 471 </td> 472 <td><textarea class="filter-text" cols=40 rows=1 placeholder="category_name=list" maxlength=128 473 name="category_name"><?php echo sanitize_text_field(atw_posts_get_filter_opt('category_name')); ?></textarea> 474 </td> 475 </tr> 476 </table> 477 478 <?php 479 atw_posts_nonce_field('atw_posts_add_category_name'); 480 atw_posts_nonce_field('atw_posts_hide_category_name'); 481 482 ?> 483 </div> 484 <div class="filter-description"> 485 Specify the <em>category_name</em> slug to display posts from that category. Include a category by selecting 486 the category from the drop-down list, 487 and clicking the "Add Category" button. This list includes all categories for standard posts that have been 488 defined. 489 You may add more than one category. If you prefix a category slug with a minus sign (e.e., -cat-slug) or use 490 the "Hide Category" button, 491 that category will NOT be displayed. You can edit the query 492 string displayed in the text area directly, and then save by clicking "Save Filter Options". 493 </div> 494 <div style="clear:both;"></div> 495 496 </div><!-- end filter-section --> 497 <?php 498 } 499 500 // ========================================= >>> atw_posts_set_post_tags <<< =============================== 501 502 function atw_posts_set_post_tags() 503 { 504 //<!-- *** Tags *** --> 505 ?> 506 507 <div class="filter-section"> 508 <div class="filter-title">• Tags <span class="filter-title-description">Include posts with these tags. (WP_Query: tag - Default: all) </span> 509 </div> 510 511 <div class="filter-opts"> 512 <table> 513 <tr> 514 <td><select class="filter-select" name="tag_selection"> 515 <?php 516 $tags = get_tags(); 517 518 foreach ($tags as $tag => $val) { 519 echo '<option value="' . $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 520 } 521 ?> 522 </select></td> 523 <td><input class="filter-button button" type="submit" name="atw_posts_add_tag" value="Add Tag"/> 524 </td> 525 <td><textarea class="filter-text" cols=40 rows=1 placeholder="tag=list" maxlength=128 526 name="tag"><?php echo sanitize_text_field(atw_posts_get_filter_opt('tag')); ?></textarea> 527 </td> 528 </tr> 529 </table> 530 <?php 531 atw_posts_nonce_field('atw_posts_add_tag'); 532 ?> 533 </div> 534 <div class="filter-description"> 535 Specify the <em>tag</em> slug to display posts from that tag. Include a tag by selecting the tag from the 536 drop-down list, 537 and clicking the "Add Tag" button. This list includes all tags for standard posts that have been defined. 538 You may add more than one tag. You can edit the query 539 string displayed in the text area directly, and then save by clicking "Save Filter Options". 540 </div> 541 <div style="clear:both;"></div> 542 543 </div><!-- end filter-section --> 544 <?php 545 } 546 547 // ========================================= >>> atw_posts_set_slider_group <<< =============================== 548 549 function atw_posts_set_slider_group() 550 { 551 //<!-- *** Slider Group *** --> 552 if (!function_exists('atw_slider_installed')) // don't show this if we don't have the slider installed 553 return; 554 ?> 555 556 <div class="filter-section"> 557 <div class="filter-title">• Slider Group <span class="filter-title-description">Include posts from these Slider Groups (most useful with Weaver Slider plugin)</span> 558 </div> 559 560 <div class="filter-opts"> 561 <table> 562 <tr> 563 <td><select class="filter-select" name="group_selection"> 564 <?php 565 566 $terms = get_terms('atw_slider_group'); 567 foreach ($terms as $term) { 568 echo '<option value="' . $term->slug . '">' . $term->name . ' (' . $term->slug . ')</option>'; 569 } 570 ?> 571 </select></td> 572 <td><input class="filter-button button" type="submit" name="atw_posts_add_group" 573 value="Add Slider Group"/></td> 574 <td><textarea class="filter-text" cols=40 rows=1 placeholder="atw_slider_group=list" maxlength=128 575 name="atw_slider_group"><?php echo sanitize_text_field(atw_posts_get_filter_opt('atw_slider_group')); ?></textarea> 576 </td> 577 </tr> 578 </table> 579 <?php 580 atw_posts_nonce_field('atw_posts_add_group'); 581 ?> 582 </div> 583 <div class="filter-description"> 584 Specify the <em>Slider Group</em> slug to display posts from that slider group. Include a group by selecting 585 the group from the drop-down list, 586 and clicking the "Add Slider Group" button. This list includes only groups for the atw_sliders_post that 587 have been defined. 588 You may add more than one group. You can edit the query 589 string displayed in the text area directly, and then save by clicking "Save Filter Options". 590 <em style="font-weight:bold;color:red;">Important:</em> Post Type option must include "atw_slider_post" to 591 display slider groups. 592 </div> 593 <div style="clear:both;"></div> 594 595 </div><!-- end filter-section --> 596 <?php 597 } 598 599 // ========================================= >>> atw_posts_set_author <<< =============================== 600 601 function atw_posts_set_author() 602 { 603 //<!-- *** Author *** --> 604 ?> 605 606 <div class="filter-section"> 607 <div class="filter-title">• Author <span class="filter-title-description">Include posts with these authors. (WP_Query: author - Default: all) </span> 608 </div> 609 610 <div class="filter-opts"> 611 <?php 612 $user_args = array( 613 'fields' => array('ID', 'user_nicename', 'display_name'), 614 'who' => 'authors', 615 'orderby' => 'display_name' 616 ); 617 $wp_user_search = new WP_User_Query($user_args); 618 $authors = $wp_user_search->get_results(); 619 ?> 620 <table> 621 <tr> 622 <td><select class="filter-select" name="author_selection"> 623 <?php 624 foreach ($authors as $author => $val) { 625 echo '<option value="' . $val->ID . '">' . $val->display_name . ' (' . $val->ID . ')</option>'; 626 } 627 ?> 628 </select></td> 629 <td><input class="filter-button button" type="submit" name="atw_posts_add_author" 630 value="Add Author"/></td> 631 <td><textarea class="filter-text" cols=40 rows=1 placeholder="author=list" maxlength=128 632 name="author"><?php echo sanitize_text_field(atw_posts_get_filter_opt('author')); ?></textarea> 633 </td> 634 </tr> 635 </table> 636 <?php 637 atw_posts_nonce_field('atw_posts_add_author'); 638 ?> 639 </div> 640 <div class="filter-description"> 641 Specify the <em>author</em> ID to display posts from that author. Include an author by selecting the 642 author's display name from the drop-down list, 643 and clicking the "Add Author" button. This list includes all registered users with a role of Contributor or 644 higher. 645 You may add more than one author. If you prefix a category slug with a minus sign (e.e., -3), the author 646 with that ID will NOT be displayed. You can edit the query 647 string displayed in the text area directly - use the author ID shown in the drop-down list, and then save by 648 clicking "Save Filter Options". 649 </div> 650 <div style="clear:both;"></div> 651 652 </div><!-- end filter-section --> 653 <?php 654 } 655 656 // ========================================= >>> atw_posts_set_by_posts <<< =============================== 657 658 function atw_posts_set_by_posts() 659 { 660 //<!-- *** by Pates *** --> 661 ?> 662 663 <div class="filter-section"> 664 <div class="filter-title">• By Post IDs <span class="filter-title-description">Include posts with these post IDs</span> 665 </div> 666 667 <div class="filter-opts"> 668 <textarea class="filter-text" cols=60 rows=1 placeholder="Post ID list" maxlength=512 669 name="post_ids"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_ids')); ?></textarea> 670 671 </div> 672 <div class="filter-description"> 673 Specify a comma separated list of <em>Post IDs</em> to display posts in that list, in the order specified. 674 This option will override 675 other selection options (e.g., Tags, Date, etc.). You can find a post's ID in your browser's URL address 676 field when editing the 677 post with the Post editor. It is the number right after the <em>?post=</em>. Sorry this can't be easier, but 678 the only way 679 WordPress supports showing a specific set of posts is by ID. You may also find it helpful to set the "Number 680 of Posts to Show" option above to -1. 681 </div> 682 <div style="clear:both;"></div> 234 683 </div> 684 <?php 685 } 686 687 // ========================================= >>> atw_posts_set_post_slug <<< =============================== 688 689 function atw_posts_set_post_slug() 690 { 691 //<!-- *** by Post Slug *** --> 692 ?> 693 694 <div class="filter-section"> 695 696 <div class="filter-title">• By Post Slug <span class="filter-title-description">Include only post with this title slug</span> 697 </div> 698 699 <div class="filter-opts"> 700 <textarea class="filter-text" cols=40 rows=1 placeholder="page-title-slug" maxlength=512 701 name="post_slug"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_slug')); ?></textarea> 702 703 </div> 704 <div class="filter-description"> 705 This option will display a single post with the specified slug - usually automatically generated from the 706 posts's title. 707 If this is a post from a custom post type, you need to specify that in the "Post Type" setting. Other 708 selection options are ignored. 709 This is the WP_Query 'name' argument. 710 </div> 711 712 <div style="clear:both;"></div> 713 714 </div><!-- end filter-section --> 715 <?php 716 } 717 718 719 // ========================================= >>> atw_posts_set_date <<< =============================== 720 721 function atw_posts_set_date() 722 { 723 // <!-- *** Date *** --> 724 ?> 725 <div class="filter-section"> 726 <div class="filter-title">• Date <span class="filter-title-description">Include posts in a date range. (Default: all)</span> 727 </div> 728 729 <div class="filter-opts"> 730 <?php 731 $dates = array('Today' => 'today', 'Past 24 Hours' => 'past-24h', 'This Week' => 'this-week', 'Past 7 Days' => 'past-week', 732 'This Month' => 'this-month', 'Past 30 Days' => 'past-30d', 'This Year' => 'this-year', 'Past 365 Days' => 'past-365d' 733 ); 734 ?> 735 <table> 736 <tr> 737 <td><select class="filter-select" name="date_selection"> 738 <?php 739 foreach ($dates as $date => $val) { 740 echo '<option value="' . $val . '">' . $date . '</option>'; 741 } 742 ?> 743 </select></td> 744 <td><input class="filter-button button" type="submit" name="atw_posts_add_date" 745 value="Select Date"/></td> 746 <td><textarea class="filter-text" cols=40 rows=1 placeholder="date=date-slug" maxlength=128 747 name="date"><?php echo sanitize_text_field(atw_posts_get_filter_opt('date')); ?></textarea> 748 </td> 749 </tr> 750 </table> 751 <?php 752 atw_posts_nonce_field('atw_posts_add_date'); 753 ?> 754 </div> 755 <div class="filter-description"> 756 You can specify a pre-defined date range of posts to display. If you need to specify other date options, see 757 the WordPress WP_Query help page, and add specific date values using the "Custom WP_Query Args" section 758 below. 759 </div> 760 <div style="clear:both;"></div> 761 762 </div><!-- end filter-section --> 763 235 764 236 765 <div style="clear:both;"></div> 237 238 <div class="filter-description"> 239 <p> 240 Use this section to define how each post is to be displayed - title, excerpted, etc. These options apply to how each post is displayed when 241 using the plugin's built-in post layout, or when used with native Weaver Xtreme or Weaver II layout. Use the Content Selection Filter to define which posts 242 will be displayed. The Slider Image Show options can be used to define how images are used in a image only slide show. (Note: when using the 243 Weaver Slider plugin to display an image slider, these Post Display options do not apply.) 244 </p> 766 <?php 767 } 768 769 // ========================================= >>> atw_posts_set_taxonomy <<< =============================== 770 771 function atw_posts_set_taxonomy() 772 { 773 //<!-- *** Custom Taxonomies *** --> 774 ?> 775 <div class="filter-section"> 776 <div class="filter-title">• Custom Taxonomies <span class="filter-title-description">Manual specification of Custom Taxonomies</span> 777 </div> 778 779 <div class="filter-opts"> 780 <?php 781 $taxonomies = get_taxonomies(array('public' => true, '_builtin' => false), 'objects'); 782 $li_out = false; 783 if (empty($taxonomies)) { 784 echo '<strong>No Custom Taxonomies Found</strong><br /><br />'; 785 } else { 786 echo '<ul>'; 787 $li_out = false; 788 foreach ($taxonomies as $taxonomy => $val) { 789 if ($val->name == 'atw_slider_group') 790 continue; 791 $li_out = true; 792 echo '<li><strong>Taxonomy name: </strong> <em>' . $val->label . '</em> (slug: ' . $val->name . ')'; 793 $tax = $val->name; 794 $terms = get_terms($tax); 795 796 $lead = '<br /><span style="margin-left:20px;">Values (slugs): </span> '; 797 798 if (is_wp_error($terms)) { 799 continue; 800 } else { 801 if (empty($terms)) { 802 echo '<br /><span style="margin-left:20px;">Values: </span> None defined.<br />'; 803 continue; 804 } 805 foreach ($terms as $term) { 806 echo $lead; 807 $lead = ', '; 808 echo esc_attr($term->slug); 809 } 810 echo "<br />"; 811 } 812 echo '</li>'; 813 } 814 if (!$li_out) { 815 echo '<li>No custom taxonomies defined for this site.</li>'; 816 } 817 echo '</ul>'; 818 } 819 820 if ($li_out) { 821 ?> 822 <table> 823 <tr> 824 <td>Specify custom taxonomy parameters:</td> 825 <td><textarea class="filter-text" cols=60 rows=1 826 placeholder="custom_taxonomy_name=custom_values_by_slug_list" maxlength=512 827 name="taxonomy"><?php echo sanitize_text_field(atw_posts_get_filter_opt('taxonomy')); ?></textarea> 828 </td> 829 </tr> 830 </table> 831 <?php 832 } 833 ?> 834 </div> 835 <div class="filter-description"> 836 Various plugins can create Custom Taxonomies for use with custom post types. You can use these custom 837 taxonomy names and 838 values to specify additional filter terms to this filter definition. Add as many values as you wish for a 839 custom taxonomy 840 in the text box, then click "Save Filter Options" to set the value. For example, you could add a value 841 something like 842 <code>custom_category=cat1</code> to include custom posts with the 'custom_category' taxonomy with a value 843 'cat1'. Separate 844 different taxonomy lists with a space. 845 <em style="font-weight:bold;color:red;">Important:</em> Be sure to include the corresponding custom post 846 type in the "Post Type" section that matches the 847 custom taxonomy. 848 </div> 245 849 </div> 246 </div> 247 <?php 248 } 249 250 // ========================================= >>> atw_posts_filter_basic <<< =============================== 251 252 function atw_posts_filter_basic() { 253 // **** basic options **** 254 ?> 255 256 <div class="filter-section"> 257 <div class="filter-title">• Basic Options <span class="filter-title-description">Some basic options for selecting posts </span></div> 258 <div class="filter-opts"> 259 850 <?php 851 } 852 853 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 854 855 function atw_posts_set_custom_wpq() 856 { 857 //<!-- *** Custom Taxonomies *** --> 858 ?> 859 <!-- *** Other WP_Query args *** --> 860 861 <div class="filter-section"> 862 <div class="filter-title">• Custom WP_Query Args (Advanced Option) <span class="filter-title-description">Manual specification of WP_Query arguments</span> 863 </div> 864 865 <div class="filter-opts"> 866 867 <table> 868 <tr> 869 <td>Specify custom WP_Query arguments:</td> 870 <td><textarea class="filter-text" cols=60 rows=1 placeholder="arg1=val1 arg2=val2 ..." maxlength=512 871 name="wp_query_args"><?php echo esc_textarea(atw_posts_get_filter_opt('wp_query_args')); ?></textarea> 872 </td> 873 </tr> 874 </table> 875 </div> 876 <div class="filter-description"> 877 <em>This option is intended for advanced users.</em> The Selection Filter Options specified on this admin 878 page 879 are mapped to the corresponding WordPress <code>WP_Query</code> function arguments, but there are many 880 additional WP_Query options 881 not included in these options; most users will never need them. 882 However, you can specify your own custom arguments to WP_Query here. Provide as many arguments 883 as you need in the text box, each separated by a space. These arguments will be added to any other options 884 specified above, and be 885 added directly to the '$args' parameter to WP_Query. For a full, very technical explanation of all the 886 options available for WP_Query, please consult the 887 <a href="http://codex.wordpress.org/Class_Reference/WP_Query" alt="WP_Query Codex Entry" target="_blank">WordPress 888 Codex for WP_Query</a>. 889 <em style="font-weight:bold;color:red;">Important:</em> WP_Query arguments requiring values with 'array()' 890 are <em><strong>not</strong></em> supported 891 by this plugin. 892 </div> 893 </div> 894 <?php 895 } 896 897 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 898 899 if (WEAVER_SHOWPOSTS_TEMPLATE) { 900 function atw_posts_set_custom_template() 901 { 902 //<!-- *** Custom Taxonomies *** --> 903 904 if (!current_user_can('unfiltered_html')) 905 return; // don't even show 906 907 $text = atw_posts_get_filter_opt('post_template'); 908 $rows = 1; 909 910 if (strlen($text) > 0) 911 $lines = count(explode(PHP_EOL, $text)); 912 else 913 $lines = 0; 914 if ($lines > 20) 915 $lines = 18; 916 if ($lines > 0) 917 $rows = $lines + 2; 918 919 ?> 920 <!-- *** Custom Post *** --> 921 922 <div class="filter-section"> 923 <div class="filter-title">• Custom Post Template (Advanced Option) <span 924 class="filter-title-description">Define custom template to display posts</span></div> 925 926 <div class="filter-opts"> 927 928 <textarea class="filter-text" style="max-width:90%;" cols=100 929 rows=<?php echo $rows; ?> placeholder="Enter post template" maxlength=2048 930 name="post_template"><?php echo esc_textarea($text); ?></textarea></td></tr></table> 931 </div> 932 <div class="filter-description"> 933 <em>This option is intended for advanced users.</em> You can define a completely custom template to 934 display posts. 935 You must read the help file for an explanation of this option. 936 </div> 937 </div> 260 938 <?php 261 262 atw_posts_filter_checkbox('show_sticky_posts','Show Sticky Posts at beginning of displayed posts','');263 264 atw_posts_filter_checkbox('use_paging','Use Paging (posts will be paged using Number of Posts per page)');265 266 atw_posts_filter_checkbox('no_top_clear','Do not clear:both at start of posts. (allows posts to be inline)');267 268 atw_posts_filter_val('posts_per_page', 'Number of Posts to Show (Use -1 for all. Default: Settings->Reading value)');269 270 atw_posts_filter_val('offset', 'Number of posts to skip over');271 272 273 atw_posts_filter_val('excerpt_length','Excerpt length (words)', '<span style="padding-left:70px"></span>');274 275 atw_posts_filter_val('cols','Display posts in columns (1-3)')276 ?>277 <?php $cur_order = atw_posts_get_filter_opt('orderby'); ?>278 <br />279 <strong>Display posts ordered by:</strong>280 <select name='orderby'>281 <option value="date" <?php selected( $cur_order == 'date');?>>Date</option>282 <option value="title" <?php selected( $cur_order == 'title');?>>Post Title</option>283 <option value="modified" <?php selected( $cur_order == 'modified');?>>Last Modified Date</option>284 <option value="rand" <?php selected( $cur_order == 'rand');?>>Random order</option>285 <option value="comment_count" <?php selected( $cur_order == 'comment_count');?>>Number of comments</option>286 <option value="author" <?php selected( $cur_order == 'author');?>>Author</option>287 <option value="ID" <?php selected( $cur_order == 'ID');?>>Post ID</option>288 <option value="menu_order" <?php selected( $cur_order == 'menu_order');?>>Menu/Custom Post Order</option>289 <option value="none" <?php selected( $cur_order == 'none');?>>No order</option>290 </select>291 292 <?php $cur_order = atw_posts_get_filter_opt('order'); ?>293 <strong style="padding-left:25px">Sort order:</strong>294 <select name='order'>295 <option value="DESC" <?php selected( $cur_order == 'DESC');?>>Descending (3,2,1) (default)</option>296 <option value="ASC" <?php selected( $cur_order == 'ASC');?>>Ascending (1,2,3)</option>297 </select>298 </div>299 300 <div style="clear:both;"></div>301 302 </div><!-- end filter-section -->303 <?php304 }305 306 // ========================================= >>> atw_posts_set_post_type <<< ===============================307 308 function atw_posts_set_post_type() {309 // **** post_type ****310 ?>311 <div class="filter-section">312 <div class="filter-title">• Post Type <span class="filter-title-description">Include posts with this post type. (WP_Query: post_type - Default: post) </span></div>313 <div class="filter-opts">314 <table><tr>315 <td><select class="filter-select" name="post_type_selection" >316 <?php317 $post_types = get_post_types(array() , 'names');318 foreach ($post_types as $post_type) {319 if ($post_type != 'page'320 && $post_type != 'nav_menu_item'321 && $post_type != 'revision'322 && $post_type != 'attachment')323 echo '<option value="'. $post_type . '">' . $post_type . '</option>';324 939 } 325 ?> 326 </select></td> 327 <td><input class="button filter-button" type="submit" name="atw_posts_add_post_type" value="Add Post Type" /></td> 328 <td><textarea class="filter-text" cols=40 rows=1 placeholder="post_type=list" maxlength=128 name="post_type"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_type')); ?></textarea></td> 329 </tr></table> 330 331 <?php 332 atw_posts_nonce_field('atw_posts_add_post_type'); 333 ?> 334 </div> 335 <div class="filter-description"> 336 Specify the <em>post_type</em> used to select posts. If you just want standard posts, you don't need to define this setting. 337 Include a post type by selecting the type from the drop-down list, 338 and clicking the "Add Post Type" button. This list includes any <em>Custom Post Types</em> that may be defined by 339 plugins you have installed. These custom post types may or may not display useful content depending how they are 340 used by the plugin. You may add more than one post type. You can edit the query 341 string displayed in the text area directly, and then save by clicking "Save Filter Options". 342 </div> 343 <div style="clear:both;"></div> 344 345 </div><!-- end filter-section --> 346 <?php 347 } 348 349 350 // ========================================= >>> atw_posts_set_post_cats <<< =============================== 351 352 function atw_posts_set_post_cats() { 353 //<!-- **** Post Categories **** --> 354 ?> 355 <div class="filter-section"> 356 <div class="filter-title">• Categories <span class="filter-title-description">Include posts with these categories. (WP_Query: category_name - Default: all) </span></div> 357 <div class="filter-opts"> 358 <table><tr> 359 <td><select class="filter-select" name="category_name_selection" > 360 <?php 361 $cats = get_categories( ); 362 363 foreach ($cats as $cat => $val) { 364 echo '<option value="'. $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 365 } 366 ?> 367 </select></td> 368 <td><input class="button" type="submit" name="atw_posts_add_category_name" value="Add Category" /></td> 369 <td><input class="button" type="submit" name="atw_posts_hide_category_name" value="Hide Category" /></td> 370 <td><textarea class="filter-text" cols=40 rows=1 placeholder="category_name=list" maxlength=128 name="category_name"><?php echo sanitize_text_field(atw_posts_get_filter_opt('category_name')); ?></textarea></td> 371 </tr></table> 372 373 <?php 374 atw_posts_nonce_field('atw_posts_add_category_name'); 375 atw_posts_nonce_field('atw_posts_hide_category_name'); 376 377 ?> 378 </div> 379 <div class="filter-description"> 380 Specify the <em>category_name</em> slug to display posts from that category. Include a category by selecting the category from the drop-down list, 381 and clicking the "Add Category" button. This list includes all categories for standard posts that have been defined. 382 You may add more than one category. If you prefix a category slug with a minus sign (e.e., -cat-slug) or use the "Hide Category" button, 383 that category will NOT be displayed. You can edit the query 384 string displayed in the text area directly, and then save by clicking "Save Filter Options". 385 </div> 386 <div style="clear:both;"></div> 387 388 </div><!-- end filter-section --> 389 <?php 390 } 391 392 // ========================================= >>> atw_posts_set_post_tags <<< =============================== 393 394 function atw_posts_set_post_tags() { 395 //<!-- *** Tags *** --> 396 ?> 397 398 <div class="filter-section"> 399 <div class="filter-title">• Tags <span class="filter-title-description">Include posts with these tags. (WP_Query: tag - Default: all) </span></div> 400 401 <div class="filter-opts"> 402 <table><tr> 403 <td><select class="filter-select" name="tag_selection" > 404 <?php 405 $tags = get_tags( ); 406 407 foreach ($tags as $tag => $val) { 408 echo '<option value="'. $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 409 } 410 ?> 411 </select></td> 412 <td><input class="filter-button button" type="submit" name="atw_posts_add_tag" value="Add Tag" /></td> 413 <td><textarea class="filter-text" cols=40 rows=1 placeholder="tag=list" maxlength=128 name="tag"><?php echo sanitize_text_field(atw_posts_get_filter_opt('tag')); ?></textarea></td> 414 </tr></table> 415 <?php 416 atw_posts_nonce_field('atw_posts_add_tag'); 417 ?> 418 </div> 419 <div class="filter-description"> 420 Specify the <em>tag</em> slug to display posts from that tag. Include a tag by selecting the tag from the drop-down list, 421 and clicking the "Add Tag" button. This list includes all tags for standard posts that have been defined. 422 You may add more than one tag. You can edit the query 423 string displayed in the text area directly, and then save by clicking "Save Filter Options". 424 </div> 425 <div style="clear:both;"></div> 426 427 </div><!-- end filter-section --> 428 <?php 429 } 430 431 // ========================================= >>> atw_posts_set_slider_group <<< =============================== 432 433 function atw_posts_set_slider_group() { 434 //<!-- *** Slider Group *** --> 435 if ( !function_exists('atw_slider_installed') ) // don't show this if we don't have the slider installed 436 return; 437 ?> 438 439 <div class="filter-section"> 440 <div class="filter-title">• Slider Group <span class="filter-title-description">Include posts from these Slider Groups (most useful with Weaver Slider plugin)</span></div> 441 442 <div class="filter-opts"> 443 <table><tr> 444 <td><select class="filter-select" name="group_selection" > 445 <?php 446 447 $terms = get_terms( 'atw_slider_group' ); 448 foreach ( $terms as $term ) { 449 echo '<option value="'. $term->slug . '">' . $term->name . ' (' . $term->slug . ')</option>'; 450 } 451 ?> 452 </select></td> 453 <td><input class="filter-button button" type="submit" name="atw_posts_add_group" value="Add Slider Group" /></td> 454 <td><textarea class="filter-text" cols=40 rows=1 placeholder="atw_slider_group=list" maxlength=128 name="atw_slider_group"><?php echo sanitize_text_field(atw_posts_get_filter_opt('atw_slider_group')); ?></textarea></td> 455 </tr></table> 456 <?php 457 atw_posts_nonce_field('atw_posts_add_group'); 458 ?> 459 </div> 460 <div class="filter-description"> 461 Specify the <em>Slider Group</em> slug to display posts from that slider group. Include a group by selecting the group from the drop-down list, 462 and clicking the "Add Slider Group" button. This list includes only groups for the atw_sliders_post that have been defined. 463 You may add more than one group. You can edit the query 464 string displayed in the text area directly, and then save by clicking "Save Filter Options". 465 <em style="font-weight:bold;color:red;">Important:</em> Post Type option must include "atw_slider_post" to display slider groups. 466 </div> 467 <div style="clear:both;"></div> 468 469 </div><!-- end filter-section --> 470 <?php 471 } 472 473 // ========================================= >>> atw_posts_set_author <<< =============================== 474 475 function atw_posts_set_author() { 476 //<!-- *** Author *** --> 477 ?> 478 479 <div class="filter-section"> 480 <div class="filter-title">• Author <span class="filter-title-description">Include posts with these authors. (WP_Query: author - Default: all) </span></div> 481 482 <div class="filter-opts"> 483 <?php 484 $user_args = array( 485 'fields' => array( 'ID', 'user_nicename', 'display_name' ), 486 'who' => 'authors', 487 'orderby' => 'display_name' 488 ); 489 $wp_user_search = new WP_User_Query( $user_args ); 490 $authors = $wp_user_search->get_results(); 491 ?> 492 <table><tr> 493 <td><select class="filter-select" name="author_selection" > 494 <?php 495 foreach ($authors as $author => $val) { 496 echo '<option value="' . $val->ID . '">' . $val->display_name . ' (' . $val->ID . ')</option>'; 497 } 498 ?> 499 </select></td> 500 <td><input class="filter-button button" type="submit" name="atw_posts_add_author" value="Add Author" /></td> 501 <td><textarea class="filter-text" cols=40 rows=1 placeholder="author=list" maxlength=128 name="author"><?php echo sanitize_text_field(atw_posts_get_filter_opt('author')); ?></textarea></td> 502 </tr></table> 503 <?php 504 atw_posts_nonce_field('atw_posts_add_author'); 505 ?> 506 </div> 507 <div class="filter-description"> 508 Specify the <em>author</em> ID to display posts from that author. Include an author by selecting the author's display name from the drop-down list, 509 and clicking the "Add Author" button. This list includes all registered users with a role of Contributor or higher. 510 You may add more than one author. If you prefix a category slug with a minus sign (e.e., -3), the author with that ID will NOT be displayed. You can edit the query 511 string displayed in the text area directly - use the author ID shown in the drop-down list, and then save by clicking "Save Filter Options". 512 </div> 513 <div style="clear:both;"></div> 514 515 </div><!-- end filter-section --> 516 <?php 517 } 518 519 // ========================================= >>> atw_posts_set_by_posts <<< =============================== 520 521 function atw_posts_set_by_posts() { 522 //<!-- *** by Pates *** --> 523 ?> 524 525 <div class="filter-section"> 526 <div class="filter-title">• By Post IDs <span class="filter-title-description">Include posts with these post IDs</span></div> 527 528 <div class="filter-opts"> 529 <textarea class="filter-text" cols=60 rows=1 placeholder="Post ID list" maxlength=512 name="post_ids"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_ids')); ?></textarea> 530 531 </div> 532 <div class="filter-description"> 533 Specify a comma separated list of <em>Post IDs</em> to display posts in that list, in the order specified. This option will override 534 other selection options (e.g., Tags, Date, etc.). You can find a post's ID in your browser's URL address field when editing the 535 post with the Post editor. It is the number right after the <em>?post=</em>. Sorry this can't be easier, but the only way 536 WordPress supports showing a specific set of posts is by ID. You may also find it helpful to set the "Number of Posts to Show" option above to -1. 537 </div> 538 <div style="clear:both;"></div> 539 </div> 540 <?php 541 } 542 543 // ========================================= >>> atw_posts_set_post_slug <<< =============================== 544 545 function atw_posts_set_post_slug() { 546 //<!-- *** by Post Slug *** --> 547 ?> 548 549 <div class="filter-section"> 550 551 <div class="filter-title">• By Post Slug <span class="filter-title-description">Include only post with this title slug</span></div> 552 553 <div class="filter-opts"> 554 <textarea class="filter-text" cols=40 rows=1 placeholder="page-title-slug" maxlength=512 name="post_slug"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_slug')); ?></textarea> 555 556 </div> 557 <div class="filter-description"> 558 This option will display a single post with the specified slug - usually automatically generated from the posts's title. 559 If this is a post from a custom post type, you need to specify that in the "Post Type" setting. Other selection options are ignored. 560 This is the WP_Query 'name' argument. 561 </div> 562 563 <div style="clear:both;"></div> 564 565 </div><!-- end filter-section --> 566 <?php 567 } 568 569 570 571 // ========================================= >>> atw_posts_set_date <<< =============================== 572 573 function atw_posts_set_date() { 574 // <!-- *** Date *** --> 575 ?> 576 <div class="filter-section"> 577 <div class="filter-title">• Date <span class="filter-title-description">Include posts in a date range. (Default: all)</span></div> 578 579 <div class="filter-opts"> 580 <?php 581 $dates = array('Today' => 'today', 'Past 24 Hours' => 'past-24h', 'This Week' => 'this-week', 'Past 7 Days' => 'past-week', 582 'This Month' => 'this-month', 'Past 30 Days' => 'past-30d', 'This Year' => 'this-year', 'Past 365 Days' => 'past-365d' 583 ); 584 ?> 585 <table><tr> 586 <td><select class="filter-select" name="date_selection"> 587 <?php 588 foreach ($dates as $date => $val) { 589 echo '<option value="' . $val . '">' . $date . '</option>'; 590 } 591 ?> 592 </select></td> 593 <td><input class="filter-button button" type="submit" name="atw_posts_add_date" value="Select Date" /></td> 594 <td><textarea class="filter-text" cols=40 rows=1 placeholder="date=date-slug" maxlength=128 name="date"><?php echo sanitize_text_field(atw_posts_get_filter_opt('date')); ?></textarea></td> 595 </tr></table> 596 <?php 597 atw_posts_nonce_field('atw_posts_add_date'); 598 ?> 599 </div> 600 <div class="filter-description"> 601 You can specify a pre-defined date range of posts to display. If you need to specify other date options, see the WordPress WP_Query help page, and add specific date values using the "Custom WP_Query Args" section below. 602 </div> 603 <div style="clear:both;"></div> 604 605 </div><!-- end filter-section --> 606 607 608 <div style="clear:both;"></div> 609 <?php 610 } 611 612 // ========================================= >>> atw_posts_set_taxonomy <<< =============================== 613 614 function atw_posts_set_taxonomy() { 615 //<!-- *** Custom Taxonomies *** --> 616 ?> 617 <div class="filter-section"> 618 <div class="filter-title">• Custom Taxonomies <span class="filter-title-description">Manual specification of Custom Taxonomies</span></div> 619 620 <div class="filter-opts"> 621 <?php 622 $taxonomies = get_taxonomies(array( 'public' => true, '_builtin' => false), 'objects'); 623 $li_out = false; 624 if (empty($taxonomies)) { 625 echo '<strong>No Custom Taxonomies Found</strong><br /><br />'; 626 } else { 627 echo '<ul>'; 628 $li_out = false; 629 foreach ($taxonomies as $taxonomy => $val ) { 630 if ($val->name == 'atw_slider_group') 631 continue; 632 $li_out = true; 633 echo '<li><strong>Taxonomy name: </strong> <em>' . $val->label . '</em> (slug: ' . $val->name . ')'; 634 $tax = $val->name; 635 $terms = get_terms( $tax ); 636 637 $lead = '<br /><span style="margin-left:20px;">Values (slugs): </span> '; 638 639 if ( is_wp_error( $terms ) ) { 640 continue; 641 } else { 642 if (empty($terms)) { 643 echo '<br /><span style="margin-left:20px;">Values: </span> None defined.<br />'; 644 continue; 645 } 646 foreach ( $terms as $term ) { 647 echo $lead; 648 $lead = ', '; 649 echo esc_attr( $term->slug ); 650 } 651 echo "<br />"; 652 } 653 echo '</li>'; 654 } 655 if ( !$li_out ) { 656 echo '<li>No custom taxonomies defined for this site.</li>'; 657 } 658 echo '</ul>'; 659 } 660 661 if ( $li_out ) { 662 ?> 663 <table><tr><td>Specify custom taxonomy parameters:</td><td><textarea class="filter-text" cols=60 rows=1 placeholder="custom_taxonomy_name=custom_values_by_slug_list" maxlength=512 name="taxonomy"><?php echo sanitize_text_field(atw_posts_get_filter_opt('taxonomy')); ?></textarea></td></tr></table> 664 <?php 665 } 666 ?> 667 </div> 668 <div class="filter-description"> 669 Various plugins can create Custom Taxonomies for use with custom post types. You can use these custom taxonomy names and 670 values to specify additional filter terms to this filter definition. Add as many values as you wish for a custom taxonomy 671 in the text box, then click "Save Filter Options" to set the value. For example, you could add a value something like 672 <code>custom_category=cat1</code> to include custom posts with the 'custom_category' taxonomy with a value 'cat1'. Separate 673 different taxonomy lists with a space. 674 <em style="font-weight:bold;color:red;">Important:</em> Be sure to include the corresponding custom post type in the "Post Type" section that matches the 675 custom taxonomy. 676 </div> 677 </div> 678 <?php 679 } 680 681 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 682 683 function atw_posts_set_custom_wpq() { 684 //<!-- *** Custom Taxonomies *** --> 685 ?> 686 <!-- *** Other WP_Query args *** --> 687 688 <div class="filter-section"> 689 <div class="filter-title">• Custom WP_Query Args (Advanced Option) <span class="filter-title-description">Manual specification of WP_Query arguments</span></div> 690 691 <div class="filter-opts"> 692 693 <table><tr><td>Specify custom WP_Query arguments:</td><td><textarea class="filter-text" cols=60 rows=1 placeholder="arg1=val1 arg2=val2 ..." maxlength=512 name="wp_query_args"><?php echo esc_textarea(atw_posts_get_filter_opt('wp_query_args')); ?></textarea></td></tr></table> 694 </div> 695 <div class="filter-description"> 696 <em>This option is intended for advanced users.</em> The Selection Filter Options specified on this admin page 697 are mapped to the corresponding WordPress <code>WP_Query</code> function arguments, but there are many additional WP_Query options 698 not included in these options; most users will never need them. 699 However, you can specify your own custom arguments to WP_Query here. Provide as many arguments 700 as you need in the text box, each separated by a space. These arguments will be added to any other options specified above, and be 701 added directly to the '$args' parameter to WP_Query. For a full, very technical explanation of all the options available for WP_Query, please consult the 702 <a href="http://codex.wordpress.org/Class_Reference/WP_Query" alt="WP_Query Codex Entry" target="_blank">WordPress Codex for WP_Query</a>. 703 <em style="font-weight:bold;color:red;">Important:</em> WP_Query arguments requiring values with 'array()' are <em><strong>not</strong></em> supported 704 by this plugin. 705 </div> 706 </div> 707 <?php 708 } 709 710 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 711 712 if ( WEAVER_SHOWPOSTS_TEMPLATE ) { 713 function atw_posts_set_custom_template() { 714 //<!-- *** Custom Taxonomies *** --> 715 716 if ( !current_user_can('unfiltered_html') ) 717 return; // don't even show 718 719 $text = atw_posts_get_filter_opt('post_template'); 720 $rows = 1; 721 722 if (strlen($text) > 0) 723 $lines = count (explode(PHP_EOL, $text)); 724 else 725 $lines = 0; 726 if ($lines > 20) 727 $lines = 18; 728 if ($lines > 0) 729 $rows = $lines + 2; 730 731 ?> 732 <!-- *** Custom Post *** --> 733 734 <div class="filter-section"> 735 <div class="filter-title">• Custom Post Template (Advanced Option) <span class="filter-title-description">Define custom template to display posts</span></div> 736 737 <div class="filter-opts"> 738 739 <textarea class="filter-text" style="max-width:90%;" cols=100 rows=<?php echo $rows; ?> placeholder="Enter post template" maxlength=2048 name="post_template"><?php echo esc_textarea($text); ?></textarea></td></tr></table> 740 </div> 741 <div class="filter-description"> 742 <em>This option is intended for advanced users.</em> You can define a completely custom template to display posts. 743 You must read the help file for an explanation of this option. 744 </div> 745 </div> 746 <?php 747 } 748 } 749 940 } 941 -
show-posts/tags/1.8.1/includes/atw-runtime-lib.php
r2213242 r2947913 350 350 } 351 351 352 function atw_posts_allow_file_read(): bool 353 { 354 // return true if it is allowed to use on MultiSite 355 356 return ((!is_multisite() && current_user_can('install_plugins')) 357 || (is_multisite() && current_user_can('manage_network_themes'))); 358 } 359 352 360 // ====================================== >>> atw_posts_is... <<< ====================================== 353 361 -
show-posts/tags/1.8.1/includes/downloader.php
r2891911 r2947913 2 2 // will down load current settings based on db setting 3 3 // __ added - 12/11/14 4 if ( !current_user_can( 'manage_options' ) ) { 5 exit; 6 } 4 7 5 8 $wp_root = dirname(__FILE__) .'/../../../../'; -
show-posts/tags/1.8.1/readme.txt
r2900851 r2947913 8 8 Tags: weaver theme, settings, save, subthemes 9 9 Text Domain: show-posts 10 Requires at least: 5.411 Tested up to: 6. 212 Stable tag: 1.8 10 Requires at least: 7.2 11 Tested up to: 6.3 12 Stable tag: 1.8.1 13 13 14 14 == Description == … … 50 50 Please use the WordPress Plugins:Install page to install this plugin. 51 51 52 53 52 == Frequently Asked Questions == 54 53 … … 60 59 61 60 == Changelog == 61 = 1.8.1 = 62 * Fix: multisite permissions 63 62 64 = 1.8 = 63 65 * Fix: string validation, translation name -
show-posts/trunk/atw-show-posts.php
r2900851 r2947913 6 6 Author: wpweaver 7 7 Author URI: http://weavertheme.com/about/ 8 Version: 1.8 8 Version: 1.8.1 9 9 10 10 License: GPL … … 31 31 */ 32 32 33 const WEAVER_SHOWPOSTS_VERSION = '1.8 ';33 const WEAVER_SHOWPOSTS_VERSION = '1.8.1'; 34 34 const WEAVER_SHOWPOSTS_MINIFY = '.min'; // '' for dev, '.min' for production 35 35 const WEAVER_SHOWPOSTS_TEMPLATE = false; // future feature -
show-posts/trunk/includes/atw-admin-lib.php
r2891911 r2947913 45 45 function atw_posts_restore_filter() { 46 46 if (!(isset($_POST['uploadit']) && $_POST['uploadit'] == 'yes')) return; 47 48 if (!atw_posts_allow_file_read()) { 49 atw_posts_save_msg( 'File Read Access problem. File not restored.' ); 50 return; 51 } 47 52 48 53 // upload theme from users computer … … 99 104 100 105 function atw_posts_set_to_serialized_values($contents) { 106 if (!atw_posts_allow_file_read()) { 107 return false; 108 } 101 109 102 110 $restore = unserialize($contents); -
show-posts/trunk/includes/atw-posts-filters-admin.php
r2213242 r2947913 1 1 <?php 2 2 // ======================================================== filters admin =============================== 3 function atw_posts_filters_admin() { 4 ?> 3 function atw_posts_filters_admin() 4 { 5 ?> 5 6 <h2 style="color:blue;">Create and Define Filters</h2> 6 7 <form method="post" enctype="multipart/form-data"> 7 <input type="hidden" name="atw_posts_save_filter_opts" value="Filter Options Saved" />8 <input type="hidden" name="atw_posts_save_filter_opts" value="Filter Options Saved"/> 8 9 <input style="display:none;" type="submit" name="atw_stop_enter" value="Ignore Enter"/> 9 10 10 <?php 11 //settings_fields( 'atw_posts_opt_group' ); 12 //atw_posts_delete_all_options(); // @@@@@@ for debugging 13 14 atw_posts_select_filter(); // select filter box 15 atw_posts_save_filter_button(); 16 17 atw_posts_define_display(); // define content display options 18 atw_posts_save_filter_button(); 19 ?> 20 <h3><u>Define Content Selection Filter Options</u></h3> 21 22 <style> 23 .filter-section {padding:10px;border:2px solid #aaa;margin-bottom:5px;} 24 .filter-title {font-size:110%;font-weight:bold;color:blue;margin-bottom:5px;} 25 .filter-title-description {padding-left:40px;font-size:90%;font-weight:normal;font-style:italic;color:#444;} 26 .filter-opts {margin:0 0 5px 15px;} 27 .filter-description {padding-left:1%;font-size:90%;} 28 .filter-select {} 29 .filter-text {margin-left:20px;} 30 .filter-button{} 31 </style> 32 33 <?php 34 atw_posts_filter_basic(); // basic filter options box 35 36 atw_posts_set_post_type(); // set post type 37 38 atw_posts_set_slider_group(); // the slider group 39 40 atw_posts_save_filter_button(); 41 42 atw_posts_set_post_cats(); // set post categories 43 44 atw_posts_set_post_tags(); // tag filters 45 46 atw_posts_set_by_posts(); // set by post id 47 48 atw_posts_set_post_slug(); // by post slug 49 50 atw_posts_save_filter_button(); 51 52 atw_posts_set_author(); // select the author 53 54 atw_posts_set_date(); // select by date 55 56 atw_posts_set_taxonomy(); // select by custom taxonomy 57 58 atw_posts_set_custom_wpq(); // set custom WP_Query args 59 60 atw_posts_save_filter_button(); 61 62 if (WEAVER_SHOWPOSTS_TEMPLATE) 63 atw_posts_set_custom_template(); 64 65 atw_posts_nonce_field('atw_posts_save_filter_opts'); 66 67 ?> 11 <?php 12 //settings_fields( 'atw_posts_opt_group' ); 13 //atw_posts_delete_all_options(); // @@@@@@ for debugging 14 15 atw_posts_select_filter(); // select filter box 16 atw_posts_save_filter_button(); 17 18 atw_posts_define_display(); // define content display options 19 atw_posts_save_filter_button(); 20 ?> 21 <h3><u>Define Content Selection Filter Options</u></h3> 22 23 <style> 24 .filter-section { 25 padding: 10px; 26 border: 2px solid #aaa; 27 margin-bottom: 5px; 28 } 29 30 .filter-title { 31 font-size: 110%; 32 font-weight: bold; 33 color: blue; 34 margin-bottom: 5px; 35 } 36 37 .filter-title-description { 38 padding-left: 40px; 39 font-size: 90%; 40 font-weight: normal; 41 font-style: italic; 42 color: #444; 43 } 44 45 .filter-opts { 46 margin: 0 0 5px 15px; 47 } 48 49 .filter-description { 50 padding-left: 1%; 51 font-size: 90%; 52 } 53 54 .filter-select { 55 } 56 57 .filter-text { 58 margin-left: 20px; 59 } 60 61 .filter-button { 62 } 63 </style> 64 65 <?php 66 atw_posts_filter_basic(); // basic filter options box 67 68 atw_posts_set_post_type(); // set post type 69 70 atw_posts_set_slider_group(); // the slider group 71 72 atw_posts_save_filter_button(); 73 74 atw_posts_set_post_cats(); // set post categories 75 76 atw_posts_set_post_tags(); // tag filters 77 78 atw_posts_set_by_posts(); // set by post id 79 80 atw_posts_set_post_slug(); // by post slug 81 82 atw_posts_save_filter_button(); 83 84 atw_posts_set_author(); // select the author 85 86 atw_posts_set_date(); // select by date 87 88 atw_posts_set_taxonomy(); // select by custom taxonomy 89 90 atw_posts_set_custom_wpq(); // set custom WP_Query args 91 92 atw_posts_save_filter_button(); 93 94 if (WEAVER_SHOWPOSTS_TEMPLATE) 95 atw_posts_set_custom_template(); 96 97 atw_posts_nonce_field('atw_posts_save_filter_opts'); 98 99 ?> 68 100 69 101 </form> 70 <hr /> 71 <?php 72 } 73 74 function atw_posts_save_filter_button() { 75 ?> 76 <input style="margin-bottom:5px;" class="button-primary" type="submit" name="atw_posts_save_options" value="Save Filter Options"/> 77 <?php 102 <hr/> 103 <?php 104 } 105 106 function atw_posts_save_filter_button() 107 { 108 ?> 109 <input style="margin-bottom:5px;" class="button-primary" type="submit" name="atw_posts_save_options" 110 value="Save Filter Options"/> 111 <?php 78 112 } 79 113 80 114 // ========================================= >>> atw_posts_select_filter <<< =============================== 81 115 82 function atw_posts_select_filter() { 116 function atw_posts_select_filter() 117 { 83 118 84 119 $current_filter = atw_posts_getopt('current_filter'); 85 ?> 86 87 <h3><u>Select Filter</u></h3> 88 89 90 <!-- ** Current Filter ** --> 91 92 <div class="filter-section"> 93 <div class="filter-title">• Current Filter: <em style="font-size:150%;color:#CC2323;"><?php echo atw_posts_get_filter_opt('name'); ?></em> 94 <span class="filter-title-description">Select a filter to define or edit </span></div> 95 <?php 96 97 $filters = atw_posts_getopt('filters'); 98 $cur_slug = ''; 99 $cur_name = ''; 100 101 echo '<table><tr><td><strong>Select Filter: </strong></td><td><select name="selected_filter" onchange="this.form.submit()">'; 102 foreach ($filters as $filter => $val) { // display dropdown of available filters 103 if ($filter == $current_filter) { 104 $cur_slug = $filter; 105 $cur_name = $val['name']; 106 echo '<option value="'. $filter . '" selected="selected">' . $val['name'] . ' (' . $filter . ')</option>'; 107 } else { 108 echo '<option value="'. $filter . '">' . $val['name'] . ' (' . $filter . ')</option>'; 120 ?> 121 122 <h3><u>Select Filter</u></h3> 123 124 125 <!-- ** Current Filter ** --> 126 127 <div class="filter-section"> 128 <div class="filter-title">• Current Filter: <em 129 style="font-size:150%;color:#CC2323;"><?php echo atw_posts_get_filter_opt('name'); ?></em> 130 <span class="filter-title-description">Select a filter to define or edit </span></div> 131 <?php 132 133 $filters = atw_posts_getopt('filters'); 134 $cur_slug = ''; 135 $cur_name = ''; 136 137 echo '<table><tr><td><strong>Select Filter: </strong></td><td><select name="selected_filter" onchange="this.form.submit()">'; 138 foreach ($filters as $filter => $val) { // display dropdown of available filters 139 if ($filter == $current_filter) { 140 $cur_slug = $filter; 141 $cur_name = $val['name']; 142 echo '<option value="' . $filter . '" selected="selected">' . $val['name'] . ' (' . $filter . ')</option>'; 143 } else { 144 echo '<option value="' . $filter . '">' . $val['name'] . ' (' . $filter . ')</option>'; 145 } 109 146 } 147 echo '</select>'; 148 ?> 149 150 ← <input class="button" type="submit" 151 onclick="return confirm('This will clear all current filter settings. The filter will also be deleted unless it is the Default filter. Are you sure?');" 152 name="atw_posts_delete_filter" value="Clear/Delete Current Filter"/></td></tr> 153 <tr> 154 <td> </td> 155 <td><span style="padding-left:20px;"></span></span><textarea cols=32 rows=1 156 placeholder="Enter name for new/duplicate filter" 157 maxlength=64 name="filter_name"></textarea> 158 ← <input class="button" type="submit" name="atw_posts_new_filter" 159 value="Create New Filter"/> 160 <em>-or-</em> <input class="button" type="submit" name="atw_posts_duplicate_filter" 161 value="Duplicate Current Filter"/></td> 162 </tr> 163 </table> 164 <?php 165 166 $time = date('Y-m-d-Hi'); 167 168 echo "<div style='margin-top:6px;'>\n"; 169 170 atw_posts_download_link('<strong>Save Settings</strong> for current filter <strong>' . $cur_name . '</strong>.', 171 $cur_slug, 'filter', $time); 172 173 ?> 174 </div> 175 <?php 176 if (atw_posts_allow_file_read()) { 177 ?> 178 <div> 179 <input style="margin-left:8em;" class="download-link" type="submit" name="atw_posts_restore_filter" 180 value="Restore Filter"/> 181 <span style="border:1px solid #CCC;width:400px;padding:2px;"><input name="post_uploaded" 182 type="file"/></span> 183 <input type="hidden" name="uploadit" value="yes"/>- Upload file to restore a filter 184 </div> 185 <?php 186 } else { 187 ?> 188 <div style="margin-left:8em;"> 189 <span style="font-weight: bold; color:red;">File Upload Access Restriction: </span> 190 Sorry, you must be a Multi-Site Super Admin or have the <em>install_plugins</em> capability set for your 191 account by a Super Admin to read settings files. (e.g., with the <em>User Role Editor</em> plugin.)</strong> 192 </div> 193 <?php 110 194 } 111 echo '</select>'; 112 ?> 113 114 ← <input class="button" type="submit" onclick="return confirm('This will clear all current filter settings. The filter will also be deleted unless it is the Default filter. Are you sure?');" 115 name="atw_posts_delete_filter" value="Clear/Delete Current Filter"/></td></tr> 116 <tr><td> </td><td><span style="padding-left:20px;"></span></span><textarea cols=32 rows=1 placeholder="Enter name for new/duplicate filter" maxlength=64 name="filter_name"></textarea> 117 ← <input class="button" type="submit" name="atw_posts_new_filter" value="Create New Filter"/> 118 <em>-or-</em> <input class="button" type="submit" name="atw_posts_duplicate_filter" value="Duplicate Current Filter"/></td></tr></table> 119 <?php 120 121 $time = date('Y-m-d-Hi'); 122 123 echo "<div style='margin-top:6px;'>\n"; 124 125 atw_posts_download_link('<strong>Save Settings</strong> for current filter <strong>' . $cur_name . '</strong>.', 126 $cur_slug, 'filter', $time ); 127 128 ?> 129 </div> 130 <input style="margin-left:8em;" class="download-link" type="submit" name="atw_posts_restore_filter" value="Restore Filter" /> 131 <span style="border:1px solid #CCC;width:400px;padding:2px;"><input name="post_uploaded" type="file" /></span> 132 <input type="hidden" name="uploadit" value="yes" />- Upload file to restore a filter 133 <br /><br /> 195 ?> 196 <br/><br/> 134 197 <div style="clear:both;"></div> 135 <div class="filter-title">• Native Theme Support <span class="filter-title-description">Interaction with native theme. Options apply to all filters, but not to image sliders.</span></div> 198 <div class="filter-title">• Native Theme Support <span class="filter-title-description">Interaction with native theme. Options apply to all filters, but not to image sliders.</span> 199 </div> 136 200 <div class="filter-opts"> 137 201 138 <?php202 <?php 139 203 $native = false; 140 if ( !atw_posts_is_generic()) {141 atw_posts_form_checkbox('ignore_aspen_weaver', 'Disable automatic post display integration with Weaver Themes.');204 if (!atw_posts_is_generic()) { 205 atw_posts_form_checkbox('ignore_aspen_weaver', 'Disable automatic post display integration with Weaver Themes.'); 142 206 $native = true; 143 207 } 144 208 $has_templates = atw_posts_theme_has_templates(); 145 if ( $has_templates) {209 if ($has_templates) { 146 210 atw_posts_form_checkbox('use_native_theme_templates', 147 "<strong>Use Current Theme's Native Post Display</strong> - Native post display capability detected.211 "<strong>Use Current Theme's Native Post Display</strong> - Native post display capability detected. 148 212 You will need to try this option to see if it works or properly or not.<br />"); 149 213 $native = true; 150 214 } 151 if ( !$native ) { 152 ?> 153 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 154 <em>Sorry, your theme does not seem to have native support for displaying posts from this plugin.</em> You 155 can add custom CSS rules on the "Style" tab to make posts better match your current theme.<br /><br /> 156 <?php 215 if (!$native) { 216 ?> 217 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 218 <em>Sorry, your theme does not seem to have native support for displaying posts from this plugin.</em> You 219 can add custom CSS rules on the "Style" tab to make posts better match your current theme. 220 <br/><br/> 221 <?php 157 222 } 158 ?>223 ?> 159 224 </div> 160 225 161 226 162 227 <div class="filter-title">• [show_posts] Shortcode 163 <span class="filter-title-description">Copy/Paste either of these shortcodes to display posts in your content</span></div> 164 165 <table> 166 <tr><td>Shortcode using filter name: </td><td><strong>[show_posts filter=<?php echo $current_filter; ?>]</strong> 167 - You can also use the "Add [show_posts]" button on the Page/Post Editor.</td></tr> 168 <tr><td>Shortcode using parameters: </td><td><strong>[show_posts 169 <?php 170 $params = atw_posts_get_filter_params(); // define in atw-runtime-lib.php 171 echo $params; 172 ?> 173 ]</strong></td></tr></table> 174 </div> 175 176 <?php 177 atw_posts_nonce_field('atw_posts_set_to_filter'); 178 atw_posts_nonce_field('atw_posts_delete_filter'); 179 atw_posts_nonce_field('atw_posts_new_filter'); 180 atw_posts_nonce_field('atw_posts_duplicate_filter'); 181 atw_posts_nonce_field('atw_posts_restore_filter'); 228 <span class="filter-title-description">Copy/Paste either of these shortcodes to display posts in your content</span> 229 </div> 230 231 <table> 232 <tr> 233 <td>Shortcode using filter name: </td> 234 <td><strong>[show_posts filter=<?php echo $current_filter; ?>]</strong> 235 - You can also use the "Add [show_posts]" button on the Page/Post Editor. 236 </td> 237 </tr> 238 <tr> 239 <td>Shortcode using parameters: </td> 240 <td><strong>[show_posts 241 <?php 242 $params = atw_posts_get_filter_params(); // define in atw-runtime-lib.php 243 echo $params; 244 ?> 245 ]</strong></td> 246 </tr> 247 </table> 248 </div> 249 250 <?php 251 atw_posts_nonce_field('atw_posts_set_to_filter'); 252 atw_posts_nonce_field('atw_posts_delete_filter'); 253 atw_posts_nonce_field('atw_posts_new_filter'); 254 atw_posts_nonce_field('atw_posts_duplicate_filter'); 255 atw_posts_nonce_field('atw_posts_restore_filter'); 182 256 183 257 } … … 185 259 // ========================================= >>> atw_posts_define_display <<< =============================== 186 260 187 function atw_posts_define_display() { 261 function atw_posts_define_display() 262 { 188 263 // define display filter options 189 ?>264 ?> 190 265 191 266 <h3><u>Define Post Display Filter Options</u></h3> 192 267 <div class="filter-section"> 193 <div class="filter-title">• Post Display <span class="filter-title-description">When displaying posts, use these display options. Don't apply to image sliders.</span></div> 194 195 <div class="filter-opts"> 196 <?php 197 $has_templates = atw_posts_theme_has_templates(); 198 if ($has_templates && atw_posts_is_generic() && atw_posts_getopt('use_native_theme_templates') ) { 199 ?> 200 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 201 <em>Post Display Options not available when using your theme's content display as checked in the option above.</em><br /><br /> 202 <?php 203 } else { 204 atw_posts_filter_checkbox('hide_title','Hide Post Title',''); 205 atw_posts_filter_checkbox('show_avatar','Show Author Avatar'); 206 207 atw_posts_filter_checkbox('hide_top_info','Hide Top Post Meta Info (date, author)',''); 208 atw_posts_filter_checkbox('hide_bottom_info','Hide Bottom Post Meta Info (category, tag, comment link)'); 209 210 atw_posts_filter_checkbox('hide_featured_image','Hide Featurd Image in post (default: show; or theme defaults)', ''); 211 212 echo '<br />'; 213 atw_posts_filter_textarea('more_msg','"Continue Reading..." message for excerpts.'); 214 215 $cur_show = atw_posts_get_filter_opt('show'); 216 ?> 217 218 219 <div style="padding:1em 0 .5em 4em;text-indent:-1.7em;">Display posts as: 220 <select name="show"> 221 <option value="" <?php selected( $cur_show == '' );?>></option> 222 <option value="full" <?php selected( $cur_show == 'full');?>>Full post</option> 223 <option value="excerpt" <?php selected( $cur_show == 'excerpt');?>>Excerpt</option> 224 <option value="title" <?php selected( $cur_show == 'title');?>>Title + Top Meta Line</option> 225 <option value="titlelist" <?php selected( $cur_show == 'titlelist');?>>Title only as list</option> 226 <option value="title_featured" <?php selected( $cur_show == 'title_featured');?>>Title + Featured Image</option> 227 </select> How to display posts - (Default: full post; Weaver theme settings) 268 <div class="filter-title">• Post Display <span class="filter-title-description">When displaying posts, use these display options. Don't apply to image sliders.</span> 269 </div> 270 271 <div class="filter-opts"> 272 <?php 273 $has_templates = atw_posts_theme_has_templates(); 274 if ($has_templates && atw_posts_is_generic() && atw_posts_getopt('use_native_theme_templates')) { 275 ?> 276 <span style="display:inline;padding-left:2.5em;text-indent:-1.7em;"></span> 277 <em>Post Display Options not available when using your theme's content display as checked in the option 278 above.</em><br/><br/> 279 <?php 280 } else { 281 atw_posts_filter_checkbox('hide_title', 'Hide Post Title', ''); 282 atw_posts_filter_checkbox('show_avatar', 'Show Author Avatar'); 283 284 atw_posts_filter_checkbox('hide_top_info', 'Hide Top Post Meta Info (date, author)', ''); 285 atw_posts_filter_checkbox('hide_bottom_info', 'Hide Bottom Post Meta Info (category, tag, comment link)'); 286 287 atw_posts_filter_checkbox('hide_featured_image', 'Hide Featurd Image in post (default: show; or theme defaults)', ''); 288 289 echo '<br />'; 290 atw_posts_filter_textarea('more_msg', '"Continue Reading..." message for excerpts.'); 291 292 $cur_show = atw_posts_get_filter_opt('show'); 293 ?> 294 295 296 <div style="padding:1em 0 .5em 4em;text-indent:-1.7em;">Display posts as: 297 <select name="show"> 298 <option value="" <?php selected($cur_show == ''); ?>></option> 299 <option value="full" <?php selected($cur_show == 'full'); ?>>Full post</option> 300 <option value="excerpt" <?php selected($cur_show == 'excerpt'); ?>>Excerpt</option> 301 <option value="title" <?php selected($cur_show == 'title'); ?>>Title + Top Meta Line</option> 302 <option value="titlelist" <?php selected($cur_show == 'titlelist'); ?>>Title only as list 303 </option> 304 <option value="title_featured" <?php selected($cur_show == 'title_featured'); ?>>Title + 305 Featured Image 306 </option> 307 </select> How to display posts - (Default: full post; Weaver theme settings) 308 </div> 309 310 311 <?php 312 } // else not getting from gallery 313 ?> 314 </div> 315 316 <div style="clear:both;"></div> 317 318 <div class="filter-description"> 319 <p> 320 Use this section to define how each post is to be displayed - title, excerpted, etc. These options apply 321 to how each post is displayed when 322 using the plugin's built-in post layout, or when used with native Weaver Xtreme or Weaver II layout. Use 323 the Content Selection Filter to define which posts 324 will be displayed. The Slider Image Show options can be used to define how images are used in a image 325 only slide show. (Note: when using the 326 Weaver Slider plugin to display an image slider, these Post Display options do not apply.) 327 </p> 328 </div> 228 329 </div> 229 230 231 <?php 232 } // else not getting from gallery 233 ?> 330 <?php 331 } 332 333 // ========================================= >>> atw_posts_filter_basic <<< =============================== 334 335 function atw_posts_filter_basic() 336 { 337 // **** basic options **** 338 ?> 339 340 <div class="filter-section"> 341 <div class="filter-title">• Basic Options <span class="filter-title-description">Some basic options for selecting posts </span> 342 </div> 343 <div class="filter-opts"> 344 345 <?php 346 347 atw_posts_filter_checkbox('show_sticky_posts', 'Show Sticky Posts at beginning of displayed posts', ''); 348 349 atw_posts_filter_checkbox('use_paging', 'Use Paging (posts will be paged using Number of Posts per page)'); 350 351 atw_posts_filter_checkbox('no_top_clear', 'Do not clear:both at start of posts. (allows posts to be inline)'); 352 353 atw_posts_filter_val('posts_per_page', 'Number of Posts to Show (Use -1 for all. Default: Settings->Reading value)'); 354 355 atw_posts_filter_val('offset', 'Number of posts to skip over'); 356 357 358 atw_posts_filter_val('excerpt_length', 'Excerpt length (words)', '<span style="padding-left:70px"></span>'); 359 360 atw_posts_filter_val('cols', 'Display posts in columns (1-3)') 361 ?> 362 <?php $cur_order = atw_posts_get_filter_opt('orderby'); ?> 363 <br/> 364 <strong>Display posts ordered by:</strong> 365 <select name='orderby'> 366 <option value="date" <?php selected($cur_order == 'date'); ?>>Date</option> 367 <option value="title" <?php selected($cur_order == 'title'); ?>>Post Title</option> 368 <option value="modified" <?php selected($cur_order == 'modified'); ?>>Last Modified Date</option> 369 <option value="rand" <?php selected($cur_order == 'rand'); ?>>Random order</option> 370 <option value="comment_count" <?php selected($cur_order == 'comment_count'); ?>>Number of comments 371 </option> 372 <option value="author" <?php selected($cur_order == 'author'); ?>>Author</option> 373 <option value="ID" <?php selected($cur_order == 'ID'); ?>>Post ID</option> 374 <option value="menu_order" <?php selected($cur_order == 'menu_order'); ?>>Menu/Custom Post Order 375 </option> 376 <option value="none" <?php selected($cur_order == 'none'); ?>>No order</option> 377 </select> 378 379 <?php $cur_order = atw_posts_get_filter_opt('order'); ?> 380 <strong style="padding-left:25px">Sort order:</strong> 381 <select name='order'> 382 <option value="DESC" <?php selected($cur_order == 'DESC'); ?>>Descending (3,2,1) (default)</option> 383 <option value="ASC" <?php selected($cur_order == 'ASC'); ?>>Ascending (1,2,3)</option> 384 </select> 385 </div> 386 387 <div style="clear:both;"></div> 388 389 </div><!-- end filter-section --> 390 <?php 391 } 392 393 // ========================================= >>> atw_posts_set_post_type <<< =============================== 394 395 function atw_posts_set_post_type() 396 { 397 // **** post_type **** 398 ?> 399 <div class="filter-section"> 400 <div class="filter-title">• Post Type <span class="filter-title-description">Include posts with this post type. (WP_Query: post_type - Default: post) </span> 401 </div> 402 <div class="filter-opts"> 403 <table> 404 <tr> 405 <td><select class="filter-select" name="post_type_selection"> 406 <?php 407 $post_types = get_post_types(array(), 'names'); 408 foreach ($post_types as $post_type) { 409 if ($post_type != 'page' 410 && $post_type != 'nav_menu_item' 411 && $post_type != 'revision' 412 && $post_type != 'attachment') 413 echo '<option value="' . $post_type . '">' . $post_type . '</option>'; 414 } 415 ?> 416 </select></td> 417 <td><input class="button filter-button" type="submit" name="atw_posts_add_post_type" 418 value="Add Post Type"/></td> 419 <td><textarea class="filter-text" cols=40 rows=1 placeholder="post_type=list" maxlength=128 420 name="post_type"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_type')); ?></textarea> 421 </td> 422 </tr> 423 </table> 424 425 <?php 426 atw_posts_nonce_field('atw_posts_add_post_type'); 427 ?> 428 </div> 429 <div class="filter-description"> 430 Specify the <em>post_type</em> used to select posts. If you just want standard posts, you don't need to 431 define this setting. 432 Include a post type by selecting the type from the drop-down list, 433 and clicking the "Add Post Type" button. This list includes any <em>Custom Post Types</em> that may be 434 defined by 435 plugins you have installed. These custom post types may or may not display useful content depending how they 436 are 437 used by the plugin. You may add more than one post type. You can edit the query 438 string displayed in the text area directly, and then save by clicking "Save Filter Options". 439 </div> 440 <div style="clear:both;"></div> 441 442 </div><!-- end filter-section --> 443 <?php 444 } 445 446 447 // ========================================= >>> atw_posts_set_post_cats <<< =============================== 448 449 function atw_posts_set_post_cats() 450 { 451 //<!-- **** Post Categories **** --> 452 ?> 453 <div class="filter-section"> 454 <div class="filter-title">• Categories <span class="filter-title-description">Include posts with these categories. (WP_Query: category_name - Default: all) </span> 455 </div> 456 <div class="filter-opts"> 457 <table> 458 <tr> 459 <td><select class="filter-select" name="category_name_selection"> 460 <?php 461 $cats = get_categories(); 462 463 foreach ($cats as $cat => $val) { 464 echo '<option value="' . $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 465 } 466 ?> 467 </select></td> 468 <td><input class="button" type="submit" name="atw_posts_add_category_name" value="Add Category"/> 469 </td> 470 <td><input class="button" type="submit" name="atw_posts_hide_category_name" value="Hide Category"/> 471 </td> 472 <td><textarea class="filter-text" cols=40 rows=1 placeholder="category_name=list" maxlength=128 473 name="category_name"><?php echo sanitize_text_field(atw_posts_get_filter_opt('category_name')); ?></textarea> 474 </td> 475 </tr> 476 </table> 477 478 <?php 479 atw_posts_nonce_field('atw_posts_add_category_name'); 480 atw_posts_nonce_field('atw_posts_hide_category_name'); 481 482 ?> 483 </div> 484 <div class="filter-description"> 485 Specify the <em>category_name</em> slug to display posts from that category. Include a category by selecting 486 the category from the drop-down list, 487 and clicking the "Add Category" button. This list includes all categories for standard posts that have been 488 defined. 489 You may add more than one category. If you prefix a category slug with a minus sign (e.e., -cat-slug) or use 490 the "Hide Category" button, 491 that category will NOT be displayed. You can edit the query 492 string displayed in the text area directly, and then save by clicking "Save Filter Options". 493 </div> 494 <div style="clear:both;"></div> 495 496 </div><!-- end filter-section --> 497 <?php 498 } 499 500 // ========================================= >>> atw_posts_set_post_tags <<< =============================== 501 502 function atw_posts_set_post_tags() 503 { 504 //<!-- *** Tags *** --> 505 ?> 506 507 <div class="filter-section"> 508 <div class="filter-title">• Tags <span class="filter-title-description">Include posts with these tags. (WP_Query: tag - Default: all) </span> 509 </div> 510 511 <div class="filter-opts"> 512 <table> 513 <tr> 514 <td><select class="filter-select" name="tag_selection"> 515 <?php 516 $tags = get_tags(); 517 518 foreach ($tags as $tag => $val) { 519 echo '<option value="' . $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 520 } 521 ?> 522 </select></td> 523 <td><input class="filter-button button" type="submit" name="atw_posts_add_tag" value="Add Tag"/> 524 </td> 525 <td><textarea class="filter-text" cols=40 rows=1 placeholder="tag=list" maxlength=128 526 name="tag"><?php echo sanitize_text_field(atw_posts_get_filter_opt('tag')); ?></textarea> 527 </td> 528 </tr> 529 </table> 530 <?php 531 atw_posts_nonce_field('atw_posts_add_tag'); 532 ?> 533 </div> 534 <div class="filter-description"> 535 Specify the <em>tag</em> slug to display posts from that tag. Include a tag by selecting the tag from the 536 drop-down list, 537 and clicking the "Add Tag" button. This list includes all tags for standard posts that have been defined. 538 You may add more than one tag. You can edit the query 539 string displayed in the text area directly, and then save by clicking "Save Filter Options". 540 </div> 541 <div style="clear:both;"></div> 542 543 </div><!-- end filter-section --> 544 <?php 545 } 546 547 // ========================================= >>> atw_posts_set_slider_group <<< =============================== 548 549 function atw_posts_set_slider_group() 550 { 551 //<!-- *** Slider Group *** --> 552 if (!function_exists('atw_slider_installed')) // don't show this if we don't have the slider installed 553 return; 554 ?> 555 556 <div class="filter-section"> 557 <div class="filter-title">• Slider Group <span class="filter-title-description">Include posts from these Slider Groups (most useful with Weaver Slider plugin)</span> 558 </div> 559 560 <div class="filter-opts"> 561 <table> 562 <tr> 563 <td><select class="filter-select" name="group_selection"> 564 <?php 565 566 $terms = get_terms('atw_slider_group'); 567 foreach ($terms as $term) { 568 echo '<option value="' . $term->slug . '">' . $term->name . ' (' . $term->slug . ')</option>'; 569 } 570 ?> 571 </select></td> 572 <td><input class="filter-button button" type="submit" name="atw_posts_add_group" 573 value="Add Slider Group"/></td> 574 <td><textarea class="filter-text" cols=40 rows=1 placeholder="atw_slider_group=list" maxlength=128 575 name="atw_slider_group"><?php echo sanitize_text_field(atw_posts_get_filter_opt('atw_slider_group')); ?></textarea> 576 </td> 577 </tr> 578 </table> 579 <?php 580 atw_posts_nonce_field('atw_posts_add_group'); 581 ?> 582 </div> 583 <div class="filter-description"> 584 Specify the <em>Slider Group</em> slug to display posts from that slider group. Include a group by selecting 585 the group from the drop-down list, 586 and clicking the "Add Slider Group" button. This list includes only groups for the atw_sliders_post that 587 have been defined. 588 You may add more than one group. You can edit the query 589 string displayed in the text area directly, and then save by clicking "Save Filter Options". 590 <em style="font-weight:bold;color:red;">Important:</em> Post Type option must include "atw_slider_post" to 591 display slider groups. 592 </div> 593 <div style="clear:both;"></div> 594 595 </div><!-- end filter-section --> 596 <?php 597 } 598 599 // ========================================= >>> atw_posts_set_author <<< =============================== 600 601 function atw_posts_set_author() 602 { 603 //<!-- *** Author *** --> 604 ?> 605 606 <div class="filter-section"> 607 <div class="filter-title">• Author <span class="filter-title-description">Include posts with these authors. (WP_Query: author - Default: all) </span> 608 </div> 609 610 <div class="filter-opts"> 611 <?php 612 $user_args = array( 613 'fields' => array('ID', 'user_nicename', 'display_name'), 614 'who' => 'authors', 615 'orderby' => 'display_name' 616 ); 617 $wp_user_search = new WP_User_Query($user_args); 618 $authors = $wp_user_search->get_results(); 619 ?> 620 <table> 621 <tr> 622 <td><select class="filter-select" name="author_selection"> 623 <?php 624 foreach ($authors as $author => $val) { 625 echo '<option value="' . $val->ID . '">' . $val->display_name . ' (' . $val->ID . ')</option>'; 626 } 627 ?> 628 </select></td> 629 <td><input class="filter-button button" type="submit" name="atw_posts_add_author" 630 value="Add Author"/></td> 631 <td><textarea class="filter-text" cols=40 rows=1 placeholder="author=list" maxlength=128 632 name="author"><?php echo sanitize_text_field(atw_posts_get_filter_opt('author')); ?></textarea> 633 </td> 634 </tr> 635 </table> 636 <?php 637 atw_posts_nonce_field('atw_posts_add_author'); 638 ?> 639 </div> 640 <div class="filter-description"> 641 Specify the <em>author</em> ID to display posts from that author. Include an author by selecting the 642 author's display name from the drop-down list, 643 and clicking the "Add Author" button. This list includes all registered users with a role of Contributor or 644 higher. 645 You may add more than one author. If you prefix a category slug with a minus sign (e.e., -3), the author 646 with that ID will NOT be displayed. You can edit the query 647 string displayed in the text area directly - use the author ID shown in the drop-down list, and then save by 648 clicking "Save Filter Options". 649 </div> 650 <div style="clear:both;"></div> 651 652 </div><!-- end filter-section --> 653 <?php 654 } 655 656 // ========================================= >>> atw_posts_set_by_posts <<< =============================== 657 658 function atw_posts_set_by_posts() 659 { 660 //<!-- *** by Pates *** --> 661 ?> 662 663 <div class="filter-section"> 664 <div class="filter-title">• By Post IDs <span class="filter-title-description">Include posts with these post IDs</span> 665 </div> 666 667 <div class="filter-opts"> 668 <textarea class="filter-text" cols=60 rows=1 placeholder="Post ID list" maxlength=512 669 name="post_ids"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_ids')); ?></textarea> 670 671 </div> 672 <div class="filter-description"> 673 Specify a comma separated list of <em>Post IDs</em> to display posts in that list, in the order specified. 674 This option will override 675 other selection options (e.g., Tags, Date, etc.). You can find a post's ID in your browser's URL address 676 field when editing the 677 post with the Post editor. It is the number right after the <em>?post=</em>. Sorry this can't be easier, but 678 the only way 679 WordPress supports showing a specific set of posts is by ID. You may also find it helpful to set the "Number 680 of Posts to Show" option above to -1. 681 </div> 682 <div style="clear:both;"></div> 234 683 </div> 684 <?php 685 } 686 687 // ========================================= >>> atw_posts_set_post_slug <<< =============================== 688 689 function atw_posts_set_post_slug() 690 { 691 //<!-- *** by Post Slug *** --> 692 ?> 693 694 <div class="filter-section"> 695 696 <div class="filter-title">• By Post Slug <span class="filter-title-description">Include only post with this title slug</span> 697 </div> 698 699 <div class="filter-opts"> 700 <textarea class="filter-text" cols=40 rows=1 placeholder="page-title-slug" maxlength=512 701 name="post_slug"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_slug')); ?></textarea> 702 703 </div> 704 <div class="filter-description"> 705 This option will display a single post with the specified slug - usually automatically generated from the 706 posts's title. 707 If this is a post from a custom post type, you need to specify that in the "Post Type" setting. Other 708 selection options are ignored. 709 This is the WP_Query 'name' argument. 710 </div> 711 712 <div style="clear:both;"></div> 713 714 </div><!-- end filter-section --> 715 <?php 716 } 717 718 719 // ========================================= >>> atw_posts_set_date <<< =============================== 720 721 function atw_posts_set_date() 722 { 723 // <!-- *** Date *** --> 724 ?> 725 <div class="filter-section"> 726 <div class="filter-title">• Date <span class="filter-title-description">Include posts in a date range. (Default: all)</span> 727 </div> 728 729 <div class="filter-opts"> 730 <?php 731 $dates = array('Today' => 'today', 'Past 24 Hours' => 'past-24h', 'This Week' => 'this-week', 'Past 7 Days' => 'past-week', 732 'This Month' => 'this-month', 'Past 30 Days' => 'past-30d', 'This Year' => 'this-year', 'Past 365 Days' => 'past-365d' 733 ); 734 ?> 735 <table> 736 <tr> 737 <td><select class="filter-select" name="date_selection"> 738 <?php 739 foreach ($dates as $date => $val) { 740 echo '<option value="' . $val . '">' . $date . '</option>'; 741 } 742 ?> 743 </select></td> 744 <td><input class="filter-button button" type="submit" name="atw_posts_add_date" 745 value="Select Date"/></td> 746 <td><textarea class="filter-text" cols=40 rows=1 placeholder="date=date-slug" maxlength=128 747 name="date"><?php echo sanitize_text_field(atw_posts_get_filter_opt('date')); ?></textarea> 748 </td> 749 </tr> 750 </table> 751 <?php 752 atw_posts_nonce_field('atw_posts_add_date'); 753 ?> 754 </div> 755 <div class="filter-description"> 756 You can specify a pre-defined date range of posts to display. If you need to specify other date options, see 757 the WordPress WP_Query help page, and add specific date values using the "Custom WP_Query Args" section 758 below. 759 </div> 760 <div style="clear:both;"></div> 761 762 </div><!-- end filter-section --> 763 235 764 236 765 <div style="clear:both;"></div> 237 238 <div class="filter-description"> 239 <p> 240 Use this section to define how each post is to be displayed - title, excerpted, etc. These options apply to how each post is displayed when 241 using the plugin's built-in post layout, or when used with native Weaver Xtreme or Weaver II layout. Use the Content Selection Filter to define which posts 242 will be displayed. The Slider Image Show options can be used to define how images are used in a image only slide show. (Note: when using the 243 Weaver Slider plugin to display an image slider, these Post Display options do not apply.) 244 </p> 766 <?php 767 } 768 769 // ========================================= >>> atw_posts_set_taxonomy <<< =============================== 770 771 function atw_posts_set_taxonomy() 772 { 773 //<!-- *** Custom Taxonomies *** --> 774 ?> 775 <div class="filter-section"> 776 <div class="filter-title">• Custom Taxonomies <span class="filter-title-description">Manual specification of Custom Taxonomies</span> 777 </div> 778 779 <div class="filter-opts"> 780 <?php 781 $taxonomies = get_taxonomies(array('public' => true, '_builtin' => false), 'objects'); 782 $li_out = false; 783 if (empty($taxonomies)) { 784 echo '<strong>No Custom Taxonomies Found</strong><br /><br />'; 785 } else { 786 echo '<ul>'; 787 $li_out = false; 788 foreach ($taxonomies as $taxonomy => $val) { 789 if ($val->name == 'atw_slider_group') 790 continue; 791 $li_out = true; 792 echo '<li><strong>Taxonomy name: </strong> <em>' . $val->label . '</em> (slug: ' . $val->name . ')'; 793 $tax = $val->name; 794 $terms = get_terms($tax); 795 796 $lead = '<br /><span style="margin-left:20px;">Values (slugs): </span> '; 797 798 if (is_wp_error($terms)) { 799 continue; 800 } else { 801 if (empty($terms)) { 802 echo '<br /><span style="margin-left:20px;">Values: </span> None defined.<br />'; 803 continue; 804 } 805 foreach ($terms as $term) { 806 echo $lead; 807 $lead = ', '; 808 echo esc_attr($term->slug); 809 } 810 echo "<br />"; 811 } 812 echo '</li>'; 813 } 814 if (!$li_out) { 815 echo '<li>No custom taxonomies defined for this site.</li>'; 816 } 817 echo '</ul>'; 818 } 819 820 if ($li_out) { 821 ?> 822 <table> 823 <tr> 824 <td>Specify custom taxonomy parameters:</td> 825 <td><textarea class="filter-text" cols=60 rows=1 826 placeholder="custom_taxonomy_name=custom_values_by_slug_list" maxlength=512 827 name="taxonomy"><?php echo sanitize_text_field(atw_posts_get_filter_opt('taxonomy')); ?></textarea> 828 </td> 829 </tr> 830 </table> 831 <?php 832 } 833 ?> 834 </div> 835 <div class="filter-description"> 836 Various plugins can create Custom Taxonomies for use with custom post types. You can use these custom 837 taxonomy names and 838 values to specify additional filter terms to this filter definition. Add as many values as you wish for a 839 custom taxonomy 840 in the text box, then click "Save Filter Options" to set the value. For example, you could add a value 841 something like 842 <code>custom_category=cat1</code> to include custom posts with the 'custom_category' taxonomy with a value 843 'cat1'. Separate 844 different taxonomy lists with a space. 845 <em style="font-weight:bold;color:red;">Important:</em> Be sure to include the corresponding custom post 846 type in the "Post Type" section that matches the 847 custom taxonomy. 848 </div> 245 849 </div> 246 </div> 247 <?php 248 } 249 250 // ========================================= >>> atw_posts_filter_basic <<< =============================== 251 252 function atw_posts_filter_basic() { 253 // **** basic options **** 254 ?> 255 256 <div class="filter-section"> 257 <div class="filter-title">• Basic Options <span class="filter-title-description">Some basic options for selecting posts </span></div> 258 <div class="filter-opts"> 259 850 <?php 851 } 852 853 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 854 855 function atw_posts_set_custom_wpq() 856 { 857 //<!-- *** Custom Taxonomies *** --> 858 ?> 859 <!-- *** Other WP_Query args *** --> 860 861 <div class="filter-section"> 862 <div class="filter-title">• Custom WP_Query Args (Advanced Option) <span class="filter-title-description">Manual specification of WP_Query arguments</span> 863 </div> 864 865 <div class="filter-opts"> 866 867 <table> 868 <tr> 869 <td>Specify custom WP_Query arguments:</td> 870 <td><textarea class="filter-text" cols=60 rows=1 placeholder="arg1=val1 arg2=val2 ..." maxlength=512 871 name="wp_query_args"><?php echo esc_textarea(atw_posts_get_filter_opt('wp_query_args')); ?></textarea> 872 </td> 873 </tr> 874 </table> 875 </div> 876 <div class="filter-description"> 877 <em>This option is intended for advanced users.</em> The Selection Filter Options specified on this admin 878 page 879 are mapped to the corresponding WordPress <code>WP_Query</code> function arguments, but there are many 880 additional WP_Query options 881 not included in these options; most users will never need them. 882 However, you can specify your own custom arguments to WP_Query here. Provide as many arguments 883 as you need in the text box, each separated by a space. These arguments will be added to any other options 884 specified above, and be 885 added directly to the '$args' parameter to WP_Query. For a full, very technical explanation of all the 886 options available for WP_Query, please consult the 887 <a href="http://codex.wordpress.org/Class_Reference/WP_Query" alt="WP_Query Codex Entry" target="_blank">WordPress 888 Codex for WP_Query</a>. 889 <em style="font-weight:bold;color:red;">Important:</em> WP_Query arguments requiring values with 'array()' 890 are <em><strong>not</strong></em> supported 891 by this plugin. 892 </div> 893 </div> 894 <?php 895 } 896 897 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 898 899 if (WEAVER_SHOWPOSTS_TEMPLATE) { 900 function atw_posts_set_custom_template() 901 { 902 //<!-- *** Custom Taxonomies *** --> 903 904 if (!current_user_can('unfiltered_html')) 905 return; // don't even show 906 907 $text = atw_posts_get_filter_opt('post_template'); 908 $rows = 1; 909 910 if (strlen($text) > 0) 911 $lines = count(explode(PHP_EOL, $text)); 912 else 913 $lines = 0; 914 if ($lines > 20) 915 $lines = 18; 916 if ($lines > 0) 917 $rows = $lines + 2; 918 919 ?> 920 <!-- *** Custom Post *** --> 921 922 <div class="filter-section"> 923 <div class="filter-title">• Custom Post Template (Advanced Option) <span 924 class="filter-title-description">Define custom template to display posts</span></div> 925 926 <div class="filter-opts"> 927 928 <textarea class="filter-text" style="max-width:90%;" cols=100 929 rows=<?php echo $rows; ?> placeholder="Enter post template" maxlength=2048 930 name="post_template"><?php echo esc_textarea($text); ?></textarea></td></tr></table> 931 </div> 932 <div class="filter-description"> 933 <em>This option is intended for advanced users.</em> You can define a completely custom template to 934 display posts. 935 You must read the help file for an explanation of this option. 936 </div> 937 </div> 260 938 <?php 261 262 atw_posts_filter_checkbox('show_sticky_posts','Show Sticky Posts at beginning of displayed posts','');263 264 atw_posts_filter_checkbox('use_paging','Use Paging (posts will be paged using Number of Posts per page)');265 266 atw_posts_filter_checkbox('no_top_clear','Do not clear:both at start of posts. (allows posts to be inline)');267 268 atw_posts_filter_val('posts_per_page', 'Number of Posts to Show (Use -1 for all. Default: Settings->Reading value)');269 270 atw_posts_filter_val('offset', 'Number of posts to skip over');271 272 273 atw_posts_filter_val('excerpt_length','Excerpt length (words)', '<span style="padding-left:70px"></span>');274 275 atw_posts_filter_val('cols','Display posts in columns (1-3)')276 ?>277 <?php $cur_order = atw_posts_get_filter_opt('orderby'); ?>278 <br />279 <strong>Display posts ordered by:</strong>280 <select name='orderby'>281 <option value="date" <?php selected( $cur_order == 'date');?>>Date</option>282 <option value="title" <?php selected( $cur_order == 'title');?>>Post Title</option>283 <option value="modified" <?php selected( $cur_order == 'modified');?>>Last Modified Date</option>284 <option value="rand" <?php selected( $cur_order == 'rand');?>>Random order</option>285 <option value="comment_count" <?php selected( $cur_order == 'comment_count');?>>Number of comments</option>286 <option value="author" <?php selected( $cur_order == 'author');?>>Author</option>287 <option value="ID" <?php selected( $cur_order == 'ID');?>>Post ID</option>288 <option value="menu_order" <?php selected( $cur_order == 'menu_order');?>>Menu/Custom Post Order</option>289 <option value="none" <?php selected( $cur_order == 'none');?>>No order</option>290 </select>291 292 <?php $cur_order = atw_posts_get_filter_opt('order'); ?>293 <strong style="padding-left:25px">Sort order:</strong>294 <select name='order'>295 <option value="DESC" <?php selected( $cur_order == 'DESC');?>>Descending (3,2,1) (default)</option>296 <option value="ASC" <?php selected( $cur_order == 'ASC');?>>Ascending (1,2,3)</option>297 </select>298 </div>299 300 <div style="clear:both;"></div>301 302 </div><!-- end filter-section -->303 <?php304 }305 306 // ========================================= >>> atw_posts_set_post_type <<< ===============================307 308 function atw_posts_set_post_type() {309 // **** post_type ****310 ?>311 <div class="filter-section">312 <div class="filter-title">• Post Type <span class="filter-title-description">Include posts with this post type. (WP_Query: post_type - Default: post) </span></div>313 <div class="filter-opts">314 <table><tr>315 <td><select class="filter-select" name="post_type_selection" >316 <?php317 $post_types = get_post_types(array() , 'names');318 foreach ($post_types as $post_type) {319 if ($post_type != 'page'320 && $post_type != 'nav_menu_item'321 && $post_type != 'revision'322 && $post_type != 'attachment')323 echo '<option value="'. $post_type . '">' . $post_type . '</option>';324 939 } 325 ?> 326 </select></td> 327 <td><input class="button filter-button" type="submit" name="atw_posts_add_post_type" value="Add Post Type" /></td> 328 <td><textarea class="filter-text" cols=40 rows=1 placeholder="post_type=list" maxlength=128 name="post_type"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_type')); ?></textarea></td> 329 </tr></table> 330 331 <?php 332 atw_posts_nonce_field('atw_posts_add_post_type'); 333 ?> 334 </div> 335 <div class="filter-description"> 336 Specify the <em>post_type</em> used to select posts. If you just want standard posts, you don't need to define this setting. 337 Include a post type by selecting the type from the drop-down list, 338 and clicking the "Add Post Type" button. This list includes any <em>Custom Post Types</em> that may be defined by 339 plugins you have installed. These custom post types may or may not display useful content depending how they are 340 used by the plugin. You may add more than one post type. You can edit the query 341 string displayed in the text area directly, and then save by clicking "Save Filter Options". 342 </div> 343 <div style="clear:both;"></div> 344 345 </div><!-- end filter-section --> 346 <?php 347 } 348 349 350 // ========================================= >>> atw_posts_set_post_cats <<< =============================== 351 352 function atw_posts_set_post_cats() { 353 //<!-- **** Post Categories **** --> 354 ?> 355 <div class="filter-section"> 356 <div class="filter-title">• Categories <span class="filter-title-description">Include posts with these categories. (WP_Query: category_name - Default: all) </span></div> 357 <div class="filter-opts"> 358 <table><tr> 359 <td><select class="filter-select" name="category_name_selection" > 360 <?php 361 $cats = get_categories( ); 362 363 foreach ($cats as $cat => $val) { 364 echo '<option value="'. $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 365 } 366 ?> 367 </select></td> 368 <td><input class="button" type="submit" name="atw_posts_add_category_name" value="Add Category" /></td> 369 <td><input class="button" type="submit" name="atw_posts_hide_category_name" value="Hide Category" /></td> 370 <td><textarea class="filter-text" cols=40 rows=1 placeholder="category_name=list" maxlength=128 name="category_name"><?php echo sanitize_text_field(atw_posts_get_filter_opt('category_name')); ?></textarea></td> 371 </tr></table> 372 373 <?php 374 atw_posts_nonce_field('atw_posts_add_category_name'); 375 atw_posts_nonce_field('atw_posts_hide_category_name'); 376 377 ?> 378 </div> 379 <div class="filter-description"> 380 Specify the <em>category_name</em> slug to display posts from that category. Include a category by selecting the category from the drop-down list, 381 and clicking the "Add Category" button. This list includes all categories for standard posts that have been defined. 382 You may add more than one category. If you prefix a category slug with a minus sign (e.e., -cat-slug) or use the "Hide Category" button, 383 that category will NOT be displayed. You can edit the query 384 string displayed in the text area directly, and then save by clicking "Save Filter Options". 385 </div> 386 <div style="clear:both;"></div> 387 388 </div><!-- end filter-section --> 389 <?php 390 } 391 392 // ========================================= >>> atw_posts_set_post_tags <<< =============================== 393 394 function atw_posts_set_post_tags() { 395 //<!-- *** Tags *** --> 396 ?> 397 398 <div class="filter-section"> 399 <div class="filter-title">• Tags <span class="filter-title-description">Include posts with these tags. (WP_Query: tag - Default: all) </span></div> 400 401 <div class="filter-opts"> 402 <table><tr> 403 <td><select class="filter-select" name="tag_selection" > 404 <?php 405 $tags = get_tags( ); 406 407 foreach ($tags as $tag => $val) { 408 echo '<option value="'. $val->slug . '">' . $val->name . ' (' . $val->slug . ')</option>'; 409 } 410 ?> 411 </select></td> 412 <td><input class="filter-button button" type="submit" name="atw_posts_add_tag" value="Add Tag" /></td> 413 <td><textarea class="filter-text" cols=40 rows=1 placeholder="tag=list" maxlength=128 name="tag"><?php echo sanitize_text_field(atw_posts_get_filter_opt('tag')); ?></textarea></td> 414 </tr></table> 415 <?php 416 atw_posts_nonce_field('atw_posts_add_tag'); 417 ?> 418 </div> 419 <div class="filter-description"> 420 Specify the <em>tag</em> slug to display posts from that tag. Include a tag by selecting the tag from the drop-down list, 421 and clicking the "Add Tag" button. This list includes all tags for standard posts that have been defined. 422 You may add more than one tag. You can edit the query 423 string displayed in the text area directly, and then save by clicking "Save Filter Options". 424 </div> 425 <div style="clear:both;"></div> 426 427 </div><!-- end filter-section --> 428 <?php 429 } 430 431 // ========================================= >>> atw_posts_set_slider_group <<< =============================== 432 433 function atw_posts_set_slider_group() { 434 //<!-- *** Slider Group *** --> 435 if ( !function_exists('atw_slider_installed') ) // don't show this if we don't have the slider installed 436 return; 437 ?> 438 439 <div class="filter-section"> 440 <div class="filter-title">• Slider Group <span class="filter-title-description">Include posts from these Slider Groups (most useful with Weaver Slider plugin)</span></div> 441 442 <div class="filter-opts"> 443 <table><tr> 444 <td><select class="filter-select" name="group_selection" > 445 <?php 446 447 $terms = get_terms( 'atw_slider_group' ); 448 foreach ( $terms as $term ) { 449 echo '<option value="'. $term->slug . '">' . $term->name . ' (' . $term->slug . ')</option>'; 450 } 451 ?> 452 </select></td> 453 <td><input class="filter-button button" type="submit" name="atw_posts_add_group" value="Add Slider Group" /></td> 454 <td><textarea class="filter-text" cols=40 rows=1 placeholder="atw_slider_group=list" maxlength=128 name="atw_slider_group"><?php echo sanitize_text_field(atw_posts_get_filter_opt('atw_slider_group')); ?></textarea></td> 455 </tr></table> 456 <?php 457 atw_posts_nonce_field('atw_posts_add_group'); 458 ?> 459 </div> 460 <div class="filter-description"> 461 Specify the <em>Slider Group</em> slug to display posts from that slider group. Include a group by selecting the group from the drop-down list, 462 and clicking the "Add Slider Group" button. This list includes only groups for the atw_sliders_post that have been defined. 463 You may add more than one group. You can edit the query 464 string displayed in the text area directly, and then save by clicking "Save Filter Options". 465 <em style="font-weight:bold;color:red;">Important:</em> Post Type option must include "atw_slider_post" to display slider groups. 466 </div> 467 <div style="clear:both;"></div> 468 469 </div><!-- end filter-section --> 470 <?php 471 } 472 473 // ========================================= >>> atw_posts_set_author <<< =============================== 474 475 function atw_posts_set_author() { 476 //<!-- *** Author *** --> 477 ?> 478 479 <div class="filter-section"> 480 <div class="filter-title">• Author <span class="filter-title-description">Include posts with these authors. (WP_Query: author - Default: all) </span></div> 481 482 <div class="filter-opts"> 483 <?php 484 $user_args = array( 485 'fields' => array( 'ID', 'user_nicename', 'display_name' ), 486 'who' => 'authors', 487 'orderby' => 'display_name' 488 ); 489 $wp_user_search = new WP_User_Query( $user_args ); 490 $authors = $wp_user_search->get_results(); 491 ?> 492 <table><tr> 493 <td><select class="filter-select" name="author_selection" > 494 <?php 495 foreach ($authors as $author => $val) { 496 echo '<option value="' . $val->ID . '">' . $val->display_name . ' (' . $val->ID . ')</option>'; 497 } 498 ?> 499 </select></td> 500 <td><input class="filter-button button" type="submit" name="atw_posts_add_author" value="Add Author" /></td> 501 <td><textarea class="filter-text" cols=40 rows=1 placeholder="author=list" maxlength=128 name="author"><?php echo sanitize_text_field(atw_posts_get_filter_opt('author')); ?></textarea></td> 502 </tr></table> 503 <?php 504 atw_posts_nonce_field('atw_posts_add_author'); 505 ?> 506 </div> 507 <div class="filter-description"> 508 Specify the <em>author</em> ID to display posts from that author. Include an author by selecting the author's display name from the drop-down list, 509 and clicking the "Add Author" button. This list includes all registered users with a role of Contributor or higher. 510 You may add more than one author. If you prefix a category slug with a minus sign (e.e., -3), the author with that ID will NOT be displayed. You can edit the query 511 string displayed in the text area directly - use the author ID shown in the drop-down list, and then save by clicking "Save Filter Options". 512 </div> 513 <div style="clear:both;"></div> 514 515 </div><!-- end filter-section --> 516 <?php 517 } 518 519 // ========================================= >>> atw_posts_set_by_posts <<< =============================== 520 521 function atw_posts_set_by_posts() { 522 //<!-- *** by Pates *** --> 523 ?> 524 525 <div class="filter-section"> 526 <div class="filter-title">• By Post IDs <span class="filter-title-description">Include posts with these post IDs</span></div> 527 528 <div class="filter-opts"> 529 <textarea class="filter-text" cols=60 rows=1 placeholder="Post ID list" maxlength=512 name="post_ids"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_ids')); ?></textarea> 530 531 </div> 532 <div class="filter-description"> 533 Specify a comma separated list of <em>Post IDs</em> to display posts in that list, in the order specified. This option will override 534 other selection options (e.g., Tags, Date, etc.). You can find a post's ID in your browser's URL address field when editing the 535 post with the Post editor. It is the number right after the <em>?post=</em>. Sorry this can't be easier, but the only way 536 WordPress supports showing a specific set of posts is by ID. You may also find it helpful to set the "Number of Posts to Show" option above to -1. 537 </div> 538 <div style="clear:both;"></div> 539 </div> 540 <?php 541 } 542 543 // ========================================= >>> atw_posts_set_post_slug <<< =============================== 544 545 function atw_posts_set_post_slug() { 546 //<!-- *** by Post Slug *** --> 547 ?> 548 549 <div class="filter-section"> 550 551 <div class="filter-title">• By Post Slug <span class="filter-title-description">Include only post with this title slug</span></div> 552 553 <div class="filter-opts"> 554 <textarea class="filter-text" cols=40 rows=1 placeholder="page-title-slug" maxlength=512 name="post_slug"><?php echo sanitize_text_field(atw_posts_get_filter_opt('post_slug')); ?></textarea> 555 556 </div> 557 <div class="filter-description"> 558 This option will display a single post with the specified slug - usually automatically generated from the posts's title. 559 If this is a post from a custom post type, you need to specify that in the "Post Type" setting. Other selection options are ignored. 560 This is the WP_Query 'name' argument. 561 </div> 562 563 <div style="clear:both;"></div> 564 565 </div><!-- end filter-section --> 566 <?php 567 } 568 569 570 571 // ========================================= >>> atw_posts_set_date <<< =============================== 572 573 function atw_posts_set_date() { 574 // <!-- *** Date *** --> 575 ?> 576 <div class="filter-section"> 577 <div class="filter-title">• Date <span class="filter-title-description">Include posts in a date range. (Default: all)</span></div> 578 579 <div class="filter-opts"> 580 <?php 581 $dates = array('Today' => 'today', 'Past 24 Hours' => 'past-24h', 'This Week' => 'this-week', 'Past 7 Days' => 'past-week', 582 'This Month' => 'this-month', 'Past 30 Days' => 'past-30d', 'This Year' => 'this-year', 'Past 365 Days' => 'past-365d' 583 ); 584 ?> 585 <table><tr> 586 <td><select class="filter-select" name="date_selection"> 587 <?php 588 foreach ($dates as $date => $val) { 589 echo '<option value="' . $val . '">' . $date . '</option>'; 590 } 591 ?> 592 </select></td> 593 <td><input class="filter-button button" type="submit" name="atw_posts_add_date" value="Select Date" /></td> 594 <td><textarea class="filter-text" cols=40 rows=1 placeholder="date=date-slug" maxlength=128 name="date"><?php echo sanitize_text_field(atw_posts_get_filter_opt('date')); ?></textarea></td> 595 </tr></table> 596 <?php 597 atw_posts_nonce_field('atw_posts_add_date'); 598 ?> 599 </div> 600 <div class="filter-description"> 601 You can specify a pre-defined date range of posts to display. If you need to specify other date options, see the WordPress WP_Query help page, and add specific date values using the "Custom WP_Query Args" section below. 602 </div> 603 <div style="clear:both;"></div> 604 605 </div><!-- end filter-section --> 606 607 608 <div style="clear:both;"></div> 609 <?php 610 } 611 612 // ========================================= >>> atw_posts_set_taxonomy <<< =============================== 613 614 function atw_posts_set_taxonomy() { 615 //<!-- *** Custom Taxonomies *** --> 616 ?> 617 <div class="filter-section"> 618 <div class="filter-title">• Custom Taxonomies <span class="filter-title-description">Manual specification of Custom Taxonomies</span></div> 619 620 <div class="filter-opts"> 621 <?php 622 $taxonomies = get_taxonomies(array( 'public' => true, '_builtin' => false), 'objects'); 623 $li_out = false; 624 if (empty($taxonomies)) { 625 echo '<strong>No Custom Taxonomies Found</strong><br /><br />'; 626 } else { 627 echo '<ul>'; 628 $li_out = false; 629 foreach ($taxonomies as $taxonomy => $val ) { 630 if ($val->name == 'atw_slider_group') 631 continue; 632 $li_out = true; 633 echo '<li><strong>Taxonomy name: </strong> <em>' . $val->label . '</em> (slug: ' . $val->name . ')'; 634 $tax = $val->name; 635 $terms = get_terms( $tax ); 636 637 $lead = '<br /><span style="margin-left:20px;">Values (slugs): </span> '; 638 639 if ( is_wp_error( $terms ) ) { 640 continue; 641 } else { 642 if (empty($terms)) { 643 echo '<br /><span style="margin-left:20px;">Values: </span> None defined.<br />'; 644 continue; 645 } 646 foreach ( $terms as $term ) { 647 echo $lead; 648 $lead = ', '; 649 echo esc_attr( $term->slug ); 650 } 651 echo "<br />"; 652 } 653 echo '</li>'; 654 } 655 if ( !$li_out ) { 656 echo '<li>No custom taxonomies defined for this site.</li>'; 657 } 658 echo '</ul>'; 659 } 660 661 if ( $li_out ) { 662 ?> 663 <table><tr><td>Specify custom taxonomy parameters:</td><td><textarea class="filter-text" cols=60 rows=1 placeholder="custom_taxonomy_name=custom_values_by_slug_list" maxlength=512 name="taxonomy"><?php echo sanitize_text_field(atw_posts_get_filter_opt('taxonomy')); ?></textarea></td></tr></table> 664 <?php 665 } 666 ?> 667 </div> 668 <div class="filter-description"> 669 Various plugins can create Custom Taxonomies for use with custom post types. You can use these custom taxonomy names and 670 values to specify additional filter terms to this filter definition. Add as many values as you wish for a custom taxonomy 671 in the text box, then click "Save Filter Options" to set the value. For example, you could add a value something like 672 <code>custom_category=cat1</code> to include custom posts with the 'custom_category' taxonomy with a value 'cat1'. Separate 673 different taxonomy lists with a space. 674 <em style="font-weight:bold;color:red;">Important:</em> Be sure to include the corresponding custom post type in the "Post Type" section that matches the 675 custom taxonomy. 676 </div> 677 </div> 678 <?php 679 } 680 681 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 682 683 function atw_posts_set_custom_wpq() { 684 //<!-- *** Custom Taxonomies *** --> 685 ?> 686 <!-- *** Other WP_Query args *** --> 687 688 <div class="filter-section"> 689 <div class="filter-title">• Custom WP_Query Args (Advanced Option) <span class="filter-title-description">Manual specification of WP_Query arguments</span></div> 690 691 <div class="filter-opts"> 692 693 <table><tr><td>Specify custom WP_Query arguments:</td><td><textarea class="filter-text" cols=60 rows=1 placeholder="arg1=val1 arg2=val2 ..." maxlength=512 name="wp_query_args"><?php echo esc_textarea(atw_posts_get_filter_opt('wp_query_args')); ?></textarea></td></tr></table> 694 </div> 695 <div class="filter-description"> 696 <em>This option is intended for advanced users.</em> The Selection Filter Options specified on this admin page 697 are mapped to the corresponding WordPress <code>WP_Query</code> function arguments, but there are many additional WP_Query options 698 not included in these options; most users will never need them. 699 However, you can specify your own custom arguments to WP_Query here. Provide as many arguments 700 as you need in the text box, each separated by a space. These arguments will be added to any other options specified above, and be 701 added directly to the '$args' parameter to WP_Query. For a full, very technical explanation of all the options available for WP_Query, please consult the 702 <a href="http://codex.wordpress.org/Class_Reference/WP_Query" alt="WP_Query Codex Entry" target="_blank">WordPress Codex for WP_Query</a>. 703 <em style="font-weight:bold;color:red;">Important:</em> WP_Query arguments requiring values with 'array()' are <em><strong>not</strong></em> supported 704 by this plugin. 705 </div> 706 </div> 707 <?php 708 } 709 710 // ========================================= >>> atw_posts_set_custom_wpq <<< =============================== 711 712 if ( WEAVER_SHOWPOSTS_TEMPLATE ) { 713 function atw_posts_set_custom_template() { 714 //<!-- *** Custom Taxonomies *** --> 715 716 if ( !current_user_can('unfiltered_html') ) 717 return; // don't even show 718 719 $text = atw_posts_get_filter_opt('post_template'); 720 $rows = 1; 721 722 if (strlen($text) > 0) 723 $lines = count (explode(PHP_EOL, $text)); 724 else 725 $lines = 0; 726 if ($lines > 20) 727 $lines = 18; 728 if ($lines > 0) 729 $rows = $lines + 2; 730 731 ?> 732 <!-- *** Custom Post *** --> 733 734 <div class="filter-section"> 735 <div class="filter-title">• Custom Post Template (Advanced Option) <span class="filter-title-description">Define custom template to display posts</span></div> 736 737 <div class="filter-opts"> 738 739 <textarea class="filter-text" style="max-width:90%;" cols=100 rows=<?php echo $rows; ?> placeholder="Enter post template" maxlength=2048 name="post_template"><?php echo esc_textarea($text); ?></textarea></td></tr></table> 740 </div> 741 <div class="filter-description"> 742 <em>This option is intended for advanced users.</em> You can define a completely custom template to display posts. 743 You must read the help file for an explanation of this option. 744 </div> 745 </div> 746 <?php 747 } 748 } 749 940 } 941 -
show-posts/trunk/includes/atw-runtime-lib.php
r2213242 r2947913 350 350 } 351 351 352 function atw_posts_allow_file_read(): bool 353 { 354 // return true if it is allowed to use on MultiSite 355 356 return ((!is_multisite() && current_user_can('install_plugins')) 357 || (is_multisite() && current_user_can('manage_network_themes'))); 358 } 359 352 360 // ====================================== >>> atw_posts_is... <<< ====================================== 353 361 -
show-posts/trunk/includes/downloader.php
r2891911 r2947913 2 2 // will down load current settings based on db setting 3 3 // __ added - 12/11/14 4 if ( !current_user_can( 'manage_options' ) ) { 5 exit; 6 } 4 7 5 8 $wp_root = dirname(__FILE__) .'/../../../../'; -
show-posts/trunk/readme.txt
r2900851 r2947913 8 8 Tags: weaver theme, settings, save, subthemes 9 9 Text Domain: show-posts 10 Requires at least: 5.411 Tested up to: 6. 212 Stable tag: 1.8 10 Requires at least: 7.2 11 Tested up to: 6.3 12 Stable tag: 1.8.1 13 13 14 14 == Description == … … 50 50 Please use the WordPress Plugins:Install page to install this plugin. 51 51 52 53 52 == Frequently Asked Questions == 54 53 … … 60 59 61 60 == Changelog == 61 = 1.8.1 = 62 * Fix: multisite permissions 63 62 64 = 1.8 = 63 65 * Fix: string validation, translation name
Note: See TracChangeset
for help on using the changeset viewer.