Plugin Directory

Changeset 3366306


Ignore:
Timestamp:
09/23/2025 08:40:41 AM (6 months ago)
Author:
kgcoder
Message:

Update plugin to version 2.1.0

Location:
static-web-publisher/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • static-web-publisher/trunk/includes/comments-json.php

    r3358095 r3366306  
    3131    $offset = ($page - 1) * $per_page;
    3232
     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
    3338    $comments = get_comments(array(
    3439        'post_id' => $post_id,
     
    3641        'number' => $per_page,
    3742        'offset' => $offset,
     43        'orderby' => 'comment_date_gmt',
     44        'order' => $order,
     45       
    3846    ));
    3947
  • static-web-publisher/trunk/includes/panels.php

    r3358095 r3366306  
    2323        'modify_internal_links' => false,
    2424        'modify_external_links' => false,
     25        'comments_title' => '',
     26        'no_comments_message' => '',
    2527        'top_panel' => array(
    2628            'main_link' => '',
     
    3436        ),
    3537    ));
     38
     39    $comments_title = $settings['comments_title'];
     40    $no_comments_message = $settings['no_comments_message'];
     41
    3642
    3743    $top_panel = $settings['top_panel'];
     
    107113    echo ' side="left"';
    108114}
    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>
    110116<?php endif; ?>
    111117<?php if($should_show_bottom_panel){ ?>
  • static-web-publisher/trunk/includes/settings.php

    r3358095 r3366306  
    1717        'modify_internal_links' => false,
    1818        'modify_external_links' => false,
     19        'comments_title' => '',
     20        'no_comments_message' => '',
    1921        'top_panel' => array(
    2022            'main_link' => '',
     
    8688            </div>
    8789
     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>
    88104           
    89105
     
    232248        'modify_internal_links' => false,
    233249        'modify_external_links' => false,
     250        'comments_title' => '',
     251        'no_comments_message' => '',
    234252        'top_panel' => array(
    235253            'main_link' => '',
     
    287305
    288306
     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
    289310
    290311    // Sanitize top_panel
  • static-web-publisher/trunk/readme.txt

    r3358095 r3366306  
    55Requires at least: 5.1
    66Tested up to: 6.8
    7 Stable tag: 2.0.0
     7Stable tag: 2.1.0
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    101101== Changelog == 
    102102
     103= 2.1.0 =
     104It'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
    103106= 2.0.0 =
    104107Color configuration of panels was removed from Settings.
     
    121124
    122125== Upgrade Notice == 
     126
     127= 2.1.0 =
     128It'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
    123130= 2.0.0 =
    124131After 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  
    44Plugin Name: Static Web Publisher
    55Description: Publishes your posts and pages on the Static Web
    6 Version: 2.0.0
     6Version: 2.1.0
    77Author: Karen Grigorian
    88Author URI: https://github.com/kgcoder
     
    5454
    5555    if ($main_link === '' && $main_title === '' && $logo_url === '') {
     56        $settings['comments_title'] = 'Comments';
     57        $settings['no_comments_message'] = 'No comments yet';
    5658        $settings['top_panel']['main_title'] = get_bloginfo('name');
    5759        $settings['top_panel']['main_link'] = home_url();
Note: See TracChangeset for help on using the changeset viewer.