Plugin Directory

Changeset 3282755


Ignore:
Timestamp:
04/27/2025 01:33:22 PM (10 months ago)
Author:
contentpen
Message:

Release version 1.0.3: Added fix: update post issue.

Location:
contentpen
Files:
6 edited
1 copied

Legend:

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

    r3282645 r3282755  
    44Requires at least: 5.8
    55Tested up to: 6.7
    6 Stable tag: 1.0.2
     6Stable tag: 1.0.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
  • contentpen/tags/1.0.3/contentpen-plugin.php

    r3282645 r3282755  
    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.2
     7 * Version: 1.0.3
    88 * Requires at least: 5.8
    99 * Requires PHP: 7.4
     
    2020}
    2121
    22 define('CONTENTPEN_VERSION', '1.0.2');
     22define('CONTENTPEN_VERSION', '1.0.3');
    2323define('CONTENTPEN_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2424define('CONTENTPEN_PLUGIN_URL', plugin_dir_url(__FILE__));
  • contentpen/tags/1.0.3/includes/class-contentpen-api.php

    r3282645 r3282755  
    125125      }
    126126    }
    127     if(!$request) {
     127    if (!$request) {
    128128      return $formatted_authors;
    129129    }
     
    151151    }
    152152
    153     if(!$request) {
     153    if (!$request) {
    154154      return $formatted_categories;
    155155    }
     
    593593    }
    594594
     595    // Get parameters from the request and add them to post_data if they exist
     596    $params = $request->get_params();
     597
     598    // Process categories
     599    $categories = array();
     600    if (!empty($params['categories'])) {
     601      $categories = array_map('intval', explode(',', sanitize_text_field($params['categories'])));
     602    }
     603
     604    // Process tags
     605    $tags = array();
     606    if (!empty($params['tags'])) {
     607      $tags = array_map('sanitize_text_field', explode(',', $params['tags']));
     608    }
     609
     610    // Remove content filters for raw HTML support
     611    $this->kses_remove_filters();
     612
     613    // Prepare post data
    595614    $post_data = array(
    596615      'ID' => $post_id,
    597     );
    598 
    599     // Get parameters from the request and add them to post_data if they exist
    600     $params = $request->get_params();
    601 
     616      'post_author' => isset($params['author']) ? (int)$params['author'] : get_current_user_id(),
     617      'post_category' => $categories,
     618      'tags_input' => $tags,
     619      'post_type' => 'post'
     620    );
     621
     622    // Check for required fields
    602623    if (isset($params['title'])) {
    603624      $post_data['post_title'] = sanitize_text_field($params['title']);
  • contentpen/trunk/README.txt

    r3282645 r3282755  
    44Requires at least: 5.8
    55Tested up to: 6.7
    6 Stable tag: 1.0.2
     6Stable tag: 1.0.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
  • contentpen/trunk/contentpen-plugin.php

    r3282645 r3282755  
    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.2
     7 * Version: 1.0.3
    88 * Requires at least: 5.8
    99 * Requires PHP: 7.4
     
    2020}
    2121
    22 define('CONTENTPEN_VERSION', '1.0.2');
     22define('CONTENTPEN_VERSION', '1.0.3');
    2323define('CONTENTPEN_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2424define('CONTENTPEN_PLUGIN_URL', plugin_dir_url(__FILE__));
  • contentpen/trunk/includes/class-contentpen-api.php

    r3282645 r3282755  
    125125      }
    126126    }
    127     if(!$request) {
     127    if (!$request) {
    128128      return $formatted_authors;
    129129    }
     
    151151    }
    152152
    153     if(!$request) {
     153    if (!$request) {
    154154      return $formatted_categories;
    155155    }
     
    593593    }
    594594
     595    // Get parameters from the request and add them to post_data if they exist
     596    $params = $request->get_params();
     597
     598    // Process categories
     599    $categories = array();
     600    if (!empty($params['categories'])) {
     601      $categories = array_map('intval', explode(',', sanitize_text_field($params['categories'])));
     602    }
     603
     604    // Process tags
     605    $tags = array();
     606    if (!empty($params['tags'])) {
     607      $tags = array_map('sanitize_text_field', explode(',', $params['tags']));
     608    }
     609
     610    // Remove content filters for raw HTML support
     611    $this->kses_remove_filters();
     612
     613    // Prepare post data
    595614    $post_data = array(
    596615      'ID' => $post_id,
    597     );
    598 
    599     // Get parameters from the request and add them to post_data if they exist
    600     $params = $request->get_params();
    601 
     616      'post_author' => isset($params['author']) ? (int)$params['author'] : get_current_user_id(),
     617      'post_category' => $categories,
     618      'tags_input' => $tags,
     619      'post_type' => 'post'
     620    );
     621
     622    // Check for required fields
    602623    if (isset($params['title'])) {
    603624      $post_data['post_title'] = sanitize_text_field($params['title']);
Note: See TracChangeset for help on using the changeset viewer.