Plugin Directory

Changeset 3290077


Ignore:
Timestamp:
05/08/2025 05:57:34 PM (11 months ago)
Author:
galbc
Message:

Release version 1.0.13

Location:
sapientseo
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sapientseo/tags/1.0.13/inc/api/posts.php

    r3290074 r3290077  
    127127// 🔹 Create Post
    128128function sapient_seo_create_post(WP_REST_Request $request) {
    129     $params   = $request->get_json_params();
    130     $title    = sanitize_text_field($params['title'] ?? '');
    131     $content  = wp_kses_post($params['content'] ?? '');
    132     $excerpt  = sanitize_text_field($params['excerpt'] ?? '');
    133     $status   = in_array($params['status'] ?? '', ['draft', 'publish', 'future', 'pending']) ? $params['status'] : 'draft';
    134     $type     = sanitize_text_field($params['post_type'] ?? 'post');
    135     $postDate = !empty($params['post_date']) ? sanitize_text_field($params['post_date']) : current_time('mysql');
     129    $params    = $request->get_json_params();
     130    $title     = sanitize_text_field($params['title'] ?? '');
     131    $content   = wp_kses_post($params['content'] ?? '');
     132    $excerpt   = sanitize_text_field($params['excerpt'] ?? '');
     133    $status    = in_array($params['status'] ?? '', ['draft', 'publish', 'pending', 'future', 'private'], true) ? $params['status'] : 'draft';
     134    $type      = sanitize_text_field($params['post_type'] ?? 'post');
     135    $post_date = !empty($params['post_date']) ? sanitize_text_field($params['post_date']) : current_time('mysql');
    136136
    137137    if (empty($title)) {
     
    140140
    141141    $post_data = [
    142         'post_title'    => $title,
    143         'post_content'  => $content,
    144         'post_excerpt'  => $excerpt,
    145         'post_status'   => $status,
    146         'post_type'     => $type,
    147         'post_date'     => $postDate,
     142        'post_title'   => $title,
     143        'post_content' => $content,
     144        'post_excerpt' => $excerpt,
     145        'post_status'  => $status,
     146        'post_type'    => $type,
     147        'post_date'    => $post_date,
    148148    ];
    149149
     
    174174        'post_title'   => sanitize_text_field($params['title'] ?? ''),
    175175        'post_content' => wp_kses_post($params['content'] ?? ''),
     176        'post_excerpt' => sanitize_text_field($params['excerpt'] ?? ''),
    176177    ];
    177178
    178     if (isset($params['status']) && in_array($params['status'], ['draft', 'publish'])) {
     179    if (isset($params['status']) && in_array($params['status'], ['draft', 'publish', 'pending', 'future', 'private'], true)) {
    179180        $post_data['post_status'] = $params['status'];
    180181    }
  • sapientseo/tags/1.0.13/readme.txt

    r3290074 r3290077  
    44Tested up to: 6.8
    55Requires PHP: 7.4
    6 Stable tag: 1.0.12
     6Stable tag: 1.0.13
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • sapientseo/tags/1.0.13/sapientseo.php

    r3290074 r3290077  
    33 * Plugin Name: SapientSEO
    44 * Description: Connect your WordPress site to SapientSEO using secure custom REST API endpoints.
    5  * Version: 1.0.12
     5 * Version: 1.0.13
    66 * Author: SapientSEO
    77 * Plugin URI: https://sapientseo.ai
  • sapientseo/trunk/inc/api/posts.php

    r3290074 r3290077  
    127127// 🔹 Create Post
    128128function sapient_seo_create_post(WP_REST_Request $request) {
    129     $params   = $request->get_json_params();
    130     $title    = sanitize_text_field($params['title'] ?? '');
    131     $content  = wp_kses_post($params['content'] ?? '');
    132     $excerpt  = sanitize_text_field($params['excerpt'] ?? '');
    133     $status   = in_array($params['status'] ?? '', ['draft', 'publish', 'future', 'pending']) ? $params['status'] : 'draft';
    134     $type     = sanitize_text_field($params['post_type'] ?? 'post');
    135     $postDate = !empty($params['post_date']) ? sanitize_text_field($params['post_date']) : current_time('mysql');
     129    $params    = $request->get_json_params();
     130    $title     = sanitize_text_field($params['title'] ?? '');
     131    $content   = wp_kses_post($params['content'] ?? '');
     132    $excerpt   = sanitize_text_field($params['excerpt'] ?? '');
     133    $status    = in_array($params['status'] ?? '', ['draft', 'publish', 'pending', 'future', 'private'], true) ? $params['status'] : 'draft';
     134    $type      = sanitize_text_field($params['post_type'] ?? 'post');
     135    $post_date = !empty($params['post_date']) ? sanitize_text_field($params['post_date']) : current_time('mysql');
    136136
    137137    if (empty($title)) {
     
    140140
    141141    $post_data = [
    142         'post_title'    => $title,
    143         'post_content'  => $content,
    144         'post_excerpt'  => $excerpt,
    145         'post_status'   => $status,
    146         'post_type'     => $type,
    147         'post_date'     => $postDate,
     142        'post_title'   => $title,
     143        'post_content' => $content,
     144        'post_excerpt' => $excerpt,
     145        'post_status'  => $status,
     146        'post_type'    => $type,
     147        'post_date'    => $post_date,
    148148    ];
    149149
     
    174174        'post_title'   => sanitize_text_field($params['title'] ?? ''),
    175175        'post_content' => wp_kses_post($params['content'] ?? ''),
     176        'post_excerpt' => sanitize_text_field($params['excerpt'] ?? ''),
    176177    ];
    177178
    178     if (isset($params['status']) && in_array($params['status'], ['draft', 'publish'])) {
     179    if (isset($params['status']) && in_array($params['status'], ['draft', 'publish', 'pending', 'future', 'private'], true)) {
    179180        $post_data['post_status'] = $params['status'];
    180181    }
  • sapientseo/trunk/readme.txt

    r3290074 r3290077  
    44Tested up to: 6.8
    55Requires PHP: 7.4
    6 Stable tag: 1.0.12
     6Stable tag: 1.0.13
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • sapientseo/trunk/sapientseo.php

    r3290074 r3290077  
    33 * Plugin Name: SapientSEO
    44 * Description: Connect your WordPress site to SapientSEO using secure custom REST API endpoints.
    5  * Version: 1.0.12
     5 * Version: 1.0.13
    66 * Author: SapientSEO
    77 * Plugin URI: https://sapientseo.ai
Note: See TracChangeset for help on using the changeset viewer.