Changeset 3463958
- Timestamp:
- 02/18/2026 06:00:29 AM (7 weeks ago)
- Location:
- contentpen
- Files:
-
- 6 edited
- 1 copied
-
tags/1.0.10 (copied) (copied from contentpen/trunk)
-
tags/1.0.10/README.txt (modified) (3 diffs)
-
tags/1.0.10/contentpen-plugin.php (modified) (2 diffs)
-
tags/1.0.10/includes/class-contentpen-api.php (modified) (2 diffs)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/contentpen-plugin.php (modified) (2 diffs)
-
trunk/includes/class-contentpen-api.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
contentpen/tags/1.0.10/README.txt
r3457988 r3463958 4 4 Requires at least: 5.8 5 5 Tested up to: 6.9.1 6 Stable tag: 1.0. 96 Stable tag: 1.0.10 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 55 55 == Changelog == 56 56 57 = 1.0.10 = 58 * Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions. 59 57 60 = 1.0.9 = 58 61 * Fixed REST API route registration for posts endpoint to prevent routing conflicts … … 73 76 == Upgrade Notice == 74 77 78 = 1.0.10 = 79 * Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions. 80 75 81 = 1.0.9 = 76 82 * Fixed REST API route registration for posts endpoint to prevent routing conflicts -
contentpen/tags/1.0.10/contentpen-plugin.php
r3457988 r3463958 5 5 * Plugin URI: https://contentpen.ai 6 6 * Description: Contentpen is an AI-powered content writing assistant designed to help businesses create, optimize, and publish SEO-friendly blog posts at scale. By combining deep research with your brand's unique voice, Contentpen crafts high-impact articles that outperform your competition. 7 * Version: 1.0. 97 * Version: 1.0.10 8 8 * Requires at least: 5.8 9 9 * Requires PHP: 7.4 … … 20 20 } 21 21 22 define('CONTENTPEN_VERSION', '1.0. 9');22 define('CONTENTPEN_VERSION', '1.0.10'); 23 23 define('CONTENTPEN_PLUGIN_DIR', plugin_dir_path(__FILE__)); 24 24 define('CONTENTPEN_PLUGIN_URL', plugin_dir_url(__FILE__)); -
contentpen/tags/1.0.10/includes/class-contentpen-api.php
r3457988 r3463958 54 54 )); 55 55 56 // Posts endpoint - handles both GET (list) and POST (create)57 56 register_rest_route($this->namespace, '/posts', array( 58 array( 59 'methods' => 'GET', 60 'callback' => array($this, 'get_posts'), 61 'permission_callback' => array($this, 'check_api_key') 62 ), 63 array( 64 'methods' => 'POST', 65 'callback' => array($this, 'create_post'), 66 'permission_callback' => array($this, 'check_api_key') 67 ) 57 'methods' => 'POST', 58 'callback' => array($this, 'create_post'), 59 'permission_callback' => array($this, 'check_api_key') 68 60 )); 69 61 … … 514 506 } 515 507 516 public function get_posts($request)517 {518 $args = array(519 'post_type' => 'post',520 'posts_per_page' => 10,521 'post_status' => array('publish', 'draft', 'pending')522 );523 524 $posts = get_posts($args);525 $formatted_posts = array();526 527 foreach ($posts as $post) {528 $formatted_posts[] = array(529 'id' => $post->ID,530 'title' => $post->post_title,531 'status' => $post->post_status,532 'date' => $post->post_date,533 'url' => get_permalink($post->ID),534 'excerpt' => $post->post_excerpt,535 'featured_image' => get_the_post_thumbnail_url($post->ID)536 );537 }538 539 return new WP_REST_Response($formatted_posts, 200);540 }541 542 508 private function set_featured_image($post_id, $image_url) 543 509 { -
contentpen/trunk/README.txt
r3457988 r3463958 4 4 Requires at least: 5.8 5 5 Tested up to: 6.9.1 6 Stable tag: 1.0. 96 Stable tag: 1.0.10 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 55 55 == Changelog == 56 56 57 = 1.0.10 = 58 * Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions. 59 57 60 = 1.0.9 = 58 61 * Fixed REST API route registration for posts endpoint to prevent routing conflicts … … 73 76 == Upgrade Notice == 74 77 78 = 1.0.10 = 79 * Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions. 80 75 81 = 1.0.9 = 76 82 * Fixed REST API route registration for posts endpoint to prevent routing conflicts -
contentpen/trunk/contentpen-plugin.php
r3457988 r3463958 5 5 * Plugin URI: https://contentpen.ai 6 6 * Description: Contentpen is an AI-powered content writing assistant designed to help businesses create, optimize, and publish SEO-friendly blog posts at scale. By combining deep research with your brand's unique voice, Contentpen crafts high-impact articles that outperform your competition. 7 * Version: 1.0. 97 * Version: 1.0.10 8 8 * Requires at least: 5.8 9 9 * Requires PHP: 7.4 … … 20 20 } 21 21 22 define('CONTENTPEN_VERSION', '1.0. 9');22 define('CONTENTPEN_VERSION', '1.0.10'); 23 23 define('CONTENTPEN_PLUGIN_DIR', plugin_dir_path(__FILE__)); 24 24 define('CONTENTPEN_PLUGIN_URL', plugin_dir_url(__FILE__)); -
contentpen/trunk/includes/class-contentpen-api.php
r3457988 r3463958 54 54 )); 55 55 56 // Posts endpoint - handles both GET (list) and POST (create)57 56 register_rest_route($this->namespace, '/posts', array( 58 array( 59 'methods' => 'GET', 60 'callback' => array($this, 'get_posts'), 61 'permission_callback' => array($this, 'check_api_key') 62 ), 63 array( 64 'methods' => 'POST', 65 'callback' => array($this, 'create_post'), 66 'permission_callback' => array($this, 'check_api_key') 67 ) 57 'methods' => 'POST', 58 'callback' => array($this, 'create_post'), 59 'permission_callback' => array($this, 'check_api_key') 68 60 )); 69 61 … … 514 506 } 515 507 516 public function get_posts($request)517 {518 $args = array(519 'post_type' => 'post',520 'posts_per_page' => 10,521 'post_status' => array('publish', 'draft', 'pending')522 );523 524 $posts = get_posts($args);525 $formatted_posts = array();526 527 foreach ($posts as $post) {528 $formatted_posts[] = array(529 'id' => $post->ID,530 'title' => $post->post_title,531 'status' => $post->post_status,532 'date' => $post->post_date,533 'url' => get_permalink($post->ID),534 'excerpt' => $post->post_excerpt,535 'featured_image' => get_the_post_thumbnail_url($post->ID)536 );537 }538 539 return new WP_REST_Response($formatted_posts, 200);540 }541 542 508 private function set_featured_image($post_id, $image_url) 543 509 {
Note: See TracChangeset
for help on using the changeset viewer.