Plugin Directory

Changeset 3463958


Ignore:
Timestamp:
02/18/2026 06:00:29 AM (7 weeks ago)
Author:
contentpen
Message:

chg: remove route conflicting get posts endpoint

Location:
contentpen
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • contentpen/tags/1.0.10/README.txt

    r3457988 r3463958  
    44Requires at least: 5.8
    55Tested up to: 6.9.1
    6 Stable tag: 1.0.9
     6Stable tag: 1.0.10
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    5555== Changelog ==
    5656
     57= 1.0.10 =
     58* Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions.
     59
    5760= 1.0.9 =
    5861* Fixed REST API route registration for posts endpoint to prevent routing conflicts
     
    7376== Upgrade Notice ==
    7477
     78= 1.0.10 =
     79* Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions.
     80
    7581= 1.0.9 =
    7682* Fixed REST API route registration for posts endpoint to prevent routing conflicts
  • contentpen/tags/1.0.10/contentpen-plugin.php

    r3457988 r3463958  
    55 * Plugin URI: https://contentpen.ai
    66 * 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.9
     7 * Version: 1.0.10
    88 * Requires at least: 5.8
    99 * Requires PHP: 7.4
     
    2020}
    2121
    22 define('CONTENTPEN_VERSION', '1.0.9');
     22define('CONTENTPEN_VERSION', '1.0.10');
    2323define('CONTENTPEN_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2424define('CONTENTPEN_PLUGIN_URL', plugin_dir_url(__FILE__));
  • contentpen/tags/1.0.10/includes/class-contentpen-api.php

    r3457988 r3463958  
    5454    ));
    5555
    56     // Posts endpoint - handles both GET (list) and POST (create)
    5756    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')
    6860    ));
    6961
     
    514506  }
    515507
    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 
    542508  private function set_featured_image($post_id, $image_url)
    543509  {
  • contentpen/trunk/README.txt

    r3457988 r3463958  
    44Requires at least: 5.8
    55Tested up to: 6.9.1
    6 Stable tag: 1.0.9
     6Stable tag: 1.0.10
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    5555== Changelog ==
    5656
     57= 1.0.10 =
     58* Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions.
     59
    5760= 1.0.9 =
    5861* Fixed REST API route registration for posts endpoint to prevent routing conflicts
     
    7376== Upgrade Notice ==
    7477
     78= 1.0.10 =
     79* Removed unused GET /posts endpoint that caused route conflicts in some wordpress versions.
     80
    7581= 1.0.9 =
    7682* Fixed REST API route registration for posts endpoint to prevent routing conflicts
  • contentpen/trunk/contentpen-plugin.php

    r3457988 r3463958  
    55 * Plugin URI: https://contentpen.ai
    66 * 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.9
     7 * Version: 1.0.10
    88 * Requires at least: 5.8
    99 * Requires PHP: 7.4
     
    2020}
    2121
    22 define('CONTENTPEN_VERSION', '1.0.9');
     22define('CONTENTPEN_VERSION', '1.0.10');
    2323define('CONTENTPEN_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2424define('CONTENTPEN_PLUGIN_URL', plugin_dir_url(__FILE__));
  • contentpen/trunk/includes/class-contentpen-api.php

    r3457988 r3463958  
    5454    ));
    5555
    56     // Posts endpoint - handles both GET (list) and POST (create)
    5756    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')
    6860    ));
    6961
     
    514506  }
    515507
    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 
    542508  private function set_featured_image($post_id, $image_url)
    543509  {
Note: See TracChangeset for help on using the changeset viewer.