Plugin Directory

Changeset 3270478


Ignore:
Timestamp:
04/10/2025 01:07:24 PM (12 months ago)
Author:
gaft
Message:

Update to version 1.21.0

Location:
augment-types
Files:
7 edited
10 copied

Legend:

Unmodified
Added
Removed
  • augment-types/tags/1.21.0/README.md

    r3264386 r3270478  
    11# Augment Types
    22
    3 Stable tag: 1.20.0
     3Stable tag: 1.21.0
    44Tested up to: 6.7.99 
    55Requires at least: 4.6 
  • augment-types/tags/1.21.0/augment-types.php

    r3264386 r3270478  
    77 * Author URI:  https://genealysontorcende.wordpress.com/
    88 * Description: Add essential functionalities to WordPress Post Types.
    9  * Version:     1.20.0
     9 * Version:     1.21.0
    1010 * License:     GNU General Public License v3.0
    1111 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • augment-types/tags/1.21.0/includes/Archive.php

    r3203335 r3270478  
    7575
    7676        foreach ( $types as $type ) {
    77             if ( in_array( $type->name, array( 'post', 'page', 'attachment' ), true ) || ! $type->rewrite ) {
     77            if ( in_array( $type->name, array( 'post', 'page', 'attachment' ), true ) ) {
     78                continue;
     79            }
     80
     81            if ( ! $type->rewrite ) {
    7882                continue;
    7983            }
     
    191195
    192196        if ( is_admin() || ! $query ) {
    193             return $query;
     197            return;
    194198        }
    195199
     
    197201
    198202        if ( ! $wp_query ) {
    199             return $query;
     203            return;
    200204        }
    201205
     
    209213            }
    210214        }
    211 
    212         return $query;
    213215
    214216    }
     
    319321            remove_action( 'save_post', array( $this, 'save_post' ) );
    320322            wp_update_post( $postarr );
    321             add_action( 'save_post', array( $this, 'save_post' ) );
     323            add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
    322324        }
    323325
     
    340342        $screen = get_current_screen();
    341343
    342         return ! ( null === $screen || ! in_array( $screen->base, array( 'edit', 'post' ), true ) );
     344        return null !== $screen && in_array( $screen->base, array( 'edit', 'post' ), true );
    343345
    344346    }
  • augment-types/tags/1.21.0/includes/Expire.php

    r3264386 r3270478  
    189189        $screen = get_current_screen();
    190190
    191         return ! ( null === $screen || ! in_array( $screen->base, array( 'edit', 'post' ), true ) );
     191        return null !== $screen && in_array( $screen->base, array( 'edit', 'post' ), true );
    192192
    193193    }
  • augment-types/tags/1.21.0/includes/Feature.php

    r2877642 r3270478  
    133133        }
    134134
    135         if ( ! post_type_supports( $screen->post_type, 'thumbnail' ) ) {
    136             return false;
    137         }
    138 
    139         return true;
     135        return post_type_supports( $screen->post_type, 'thumbnail' );
    140136
    141137    }
  • augment-types/tags/1.21.0/includes/Sort.php

    r3264386 r3270478  
    278278        }
    279279
    280         if ( isset( $_GET['orderby'] ) || isset( $_GET['paged'] ) ) {
    281             return false;
    282         }
    283 
    284         return true;
     280        return ! isset( $_GET['orderby'] ) && ! isset( $_GET['paged'] );
    285281
    286282    }
     
    355351
    356352        if ( $query->get( 'orderby' ) || $query->is_search() ) {
    357             return $query;
     353            return;
    358354        }
    359355
     
    365361        $query->set( 'orderby', $meta );
    366362
    367         return $query;
    368 
    369363    }
    370364
     
    372366    public function set_terms_order( $pieces, $taxonomies, $args ) {
    373367
    374         if ( ! ( ( is_admin() && isset( $_GET['orderby'] ) ) || ( isset( $args['ignore_term_order'] ) && true === $args['ignore_term_order'] ) ) ) {
     368        if ( ! ( is_admin() && isset( $_GET['orderby'] ) ) && ! ( isset( $args['ignore_term_order'] ) && true === $args['ignore_term_order'] ) ) {
    375369            $pieces['orderby'] = 'ORDER BY t.term_order ASC,  t.term_id';
    376370            $pieces['order']   = 'DESC';
  • augment-types/trunk/README.md

    r3264386 r3270478  
    11# Augment Types
    22
    3 Stable tag: 1.20.0
     3Stable tag: 1.21.0
    44Tested up to: 6.7.99 
    55Requires at least: 4.6 
  • augment-types/trunk/augment-types.php

    r3264386 r3270478  
    77 * Author URI:  https://genealysontorcende.wordpress.com/
    88 * Description: Add essential functionalities to WordPress Post Types.
    9  * Version:     1.20.0
     9 * Version:     1.21.0
    1010 * License:     GNU General Public License v3.0
    1111 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
  • augment-types/trunk/includes/Archive.php

    r3203335 r3270478  
    7575
    7676        foreach ( $types as $type ) {
    77             if ( in_array( $type->name, array( 'post', 'page', 'attachment' ), true ) || ! $type->rewrite ) {
     77            if ( in_array( $type->name, array( 'post', 'page', 'attachment' ), true ) ) {
     78                continue;
     79            }
     80
     81            if ( ! $type->rewrite ) {
    7882                continue;
    7983            }
     
    191195
    192196        if ( is_admin() || ! $query ) {
    193             return $query;
     197            return;
    194198        }
    195199
     
    197201
    198202        if ( ! $wp_query ) {
    199             return $query;
     203            return;
    200204        }
    201205
     
    209213            }
    210214        }
    211 
    212         return $query;
    213215
    214216    }
     
    319321            remove_action( 'save_post', array( $this, 'save_post' ) );
    320322            wp_update_post( $postarr );
    321             add_action( 'save_post', array( $this, 'save_post' ) );
     323            add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
    322324        }
    323325
     
    340342        $screen = get_current_screen();
    341343
    342         return ! ( null === $screen || ! in_array( $screen->base, array( 'edit', 'post' ), true ) );
     344        return null !== $screen && in_array( $screen->base, array( 'edit', 'post' ), true );
    343345
    344346    }
  • augment-types/trunk/includes/Expire.php

    r3264386 r3270478  
    189189        $screen = get_current_screen();
    190190
    191         return ! ( null === $screen || ! in_array( $screen->base, array( 'edit', 'post' ), true ) );
     191        return null !== $screen && in_array( $screen->base, array( 'edit', 'post' ), true );
    192192
    193193    }
  • augment-types/trunk/includes/Feature.php

    r2877642 r3270478  
    133133        }
    134134
    135         if ( ! post_type_supports( $screen->post_type, 'thumbnail' ) ) {
    136             return false;
    137         }
    138 
    139         return true;
     135        return post_type_supports( $screen->post_type, 'thumbnail' );
    140136
    141137    }
  • augment-types/trunk/includes/Sort.php

    r3264386 r3270478  
    278278        }
    279279
    280         if ( isset( $_GET['orderby'] ) || isset( $_GET['paged'] ) ) {
    281             return false;
    282         }
    283 
    284         return true;
     280        return ! isset( $_GET['orderby'] ) && ! isset( $_GET['paged'] );
    285281
    286282    }
     
    355351
    356352        if ( $query->get( 'orderby' ) || $query->is_search() ) {
    357             return $query;
     353            return;
    358354        }
    359355
     
    365361        $query->set( 'orderby', $meta );
    366362
    367         return $query;
    368 
    369363    }
    370364
     
    372366    public function set_terms_order( $pieces, $taxonomies, $args ) {
    373367
    374         if ( ! ( ( is_admin() && isset( $_GET['orderby'] ) ) || ( isset( $args['ignore_term_order'] ) && true === $args['ignore_term_order'] ) ) ) {
     368        if ( ! ( is_admin() && isset( $_GET['orderby'] ) ) && ! ( isset( $args['ignore_term_order'] ) && true === $args['ignore_term_order'] ) ) {
    375369            $pieces['orderby'] = 'ORDER BY t.term_order ASC,  t.term_id';
    376370            $pieces['order']   = 'DESC';
Note: See TracChangeset for help on using the changeset viewer.