Changeset 3307604
- Timestamp:
- 06/06/2025 05:24:05 PM (10 months ago)
- Location:
- simple-cpt
- Files:
-
- 27 added
- 1 deleted
- 5 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/LICENSE.txt (added)
-
tags/1.1.0/README.txt (added)
-
tags/1.1.0/admin (added)
-
tags/1.1.0/admin/class-simple-cpt-admin.php (added)
-
tags/1.1.0/admin/css (added)
-
tags/1.1.0/admin/css/simple-cpt-admin.css (added)
-
tags/1.1.0/admin/index.php (added)
-
tags/1.1.0/admin/js (added)
-
tags/1.1.0/admin/js/simple-cpt-admin.js (added)
-
tags/1.1.0/admin/partials (added)
-
tags/1.1.0/admin/partials/simple-cpt-admin-display.php (added)
-
tags/1.1.0/admin/partials/simple-cpt-admin-footer.php (added)
-
tags/1.1.0/admin/partials/simple-cpt-metabox-cpt.php (added)
-
tags/1.1.0/admin/partials/simple-cpt-metabox-tax.php (added)
-
tags/1.1.0/includes (added)
-
tags/1.1.0/includes/class-simple-cpt-activator.php (added)
-
tags/1.1.0/includes/class-simple-cpt-deactivator.php (added)
-
tags/1.1.0/includes/class-simple-cpt-i18n.php (added)
-
tags/1.1.0/includes/class-simple-cpt-loader.php (added)
-
tags/1.1.0/includes/class-simple-cpt.php (added)
-
tags/1.1.0/includes/index.php (added)
-
tags/1.1.0/index.php (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/simple-cpt.pot (added)
-
tags/1.1.0/simple-cpt.php (added)
-
tags/1.1.0/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/partials/simple-cpt-admin-display.php (modified) (11 diffs)
-
trunk/includes/class-simple-cpt-activator.php (modified) (1 diff)
-
trunk/includes/class-simple-cpt.php (modified) (5 diffs)
-
trunk/public (deleted)
-
trunk/simple-cpt.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-cpt/trunk/README.txt
r3200000 r3307604 4 4 Tags: custom post type, simple cpt, cpt, taxonomies 5 5 Requires at least: 5.3.0 6 Tested up to: 6. 7.16 Tested up to: 6.8.1 7 7 Requires PHP: 7.0 8 Stable tag: 1. 0.68 Stable tag: 1.1.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 = When are custom Taxonomies needed? = 53 53 54 Your regular blog posts use Categories and Tags to create an organization structure. Those build-in taxonomies can also be linked to any custom post type you create with Simple CPT. However, the same organization doesn ’t necessarily make sense for all custom post types. For a "book" custom post type, ideally you’d like to have the option to specify the book’s author, the genre, publisher and other book-specific data. This is when you create custom taxonomies and you associate them with your custom post type(s).54 Your regular blog posts use Categories and Tags to create an organization structure. Those build-in taxonomies can also be linked to any custom post type you create with Simple CPT. However, the same organization doesn't necessarily make sense for all custom post types. For a "book" custom post type, ideally you'd like to have the option to specify the book's author, the genre, publisher and other book-specific data. This is when you create custom taxonomies and you associate them with your custom post type(s). 55 55 56 56 = Does "Simple CPT" require manual coding or file editing? = … … 71 71 72 72 == Changelog == 73 74 = 1.1.0 = 75 * Removed unnecessary public-facing assets and functionality 76 * Streamlined plugin structure for better performance 77 * Improved code organization 78 * Ensure Compatibility with WP v6.8 73 79 74 80 = 1.0.6 = -
simple-cpt/trunk/admin/partials/simple-cpt-admin-display.php
r2650125 r3307604 13 13 14 14 // Get all CPTs created by Simple CPT 15 $args = array( 15 $args = array( 16 16 'post_type' => 'simple_cpt', 17 17 'post_status' => 'publish', 18 18 ); 19 $loop = new WP_Query( $args ); 19 $loop = new WP_Query( $args ); 20 20 $simple_cpt = []; 21 21 $simple_cpt_names = []; 22 while ( $loop->have_posts() ) : $loop->the_post(); 22 while ( $loop->have_posts() ) : $loop->the_post(); 23 23 $simple_cpt[] = array ( 24 24 'ID' => get_the_ID(), … … 33 33 34 34 // Get all taxonomies created by Simple CPT 35 $args = array( 35 $args = array( 36 36 'post_type' => 'simple_tax', 37 37 'post_status' => 'publish', 38 38 ); 39 $loop = new WP_Query( $args ); 39 $loop = new WP_Query( $args ); 40 40 $simple_tax = []; 41 41 $simple_tax_names = []; 42 while ( $loop->have_posts() ) : $loop->the_post(); 42 while ( $loop->have_posts() ) : $loop->the_post(); 43 43 $simple_tax[] = array ( 44 44 'ID' => get_the_ID(), … … 69 69 <div class="simple_cpt_wrap"> 70 70 <div class="desc"> 71 <p><?php _e( 'Published custom post types and taxonomies created by Simple CPT are listed below', 'simple-cpt'); ?></p> 71 <p><?php _e( 'Published custom post types and taxonomies created by Simple CPT are listed below', 'simple-cpt'); ?></p> 72 72 </div> 73 73 <div class="top"> 74 74 <div class="box left"> 75 75 <div> 76 <h3><a href="<?php echo admin_url( 'post-new.php?post_type=simple_cpt' , 'https'); ?>"><?php _e( 'Custom Post Types', 'simple-cpt'); ?></a></h3>76 <h3><a href="<?php echo admin_url( 'post-new.php?post_type=simple_cpt' ); ?>"><?php _e( 'Custom Post Types', 'simple-cpt'); ?></a></h3> 77 77 <?php 78 78 if(!empty($simple_cpt)){ 79 79 foreach ( $simple_cpt as $cpt ) { 80 80 $icon = empty($cpt['icon']) ? '<span class="dashicons dashicons-admin-post"></span>' : '<span class="dashicons '.$cpt['icon'].'"></span>' ; 81 ?> 81 ?> 82 82 <div class="item-row"> 83 83 <div class="left"> … … 87 87 <div class="right"> 88 88 <a href="<?php echo get_edit_post_link($cpt['ID']); ?>" title="<?php echo sprintf( __('Edit %s custom post type', 'simple-cpt'), $cpt['singular']); ?>"><?php _e('Edit Type', 'simple-cpt'); ?></a> | <a href="<?php echo esc_url( add_query_arg(array( 'post_type' => $cpt['slug'] ), admin_url( 'edit.php' )) ); ?>" title="<?php echo sprintf( __('See all %s', 'simple-cpt'), $cpt['plural']); ?>"><?php _e('See Posts', 'simple-cpt'); ?></a> 89 89 90 90 </div> 91 91 </div> … … 98 98 </div> 99 99 <p class="add_new"> 100 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_cpt' , 'https'); ?>"><?php _e( 'New Custom Post Type', 'simple-cpt');?></a>100 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_cpt' ); ?>"><?php _e( 'New Custom Post Type', 'simple-cpt');?></a> 101 101 </p> 102 102 </div> 103 103 <div class="box right"> 104 104 <div> 105 <h3><a href="<?php echo admin_url( 'post-new.php?post_type=simple_tax' , 'https'); ?>"><?php _e( 'Custom Taxonomies', 'simple-cpt'); ?></a></h3>105 <h3><a href="<?php echo admin_url( 'post-new.php?post_type=simple_tax' ); ?>"><?php _e( 'Custom Taxonomies', 'simple-cpt'); ?></a></h3> 106 106 <?php 107 107 if(!empty($simple_tax)){ 108 108 foreach ( $simple_tax as $tax ) { 109 ?> 109 ?> 110 110 <div class="item-row"> 111 111 <div class="left"> … … 124 124 </div> 125 125 <p class="add_new"> 126 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_tax' , 'https'); ?>"><?php _e( 'New Custom Taxonomy', 'simple-cpt');?></a>126 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_tax' ); ?>"><?php _e( 'New Custom Taxonomy', 'simple-cpt');?></a> 127 127 </p> 128 128 </div> 129 129 </div> 130 130 <div class="desc"> 131 <p><?php _e( 'All other public custom post types and taxonomies created by Wordpress core, your themes and other plugins are listed below', 'simple-cpt'); ?></p> 131 <p><?php _e( 'All other public custom post types and taxonomies created by Wordpress core, your themes and other plugins are listed below', 'simple-cpt'); ?></p> 132 132 </div> 133 133 <div class="bottom"> … … 137 137 <?php 138 138 $post_types = get_post_types( array( 'public' => true, ), 'objects', 'and' ); 139 if ( $post_types ) { 139 if ( $post_types ) { 140 140 foreach ( $post_types as $post_type ) { 141 141 if ( !in_array($post_type->name, $simple_cpt_names) ) { 142 142 $icon = empty($post_type->menu_icon) ? '<span class="dashicons dashicons-admin-post"></span>' : '<span class="dashicons '.$post_type->menu_icon.'"></span>' ; 143 ?> 143 ?> 144 144 <div class="item-row"> 145 145 <div class="left"> … … 149 149 <div class="right"> 150 150 <a href="<?php echo esc_url( add_query_arg(array( 'post_type' => $post_type->name ), admin_url( 'edit.php' )) ); ?>" title="<?php echo sprintf( __('See all %s', 'simple-cpt'), $post_type->labels->name); ?>"><?php echo $post_type->labels->name; ?></a> 151 151 152 152 </div> 153 153 </div> … … 161 161 </div> 162 162 <p class="add_new"> 163 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_cpt' , 'https'); ?>"><?php _e( 'New Custom Post Type', 'simple-cpt');?></a>163 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_cpt' ); ?>"><?php _e( 'New Custom Post Type', 'simple-cpt');?></a> 164 164 </p> 165 165 </div> … … 168 168 <h3><?php _e( 'Other Custom Taxonomies', 'simple-cpt'); ?></h3> 169 169 <?php 170 $taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ), 'objects', 'and' ); 170 $taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ), 'objects', 'and' ); 171 171 if ( $taxonomies ) { 172 172 foreach ( $taxonomies as $tax ) { 173 173 if ( !in_array($tax->name, $simple_tax_names) ) { 174 ?> 174 ?> 175 175 <div class="item-row"> 176 176 <div class="left"> … … 190 190 </div> 191 191 <p class="add_new"> 192 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_tax' , 'https'); ?>"><?php _e( 'New Custom Taxonomy', 'simple-cpt');?></a>192 <a class="button" href="<?php echo admin_url( 'post-new.php?post_type=simple_tax' ); ?>"><?php _e( 'New Custom Taxonomy', 'simple-cpt');?></a> 193 193 </p> 194 194 </div> -
simple-cpt/trunk/includes/class-simple-cpt-activator.php
r3200000 r3307604 32 32 33 33 require_once plugin_dir_path( __DIR__ ) . 'admin/class-simple-cpt-admin.php'; 34 $plugin_admin = new Simple_Cpt_Admin( 'simple-cpt', '1. 0.6' );34 $plugin_admin = new Simple_Cpt_Admin( 'simple-cpt', '1.1.0' ); 35 35 36 36 $plugin_admin->simple_cpt_plugin_activate_flush_rewrite(); -
simple-cpt/trunk/includes/class-simple-cpt.php
r3200000 r3307604 70 70 $this->version = SIMPLE_CPT_VERSION; 71 71 } else { 72 $this->version = '1. 0.6';72 $this->version = '1.1.0'; 73 73 } 74 74 $this->plugin_name = 'simple-cpt'; … … 77 77 $this->set_locale(); 78 78 $this->define_admin_hooks(); 79 $this->define_public_hooks();80 79 } 81 80 … … 88 87 * - Simple_Cpt_i18n. Defines internationalization functionality. 89 88 * - Simple_Cpt_Admin. Defines all hooks for the admin area. 90 * - Simple_Cpt_Public. Defines all hooks for the public side of the site.91 89 * 92 90 * Create an instance of the loader which will be used to register the hooks … … 114 112 */ 115 113 require_once plugin_dir_path( __DIR__ ) . 'admin/class-simple-cpt-admin.php'; 116 117 /**118 * The class responsible for defining all actions that occur in the public-facing119 * side of the site.120 */121 require_once plugin_dir_path( __DIR__ ) . 'public/class-simple-cpt-public.php';122 114 123 115 $this->loader = new Simple_Cpt_Loader(); … … 175 167 176 168 /** 177 * Register all of the hooks related to the public-facing functionality178 * of the plugin.179 *180 * @since 1.0.0181 * @access private182 */183 private function define_public_hooks() {184 185 $plugin_public = new Simple_Cpt_Public( $this->get_plugin_name(), $this->get_version() );186 187 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );188 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );189 }190 191 /**192 169 * Run the loader to execute all of the hooks with WordPress. 193 170 * -
simple-cpt/trunk/simple-cpt.php
r3200000 r3307604 14 14 * Plugin URI: https://wordpress.org/plugins/simple-cpt/ 15 15 * Description: Simple CPT provides an easy to use interface for registering and managing Custom Post Types and Custom Taxonomies. 16 * Version: 1. 0.616 * Version: 1.1.0 17 17 * Requires at least: 5.3.0 18 * Tested up to: 6. 7.118 * Tested up to: 6.8.1 19 19 * Requires PHP: 7.0 20 20 * Author: George Pattichis … … 35 35 * Currently plugin version. 36 36 */ 37 define( 'SIMPLE_CPT_VERSION', '1. 0.6' );37 define( 'SIMPLE_CPT_VERSION', '1.1.0' ); 38 38 39 39 /** … … 64 64 65 65 /** 66 * The core plugin class that is used to define internationalization, 67 * admin-specific hooks, and public-facing site hooks. 66 * The core plugin class that is used to define internationalization and admin-specific hooks. 68 67 */ 69 68 require plugin_dir_path( __FILE__ ) . 'includes/class-simple-cpt.php';
Note: See TracChangeset
for help on using the changeset viewer.