Plugin Directory

Changeset 3339401


Ignore:
Timestamp:
08/05/2025 06:03:23 AM (4 months ago)
Author:
totalpressorg
Message:

Update to version 5.0.7 from GitHub

Location:
custom-post-types
Files:
51 edited
1 copied

Legend:

Unmodified
Added
Removed
  • custom-post-types/assets/banner-1544x500.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/assets/banner-772x250.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/assets/icon-256x256.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/assets/screenshot-1.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/assets/screenshot-2.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/assets/screenshot-3.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/assets/screenshot-4.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • custom-post-types/tags/5.0.7/custom-post-types.php

    r3206477 r3339401  
    88Text Domain: custom-post-types
    99Domain Path: /languages/
    10 Version: 5.0.6
     10Version: 5.0.7
    1111*/
    1212
  • custom-post-types/tags/5.0.7/includes/abstracts/class-cpt-field.php

    r2989869 r3339401  
    1414        /** @var CPT_Field $field_class */
    1515        $field_class = get_called_class();
    16         if ( $field_class::get_type() == $meta_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     16        if ( $field_class::get_type() === $meta_type ) {
    1717            return $field_class::sanitize( $meta_value );
    1818        }
     
    3030        /** @var CPT_Field $field_class */
    3131        $field_class = get_called_class();
    32         if ( $field_class::get_type() == $meta_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     32        if ( $field_class::get_type() === $meta_type ) {
    3333            return $field_class::get( $meta_value );
    3434        }
  • custom-post-types/tags/5.0.7/includes/class-cpt-admin-notices.php

    r3055467 r3339401  
    2626                $notice   = $params['key'];
    2727                $duration = $params['duration'];
    28                 $this->dismiss_notice( $notice, ( 'lifetime' == $duration ? -1 : intval( $duration ) ) ); //phpcs:ignore Universal.Operators.StrictComparisons
     28                $this->dismiss_notice( $notice, ( 'lifetime' === $duration ? -1 : intval( $duration ) ) );
    2929                return 'OK';
    3030            },
     
    9696                    ! empty( $button['target'] ) ? $button['target'] : '_self',
    9797                    ! empty( $button['label'] ) ? esc_html( $button['label'] ) : '',
    98                     ! empty( $button['target'] ) && '_blank' == $button['target'] && ! $is_cta ? '<span class="dashicons dashicons-external"></span>' : '' //phpcs:ignore Universal.Operators.StrictComparisons
     98                    ! empty( $button['target'] ) && '_blank' === $button['target'] && ! $is_cta ? '<span class="dashicons dashicons-external"></span>' : ''
    9999                );
    100100            }
    101101        }
    102102        if ( $dismissible ) {
    103             $button_label     = true === $dismissible ? __( 'Dismiss notice', 'custom-post-types' ) : sprintf( __( 'Dismiss notice for %s days', 'custom-post-types' ), (int) $dismissible ); //phpcs:ignore Universal.Operators.StrictComparisons
     103            $button_label     = true === $dismissible ? __( 'Dismiss notice', 'custom-post-types' ) : sprintf( __( 'Dismiss notice for %s days', 'custom-post-types' ), (int) $dismissible );
    104104            $notice_buttons[] = sprintf(
    105105                '<a href="#" class="cpt-dismiss-notice" data-notice="%1$s" data-duration="%2$s" title="%3$s" aria-label="%3$s">%3$s</a>',
    106106                $id,
    107                 ( true === $dismissible ? 'lifetime' : $dismissible ), //phpcs:ignore Universal.Operators.StrictComparisons
     107                ( true === $dismissible ? 'lifetime' : $dismissible ),
    108108                $button_label
    109109            );
     
    146146            $type        = ! empty( get_post_meta( $notice->ID, 'type', true ) ) ? get_post_meta( $notice->ID, 'type', true ) : 'info';
    147147            $dismissable = ! empty( get_post_meta( $notice->ID, 'dismissible', true ) ) ? get_post_meta( $notice->ID, 'dismissible', true ) : false;
    148             $admin_only  = 'true' == get_post_meta( $notice->ID, 'admin_only', true ); //phpcs:ignore Universal.Operators.StrictComparisons
     148            $admin_only  = true === filter_var( get_post_meta( $notice->ID, 'admin_only', true ), FILTER_VALIDATE_BOOLEAN );
    149149            $buttons     = ! empty( get_post_meta( $notice->ID, 'buttons', true ) ) ? get_post_meta( $notice->ID, 'buttons', true ) : false;
    150150            if ( $dismissable < 0 ) {
  • custom-post-types/tags/5.0.7/includes/class-cpt-admin-pages.php

    r3055467 r3339401  
    6363            $page_order  = is_numeric( get_post_meta( $page->ID, 'order', true ) ) ? get_post_meta( $page->ID, 'order', true ) : null;
    6464            $page_icon   = ! empty( get_post_meta( $page->ID, 'menu_icon', true ) ) ? get_post_meta( $page->ID, 'menu_icon', true ) : '';
    65             $admin_only  = 'true' == get_post_meta( $page->ID, 'admin_only', true ); //phpcs:ignore Universal.Operators.StrictComparisons
     65            $admin_only  = true === filter_var( get_post_meta( $page->ID, 'admin_only', true ), FILTER_VALIDATE_BOOLEAN );
    6666            if ( $page_parent && stripos( $page_parent, '/' ) !== false ) {
    6767                $page_parent = explode( '/', $page_parent );
  • custom-post-types/tags/5.0.7/includes/class-cpt-core.php

    r2989869 r3339401  
    108108
    109109        include_once CPT_PATH . '/includes/compatibilities/v4.php';
    110 //      include_once CPT_PATH . '/includes/compatibilities/acf.php';
    111 //      include_once CPT_PATH . '/includes/compatibilities/saswp.php';
     110        //      include_once CPT_PATH . '/includes/compatibilities/acf.php';
     111        //      include_once CPT_PATH . '/includes/compatibilities/saswp.php';
    112112    }
    113113
  • custom-post-types/tags/5.0.7/includes/class-cpt-field-groups.php

    r3036818 r3339401  
    2828     */
    2929    private function sanitize_field_args( $field = array() ) {
    30         $field['required'] = ! empty( $field['required'] ) && 'true' == $field['required']; //phpcs:ignore Universal.Operators.StrictComparisons
     30        $field['required'] = ! empty( $field['required'] ) && true === filter_var( $field['required'], FILTER_VALIDATE_BOOLEAN );
    3131        if ( ! empty( $field['extra']['options'] ) && ! is_array( $field['extra']['options'] ) ) {
    3232            $field['extra']['options'] = cpt_utils()->get_options_from_string( $field['extra']['options'] );
    3333        }
    3434        foreach ( $field as $key => $value ) {
    35             if ( substr( $key, 0, 5 ) == 'wrap_' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     35            if ( 'wrap_' === substr( $key, 0, 5 ) ) {
    3636                if ( ! empty( $value ) ) {
    3737                    $field['wrap'][ str_replace( 'wrap_', '', $key ) ] = $value;
     
    3939                unset( $field[ $key ] );
    4040            }
     41        }
     42        if ( ! empty( $field['extra']['fields'] ) ) {
     43            $fields                   = array_map(
     44                array( $this, 'sanitize_field_args' ),
     45                $field['extra']['fields']
     46            );
     47            $field['extra']['fields'] = $fields;
    4148        }
    4249        return $field;
     
    7784            $position     = ! empty( get_post_meta( $group->ID, 'position', true ) ) ? get_post_meta( $group->ID, 'position', true ) : 'normal';
    7885            $order        = get_post_meta( $group->ID, 'order', true );
    79             $admin_only   = 'true' == get_post_meta( $group->ID, 'admin_only', true ); //phpcs:ignore Universal.Operators.StrictComparisons
    80             $show_in_rest = 'true' == get_post_meta( $group->ID, 'show_in_rest', true ); //phpcs:ignore Universal.Operators.StrictComparisons
     86            $admin_only   = true === filter_var( get_post_meta( $group->ID, 'admin_only', true ), FILTER_VALIDATE_BOOLEAN );
     87            $show_in_rest = true === filter_var( get_post_meta( $group->ID, 'show_in_rest', true ), FILTER_VALIDATE_BOOLEAN );
    8188            $fields       = ! empty( get_post_meta( $group->ID, 'fields', true ) ) ? array_map(
    8289                array( $this, 'sanitize_field_args' ),
  • custom-post-types/tags/5.0.7/includes/class-cpt-fields.php

    r3055467 r3339401  
    625625            return $meta_value;
    626626        }
    627         if ( ! is_string( $meta_value ) && ( ! cpt_utils()->is_rest() || 'the_content' == current_filter() ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     627        if ( ! is_string( $meta_value ) && ( ! cpt_utils()->is_rest() || 'the_content' === current_filter() ) ) {
    628628            if ( current_user_can( 'edit_posts' ) ) {
    629629                return sprintf(
  • custom-post-types/tags/5.0.7/includes/class-cpt-plugin.php

    r3206477 r3339401  
    5454     */
    5555    public function plugin_links( $actions, $plugin_file ) {
    56         if ( 'custom-post-types/custom-post-types.php' == $plugin_file ) { //phpcs:ignore Universal.Operators.StrictComparisons
     56        if ( 'custom-post-types/custom-post-types.php' === $plugin_file ) {
    5757            $actions[] = sprintf(
    5858                '<a href="%1$s" target="_blank" aria-label="%2$s"> %2$s </a>',
  • custom-post-types/tags/5.0.7/includes/class-cpt-post-types.php

    r3055467 r3339401  
    1616    public function __construct() {
    1717        if ( empty( $this->default_args ) ) {
    18             $this->default_args = cpt_utils()->get_args( 'post-types-default-args' );
     18            add_action(
     19                'init',
     20                function () {
     21                    $this->default_args = cpt_utils()->get_args( 'post-types-default-args' );
     22                }
     23            );
    1924        }
    2025        if ( empty( $this->default_labels ) ) {
    21             $this->default_labels = cpt_utils()->get_args( 'post-types-default-labels' );
     26            add_action(
     27                'init',
     28                function () {
     29                    $this->default_labels = cpt_utils()->get_args( 'post-types-default-labels' );
     30                }
     31            );
    2232        }
    2333    }
     
    7989        }
    8090        global $pagenow;
    81         if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] == $post_type ) { //phpcs:ignore Universal.Operators.StrictComparisons, WordPress.Security.NonceVerification
     91        if ( 'edit.php' === $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] === $post_type ) {
    8292            add_filter(
    8393                'manage_posts_columns',
     
    8999
    90100                    foreach ( $columns as $key => $args ) {
    91                         if ( 'title' == $key && empty( $args['label'] ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     101                        if ( 'title' === $key && empty( $args['label'] ) ) {
    92102                            $args['label'] = $stored_title_label;
    93103                        }
    94                         if ( 'date' == $key && empty( $args['label'] ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     104                        if ( 'date' === $key && empty( $args['label'] ) ) {
    95105                            $args['label'] = $stored_date_label;
    96106                        }
     
    142152            foreach ( $post_metas as $key => $value ) {
    143153                $single_meta = get_post_meta( $post_type->ID, $key, true );
    144                 if ( substr( $key, 0, 7 ) == 'labels_' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     154                if ( 'labels_' === substr( $key, 0, 7 ) ) {
    145155                    if ( ! empty( $single_meta ) ) {
    146156                        $post_type_labels[ str_replace( 'labels_', '', $key ) ] = $single_meta;
    147157                    }
    148                 } elseif ( substr( $key, 0, 1 ) == '_' || empty( $single_meta ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     158                } elseif ( '_' === substr( $key, 0, 1 ) || empty( $single_meta ) ) {
    149159                    unset( $post_metas[ $key ] );
    150160                } else {
    151                     $post_type_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( 'true' == $single_meta ) : $single_meta; //phpcs:ignore Universal.Operators.StrictComparisons
     161                    $post_type_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( true === filter_var( $single_meta, FILTER_VALIDATE_BOOLEAN ) ) : $single_meta;
    152162                }
    153163                unset( $post_metas[ $key ] );
     
    286296            }
    287297            $id = ! empty( $post_type['id'] ) && is_string( $post_type['id'] ) ? $post_type['id'] : false;
    288             if ( $id == $post_type_id ) {
     298            if ( $id === $post_type_id ) {
    289299                $flush_rewrite_rules = true;
    290300            }
  • custom-post-types/tags/5.0.7/includes/class-cpt-taxonomies.php

    r2989869 r3339401  
    1212    public function __construct() {
    1313        if ( empty( $this->default_args ) ) {
    14             $this->default_args = cpt_utils()->get_args( 'taxonomies-default-args' );
     14            add_action(
     15                'init',
     16                function () {
     17                    $this->default_args = cpt_utils()->get_args( 'taxonomies-default-args' );
     18                }
     19            );
    1520        }
    1621        if ( empty( $this->default_labels ) ) {
    17             $this->default_labels = cpt_utils()->get_args( 'taxonomies-default-labels' );
     22            add_action(
     23                'init',
     24                function () {
     25                    $this->default_labels = cpt_utils()->get_args( 'taxonomies-default-labels' );
     26                }
     27            );
    1828        }
    1929    }
     
    8999            foreach ( $post_metas as $key => $value ) {
    90100                $single_meta = get_post_meta( $taxonomy->ID, $key, true );
    91                 if ( substr( $key, 0, 7 ) == 'labels_' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     101                if ( 'labels_' === substr( $key, 0, 7 ) ) {
    92102                    if ( ! empty( $single_meta ) ) {
    93103                        $taxonomy_labels[ str_replace( 'labels_', '', $key ) ] = $single_meta;
    94104                    }
    95                 } elseif ( substr( $key, 0, 1 ) == '_' || empty( $single_meta ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     105                } elseif ( '_' === substr( $key, 0, 1 ) || empty( $single_meta ) ) {
    96106                    unset( $post_metas[ $key ] );
    97107                } else {
    98                     $taxonomy_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( 'true' == $single_meta ) : $single_meta; //phpcs:ignore Universal.Operators.StrictComparisons
     108                    $taxonomy_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( true === filter_var( $single_meta, FILTER_VALIDATE_BOOLEAN ) ) : $single_meta;
    99109                }
    100110                unset( $post_metas[ $key ] );
     
    229239            }
    230240            $id = ! empty( $taxonomy['id'] ) && is_string( $taxonomy['id'] ) ? $taxonomy['id'] : false;
    231             if ( $id == $taxonomy_id ) {
     241            if ( $id === $taxonomy_id ) {
    232242                $flush_rewrite_rules = true;
    233243            }
  • custom-post-types/tags/5.0.7/includes/class-cpt-ui.php

    r3206477 r3339401  
    3131     */
    3232    public function add_feedback_modal() {
    33         if ( get_current_screen()->id == 'plugins' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     33        if ( 'plugins' === get_current_screen()->id ) {
    3434            require_once CPT_PATH . '/includes/templates/modal-feedback.php';
    3535        }
     
    8787        }
    8888
    89         $action = ! empty( $_GET['action'] ) && 'cpt-feedback' == $_GET['action'] ? $_GET['action'] : false; //phpcs:ignore Universal.Operators.StrictComparisons
     89        $action = ! empty( $_GET['action'] ) && 'cpt-feedback' === $_GET['action'] ? $_GET['action'] : false;
    9090        if ( ! $action ) {
    9191            return;
     
    129129        $field_group_id = $field_group['id'];
    130130        if (
    131             'id' == $meta_key && //phpcs:ignore Universal.Operators.StrictComparisons
     131            'id' === $meta_key &&
    132132            in_array( $field_group_id, array( CPT_UI_PREFIX, CPT_UI_PREFIX . '_tax', CPT_UI_PREFIX . '_field', CPT_UI_PREFIX . '_page', CPT_UI_PREFIX . '_notice' ), true )
    133133        ) {
     
    145145        $post_type   = get_post( $post_id )->post_type;
    146146        $post_status = get_post( $post_id )->post_status;
    147         if ( ! in_array( $post_type, $this->no_title_post_types, true ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || 'trash' == $post_status ) { //phpcs:ignore Universal.Operators.StrictComparisons
     147        if ( ! in_array( $post_type, $this->no_title_post_types, true ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || 'trash' === $post_status ) {
    148148            return $post_id;
    149149        }
  • custom-post-types/tags/5.0.7/includes/class-cpt-utils.php

    r3055467 r3339401  
    196196    public function get_post_title_with_parents( $post_id = 0, $title = '' ) {
    197197        $post = get_post( $post_id );
    198         if ( 0 == $post_id || ! $post ) { //phpcs:ignore Universal.Operators.StrictComparisons
     198        if ( 0 === $post_id || ! $post ) {
    199199            return $title;
    200200        }
    201201        $title = empty( $title ) ? $post->post_title : $title;
    202         if ( 0 == $post->post_parent ) { //phpcs:ignore Universal.Operators.StrictComparisons
     202        if ( 0 === $post->post_parent ) {
    203203            return $title;
    204204        }
     
    215215    public function get_term_title_with_parents( $term_id = 0, $title = '' ) {
    216216        $term = get_term( $term_id );
    217         if ( 0 == $term_id || ! $term ) { //phpcs:ignore Universal.Operators.StrictComparisons
     217        if ( 0 === $term_id || ! $term ) {
    218218            return $title;
    219219        }
    220220        $title = empty( $title ) ? $term->name : $title;
    221         if ( 0 == $term->parent ) { //phpcs:ignore Universal.Operators.StrictComparisons
     221        if ( 0 === $term->parent ) {
    222222            return $title;
    223223        }
     
    232232        $prefix = rest_get_url_prefix();
    233233        if (
    234             defined( 'REST_REQUEST' ) &&
    235             REST_REQUEST ||
    236             isset( $_GET['rest_route'] ) && //phpcs:ignore WordPress.Security.NonceVerification
    237             0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) //phpcs:ignore WordPress.Security.NonceVerification
     234            ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
     235            ( isset( $_GET['rest_route'] ) && 0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) ) //phpcs:ignore WordPress.Security.NonceVerification
    238236        ) {
    239237            return true;
     
    456454                empty( $registered_menu[2] ) || // error
    457455                strpos( $registered_menu[2], '.php' ) !== false || // core page
    458                 ( ! empty( $registered_menu[4] ) && 'wp-menu-separator' == $registered_menu[4] )  //phpcs:ignore Universal.Operators.StrictComparisons
     456                ( ! empty( $registered_menu[4] ) && 'wp-menu-separator' === $registered_menu[4] )
    459457            ) {
    460458                continue;
     
    598596            'type'     => 'select',
    599597            'extra'    => array(
    600                 'placeholder' => ( 'NO' == $default_value ? $no : $yes ) . $default_label, //phpcs:ignore Universal.Operators.StrictComparisons
     598                'placeholder' => ( 'NO' === $default_value ? $no : $yes ) . $default_label,
    601599                'multiple'    => false,
    602600                'options'     => array(
    603                     'true'  => $yes . ( 'NO' == $default_value ? '' : $default_label ), //phpcs:ignore Universal.Operators.StrictComparisons
    604                     'false' => $no . ( 'NO' == $default_value ? $default_label : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     601                    'true'  => $yes . ( 'NO' === $default_value ? '' : $default_label ),
     602                    'false' => $no . ( 'NO' === $default_value ? $default_label : '' ),
    605603                ),
    606604            ),
     
    643641     */
    644642    public function get_ui_min_field( $wrap_width = '', $type = 'number' ) {
    645         $extra = 'number' == $type ? array(
     643        $extra = 'number' === $type ? array(
    646644            'min'         => '0',
    647645            'placeholder' => '0',
     
    670668     */
    671669    public function get_ui_max_field( $wrap_width = '', $type = 'number' ) {
    672         $extra = 'number' == $type ? array( 'min' => '0' ) : array();
     670        $extra = 'number' === $type ? array( 'min' => '0' ) : array();
    673671        return array(
    674672            'key'      => 'max',
  • custom-post-types/tags/5.0.7/includes/compatibilities/saswp.php

    r2989869 r3339401  
    2222            foreach ( $fields as $field_config ) {
    2323                if (
    24                     'file' == $field_config['type'] &&
     24                    'file' === $field_config['type'] &&
    2525                    2 > count( $field_config['extra']['types'] ) &&
    2626                (
    2727                    empty( $field_config['extra']['types'][0] ) ||
    28                     'image' == $field_config['extra']['types'][0]
     28                    'image' === $field_config['extra']['types'][0]
    2929                )
    3030                ) {
     
    7676        $field_object = cpt_fields()->get_field_object( $field, \CPT_Field_Groups::SUPPORT_TYPE_CPT, $post->post_type );
    7777        if (
    78             'file' == $field_object['type'] &&
     78            'file' === $field_object['type'] &&
    7979            2 > count( $field_object['extra']['types'] ) &&
    8080            (
    8181                empty( $field_object['extra']['types'][0] ) ||
    82                 'image' == $field_object['extra']['types'][0]
     82                'image' === $field_object['extra']['types'][0]
    8383            )
    8484        ) {
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-color.php

    r2989869 r3339401  
    4848            $input_id,
    4949            $field_config['value'],
    50             ! empty( $field_config['extra']['alpha'] ) && 'true' == $field_config['extra']['alpha'] ? ' data-alpha-enabled="true" data-alpha-color-type="hex"' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     50            ! empty( $field_config['extra']['alpha'] ) && true === filter_var( $field_config['extra']['alpha'], FILTER_VALIDATE_BOOLEAN ) ? ' data-alpha-enabled="true" data-alpha-color-type="hex"' : '',
    5151            ! empty( $field_config['required'] ) ? ' required' : ''
    5252        );
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-file.php

    r3055467 r3339401  
    113113        $file_types = explode( '/', $file_type );
    114114        $main_type  = isset( $file_types[0] ) ? $file_types[0] : false;
    115         if ( $main_type && 'image' == $main_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     115        if ( $main_type && 'image' === $main_type ) {
    116116            return wp_get_attachment_image( $meta_value, 'full' );
    117117        }
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-post-rel.php

    r2989869 r3339401  
    7979        }
    8080
     81        $multiple = ! empty( $field_config['extra']['multiple'] ) && true === filter_var( $field_config['extra']['multiple'], FILTER_VALIDATE_BOOLEAN );
     82
    8183        return sprintf(
    8284            '<select name="%s" id="%s" autocomplete="off" aria-autocomplete="none" style="width: 100%%;"%s%s data-type="%s"%s>%s</select>',
    83             $input_name . ( ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? '[]' : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     85            $input_name . ( $multiple ? '[]' : '' ),
    8486            $input_id,
    8587            ! empty( $field_config['extra']['placeholder'] ) ? ' placeholder="' . $field_config['extra']['placeholder'] . '"' : '',
    86             ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? ' multiple' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     88            $multiple ? ' multiple' : '',
    8789            ! empty( $field_config['extra']['post_type'] ) ? $field_config['extra']['post_type'] : 'post',
    8890            ! empty( $field_config['required'] ) ? ' required' : '',
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-radio.php

    r3055467 r3339401  
    5454                $input_name, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5555                $value, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    56                 $value == $field_config['value'] ? ' checked="checked"' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     56                $value === $field_config['value'] ? ' checked="checked"' : '',
    5757                ! empty( $field_config['required'] ) ? ' required' : '',
    5858                $label //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-repeater.php

    r3055467 r3339401  
    4242            data-fields="<?php echo htmlspecialchars( wp_json_encode( $fields ), ENT_QUOTES, 'UTF-8' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
    4343            data-parent="<?php echo $parent_base; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
    44             data-fields-group="<?php esc_attr_e( $fields_group_id ); ?>"
     44            data-fields-group="<?php echo esc_attr( $fields_group_id ); ?>"
    4545        >
    4646            <?php
     
    8686                <?php
    8787                foreach ( $fields as $i => $field ) {
    88                     if ( CPT_UI_PREFIX . '_field' == $fields_group_id && 5 == $i ) { //phpcs:ignore Universal.Operators.StrictComparisons
     88                    if ( CPT_UI_PREFIX . '_field' === $fields_group_id && 5 === $i ) {
    8989                        ?>
    9090                        <div class="cpt-repeater-extra">
     
    228228        $field_group_id = $field_group['id'];
    229229        if (
    230             'fields' == $meta_key && //phpcs:ignore Universal.Operators.StrictComparisons
    231             CPT_UI_PREFIX . '_field' == $field_group_id && //phpcs:ignore Universal.Operators.StrictComparisons
     230            'fields' === $meta_key &&
     231            CPT_UI_PREFIX . '_field' === $field_group_id &&
    232232            ! empty( $meta_value )
    233233        ) {
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-select.php

    r2989869 r3339401  
    5959    public static function render( $input_name, $input_id, $field_config ) {
    6060        $options = '';
    61         if ( 'true' != $field_config['extra']['multiple'] ) {
     61
     62        $multiple = ! empty( $field_config['extra']['multiple'] ) && true === filter_var( $field_config['extra']['multiple'], FILTER_VALIDATE_BOOLEAN );
     63
     64        if ( ! $multiple ) {
    6265            $options .= '<option value=""></option>';
    6366        }
     
    7073                        $child_value,
    7174                        ( is_array( $field_config['value'] ) && in_array( $child_value, $field_config['value'], true ) ) ||
    72                         ( ! is_array( $field_config['value'] ) && $child_value == $field_config['value'] ) ? //phpcs:ignore Universal.Operators.StrictComparisons
     75                        ( ! is_array( $field_config['value'] ) && $child_value === $field_config['value'] ) ?
    7376                            '  selected="selected"' :
    7477                            '',
     
    8689                    $value,
    8790                    ( is_array( $field_config['value'] ) && in_array( $value, $field_config['value'], true ) ) ||
    88                     ( ! is_array( $field_config['value'] ) && $value == $field_config['value'] ) ? //phpcs:ignore Universal.Operators.StrictComparisons
     91                    ( ! is_array( $field_config['value'] ) && $value === $field_config['value'] ) ?
    8992                        '  selected="selected"' :
    9093                        '',
     
    9396            }
    9497        }
     98
    9599        return sprintf(
    96100            '<select name="%s" id="%s" autocomplete="off" aria-autocomplete="none" style="width: 100%%;"%s%s%s>%s</select>',
    97             $input_name . ( ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? '[]' : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     101            $input_name . ( $multiple ? '[]' : '' ),
    98102            $input_id,
    99103            ! empty( $field_config['extra']['placeholder'] ) ? ' placeholder="' . $field_config['extra']['placeholder'] . '"' : '',
    100             ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? ' multiple' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     104            $multiple ? ' multiple' : '',
    101105            ! empty( $field_config['required'] ) ? ' required' : '',
    102106            $options
  • custom-post-types/tags/5.0.7/includes/fields/class-cpt-field-tax-rel.php

    r2989869 r3339401  
    7979        }
    8080
     81        $multiple = ! empty( $field_config['extra']['multiple'] ) && true === filter_var( $field_config['extra']['multiple'], FILTER_VALIDATE_BOOLEAN );
     82
    8183        return sprintf(
    8284            '<select name="%s" id="%s" autocomplete="off" aria-autocomplete="none" style="width: 100%%;"%s%s data-type="%s"%s>%s</select>',
    83             $input_name . ( ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? '[]' : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     85            $input_name . ( $multiple ? '[]' : '' ),
    8486            $input_id,
    8587            ! empty( $field_config['extra']['placeholder'] ) ? ' placeholder="' . $field_config['extra']['placeholder'] . '"' : '',
    86             ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? ' multiple' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     88            $multiple ? ' multiple' : '',
    8789            ! empty( $field_config['extra']['taxonomy'] ) ? $field_config['extra']['taxonomy'] : 'category',
    8890            ! empty( $field_config['required'] ) ? ' required' : '',
  • custom-post-types/tags/5.0.7/includes/templates/page-tools.php

    r3055467 r3339401  
    2525
    2626$is_current = function ( $current ) use ( $requested_page ) {
    27     return $current == $requested_page; //phpcs:ignore Universal.Operators.StrictComparisons
     27    return $current === $requested_page;
    2828};
    2929?>
  • custom-post-types/tags/5.0.7/readme.txt

    r3206479 r3339401  
    44Donate link: https://totalpress.org/donate?utm_source=wordpress_org&utm_medium=plugin_page&utm_campaign=custom_post_types
    55Requires at least: 4.0
    6 Tested up to: 6.7
    7 Stable tag: 5.0.6
     6Tested up to: 6.8
     7Stable tag: 5.0.7
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    188188== Changelog ==
    189189
    190 = 5.0.6 - 2024-04-03 =
     190= 5.0.7 - 2025-08-04 =
     191* FIX: sanitize dropdown options on field groups;
     192
     193= 5.0.6 - 2024-12-11 =
    191194* FIX: version_compare first argument null;
    192195* FIX: check if class exist before short load using functions.php;
  • custom-post-types/trunk/custom-post-types.php

    r3206477 r3339401  
    88Text Domain: custom-post-types
    99Domain Path: /languages/
    10 Version: 5.0.6
     10Version: 5.0.7
    1111*/
    1212
  • custom-post-types/trunk/includes/abstracts/class-cpt-field.php

    r2989869 r3339401  
    1414        /** @var CPT_Field $field_class */
    1515        $field_class = get_called_class();
    16         if ( $field_class::get_type() == $meta_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     16        if ( $field_class::get_type() === $meta_type ) {
    1717            return $field_class::sanitize( $meta_value );
    1818        }
     
    3030        /** @var CPT_Field $field_class */
    3131        $field_class = get_called_class();
    32         if ( $field_class::get_type() == $meta_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     32        if ( $field_class::get_type() === $meta_type ) {
    3333            return $field_class::get( $meta_value );
    3434        }
  • custom-post-types/trunk/includes/class-cpt-admin-notices.php

    r3055467 r3339401  
    2626                $notice   = $params['key'];
    2727                $duration = $params['duration'];
    28                 $this->dismiss_notice( $notice, ( 'lifetime' == $duration ? -1 : intval( $duration ) ) ); //phpcs:ignore Universal.Operators.StrictComparisons
     28                $this->dismiss_notice( $notice, ( 'lifetime' === $duration ? -1 : intval( $duration ) ) );
    2929                return 'OK';
    3030            },
     
    9696                    ! empty( $button['target'] ) ? $button['target'] : '_self',
    9797                    ! empty( $button['label'] ) ? esc_html( $button['label'] ) : '',
    98                     ! empty( $button['target'] ) && '_blank' == $button['target'] && ! $is_cta ? '<span class="dashicons dashicons-external"></span>' : '' //phpcs:ignore Universal.Operators.StrictComparisons
     98                    ! empty( $button['target'] ) && '_blank' === $button['target'] && ! $is_cta ? '<span class="dashicons dashicons-external"></span>' : ''
    9999                );
    100100            }
    101101        }
    102102        if ( $dismissible ) {
    103             $button_label     = true === $dismissible ? __( 'Dismiss notice', 'custom-post-types' ) : sprintf( __( 'Dismiss notice for %s days', 'custom-post-types' ), (int) $dismissible ); //phpcs:ignore Universal.Operators.StrictComparisons
     103            $button_label     = true === $dismissible ? __( 'Dismiss notice', 'custom-post-types' ) : sprintf( __( 'Dismiss notice for %s days', 'custom-post-types' ), (int) $dismissible );
    104104            $notice_buttons[] = sprintf(
    105105                '<a href="#" class="cpt-dismiss-notice" data-notice="%1$s" data-duration="%2$s" title="%3$s" aria-label="%3$s">%3$s</a>',
    106106                $id,
    107                 ( true === $dismissible ? 'lifetime' : $dismissible ), //phpcs:ignore Universal.Operators.StrictComparisons
     107                ( true === $dismissible ? 'lifetime' : $dismissible ),
    108108                $button_label
    109109            );
     
    146146            $type        = ! empty( get_post_meta( $notice->ID, 'type', true ) ) ? get_post_meta( $notice->ID, 'type', true ) : 'info';
    147147            $dismissable = ! empty( get_post_meta( $notice->ID, 'dismissible', true ) ) ? get_post_meta( $notice->ID, 'dismissible', true ) : false;
    148             $admin_only  = 'true' == get_post_meta( $notice->ID, 'admin_only', true ); //phpcs:ignore Universal.Operators.StrictComparisons
     148            $admin_only  = true === filter_var( get_post_meta( $notice->ID, 'admin_only', true ), FILTER_VALIDATE_BOOLEAN );
    149149            $buttons     = ! empty( get_post_meta( $notice->ID, 'buttons', true ) ) ? get_post_meta( $notice->ID, 'buttons', true ) : false;
    150150            if ( $dismissable < 0 ) {
  • custom-post-types/trunk/includes/class-cpt-admin-pages.php

    r3055467 r3339401  
    6363            $page_order  = is_numeric( get_post_meta( $page->ID, 'order', true ) ) ? get_post_meta( $page->ID, 'order', true ) : null;
    6464            $page_icon   = ! empty( get_post_meta( $page->ID, 'menu_icon', true ) ) ? get_post_meta( $page->ID, 'menu_icon', true ) : '';
    65             $admin_only  = 'true' == get_post_meta( $page->ID, 'admin_only', true ); //phpcs:ignore Universal.Operators.StrictComparisons
     65            $admin_only  = true === filter_var( get_post_meta( $page->ID, 'admin_only', true ), FILTER_VALIDATE_BOOLEAN );
    6666            if ( $page_parent && stripos( $page_parent, '/' ) !== false ) {
    6767                $page_parent = explode( '/', $page_parent );
  • custom-post-types/trunk/includes/class-cpt-core.php

    r2989869 r3339401  
    108108
    109109        include_once CPT_PATH . '/includes/compatibilities/v4.php';
    110 //      include_once CPT_PATH . '/includes/compatibilities/acf.php';
    111 //      include_once CPT_PATH . '/includes/compatibilities/saswp.php';
     110        //      include_once CPT_PATH . '/includes/compatibilities/acf.php';
     111        //      include_once CPT_PATH . '/includes/compatibilities/saswp.php';
    112112    }
    113113
  • custom-post-types/trunk/includes/class-cpt-field-groups.php

    r3036818 r3339401  
    2828     */
    2929    private function sanitize_field_args( $field = array() ) {
    30         $field['required'] = ! empty( $field['required'] ) && 'true' == $field['required']; //phpcs:ignore Universal.Operators.StrictComparisons
     30        $field['required'] = ! empty( $field['required'] ) && true === filter_var( $field['required'], FILTER_VALIDATE_BOOLEAN );
    3131        if ( ! empty( $field['extra']['options'] ) && ! is_array( $field['extra']['options'] ) ) {
    3232            $field['extra']['options'] = cpt_utils()->get_options_from_string( $field['extra']['options'] );
    3333        }
    3434        foreach ( $field as $key => $value ) {
    35             if ( substr( $key, 0, 5 ) == 'wrap_' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     35            if ( 'wrap_' === substr( $key, 0, 5 ) ) {
    3636                if ( ! empty( $value ) ) {
    3737                    $field['wrap'][ str_replace( 'wrap_', '', $key ) ] = $value;
     
    3939                unset( $field[ $key ] );
    4040            }
     41        }
     42        if ( ! empty( $field['extra']['fields'] ) ) {
     43            $fields                   = array_map(
     44                array( $this, 'sanitize_field_args' ),
     45                $field['extra']['fields']
     46            );
     47            $field['extra']['fields'] = $fields;
    4148        }
    4249        return $field;
     
    7784            $position     = ! empty( get_post_meta( $group->ID, 'position', true ) ) ? get_post_meta( $group->ID, 'position', true ) : 'normal';
    7885            $order        = get_post_meta( $group->ID, 'order', true );
    79             $admin_only   = 'true' == get_post_meta( $group->ID, 'admin_only', true ); //phpcs:ignore Universal.Operators.StrictComparisons
    80             $show_in_rest = 'true' == get_post_meta( $group->ID, 'show_in_rest', true ); //phpcs:ignore Universal.Operators.StrictComparisons
     86            $admin_only   = true === filter_var( get_post_meta( $group->ID, 'admin_only', true ), FILTER_VALIDATE_BOOLEAN );
     87            $show_in_rest = true === filter_var( get_post_meta( $group->ID, 'show_in_rest', true ), FILTER_VALIDATE_BOOLEAN );
    8188            $fields       = ! empty( get_post_meta( $group->ID, 'fields', true ) ) ? array_map(
    8289                array( $this, 'sanitize_field_args' ),
  • custom-post-types/trunk/includes/class-cpt-fields.php

    r3055467 r3339401  
    625625            return $meta_value;
    626626        }
    627         if ( ! is_string( $meta_value ) && ( ! cpt_utils()->is_rest() || 'the_content' == current_filter() ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     627        if ( ! is_string( $meta_value ) && ( ! cpt_utils()->is_rest() || 'the_content' === current_filter() ) ) {
    628628            if ( current_user_can( 'edit_posts' ) ) {
    629629                return sprintf(
  • custom-post-types/trunk/includes/class-cpt-plugin.php

    r3206477 r3339401  
    5454     */
    5555    public function plugin_links( $actions, $plugin_file ) {
    56         if ( 'custom-post-types/custom-post-types.php' == $plugin_file ) { //phpcs:ignore Universal.Operators.StrictComparisons
     56        if ( 'custom-post-types/custom-post-types.php' === $plugin_file ) {
    5757            $actions[] = sprintf(
    5858                '<a href="%1$s" target="_blank" aria-label="%2$s"> %2$s </a>',
  • custom-post-types/trunk/includes/class-cpt-post-types.php

    r3055467 r3339401  
    1616    public function __construct() {
    1717        if ( empty( $this->default_args ) ) {
    18             $this->default_args = cpt_utils()->get_args( 'post-types-default-args' );
     18            add_action(
     19                'init',
     20                function () {
     21                    $this->default_args = cpt_utils()->get_args( 'post-types-default-args' );
     22                }
     23            );
    1924        }
    2025        if ( empty( $this->default_labels ) ) {
    21             $this->default_labels = cpt_utils()->get_args( 'post-types-default-labels' );
     26            add_action(
     27                'init',
     28                function () {
     29                    $this->default_labels = cpt_utils()->get_args( 'post-types-default-labels' );
     30                }
     31            );
    2232        }
    2333    }
     
    7989        }
    8090        global $pagenow;
    81         if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] == $post_type ) { //phpcs:ignore Universal.Operators.StrictComparisons, WordPress.Security.NonceVerification
     91        if ( 'edit.php' === $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] === $post_type ) {
    8292            add_filter(
    8393                'manage_posts_columns',
     
    8999
    90100                    foreach ( $columns as $key => $args ) {
    91                         if ( 'title' == $key && empty( $args['label'] ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     101                        if ( 'title' === $key && empty( $args['label'] ) ) {
    92102                            $args['label'] = $stored_title_label;
    93103                        }
    94                         if ( 'date' == $key && empty( $args['label'] ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     104                        if ( 'date' === $key && empty( $args['label'] ) ) {
    95105                            $args['label'] = $stored_date_label;
    96106                        }
     
    142152            foreach ( $post_metas as $key => $value ) {
    143153                $single_meta = get_post_meta( $post_type->ID, $key, true );
    144                 if ( substr( $key, 0, 7 ) == 'labels_' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     154                if ( 'labels_' === substr( $key, 0, 7 ) ) {
    145155                    if ( ! empty( $single_meta ) ) {
    146156                        $post_type_labels[ str_replace( 'labels_', '', $key ) ] = $single_meta;
    147157                    }
    148                 } elseif ( substr( $key, 0, 1 ) == '_' || empty( $single_meta ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     158                } elseif ( '_' === substr( $key, 0, 1 ) || empty( $single_meta ) ) {
    149159                    unset( $post_metas[ $key ] );
    150160                } else {
    151                     $post_type_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( 'true' == $single_meta ) : $single_meta; //phpcs:ignore Universal.Operators.StrictComparisons
     161                    $post_type_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( true === filter_var( $single_meta, FILTER_VALIDATE_BOOLEAN ) ) : $single_meta;
    152162                }
    153163                unset( $post_metas[ $key ] );
     
    286296            }
    287297            $id = ! empty( $post_type['id'] ) && is_string( $post_type['id'] ) ? $post_type['id'] : false;
    288             if ( $id == $post_type_id ) {
     298            if ( $id === $post_type_id ) {
    289299                $flush_rewrite_rules = true;
    290300            }
  • custom-post-types/trunk/includes/class-cpt-taxonomies.php

    r2989869 r3339401  
    1212    public function __construct() {
    1313        if ( empty( $this->default_args ) ) {
    14             $this->default_args = cpt_utils()->get_args( 'taxonomies-default-args' );
     14            add_action(
     15                'init',
     16                function () {
     17                    $this->default_args = cpt_utils()->get_args( 'taxonomies-default-args' );
     18                }
     19            );
    1520        }
    1621        if ( empty( $this->default_labels ) ) {
    17             $this->default_labels = cpt_utils()->get_args( 'taxonomies-default-labels' );
     22            add_action(
     23                'init',
     24                function () {
     25                    $this->default_labels = cpt_utils()->get_args( 'taxonomies-default-labels' );
     26                }
     27            );
    1828        }
    1929    }
     
    8999            foreach ( $post_metas as $key => $value ) {
    90100                $single_meta = get_post_meta( $taxonomy->ID, $key, true );
    91                 if ( substr( $key, 0, 7 ) == 'labels_' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     101                if ( 'labels_' === substr( $key, 0, 7 ) ) {
    92102                    if ( ! empty( $single_meta ) ) {
    93103                        $taxonomy_labels[ str_replace( 'labels_', '', $key ) ] = $single_meta;
    94104                    }
    95                 } elseif ( substr( $key, 0, 1 ) == '_' || empty( $single_meta ) ) { //phpcs:ignore Universal.Operators.StrictComparisons
     105                } elseif ( '_' === substr( $key, 0, 1 ) || empty( $single_meta ) ) {
    96106                    unset( $post_metas[ $key ] );
    97107                } else {
    98                     $taxonomy_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( 'true' == $single_meta ) : $single_meta; //phpcs:ignore Universal.Operators.StrictComparisons
     108                    $taxonomy_args[ $key ] = in_array( $single_meta, array( 'true', 'false' ), true ) ? ( true === filter_var( $single_meta, FILTER_VALIDATE_BOOLEAN ) ) : $single_meta;
    99109                }
    100110                unset( $post_metas[ $key ] );
     
    229239            }
    230240            $id = ! empty( $taxonomy['id'] ) && is_string( $taxonomy['id'] ) ? $taxonomy['id'] : false;
    231             if ( $id == $taxonomy_id ) {
     241            if ( $id === $taxonomy_id ) {
    232242                $flush_rewrite_rules = true;
    233243            }
  • custom-post-types/trunk/includes/class-cpt-ui.php

    r3206477 r3339401  
    3131     */
    3232    public function add_feedback_modal() {
    33         if ( get_current_screen()->id == 'plugins' ) { //phpcs:ignore Universal.Operators.StrictComparisons
     33        if ( 'plugins' === get_current_screen()->id ) {
    3434            require_once CPT_PATH . '/includes/templates/modal-feedback.php';
    3535        }
     
    8787        }
    8888
    89         $action = ! empty( $_GET['action'] ) && 'cpt-feedback' == $_GET['action'] ? $_GET['action'] : false; //phpcs:ignore Universal.Operators.StrictComparisons
     89        $action = ! empty( $_GET['action'] ) && 'cpt-feedback' === $_GET['action'] ? $_GET['action'] : false;
    9090        if ( ! $action ) {
    9191            return;
     
    129129        $field_group_id = $field_group['id'];
    130130        if (
    131             'id' == $meta_key && //phpcs:ignore Universal.Operators.StrictComparisons
     131            'id' === $meta_key &&
    132132            in_array( $field_group_id, array( CPT_UI_PREFIX, CPT_UI_PREFIX . '_tax', CPT_UI_PREFIX . '_field', CPT_UI_PREFIX . '_page', CPT_UI_PREFIX . '_notice' ), true )
    133133        ) {
     
    145145        $post_type   = get_post( $post_id )->post_type;
    146146        $post_status = get_post( $post_id )->post_status;
    147         if ( ! in_array( $post_type, $this->no_title_post_types, true ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || 'trash' == $post_status ) { //phpcs:ignore Universal.Operators.StrictComparisons
     147        if ( ! in_array( $post_type, $this->no_title_post_types, true ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || 'trash' === $post_status ) {
    148148            return $post_id;
    149149        }
  • custom-post-types/trunk/includes/class-cpt-utils.php

    r3055467 r3339401  
    196196    public function get_post_title_with_parents( $post_id = 0, $title = '' ) {
    197197        $post = get_post( $post_id );
    198         if ( 0 == $post_id || ! $post ) { //phpcs:ignore Universal.Operators.StrictComparisons
     198        if ( 0 === $post_id || ! $post ) {
    199199            return $title;
    200200        }
    201201        $title = empty( $title ) ? $post->post_title : $title;
    202         if ( 0 == $post->post_parent ) { //phpcs:ignore Universal.Operators.StrictComparisons
     202        if ( 0 === $post->post_parent ) {
    203203            return $title;
    204204        }
     
    215215    public function get_term_title_with_parents( $term_id = 0, $title = '' ) {
    216216        $term = get_term( $term_id );
    217         if ( 0 == $term_id || ! $term ) { //phpcs:ignore Universal.Operators.StrictComparisons
     217        if ( 0 === $term_id || ! $term ) {
    218218            return $title;
    219219        }
    220220        $title = empty( $title ) ? $term->name : $title;
    221         if ( 0 == $term->parent ) { //phpcs:ignore Universal.Operators.StrictComparisons
     221        if ( 0 === $term->parent ) {
    222222            return $title;
    223223        }
     
    232232        $prefix = rest_get_url_prefix();
    233233        if (
    234             defined( 'REST_REQUEST' ) &&
    235             REST_REQUEST ||
    236             isset( $_GET['rest_route'] ) && //phpcs:ignore WordPress.Security.NonceVerification
    237             0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) //phpcs:ignore WordPress.Security.NonceVerification
     234            ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
     235            ( isset( $_GET['rest_route'] ) && 0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) ) //phpcs:ignore WordPress.Security.NonceVerification
    238236        ) {
    239237            return true;
     
    456454                empty( $registered_menu[2] ) || // error
    457455                strpos( $registered_menu[2], '.php' ) !== false || // core page
    458                 ( ! empty( $registered_menu[4] ) && 'wp-menu-separator' == $registered_menu[4] )  //phpcs:ignore Universal.Operators.StrictComparisons
     456                ( ! empty( $registered_menu[4] ) && 'wp-menu-separator' === $registered_menu[4] )
    459457            ) {
    460458                continue;
     
    598596            'type'     => 'select',
    599597            'extra'    => array(
    600                 'placeholder' => ( 'NO' == $default_value ? $no : $yes ) . $default_label, //phpcs:ignore Universal.Operators.StrictComparisons
     598                'placeholder' => ( 'NO' === $default_value ? $no : $yes ) . $default_label,
    601599                'multiple'    => false,
    602600                'options'     => array(
    603                     'true'  => $yes . ( 'NO' == $default_value ? '' : $default_label ), //phpcs:ignore Universal.Operators.StrictComparisons
    604                     'false' => $no . ( 'NO' == $default_value ? $default_label : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     601                    'true'  => $yes . ( 'NO' === $default_value ? '' : $default_label ),
     602                    'false' => $no . ( 'NO' === $default_value ? $default_label : '' ),
    605603                ),
    606604            ),
     
    643641     */
    644642    public function get_ui_min_field( $wrap_width = '', $type = 'number' ) {
    645         $extra = 'number' == $type ? array(
     643        $extra = 'number' === $type ? array(
    646644            'min'         => '0',
    647645            'placeholder' => '0',
     
    670668     */
    671669    public function get_ui_max_field( $wrap_width = '', $type = 'number' ) {
    672         $extra = 'number' == $type ? array( 'min' => '0' ) : array();
     670        $extra = 'number' === $type ? array( 'min' => '0' ) : array();
    673671        return array(
    674672            'key'      => 'max',
  • custom-post-types/trunk/includes/compatibilities/saswp.php

    r2989869 r3339401  
    2222            foreach ( $fields as $field_config ) {
    2323                if (
    24                     'file' == $field_config['type'] &&
     24                    'file' === $field_config['type'] &&
    2525                    2 > count( $field_config['extra']['types'] ) &&
    2626                (
    2727                    empty( $field_config['extra']['types'][0] ) ||
    28                     'image' == $field_config['extra']['types'][0]
     28                    'image' === $field_config['extra']['types'][0]
    2929                )
    3030                ) {
     
    7676        $field_object = cpt_fields()->get_field_object( $field, \CPT_Field_Groups::SUPPORT_TYPE_CPT, $post->post_type );
    7777        if (
    78             'file' == $field_object['type'] &&
     78            'file' === $field_object['type'] &&
    7979            2 > count( $field_object['extra']['types'] ) &&
    8080            (
    8181                empty( $field_object['extra']['types'][0] ) ||
    82                 'image' == $field_object['extra']['types'][0]
     82                'image' === $field_object['extra']['types'][0]
    8383            )
    8484        ) {
  • custom-post-types/trunk/includes/fields/class-cpt-field-color.php

    r2989869 r3339401  
    4848            $input_id,
    4949            $field_config['value'],
    50             ! empty( $field_config['extra']['alpha'] ) && 'true' == $field_config['extra']['alpha'] ? ' data-alpha-enabled="true" data-alpha-color-type="hex"' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     50            ! empty( $field_config['extra']['alpha'] ) && true === filter_var( $field_config['extra']['alpha'], FILTER_VALIDATE_BOOLEAN ) ? ' data-alpha-enabled="true" data-alpha-color-type="hex"' : '',
    5151            ! empty( $field_config['required'] ) ? ' required' : ''
    5252        );
  • custom-post-types/trunk/includes/fields/class-cpt-field-file.php

    r3055467 r3339401  
    113113        $file_types = explode( '/', $file_type );
    114114        $main_type  = isset( $file_types[0] ) ? $file_types[0] : false;
    115         if ( $main_type && 'image' == $main_type ) { //phpcs:ignore Universal.Operators.StrictComparisons
     115        if ( $main_type && 'image' === $main_type ) {
    116116            return wp_get_attachment_image( $meta_value, 'full' );
    117117        }
  • custom-post-types/trunk/includes/fields/class-cpt-field-post-rel.php

    r2989869 r3339401  
    7979        }
    8080
     81        $multiple = ! empty( $field_config['extra']['multiple'] ) && true === filter_var( $field_config['extra']['multiple'], FILTER_VALIDATE_BOOLEAN );
     82
    8183        return sprintf(
    8284            '<select name="%s" id="%s" autocomplete="off" aria-autocomplete="none" style="width: 100%%;"%s%s data-type="%s"%s>%s</select>',
    83             $input_name . ( ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? '[]' : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     85            $input_name . ( $multiple ? '[]' : '' ),
    8486            $input_id,
    8587            ! empty( $field_config['extra']['placeholder'] ) ? ' placeholder="' . $field_config['extra']['placeholder'] . '"' : '',
    86             ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? ' multiple' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     88            $multiple ? ' multiple' : '',
    8789            ! empty( $field_config['extra']['post_type'] ) ? $field_config['extra']['post_type'] : 'post',
    8890            ! empty( $field_config['required'] ) ? ' required' : '',
  • custom-post-types/trunk/includes/fields/class-cpt-field-radio.php

    r3055467 r3339401  
    5454                $input_name, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    5555                $value, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    56                 $value == $field_config['value'] ? ' checked="checked"' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     56                $value === $field_config['value'] ? ' checked="checked"' : '',
    5757                ! empty( $field_config['required'] ) ? ' required' : '',
    5858                $label //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  • custom-post-types/trunk/includes/fields/class-cpt-field-repeater.php

    r3055467 r3339401  
    4242            data-fields="<?php echo htmlspecialchars( wp_json_encode( $fields ), ENT_QUOTES, 'UTF-8' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
    4343            data-parent="<?php echo $parent_base; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"
    44             data-fields-group="<?php esc_attr_e( $fields_group_id ); ?>"
     44            data-fields-group="<?php echo esc_attr( $fields_group_id ); ?>"
    4545        >
    4646            <?php
     
    8686                <?php
    8787                foreach ( $fields as $i => $field ) {
    88                     if ( CPT_UI_PREFIX . '_field' == $fields_group_id && 5 == $i ) { //phpcs:ignore Universal.Operators.StrictComparisons
     88                    if ( CPT_UI_PREFIX . '_field' === $fields_group_id && 5 === $i ) {
    8989                        ?>
    9090                        <div class="cpt-repeater-extra">
     
    228228        $field_group_id = $field_group['id'];
    229229        if (
    230             'fields' == $meta_key && //phpcs:ignore Universal.Operators.StrictComparisons
    231             CPT_UI_PREFIX . '_field' == $field_group_id && //phpcs:ignore Universal.Operators.StrictComparisons
     230            'fields' === $meta_key &&
     231            CPT_UI_PREFIX . '_field' === $field_group_id &&
    232232            ! empty( $meta_value )
    233233        ) {
  • custom-post-types/trunk/includes/fields/class-cpt-field-select.php

    r2989869 r3339401  
    5959    public static function render( $input_name, $input_id, $field_config ) {
    6060        $options = '';
    61         if ( 'true' != $field_config['extra']['multiple'] ) {
     61
     62        $multiple = ! empty( $field_config['extra']['multiple'] ) && true === filter_var( $field_config['extra']['multiple'], FILTER_VALIDATE_BOOLEAN );
     63
     64        if ( ! $multiple ) {
    6265            $options .= '<option value=""></option>';
    6366        }
     
    7073                        $child_value,
    7174                        ( is_array( $field_config['value'] ) && in_array( $child_value, $field_config['value'], true ) ) ||
    72                         ( ! is_array( $field_config['value'] ) && $child_value == $field_config['value'] ) ? //phpcs:ignore Universal.Operators.StrictComparisons
     75                        ( ! is_array( $field_config['value'] ) && $child_value === $field_config['value'] ) ?
    7376                            '  selected="selected"' :
    7477                            '',
     
    8689                    $value,
    8790                    ( is_array( $field_config['value'] ) && in_array( $value, $field_config['value'], true ) ) ||
    88                     ( ! is_array( $field_config['value'] ) && $value == $field_config['value'] ) ? //phpcs:ignore Universal.Operators.StrictComparisons
     91                    ( ! is_array( $field_config['value'] ) && $value === $field_config['value'] ) ?
    8992                        '  selected="selected"' :
    9093                        '',
     
    9396            }
    9497        }
     98
    9599        return sprintf(
    96100            '<select name="%s" id="%s" autocomplete="off" aria-autocomplete="none" style="width: 100%%;"%s%s%s>%s</select>',
    97             $input_name . ( ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? '[]' : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     101            $input_name . ( $multiple ? '[]' : '' ),
    98102            $input_id,
    99103            ! empty( $field_config['extra']['placeholder'] ) ? ' placeholder="' . $field_config['extra']['placeholder'] . '"' : '',
    100             ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? ' multiple' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     104            $multiple ? ' multiple' : '',
    101105            ! empty( $field_config['required'] ) ? ' required' : '',
    102106            $options
  • custom-post-types/trunk/includes/fields/class-cpt-field-tax-rel.php

    r2989869 r3339401  
    7979        }
    8080
     81        $multiple = ! empty( $field_config['extra']['multiple'] ) && true === filter_var( $field_config['extra']['multiple'], FILTER_VALIDATE_BOOLEAN );
     82
    8183        return sprintf(
    8284            '<select name="%s" id="%s" autocomplete="off" aria-autocomplete="none" style="width: 100%%;"%s%s data-type="%s"%s>%s</select>',
    83             $input_name . ( ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? '[]' : '' ), //phpcs:ignore Universal.Operators.StrictComparisons
     85            $input_name . ( $multiple ? '[]' : '' ),
    8486            $input_id,
    8587            ! empty( $field_config['extra']['placeholder'] ) ? ' placeholder="' . $field_config['extra']['placeholder'] . '"' : '',
    86             ! empty( $field_config['extra']['multiple'] ) && 'true' == $field_config['extra']['multiple'] ? ' multiple' : '', //phpcs:ignore Universal.Operators.StrictComparisons
     88            $multiple ? ' multiple' : '',
    8789            ! empty( $field_config['extra']['taxonomy'] ) ? $field_config['extra']['taxonomy'] : 'category',
    8890            ! empty( $field_config['required'] ) ? ' required' : '',
  • custom-post-types/trunk/includes/templates/page-tools.php

    r3055467 r3339401  
    2525
    2626$is_current = function ( $current ) use ( $requested_page ) {
    27     return $current == $requested_page; //phpcs:ignore Universal.Operators.StrictComparisons
     27    return $current === $requested_page;
    2828};
    2929?>
  • custom-post-types/trunk/readme.txt

    r3206479 r3339401  
    44Donate link: https://totalpress.org/donate?utm_source=wordpress_org&utm_medium=plugin_page&utm_campaign=custom_post_types
    55Requires at least: 4.0
    6 Tested up to: 6.7
    7 Stable tag: 5.0.6
     6Tested up to: 6.8
     7Stable tag: 5.0.7
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    188188== Changelog ==
    189189
    190 = 5.0.6 - 2024-04-03 =
     190= 5.0.7 - 2025-08-04 =
     191* FIX: sanitize dropdown options on field groups;
     192
     193= 5.0.6 - 2024-12-11 =
    191194* FIX: version_compare first argument null;
    192195* FIX: check if class exist before short load using functions.php;
Note: See TracChangeset for help on using the changeset viewer.