Changeset 3366306
- Timestamp:
- 09/23/2025 08:40:41 AM (6 months ago)
- Location:
- static-web-publisher/trunk
- Files:
-
- 5 edited
-
includes/comments-json.php (modified) (2 diffs)
-
includes/panels.php (modified) (3 diffs)
-
includes/settings.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
static-web-plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
static-web-publisher/trunk/includes/comments-json.php
r3358095 r3366306 31 31 $offset = ($page - 1) * $per_page; 32 32 33 // Order parameter: default to DESC, allow ASC via GET ?order=asc 34 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Safe: only reading sanitized GET params. 35 $order_param = isset($_GET['order']) ? strtolower( sanitize_text_field( wp_unslash( $_GET['order'] ) ) ) : ''; 36 $order = ($order_param === 'asc') ? 'ASC' : 'DESC'; 37 33 38 $comments = get_comments(array( 34 39 'post_id' => $post_id, … … 36 41 'number' => $per_page, 37 42 'offset' => $offset, 43 'orderby' => 'comment_date_gmt', 44 'order' => $order, 45 38 46 )); 39 47 -
static-web-publisher/trunk/includes/panels.php
r3358095 r3366306 23 23 'modify_internal_links' => false, 24 24 'modify_external_links' => false, 25 'comments_title' => '', 26 'no_comments_message' => '', 25 27 'top_panel' => array( 26 28 'main_link' => '', … … 34 36 ), 35 37 )); 38 39 $comments_title = $settings['comments_title']; 40 $no_comments_message = $settings['no_comments_message']; 41 36 42 37 43 $top_panel = $settings['top_panel']; … … 107 113 echo ' side="left"'; 108 114 } 109 ?>><?php echo '<comments title="Comments" empty="No comments yet">' . esc_url($comments_link). '</comments>' ?></side-panel>115 ?>><?php echo '<comments' . (!empty($comments_title) ? ' title="' . esc_attr($comments_title) . '"' : '') . (!empty($no_comments_message) ? ' empty="' . esc_attr($no_comments_message) . '"' : '') . '>' . esc_url($comments_link). '</comments>' ?></side-panel> 110 116 <?php endif; ?> 111 117 <?php if($should_show_bottom_panel){ ?> -
static-web-publisher/trunk/includes/settings.php
r3358095 r3366306 17 17 'modify_internal_links' => false, 18 18 'modify_external_links' => false, 19 'comments_title' => '', 20 'no_comments_message' => '', 19 21 'top_panel' => array( 20 22 'main_link' => '', … … 86 88 </div> 87 89 90 91 <h2>Comments</h2> 92 93 <div class="settings-option-div"> 94 <label>Comments title: </label> 95 <div class="spacerW10"></div> 96 <input class="single-text-input" type="text" name="stwbpb_settings[comments_title]" value="<?php echo esc_attr($settings['comments_title']); ?>" /> 97 </div> 98 99 <div class="settings-option-div"> 100 <label>No comments message: </label> 101 <div class="spacerW10"></div> 102 <input class="single-text-input" type="text" name="stwbpb_settings[no_comments_message]" value="<?php echo esc_attr($settings['no_comments_message']); ?>" /> 103 </div> 88 104 89 105 … … 232 248 'modify_internal_links' => false, 233 249 'modify_external_links' => false, 250 'comments_title' => '', 251 'no_comments_message' => '', 234 252 'top_panel' => array( 235 253 'main_link' => '', … … 287 305 288 306 307 $sanitized['comments_title'] = isset($input['comments_title']) ? sanitize_text_field($input['comments_title']) : ''; 308 $sanitized['no_comments_message'] = isset($input['no_comments_message']) ? sanitize_text_field($input['no_comments_message']) : ''; 309 289 310 290 311 // Sanitize top_panel -
static-web-publisher/trunk/readme.txt
r3358095 r3366306 5 5 Requires at least: 5.1 6 6 Tested up to: 6.8 7 Stable tag: 2. 0.07 Stable tag: 2.1.0 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 101 101 == Changelog == 102 102 103 = 2.1.0 = 104 It's now possible to order comments with 'order' parameter. Values: asc, desc. Title for comments section and 'no comments yet' message can now be specified in the Settings. 105 103 106 = 2.0.0 = 104 107 Color configuration of panels was removed from Settings. … … 121 124 122 125 == Upgrade Notice == 126 127 = 2.1.0 = 128 It's now possible to order comments with 'order' parameter. Values: asc, desc. Title for comments section and 'no comments yet' message can now be specified in the Settings. 129 123 130 = 2.0.0 = 124 131 After the upgrade go to Settings > Permalinks and press 'Save Changes' to update your enpoints (json-comments endpoint was added). -
static-web-publisher/trunk/static-web-plugin.php
r3358095 r3366306 4 4 Plugin Name: Static Web Publisher 5 5 Description: Publishes your posts and pages on the Static Web 6 Version: 2. 0.06 Version: 2.1.0 7 7 Author: Karen Grigorian 8 8 Author URI: https://github.com/kgcoder … … 54 54 55 55 if ($main_link === '' && $main_title === '' && $logo_url === '') { 56 $settings['comments_title'] = 'Comments'; 57 $settings['no_comments_message'] = 'No comments yet'; 56 58 $settings['top_panel']['main_title'] = get_bloginfo('name'); 57 59 $settings['top_panel']['main_link'] = home_url();
Note: See TracChangeset
for help on using the changeset viewer.