Changeset 3290077
- Timestamp:
- 05/08/2025 05:57:34 PM (11 months ago)
- Location:
- sapientseo
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.13 (copied) (copied from sapientseo/trunk)
-
tags/1.0.13/inc/api/posts.php (modified) (3 diffs)
-
tags/1.0.13/readme.txt (modified) (1 diff)
-
tags/1.0.13/sapientseo.php (modified) (1 diff)
-
trunk/inc/api/posts.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/sapientseo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sapientseo/tags/1.0.13/inc/api/posts.php
r3290074 r3290077 127 127 // 🔹 Create Post 128 128 function 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 $post Date = !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'); 136 136 137 137 if (empty($title)) { … … 140 140 141 141 $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, 148 148 ]; 149 149 … … 174 174 'post_title' => sanitize_text_field($params['title'] ?? ''), 175 175 'post_content' => wp_kses_post($params['content'] ?? ''), 176 'post_excerpt' => sanitize_text_field($params['excerpt'] ?? ''), 176 177 ]; 177 178 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)) { 179 180 $post_data['post_status'] = $params['status']; 180 181 } -
sapientseo/tags/1.0.13/readme.txt
r3290074 r3290077 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 1.0.1 26 Stable tag: 1.0.13 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
sapientseo/tags/1.0.13/sapientseo.php
r3290074 r3290077 3 3 * Plugin Name: SapientSEO 4 4 * Description: Connect your WordPress site to SapientSEO using secure custom REST API endpoints. 5 * Version: 1.0.1 25 * Version: 1.0.13 6 6 * Author: SapientSEO 7 7 * Plugin URI: https://sapientseo.ai -
sapientseo/trunk/inc/api/posts.php
r3290074 r3290077 127 127 // 🔹 Create Post 128 128 function 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 $post Date = !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'); 136 136 137 137 if (empty($title)) { … … 140 140 141 141 $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, 148 148 ]; 149 149 … … 174 174 'post_title' => sanitize_text_field($params['title'] ?? ''), 175 175 'post_content' => wp_kses_post($params['content'] ?? ''), 176 'post_excerpt' => sanitize_text_field($params['excerpt'] ?? ''), 176 177 ]; 177 178 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)) { 179 180 $post_data['post_status'] = $params['status']; 180 181 } -
sapientseo/trunk/readme.txt
r3290074 r3290077 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 1.0.1 26 Stable tag: 1.0.13 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
sapientseo/trunk/sapientseo.php
r3290074 r3290077 3 3 * Plugin Name: SapientSEO 4 4 * Description: Connect your WordPress site to SapientSEO using secure custom REST API endpoints. 5 * Version: 1.0.1 25 * Version: 1.0.13 6 6 * Author: SapientSEO 7 7 * Plugin URI: https://sapientseo.ai
Note: See TracChangeset
for help on using the changeset viewer.