Plugin Directory

Changeset 3084128


Ignore:
Timestamp:
05/09/2024 04:59:02 PM (23 months ago)
Author:
knowhalim
Message:

Filter content

Location:
easily-post-gpt
Files:
33 added
3 edited

Legend:

Unmodified
Added
Removed
  • easily-post-gpt/trunk/README.txt

    r3081139 r3084128  
    44Requires at least: 5.7
    55Tested up to: 6.5.2
    6 Stable tag: 1.0.6
     6Stable tag: 1.0.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • easily-post-gpt/trunk/admin/class-gpt2wp-admin.php

    r3081137 r3084128  
    116116}
    117117
     118function gpt2wp_replace_markdown_headers($content) {
     119
     120    $content = preg_replace('/(^|\n)### (.+)/', '$1<h3>$2</h3>', $content);
     121
     122
     123    $content = preg_replace('/(^|\n)## (.+)/', '$1<h2>$2</h2>', $content);
     124
     125 
     126    $content = preg_replace('/(^|\n)# (.+)/', '$1<h1>$2</h1>', $content);
     127
     128    return $content;
     129}
     130
     131// Apply the function to the content using the `the_content` filter.
     132add_filter('gpt2wp_content_post', 'gpt2wp_replace_markdown_headers',2,1);
    118133
    119134function gpt2wp_add_blogpost_endpoint() {
     
    127142add_action('rest_api_init', 'gpt2wp_add_blogpost_endpoint');
    128143       
     144
    129145function gpt2wp_check_api_key($request) {
    130146    $headers = apache_request_headers();
  • easily-post-gpt/trunk/gpt2wp.php

    r3081137 r3084128  
    1717 * Plugin URI:        https://gpttowp.com
    1818 * Description:       Easily post from ChatGPT to your WP without writing any codes.
    19  * Version:           1.0.6
     19 * Version:           1.0.7
    2020 * Author:            Knowhalim
    2121 * Author URI:        https://knowhalim.com/
     
    3232
    3333
    34 define( 'GPT2WP_VERSION', '1.0.6' );
     34define( 'GPT2WP_VERSION', '1.0.7' );
    3535
    3636
Note: See TracChangeset for help on using the changeset viewer.