Changeset 3292615
- Timestamp:
- 05/13/2025 01:48:24 PM (11 months ago)
- Location:
- sapientseo
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.20 (copied) (copied from sapientseo/trunk)
-
tags/1.0.20/inc/api/posts.php (modified) (2 diffs)
-
tags/1.0.20/readme.txt (modified) (1 diff)
-
tags/1.0.20/sapientseo.php (modified) (1 diff)
-
trunk/inc/api/posts.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/sapientseo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sapientseo/tags/1.0.20/inc/api/posts.php
r3291488 r3292615 112 112 'methods' => 'GET', 113 113 'callback' => 'sapient_seo_get_post_details', 114 'permission_callback' => function ($request) { 115 return sapient_seo_api_key_permission($request); 116 } 117 ]); 118 register_rest_route('sapientseo/v1', '/publish-post', [ 119 'methods' => 'POST', 120 'callback' => 'sapient_seo_quick_publish_post', 114 121 'permission_callback' => function ($request) { 115 122 return sapient_seo_api_key_permission($request); … … 299 306 ]); 300 307 } 308 309 // 🔹 Quick Publish Post 310 function sapient_seo_quick_publish_post(WP_REST_Request $request) { 311 $post_id = intval($request->get_param('post_id')); 312 if (!$post_id || get_post_status($post_id) === false) { 313 return new WP_Error('invalid_post', 'Post not found.', ['status' => 404]); 314 } 315 316 $update = wp_update_post([ 317 'ID' => $post_id, 318 'post_status' => 'publish', 319 'post_date' => current_time('mysql'), 320 'post_date_gmt' => current_time('mysql', 1), 321 ], true); 322 323 if (is_wp_error($update)) { 324 return rest_ensure_response([ 325 'error' => 'publish_failed', 326 'message' => 'Could not publish post.', 327 'status' => 500 328 ]); 329 } 330 331 return rest_ensure_response(['post_id' => $post_id, 'message' => 'Post published successfully.']); 332 } -
sapientseo/tags/1.0.20/readme.txt
r3292121 r3292615 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 1.0. 196 Stable tag: 1.0.20 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
sapientseo/tags/1.0.20/sapientseo.php
r3292121 r3292615 3 3 * Plugin Name: SapientSEO 4 4 * Description: Connect your WordPress site to SapientSEO using secure custom REST API endpoints. 5 * Version: 1.0. 195 * Version: 1.0.20 6 6 * Author: SapientSEO 7 7 * Plugin URI: https://sapientseo.ai -
sapientseo/trunk/inc/api/posts.php
r3291488 r3292615 112 112 'methods' => 'GET', 113 113 'callback' => 'sapient_seo_get_post_details', 114 'permission_callback' => function ($request) { 115 return sapient_seo_api_key_permission($request); 116 } 117 ]); 118 register_rest_route('sapientseo/v1', '/publish-post', [ 119 'methods' => 'POST', 120 'callback' => 'sapient_seo_quick_publish_post', 114 121 'permission_callback' => function ($request) { 115 122 return sapient_seo_api_key_permission($request); … … 299 306 ]); 300 307 } 308 309 // 🔹 Quick Publish Post 310 function sapient_seo_quick_publish_post(WP_REST_Request $request) { 311 $post_id = intval($request->get_param('post_id')); 312 if (!$post_id || get_post_status($post_id) === false) { 313 return new WP_Error('invalid_post', 'Post not found.', ['status' => 404]); 314 } 315 316 $update = wp_update_post([ 317 'ID' => $post_id, 318 'post_status' => 'publish', 319 'post_date' => current_time('mysql'), 320 'post_date_gmt' => current_time('mysql', 1), 321 ], true); 322 323 if (is_wp_error($update)) { 324 return rest_ensure_response([ 325 'error' => 'publish_failed', 326 'message' => 'Could not publish post.', 327 'status' => 500 328 ]); 329 } 330 331 return rest_ensure_response(['post_id' => $post_id, 'message' => 'Post published successfully.']); 332 } -
sapientseo/trunk/readme.txt
r3292121 r3292615 4 4 Tested up to: 6.8 5 5 Requires PHP: 7.4 6 Stable tag: 1.0. 196 Stable tag: 1.0.20 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
sapientseo/trunk/sapientseo.php
r3292121 r3292615 3 3 * Plugin Name: SapientSEO 4 4 * Description: Connect your WordPress site to SapientSEO using secure custom REST API endpoints. 5 * Version: 1.0. 195 * Version: 1.0.20 6 6 * Author: SapientSEO 7 7 * Plugin URI: https://sapientseo.ai
Note: See TracChangeset
for help on using the changeset viewer.