Plugin Directory

Changeset 3307604


Ignore:
Timestamp:
06/06/2025 05:24:05 PM (10 months ago)
Author:
pattihis
Message:

Version 1.1.0

Location:
simple-cpt
Files:
27 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • simple-cpt/trunk/README.txt

    r3200000 r3307604  
    44Tags: custom post type, simple cpt, cpt, taxonomies
    55Requires at least: 5.3.0
    6 Tested up to: 6.7.1
     6Tested up to: 6.8.1
    77Requires PHP: 7.0
    8 Stable tag: 1.0.6
     8Stable tag: 1.1.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252= When are custom Taxonomies needed?  =
    5353
    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).
     54Your 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).
    5555
    5656= Does "Simple CPT" require manual coding or file editing? =
     
    7171
    7272== 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
    7379
    7480= 1.0.6 =
  • simple-cpt/trunk/admin/partials/simple-cpt-admin-display.php

    r2650125 r3307604  
    1313
    1414// Get all CPTs created by Simple CPT
    15 $args = array( 
     15$args = array(
    1616    'post_type' => 'simple_cpt',
    1717    'post_status' => 'publish',
    1818);
    19 $loop = new WP_Query( $args ); 
     19$loop = new WP_Query( $args );
    2020$simple_cpt = [];
    2121$simple_cpt_names = [];
    22 while ( $loop->have_posts() ) : $loop->the_post(); 
     22while ( $loop->have_posts() ) : $loop->the_post();
    2323    $simple_cpt[] = array (
    2424        'ID'            => get_the_ID(),
     
    3333
    3434// Get all taxonomies created by Simple CPT
    35 $args = array( 
     35$args = array(
    3636    'post_type' => 'simple_tax',
    3737    'post_status' => 'publish',
    3838);
    39 $loop = new WP_Query( $args ); 
     39$loop = new WP_Query( $args );
    4040$simple_tax = [];
    4141$simple_tax_names = [];
    42 while ( $loop->have_posts() ) : $loop->the_post(); 
     42while ( $loop->have_posts() ) : $loop->the_post();
    4343    $simple_tax[] = array (
    4444        'ID'        => get_the_ID(),
     
    6969<div class="simple_cpt_wrap">
    7070    <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>
    7272    </div>
    7373    <div class="top">
    7474        <div class="box left">
    7575            <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>
    7777        <?php
    7878            if(!empty($simple_cpt)){
    7979                foreach ( $simple_cpt  as $cpt ) {
    8080                    $icon = empty($cpt['icon']) ? '<span class="dashicons dashicons-admin-post"></span>' : '<span class="dashicons '.$cpt['icon'].'"></span>' ;
    81                 ?> 
     81                ?>
    8282                    <div class="item-row">
    8383                        <div class="left">
     
    8787                        <div class="right">
    8888                            <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
    9090                        </div>
    9191                    </div>
     
    9898            </div>
    9999            <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>
    101101            </p>
    102102        </div>
    103103        <div class="box right">
    104104            <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>
    106106        <?php
    107107            if(!empty($simple_tax)){
    108108                foreach ( $simple_tax  as $tax ) {
    109                 ?> 
     109                ?>
    110110                    <div class="item-row">
    111111                        <div class="left">
     
    124124            </div>
    125125            <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>
    127127            </p>
    128128        </div>
    129129    </div>
    130130    <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>
    132132    </div>
    133133    <div class="bottom">
     
    137137        <?php
    138138            $post_types = get_post_types( array( 'public' => true, ), 'objects', 'and' );
    139             if ( $post_types ) { 
     139            if ( $post_types ) {
    140140                foreach ( $post_types as $post_type ) {
    141141                    if ( !in_array($post_type->name, $simple_cpt_names) ) {
    142142                        $icon = empty($post_type->menu_icon) ? '<span class="dashicons dashicons-admin-post"></span>' : '<span class="dashicons '.$post_type->menu_icon.'"></span>' ;
    143                     ?> 
     143                    ?>
    144144                        <div class="item-row">
    145145                            <div class="left">
     
    149149                            <div class="right">
    150150                                <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
    152152                            </div>
    153153                        </div>
     
    161161            </div>
    162162            <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>
    164164            </p>
    165165        </div>
     
    168168                <h3><?php _e( 'Other Custom Taxonomies', 'simple-cpt'); ?></h3>
    169169        <?php
    170             $taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ), 'objects', 'and' ); 
     170            $taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ), 'objects', 'and' );
    171171            if ( $taxonomies ) {
    172172                foreach ( $taxonomies  as $tax ) {
    173173                    if ( !in_array($tax->name, $simple_tax_names) ) {
    174                     ?> 
     174                    ?>
    175175                        <div class="item-row">
    176176                            <div class="left">
     
    190190            </div>
    191191            <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>
    193193            </p>
    194194        </div>
  • simple-cpt/trunk/includes/class-simple-cpt-activator.php

    r3200000 r3307604  
    3232
    3333        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' );
    3535
    3636        $plugin_admin->simple_cpt_plugin_activate_flush_rewrite();
  • simple-cpt/trunk/includes/class-simple-cpt.php

    r3200000 r3307604  
    7070            $this->version = SIMPLE_CPT_VERSION;
    7171        } else {
    72             $this->version = '1.0.6';
     72            $this->version = '1.1.0';
    7373        }
    7474        $this->plugin_name = 'simple-cpt';
     
    7777        $this->set_locale();
    7878        $this->define_admin_hooks();
    79         $this->define_public_hooks();
    8079    }
    8180
     
    8887     * - Simple_Cpt_i18n. Defines internationalization functionality.
    8988     * - Simple_Cpt_Admin. Defines all hooks for the admin area.
    90      * - Simple_Cpt_Public. Defines all hooks for the public side of the site.
    9189     *
    9290     * Create an instance of the loader which will be used to register the hooks
     
    114112         */
    115113        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-facing
    119          * side of the site.
    120          */
    121         require_once plugin_dir_path( __DIR__ ) . 'public/class-simple-cpt-public.php';
    122114
    123115        $this->loader = new Simple_Cpt_Loader();
     
    175167
    176168    /**
    177      * Register all of the hooks related to the public-facing functionality
    178      * of the plugin.
    179      *
    180      * @since    1.0.0
    181      * @access   private
    182      */
    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     /**
    192169     * Run the loader to execute all of the hooks with WordPress.
    193170     *
  • simple-cpt/trunk/simple-cpt.php

    r3200000 r3307604  
    1414 * Plugin URI:        https://wordpress.org/plugins/simple-cpt/
    1515 * Description:       Simple CPT provides an easy to use interface for registering and managing Custom Post Types and Custom Taxonomies.
    16  * Version:           1.0.6
     16 * Version:           1.1.0
    1717 * Requires at least: 5.3.0
    18  * Tested up to:      6.7.1
     18 * Tested up to:      6.8.1
    1919 * Requires PHP:      7.0
    2020 * Author:            George Pattichis
     
    3535 * Currently plugin version.
    3636 */
    37 define( 'SIMPLE_CPT_VERSION', '1.0.6' );
     37define( 'SIMPLE_CPT_VERSION', '1.1.0' );
    3838
    3939/**
     
    6464
    6565/**
    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.
    6867 */
    6968require plugin_dir_path( __FILE__ ) . 'includes/class-simple-cpt.php';
Note: See TracChangeset for help on using the changeset viewer.