Changeset 3117072
- Timestamp:
- 07/12/2024 01:52:32 PM (21 months ago)
- Location:
- seowriting
- Files:
-
- 2 edited
- 12 copied
-
tags/1.7.1 (copied) (copied from seowriting/trunk)
-
tags/1.7.1/assets (copied) (copied from seowriting/trunk/assets)
-
tags/1.7.1/assets/js/settings.js (copied) (copied from seowriting/trunk/assets/js/settings.js)
-
tags/1.7.1/classes (copied) (copied from seowriting/trunk/classes)
-
tags/1.7.1/classes/api-client.php (copied) (copied from seowriting/trunk/classes/api-client.php)
-
tags/1.7.1/classes/post-meta.php (copied) (copied from seowriting/trunk/classes/post-meta.php)
-
tags/1.7.1/readme.txt (copied) (copied from seowriting/trunk/readme.txt) (2 diffs)
-
tags/1.7.1/seowriting.php (copied) (copied from seowriting/trunk/seowriting.php) (4 diffs)
-
tags/1.7.1/tpl (copied) (copied from seowriting/trunk/tpl)
-
tags/1.7.1/tpl/settings/settings.tpl.php (copied) (copied from seowriting/trunk/tpl/settings/settings.tpl.php)
-
tags/1.7.1/uninstall.php (copied) (copied from seowriting/trunk/uninstall.php)
-
tags/1.7.1/utils.php (copied) (copied from seowriting/trunk/utils.php)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/seowriting.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seowriting/tags/1.7.1/readme.txt
r3112420 r3117072 2 2 Contributors: SEOWriting 3 3 Tags: seo writing, AI tool, AI writing, generation text 4 Tested up to: 6.5 4 Tested up to: 6.5.5 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.7. 07 Stable tag: 1.7.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.7.1 (2024/07/12) = 26 27 Feature: 28 * Paginated export posts to create knowledge base. 24 29 25 30 = 1.7.0 (2024/07/04) = -
seowriting/tags/1.7.1/seowriting.php
r3112420 r3117072 9 9 * Plugin Name: SEOWriting 10 10 * Description: SEOWriting - AI Writing Tool Plugin For Text Generation 11 * Version: 1.7. 011 * Version: 1.7.1 12 12 * Author: SEOWriting 13 13 * Author URI: https://seowriting.ai/?utm_source=wp_plugin … … 28 28 public $plugin_slug; 29 29 public $plugin_path; 30 public $version = '1.7. 0';30 public $version = '1.7.1'; 31 31 /** 32 32 * @var \SEOWriting\APIClient|null … … 423 423 $rs = [ 424 424 'result' => 1, 425 'posts' => $this->getPosts() 425 'posts' => $this->getPosts( 426 intval(isset($post['page']) ? sanitize_text_field($post['page']) : '1'), 427 intval(isset($post['per_page']) ? sanitize_text_field($post['per_page']) : '50') 428 ) 426 429 ]; 427 430 } elseif ($action === 'get_post') { … … 797 800 } 798 801 799 public function getPosts() 800 { 801 $pages = get_pages(); 802 $posts = array_merge(get_posts([ 803 'numberposts' => -1, 804 'post_type' => 'post', 805 ]), $pages === false ? [] : $pages); 806 802 public function getPosts($page = 1, $per_page = 50) 803 { 807 804 $result = []; 808 foreach ($posts as $post) { 809 if (!($post instanceof WP_Post) || $post->post_status !== 'publish') { 810 continue; 811 } 812 /** @var WP_Post $post */ 813 $result[] = [ 814 'id' => (int)$post->ID, 815 'content' => $post->post_content, 816 'title' => $post->post_title, 817 'url' => get_permalink($post->ID), 818 ]; 819 } 805 806 $query = new WP_Query([ 807 'post_type' => ['page', 'post'], 808 'post_status' => 'publish', 809 'posts_per_page' => $per_page, 810 'paged' => $page, 811 'order' => 'DESC', 812 'orderby' => 'ID' 813 ]); 814 if ($query->have_posts()) { 815 while ($query->have_posts()) { 816 $query->the_post(); 817 $result[] = [ 818 'id' => intval(get_the_ID()), 819 'content' => get_the_content(), 820 'title' => get_the_title(), 821 'url' => get_permalink() 822 ]; 823 } 824 } 825 wp_reset_postdata(); 820 826 821 827 return $result; -
seowriting/trunk/readme.txt
r3112420 r3117072 2 2 Contributors: SEOWriting 3 3 Tags: seo writing, AI tool, AI writing, generation text 4 Tested up to: 6.5 4 Tested up to: 6.5.5 5 5 Requires at least: 4.9 6 6 Requires PHP: 5.6.20 7 Stable tag: 1.7. 07 Stable tag: 1.7.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 == Changelog == 24 25 = 1.7.1 (2024/07/12) = 26 27 Feature: 28 * Paginated export posts to create knowledge base. 24 29 25 30 = 1.7.0 (2024/07/04) = -
seowriting/trunk/seowriting.php
r3112420 r3117072 9 9 * Plugin Name: SEOWriting 10 10 * Description: SEOWriting - AI Writing Tool Plugin For Text Generation 11 * Version: 1.7. 011 * Version: 1.7.1 12 12 * Author: SEOWriting 13 13 * Author URI: https://seowriting.ai/?utm_source=wp_plugin … … 28 28 public $plugin_slug; 29 29 public $plugin_path; 30 public $version = '1.7. 0';30 public $version = '1.7.1'; 31 31 /** 32 32 * @var \SEOWriting\APIClient|null … … 423 423 $rs = [ 424 424 'result' => 1, 425 'posts' => $this->getPosts() 425 'posts' => $this->getPosts( 426 intval(isset($post['page']) ? sanitize_text_field($post['page']) : '1'), 427 intval(isset($post['per_page']) ? sanitize_text_field($post['per_page']) : '50') 428 ) 426 429 ]; 427 430 } elseif ($action === 'get_post') { … … 797 800 } 798 801 799 public function getPosts() 800 { 801 $pages = get_pages(); 802 $posts = array_merge(get_posts([ 803 'numberposts' => -1, 804 'post_type' => 'post', 805 ]), $pages === false ? [] : $pages); 806 802 public function getPosts($page = 1, $per_page = 50) 803 { 807 804 $result = []; 808 foreach ($posts as $post) { 809 if (!($post instanceof WP_Post) || $post->post_status !== 'publish') { 810 continue; 811 } 812 /** @var WP_Post $post */ 813 $result[] = [ 814 'id' => (int)$post->ID, 815 'content' => $post->post_content, 816 'title' => $post->post_title, 817 'url' => get_permalink($post->ID), 818 ]; 819 } 805 806 $query = new WP_Query([ 807 'post_type' => ['page', 'post'], 808 'post_status' => 'publish', 809 'posts_per_page' => $per_page, 810 'paged' => $page, 811 'order' => 'DESC', 812 'orderby' => 'ID' 813 ]); 814 if ($query->have_posts()) { 815 while ($query->have_posts()) { 816 $query->the_post(); 817 $result[] = [ 818 'id' => intval(get_the_ID()), 819 'content' => get_the_content(), 820 'title' => get_the_title(), 821 'url' => get_permalink() 822 ]; 823 } 824 } 825 wp_reset_postdata(); 820 826 821 827 return $result;
Note: See TracChangeset
for help on using the changeset viewer.