Changeset 3075791
- Timestamp:
- 04/23/2024 01:00:21 PM (23 months ago)
- Location:
- easily-post-gpt
- Files:
-
- 33 added
- 2 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/LICENSE.txt (added)
-
tags/1.0.1/README.txt (added)
-
tags/1.0.1/admin (added)
-
tags/1.0.1/admin/class-gpt2wp-admin.php (added)
-
tags/1.0.1/admin/css (added)
-
tags/1.0.1/admin/css/gpt2wp-admin.css (added)
-
tags/1.0.1/admin/index.php (added)
-
tags/1.0.1/admin/js (added)
-
tags/1.0.1/admin/js/gpt2wp-admin.js (added)
-
tags/1.0.1/admin/partials (added)
-
tags/1.0.1/admin/partials/gpt2wp-admin-display.php (added)
-
tags/1.0.1/gpt2wp.php (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-gpt2wp-activator.php (added)
-
tags/1.0.1/includes/class-gpt2wp-deactivator.php (added)
-
tags/1.0.1/includes/class-gpt2wp-i18n.php (added)
-
tags/1.0.1/includes/class-gpt2wp-loader.php (added)
-
tags/1.0.1/includes/class-gpt2wp.php (added)
-
tags/1.0.1/includes/index.php (added)
-
tags/1.0.1/index.php (added)
-
tags/1.0.1/languages (added)
-
tags/1.0.1/languages/gpt2wp.pot (added)
-
tags/1.0.1/public (added)
-
tags/1.0.1/public/class-gpt2wp-public.php (added)
-
tags/1.0.1/public/css (added)
-
tags/1.0.1/public/css/gpt2wp-public.css (added)
-
tags/1.0.1/public/index.php (added)
-
tags/1.0.1/public/js (added)
-
tags/1.0.1/public/js/gpt2wp-public.js (added)
-
tags/1.0.1/public/partials (added)
-
tags/1.0.1/public/partials/gpt2wp-public-display.php (added)
-
tags/1.0.1/uninstall.php (added)
-
trunk/admin/class-gpt2wp-admin.php (modified) (3 diffs)
-
trunk/gpt2wp.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easily-post-gpt/trunk/admin/class-gpt2wp-admin.php
r3069299 r3075791 197 197 198 198 199 200 199 201 function gpt2wp_add_blogpost($request) { 200 202 … … 215 217 'post_title' => $post_title, 216 218 'post_content' => $post_content, 217 'post_category' => array(g et_cat_ID($post_category)),219 'post_category' => array(gpt2wp_category_make($post_category)), 218 220 'tags_input' => $post_tags, 219 221 'post_status' => 'publish', … … 487 489 return esc_attr(get_option('gpt2wp_custom_field_1')); 488 490 } 491 492 function gpt2wp_category_make($categoryName) { 493 494 $categoryExists = term_exists($categoryName, 'category'); 495 496 if ($categoryExists) { 497 498 return $categoryExists['term_id']; 499 } else { 500 501 $newCategory = wp_insert_term( 502 $categoryName, 503 'category' 504 ); 505 506 507 if (!is_wp_error($newCategory)) { 508 return $newCategory['term_id']; 509 } else { 510 511 $uncategorized = get_category_by_slug('uncategorized'); 512 return $uncategorized->term_id; 513 } 514 } 515 } -
easily-post-gpt/trunk/gpt2wp.php
r3069299 r3075791 17 17 * Plugin URI: https://gpttowp.com 18 18 * Description: Easily post from ChatGPT to your WP without writing any codes. 19 * Version: 1.0. 019 * Version: 1.0.1 20 20 * Author: Knowhalim 21 21 * Author URI: https://knowhalim.com/ … … 31 31 } 32 32 33 /**34 * Currently plugin version.35 * Start at version 1.0.0 and use SemVer - https://semver.org36 * Rename this for your plugin and update it as you release new versions.37 */38 define( 'GPT2WP_VERSION', '1.0.0' );39 33 40 /** 41 * The code that runs during plugin activation. 42 * This action is documented in includes/class-gpt2wp-activator.php 43 */ 34 define( 'GPT2WP_VERSION', '1.0.1' ); 35 36 44 37 function gpt2wp_activate_plugin() { 45 38 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gpt2wp-activator.php'; … … 47 40 } 48 41 49 /**50 * The code that runs during plugin deactivation.51 * This action is documented in includes/class-gpt2wp-deactivator.php52 */53 42 function gpt2wp_deactivate_plugin() { 54 43 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gpt2wp-deactivator.php'; … … 59 48 register_deactivation_hook( __FILE__, 'gpt2wp_deactivate_plugin' ); 60 49 61 /** 62 * The core plugin class that is used to define internationalization, 63 * admin-specific hooks, and public-facing site hooks. 64 */ 50 65 51 require plugin_dir_path( __FILE__ ) . 'includes/class-gpt2wp.php'; 66 52 67 /** 68 * Begins execution of the plugin. 69 * 70 * Since everything within the plugin is registered via hooks, 71 * then kicking off the plugin from this point in the file does 72 * not affect the page life cycle. 73 * 74 * @since 1.0.0 75 */ 53 76 54 function gpt2wp_start_run() { 77 55
Note: See TracChangeset
for help on using the changeset viewer.