Plugin Directory

Changeset 3455141


Ignore:
Timestamp:
02/06/2026 05:35:34 AM (2 weeks ago)
Author:
contentpen
Message:

add Gutenberg block converter for HTML content

Location:
contentpen
Files:
6 edited
1 copied

Legend:

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

    r3451786 r3455141  
    33Tags: AI, content writing, SEO, blogging, content marketing
    44Requires at least: 5.8
    5 Tested up to: 6.8
    6 Stable tag: 1.0.5
     5Tested up to: 6.7
     6Stable tag: 1.0.6
    77Requires PHP: 7.4
    88License: GPLv2 or later
  • contentpen/tags/1.0.6/contentpen-plugin.php

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

    r3451786 r3455141  
    33  exit;
    44}
     5
     6require_once plugin_dir_path(__FILE__) . 'class-gutenberg-converter.php';
    57
    68class ContentPen_API
     
    190192    $this->kses_remove_filters();
    191193
     194    // Convert HTML content to Gutenberg blocks
     195    $content = ContentPen_Gutenberg_Converter::convert($params['content']);
     196
    192197    // Prepare post data
     198    // Note: Don't use wp_kses_post on $content as it strips Gutenberg block comments
    193199    $post_data = array(
    194200      'post_title' => sanitize_text_field($params['title']),
    195       'post_content' => wp_kses_post($params['content']),
     201      'post_content' => $content,
    196202      'post_status' => isset($params['status']) ? sanitize_text_field($params['status']) : 'draft',
    197203      'post_author' => isset($params['author']) ? (int)$params['author'] : get_current_user_id(),
     
    664670    }
    665671    if (isset($params['content'])) {
    666       $post_data['post_content'] = wp_kses_post($params['content']);
     672      // Convert HTML content to Gutenberg blocks
     673      // Note: Don't use wp_kses_post as it strips Gutenberg block comments
     674      $content = ContentPen_Gutenberg_Converter::convert($params['content']);
     675      $post_data['post_content'] = $content;
    667676    }
    668677    if (isset($params['status'])) {
  • contentpen/trunk/README.txt

    r3451786 r3455141  
    33Tags: AI, content writing, SEO, blogging, content marketing
    44Requires at least: 5.8
    5 Tested up to: 6.8
    6 Stable tag: 1.0.5
     5Tested up to: 6.7
     6Stable tag: 1.0.6
    77Requires PHP: 7.4
    88License: GPLv2 or later
  • contentpen/trunk/contentpen-plugin.php

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

    r3451786 r3455141  
    33  exit;
    44}
     5
     6require_once plugin_dir_path(__FILE__) . 'class-gutenberg-converter.php';
    57
    68class ContentPen_API
     
    190192    $this->kses_remove_filters();
    191193
     194    // Convert HTML content to Gutenberg blocks
     195    $content = ContentPen_Gutenberg_Converter::convert($params['content']);
     196
    192197    // Prepare post data
     198    // Note: Don't use wp_kses_post on $content as it strips Gutenberg block comments
    193199    $post_data = array(
    194200      'post_title' => sanitize_text_field($params['title']),
    195       'post_content' => wp_kses_post($params['content']),
     201      'post_content' => $content,
    196202      'post_status' => isset($params['status']) ? sanitize_text_field($params['status']) : 'draft',
    197203      'post_author' => isset($params['author']) ? (int)$params['author'] : get_current_user_id(),
     
    664670    }
    665671    if (isset($params['content'])) {
    666       $post_data['post_content'] = wp_kses_post($params['content']);
     672      // Convert HTML content to Gutenberg blocks
     673      // Note: Don't use wp_kses_post as it strips Gutenberg block comments
     674      $content = ContentPen_Gutenberg_Converter::convert($params['content']);
     675      $post_data['post_content'] = $content;
    667676    }
    668677    if (isset($params['status'])) {
Note: See TracChangeset for help on using the changeset viewer.