Changeset 3055467
- Timestamp:
- 03/20/2024 04:00:13 PM (21 months ago)
- Location:
- custom-post-types
- Files:
-
- 75 added
- 18 edited
-
tags/5.0.3 (added)
-
tags/5.0.3/assets (added)
-
tags/5.0.3/assets/css (added)
-
tags/5.0.3/assets/css/backend.css (added)
-
tags/5.0.3/assets/dashboard-icon.svg (added)
-
tags/5.0.3/assets/icon-256x256.png (added)
-
tags/5.0.3/assets/icon.svg (added)
-
tags/5.0.3/assets/js (added)
-
tags/5.0.3/assets/js/backend.js (added)
-
tags/5.0.3/custom-post-types.php (added)
-
tags/5.0.3/includes (added)
-
tags/5.0.3/includes/abstracts (added)
-
tags/5.0.3/includes/abstracts/class-cpt-component.php (added)
-
tags/5.0.3/includes/abstracts/class-cpt-field.php (added)
-
tags/5.0.3/includes/args (added)
-
tags/5.0.3/includes/args/core-admin-pages-pro.php (added)
-
tags/5.0.3/includes/args/core-admin-pages.php (added)
-
tags/5.0.3/includes/args/core-post-types.php (added)
-
tags/5.0.3/includes/args/fields-field-group.php (added)
-
tags/5.0.3/includes/args/fields-post-type.php (added)
-
tags/5.0.3/includes/args/fields-repeater.php (added)
-
tags/5.0.3/includes/args/fields-taxonomy.php (added)
-
tags/5.0.3/includes/args/post-types-default-args.php (added)
-
tags/5.0.3/includes/args/post-types-default-labels.php (added)
-
tags/5.0.3/includes/args/taxonomies-default-args.php (added)
-
tags/5.0.3/includes/args/taxonomies-default-labels.php (added)
-
tags/5.0.3/includes/class-cpt-admin-notices.php (added)
-
tags/5.0.3/includes/class-cpt-admin-pages.php (added)
-
tags/5.0.3/includes/class-cpt-ajax.php (added)
-
tags/5.0.3/includes/class-cpt-core.php (added)
-
tags/5.0.3/includes/class-cpt-field-groups.php (added)
-
tags/5.0.3/includes/class-cpt-fields.php (added)
-
tags/5.0.3/includes/class-cpt-plugin.php (added)
-
tags/5.0.3/includes/class-cpt-post-types.php (added)
-
tags/5.0.3/includes/class-cpt-shortcodes.php (added)
-
tags/5.0.3/includes/class-cpt-taxonomies.php (added)
-
tags/5.0.3/includes/class-cpt-ui.php (added)
-
tags/5.0.3/includes/class-cpt-utils.php (added)
-
tags/5.0.3/includes/compatibilities (added)
-
tags/5.0.3/includes/compatibilities/saswp.php (added)
-
tags/5.0.3/includes/compatibilities/v4.php (added)
-
tags/5.0.3/includes/fields (added)
-
tags/5.0.3/includes/fields/class-cpt-field-checkbox.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-color.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-date.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-email.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-embed.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-file.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-html.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-link.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-map.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-number.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-password.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-post-rel.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-radio.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-range.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-repeater.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-select.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-separator.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-switch.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-tax-rel.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-tel.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-text.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-textarea.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-time.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-tinymce.php (added)
-
tags/5.0.3/includes/fields/class-cpt-field-user-rel.php (added)
-
tags/5.0.3/includes/functions.php (added)
-
tags/5.0.3/includes/templates (added)
-
tags/5.0.3/includes/templates/modal-feedback.php (added)
-
tags/5.0.3/includes/templates/page-tools.php (added)
-
tags/5.0.3/index.php (added)
-
tags/5.0.3/languages (added)
-
tags/5.0.3/languages/custom-post-types.pot (added)
-
tags/5.0.3/readme.txt (added)
-
trunk/custom-post-types.php (modified) (2 diffs)
-
trunk/includes/args/core-post-types.php (modified) (5 diffs)
-
trunk/includes/class-cpt-admin-notices.php (modified) (1 diff)
-
trunk/includes/class-cpt-admin-pages.php (modified) (2 diffs)
-
trunk/includes/class-cpt-ajax.php (modified) (1 diff)
-
trunk/includes/class-cpt-fields.php (modified) (9 diffs)
-
trunk/includes/class-cpt-post-types.php (modified) (1 diff)
-
trunk/includes/class-cpt-ui.php (modified) (4 diffs)
-
trunk/includes/class-cpt-utils.php (modified) (2 diffs)
-
trunk/includes/fields/class-cpt-field-checkbox.php (modified) (1 diff)
-
trunk/includes/fields/class-cpt-field-date.php (modified) (1 diff)
-
trunk/includes/fields/class-cpt-field-file.php (modified) (2 diffs)
-
trunk/includes/fields/class-cpt-field-radio.php (modified) (1 diff)
-
trunk/includes/fields/class-cpt-field-repeater.php (modified) (11 diffs)
-
trunk/includes/fields/class-cpt-field-time.php (modified) (1 diff)
-
trunk/includes/templates/modal-feedback.php (modified) (1 diff)
-
trunk/includes/templates/page-tools.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-types/trunk/custom-post-types.php
r3048971 r3055467 8 8 Text Domain: custom-post-types 9 9 Domain Path: /languages/ 10 Version: 5.0. 210 Version: 5.0.3 11 11 */ 12 12 … … 22 22 require_once dirname( CPT_PLUGIN_FILE ) . '/includes/functions.php'; 23 23 24 cpt_core(); 24 try { 25 cpt_core(); 26 } catch ( \Exception | \Throwable $e ) { 27 cpt_ui()->send_feedback( wp_json_encode( $e->getTrace() ) ); 28 throw $e; 29 } -
custom-post-types/trunk/includes/args/core-post-types.php
r2989869 r3055467 27 27 'hierarchical' => false, 28 28 'supports' => array( '' ), 29 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CPT_PATH . 'assets/dashboard-icon.svg') ),29 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode( wp_remote_retrieve_body( wp_remote_get( CPT_URL . '/assets/dashboard-icon.svg' ) ) ), 30 30 'can_export' => false, 31 31 ); … … 78 78 printf( 79 79 '<a href="%s" title="%s">%s</a>', 80 admin_url( 'edit.php?post_type=' . $key),81 __( 'View', 'custom-post-types' ),82 wp_count_posts( $key )->publish 80 esc_attr( admin_url( 'edit.php?post_type=' . $key ) ), 81 esc_attr__( 'View', 'custom-post-types' ), 82 wp_count_posts( $key )->publish //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 83 83 ); 84 84 }, … … 135 135 printf( 136 136 '<a href="%s" title="%s">%s</a>', 137 admin_url( 'edit-tags.php?taxonomy=' . $key),138 __( 'View', 'custom-post-types' ),139 wp_count_terms( array( 'taxonomy' => $key ) ) 137 esc_attr( admin_url( 'edit-tags.php?taxonomy=' . $key ) ), 138 esc_html__( 'View', 'custom-post-types' ), 139 wp_count_terms( array( 'taxonomy' => $key ) ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 140 140 ); 141 141 }, … … 160 160 ); 161 161 } 162 echo implode( ', ', $output ); 162 echo implode( ', ', $output ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 163 163 }, 164 164 ), … … 322 322 } 323 323 } 324 echo implode( ', ', $output ); 324 echo implode( ', ', $output ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 325 325 }, 326 326 ), -
custom-post-types/trunk/includes/class-cpt-admin-notices.php
r2989869 r3055467 117 117 printf( 118 118 '<div class="%s">%s<div class="message">%s</div>%s</div>', 119 $class,120 $title, 119 esc_html( $class ), 120 $title, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 121 121 wp_kses_post( $message ), 122 ! empty( $notice_buttons ) ? '<p class="actions">' . implode( '', $notice_buttons ) . '</p>' : '' 122 ! empty( $notice_buttons ) ? '<p class="actions">' . implode( '', $notice_buttons ) . '</p>' : '' //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 123 123 ); 124 124 } -
custom-post-types/trunk/includes/class-cpt-admin-pages.php
r2989869 r3055467 21 21 ?> 22 22 <div class="wrap cpt-admin-page"> 23 <h1 class="cpt-admin-page-title"><?php echo $title; ?></h1>23 <h1 class="cpt-admin-page-title"><?php echo esc_html( $title ); ?></h1> 24 24 <?php 25 25 if ( ! empty( $content ) ) { 26 26 printf( 27 27 '<div class="cpt-admin-page-content">%s</div>', 28 'tools' == $id ? $content : apply_filters( 'the_content', $content ) //phpcs:ignore Universal.Operators.StrictComparisons28 'tools' === $id ? $content : apply_filters( 'the_content', $content ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 29 29 ); 30 30 } … … 36 36 <form method="post" action="options.php" novalidate="novalidate"> 37 37 <?php settings_fields( $id ); ?> 38 <?php echo $fields; ?>38 <?php echo $fields; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 39 39 <?php submit_button(); ?> 40 40 </form> -
custom-post-types/trunk/includes/class-cpt-ajax.php
r3048971 r3055467 23 23 wp_send_json_error(); 24 24 } 25 $data = $_SERVER['REQUEST_METHOD'] === 'POST' ? $_POST : $_GET;25 $data = 'POST' === $_SERVER['REQUEST_METHOD'] ? $_POST : $_GET; //phpcs:ignore WordPress.Security.NonceVerification 26 26 $nonce = ! empty( $data['nonce'] ) && wp_verify_nonce( $data['nonce'], CPT_NONCE_KEY ); 27 27 if ( ! $nonce ) { -
custom-post-types/trunk/includes/class-cpt-fields.php
r3048971 r3055467 94 94 esc_html( $input_id ), 95 95 wp_kses_post( $field_config['label'] ), 96 $field_type::render( $input_name, $input_id, $field_config ), 96 $field_type::render( $input_name, $input_id, $field_config ), //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 97 97 ! empty( $field_config['info'] ) ? '<div class="description"><p>' . wp_kses_post( $field_config['info'] ) . '</p></div>' : '' 98 98 ); … … 123 123 $field = apply_filters( 'cpt_field_args', $field, $field_type ); 124 124 $field['fields_group_id'] = $fields_group_id; 125 echo $this->get_field_template( $field ); 125 echo $this->get_field_template( $field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 126 126 } 127 127 ?> … … 238 238 $field_group['label'], 239 239 function ( $post ) use ( $field_group ) { 240 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 240 241 echo $this->get_fields_section( 241 242 $field_group, 242 function ( $key ) use ( $post ) { 243 return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null; 243 function ( $key ) use ( $post ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 244 return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 244 245 } 245 246 ); … … 290 291 $action, 291 292 function ( $term ) use ( $field_group ) { 293 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 292 294 echo $this->get_fields_section( 293 295 $field_group, 294 function ( $key ) use ( $term ) { 295 return ! empty( $term->term_id ) ? get_term_meta( $term->term_id, $key, true ) : null; 296 function ( $key ) use ( $term ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 297 return ! empty( $term->term_id ) ? get_term_meta( $term->term_id, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 296 298 } 297 299 ); … … 340 342 $field_group['label'], 341 343 function () use ( $options_page, $field_group ) { 344 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 342 345 echo $this->get_fields_section( 343 346 $field_group, 344 function ( $key ) { 347 function ( $key ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 345 348 return get_option( $key ); 346 349 } … … 389 392 $action, 390 393 function ( $user ) use ( $field_group ) { 394 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 391 395 echo $this->get_fields_section( 392 396 $field_group, 393 function ( $key ) use ( $user ) { 394 return ! empty( $user->ID ) ? get_user_meta( $user->ID, $key, true ) : null; 397 function ( $key ) use ( $user ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 398 return ! empty( $user->ID ) ? get_user_meta( $user->ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 395 399 } 396 400 ); … … 445 449 $field_group['label'], 446 450 function ( $post ) use ( $field_group ) { 451 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 447 452 echo $this->get_fields_section( 448 453 $field_group, 449 function ( $key ) use ( $post ) { 450 return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null; 454 function ( $key ) use ( $post ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 455 return ! empty( $post->ID ) ? get_post_meta( $post->ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 451 456 } 452 457 ); … … 497 502 $field_group['label'], 498 503 function ( $comment ) use ( $field_group ) { 504 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 499 505 echo $this->get_fields_section( 500 506 $field_group, 501 function ( $key ) use ( $comment ) { 502 return ! empty( $comment->comment_ID ) ? get_comment_meta( $comment->comment_ID, $key, true ) : null; 507 function ( $key ) use ( $comment ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 508 return ! empty( $comment->comment_ID ) ? get_comment_meta( $comment->comment_ID, $key, true ) : null; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 503 509 } 504 510 ); … … 547 553 548 554 echo '<div class="description description-wide">'; 555 //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 549 556 echo $this->get_fields_section( 550 557 $field_group, 551 function ( $key ) use ( $item_id ) { 552 $key = str_replace( '-' . $item_id, '', $key ); 558 function ( $key ) use ( $item_id ) { //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 559 $key = str_replace( '-' . $item_id, '', $key ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 553 560 554 561 return ! empty( $item_id ) ? get_post_meta( $item_id, $key, true ) : null; -
custom-post-types/trunk/includes/class-cpt-post-types.php
r2989869 r3055467 79 79 } 80 80 global $pagenow; 81 if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] == $post_type ) { //phpcs:ignore Universal.Operators.StrictComparisons 81 if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && $_GET['post_type'] == $post_type ) { //phpcs:ignore Universal.Operators.StrictComparisons, WordPress.Security.NonceVerification 82 82 add_filter( 83 83 'manage_posts_columns', -
custom-post-types/trunk/includes/class-cpt-ui.php
r3048971 r3055467 41 41 * @return void 42 42 */ 43 p rivatefunction send_feedback( $feedback ) {43 public function send_feedback( $feedback ) { 44 44 $request_url = add_query_arg( 45 45 array( … … 48 48 'domain' => md5( get_home_url() ), 49 49 'v' => CPT_VERSION, 50 'extra' => wp_json_encode( $this->get_feedback_extra_data() ), 50 51 ), 51 52 'https://totalpress.org/wp-json/totalpress/v1/plugin-feedback' 52 53 ); 53 54 wp_remote_get( $request_url, array( 'blocking' => false ) ); 55 } 56 57 /** 58 * @return array 59 */ 60 private function get_feedback_extra_data() { 61 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 62 $active_theme = wp_get_theme(); 63 $all_plugins = get_plugins(); 64 $active_plugins = get_option( 'active_plugins' ); 65 foreach ( $all_plugins as $key => $value ) { 66 $is_active = ( in_array( $key, $active_plugins, true ) ) ? true : false; 67 if ( ! $is_active ) { 68 continue; 69 } 70 $plugins[ $key ] = $value['Version']; 71 } 72 return array( 73 'wp_version' => get_bloginfo( 'version' ), 74 'active_theme' => array( $active_theme->get( 'ThemeURI' ) => $active_theme->get( 'Version' ) ), 75 'active_plugins' => $plugins, 76 ); 54 77 } 55 78 … … 124 147 return $post_id; 125 148 } 126 $new_title = ! empty( $_POST['meta-fields']['plural'] ) ? $_POST['meta-fields']['plural'] : 'CPT_' . $post_id;149 $new_title = ! empty( $_POST['meta-fields']['plural'] ) ? sanitize_text_field( wp_unslash( $_POST['meta-fields']['plural'] ) ) : 'CPT_' . $post_id; //phpcs:ignore WordPress.Security.NonceVerification 127 150 global $wpdb; 128 $wpdb->update( $wpdb->posts, array( 'post_title' => $new_title ), array( 'ID' => $post_id ) ); 151 $wpdb->update( $wpdb->posts, array( 'post_title' => $new_title ), array( 'ID' => $post_id ) ); //phpcs:ignore WordPress.DB.DirectDatabaseQuery 129 152 return $post_id; 130 153 } … … 135 158 public function add_post_title_label() { 136 159 $screen = get_current_screen(); 137 $post = ! empty( $_GET['post'] ) && get_post( $_GET['post'] ) ? get_post( $_GET['post'] ) : false; 160 $post = ! empty( $_GET['post'] ) && get_post( $_GET['post'] ) ? get_post( $_GET['post'] ) : false; //phpcs:ignore WordPress.Security.NonceVerification 138 161 if ( ! in_array( $screen->post_type, $this->no_title_post_types, true ) || ! in_array( $screen->id, $this->no_title_post_types, true ) || ! $post ) { 139 162 return; 140 163 } 141 printf( '<h1 style="padding: 0;">%s</h1>', $post->post_title ); 164 printf( '<h1 style="padding: 0;">%s</h1>', $post->post_title ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 142 165 } 143 166 -
custom-post-types/trunk/includes/class-cpt-utils.php
r2989869 r3055467 234 234 defined( 'REST_REQUEST' ) && 235 235 REST_REQUEST || 236 isset( $_GET['rest_route'] ) && 237 0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) 236 isset( $_GET['rest_route'] ) && //phpcs:ignore WordPress.Security.NonceVerification 237 0 === strpos( trim( $_GET['rest_route'], '\\/' ), $prefix ) //phpcs:ignore WordPress.Security.NonceVerification 238 238 ) { 239 239 return true; … … 329 329 'posts_per_page' => -1, 330 330 'post_type' => CPT_UI_PREFIX . '_field', 331 'meta_query' => array( 331 'meta_query' => array( //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query 332 332 array( 333 333 'key' => 'supports', -
custom-post-types/trunk/includes/fields/class-cpt-field-checkbox.php
r2989869 r3055467 52 52 printf( 53 53 '<label><input type="checkbox" name="%s[]" value="%s"%s%s>%s<label><br>', 54 $input_name, 55 $value, 54 $input_name, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 55 $value, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 56 56 is_array( $field_config['value'] ) && in_array( $value, $field_config['value'], true ) ? ' checked="checked"' : '', 57 57 ! empty( $field_config['required'] ) ? ' required' : '', 58 $label 58 $label //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 59 59 ); 60 60 } -
custom-post-types/trunk/includes/fields/class-cpt-field-date.php
r2989869 r3055467 70 70 } 71 71 $config_format = get_option( 'date_format' ); 72 return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value; 72 return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value; //phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date 73 73 } 74 74 } -
custom-post-types/trunk/includes/fields/class-cpt-field-file.php
r2989869 r3055467 64 64 ?> 65 65 <div class="cpt-file-section" 66 data-type="<?php echo htmlspecialchars( wp_json_encode( $types ), ENT_QUOTES, 'UTF-8' ); ?>">67 <input name="<?php echo $input_name; ?>" value="<?php echo $field_config['value']; ?>" class="cpt-hidden-input">66 data-type="<?php echo htmlspecialchars( wp_json_encode( $types ), ENT_QUOTES, 'UTF-8' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"> 67 <input name="<?php echo $input_name; ?>" value="<?php echo $field_config['value']; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" class="cpt-hidden-input"> 68 68 <div class="cpt-file-wrap"> 69 69 <div class="cpt-file-preview"> … … 73 73 </div> 74 74 <div class="cpt-file-actions" 75 title="<?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : __( 'Choose', 'custom-post-types' ); ?>">75 title="<?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : __( 'Choose', 'custom-post-types' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"> 76 76 <div class="file-name" 77 dir="rtl"><?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : ''; ?></div>77 dir="rtl"><?php echo $field_config['value'] && get_post( $field_config['value'] ) ? basename( get_attached_file( $field_config['value'] ) ) : ''; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div> 78 78 <div class="buttons"> 79 <button class="button cpt-file-button button-primary cpt-file-upload" id="<?php echo $input_id; ?>"80 title="<?php _e( 'Choose', 'custom-post-types' ); ?>"81 aria-label="<?php _e( 'Choose', 'custom-post-types' ); ?>">79 <button class="button cpt-file-button button-primary cpt-file-upload" id="<?php echo $input_id; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" 80 title="<?php esc_attr_e( 'Choose', 'custom-post-types' ); ?>" 81 aria-label="<?php esc_attr_e( 'Choose', 'custom-post-types' ); ?>"> 82 82 <span class="dashicons dashicons-upload"></span> 83 83 </button> 84 84 <button class="button cpt-file-button button-secondary cpt-file-remove" <?php echo empty( $field_config['value'] ) ? ' disabled="disabled"' : ''; ?> 85 title="<?php _e( 'Remove', 'custom-post-types' ); ?>"86 aria-label="<?php _e( 'Remove', 'custom-post-types' ); ?>">85 title="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>" 86 aria-label="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>"> 87 87 <span class="dashicons dashicons-trash"></span> 88 88 </button> -
custom-post-types/trunk/includes/fields/class-cpt-field-radio.php
r2989869 r3055467 52 52 printf( 53 53 '<label><input type="radio" name="%s" value="%s"%s%s>%s<label><br>', 54 $input_name, 55 $value, 54 $input_name, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 55 $value, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 56 56 $value == $field_config['value'] ? ' checked="checked"' : '', //phpcs:ignore Universal.Operators.StrictComparisons 57 57 ! empty( $field_config['required'] ) ? ' required' : '', 58 $label 58 $label //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 59 59 ); 60 60 } -
custom-post-types/trunk/includes/fields/class-cpt-field-repeater.php
r3036818 r3055467 40 40 ?> 41 41 <div class="cpt-repeater-section" 42 data-fields="<?php echo htmlspecialchars( wp_json_encode( $fields ), ENT_QUOTES, 'UTF-8' ); ?>"43 data-parent="<?php echo $parent_base; ?>"44 data-fields-group="<?php e cho $fields_group_id; ?>"42 data-fields="<?php echo htmlspecialchars( wp_json_encode( $fields ), ENT_QUOTES, 'UTF-8' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" 43 data-parent="<?php echo $parent_base; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>" 44 data-fields-group="<?php esc_attr_e( $fields_group_id ); ?>" 45 45 > 46 46 <?php 47 47 foreach ( $values as $i => $value ) { 48 48 $parent = $parent_base . '[' . $i . ']'; 49 echo self::render_group( $fields, $parent, $fields_group_id, $value ); 49 echo self::render_group( $fields, $parent, $fields_group_id, $value ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 50 50 } 51 51 ?> 52 52 </div> 53 <button class="cpt-repeater-add" title="<?php _e( 'Add', 'custom-post-types' ); ?>">53 <button class="cpt-repeater-add" title="<?php esc_attr_e( 'Add', 'custom-post-types' ); ?>"> 54 54 <span class="dashicons dashicons-insert"></span> 55 55 </button> … … 73 73 <div class="order"></div> 74 74 <button class="button cpt-repeater-button button-secondary move" 75 title="<?php _e( 'Reorder', 'custom-post-types' ); ?>"76 aria-label="<?php _e( 'Reorder', 'custom-post-types' ); ?>">75 title="<?php esc_attr_e( 'Reorder', 'custom-post-types' ); ?>" 76 aria-label="<?php esc_attr_e( 'Reorder', 'custom-post-types' ); ?>"> 77 77 <span class="dashicons dashicons-move"></span> 78 78 </button> 79 79 <button class="button cpt-repeater-button button-secondary remove" 80 title="<?php _e( 'Remove', 'custom-post-types' ); ?>"81 aria-label="<?php _e( 'Remove', 'custom-post-types' ); ?>">80 title="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>" 81 aria-label="<?php esc_attr_e( 'Remove', 'custom-post-types' ); ?>"> 82 82 <span class="dashicons dashicons-remove"></span> 83 83 </button> … … 96 96 $extra_field['parent'] = $parent_field . '[extra]'; 97 97 $extra_field['fields_group_id'] = $fields_group_id; 98 echo cpt_fields()->get_field_template( $extra_field ); 98 echo cpt_fields()->get_field_template( $extra_field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 99 99 } 100 100 } … … 106 106 $field['parent'] = $parent_field; 107 107 $field['fields_group_id'] = $fields_group_id; 108 echo cpt_fields()->get_field_template( $field ); 108 echo cpt_fields()->get_field_template( $field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 109 109 } 110 110 ?> … … 112 112 <div class="cpt-repeater-remove" aria-hidden="true"> 113 113 <button class="button button-secondary abort" 114 title="<?php _e( 'Cancel', 'custom-post-types' ); ?>"115 aria-label="<?php _e( 'Cancel', 'custom-post-types' ); ?>">116 <?php _e( 'Cancel', 'custom-post-types' ); ?>114 title="<?php esc_attr_e( 'Cancel', 'custom-post-types' ); ?>" 115 aria-label="<?php esc_attr_e( 'Cancel', 'custom-post-types' ); ?>"> 116 <?php esc_attr_e( 'Cancel', 'custom-post-types' ); ?> 117 117 </button> 118 118 <button class="button button-primary confirm" 119 title="<?php _e( 'Confirm', 'custom-post-types' ); ?>"120 aria-label="<?php _e( 'Confirm', 'custom-post-types' ); ?>">121 <?php _e( 'Confirm', 'custom-post-types' ); ?>119 title="<?php esc_attr_e( 'Confirm', 'custom-post-types' ); ?>" 120 aria-label="<?php esc_attr_e( 'Confirm', 'custom-post-types' ); ?>"> 121 <?php esc_attr_e( 'Confirm', 'custom-post-types' ); ?> 122 122 </button> 123 123 </div> … … 137 137 foreach ( $fields as $field ) { 138 138 $result[ $field['key'] ] = array( 'type' => $field['type'] ); 139 if ( 'repeater' == $field['type'] ) {139 if ( 'repeater' === $field['type'] ) { 140 140 $result[ $field['key'] ]['fields'] = self::get_repeater_fields_map( $field['extra']['fields'] ); 141 141 } … … 161 161 } 162 162 163 if ( 'extra' == $meta_key && CPT_UI_PREFIX . '_field'== $field_group['id'] ) {163 if ( 'extra' === $meta_key && CPT_UI_PREFIX . '_field' === $field_group['id'] ) { 164 164 $fields = self::get_repeater_fields_map( cpt_fields()->get_field( $meta_type )::get_extra() ); 165 165 $meta_value = array( $meta_value ); … … 168 168 foreach ( $meta_value as $i => $meta_group ) { 169 169 foreach ( $meta_group as $key => $value ) { 170 if ( 'extra' == $key && CPT_UI_PREFIX . '_field'== $field_group['id'] ) {170 if ( 'extra' === $key && CPT_UI_PREFIX . '_field' === $field_group['id'] ) { 171 171 $meta_value[ $i ][ $key ] = self::sanitize_recursive( $value, $key, $meta_group['type'], $field_group, $content_type, $content_id, $fields ); 172 } elseif ( 'repeater' == $fields[ $key ]['type'] ) {172 } elseif ( 'repeater' === $fields[ $key ]['type'] ) { 173 173 $meta_value[ $i ][ $key ] = self::sanitize_recursive( $value, $key, 'repeater', $field_group, $content_type, $content_id, $fields[ $key ]['fields'] ); 174 174 } else { … … 178 178 } 179 179 180 return ( 'extra' == $meta_key && CPT_UI_PREFIX . '_field'== $field_group['id'] ) ? $meta_value[0] : $meta_value;180 return ( 'extra' === $meta_key && CPT_UI_PREFIX . '_field' === $field_group['id'] ) ? $meta_value[0] : $meta_value; 181 181 } 182 182 } … … 212 212 $field['parent'] = $parent . '[extra]'; 213 213 $field['fields_group_id'] = $fields_group_id; 214 echo cpt_fields()->get_field_template( $field ); 214 echo cpt_fields()->get_field_template( $field ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 215 215 } 216 216 … … 238 238 } 239 239 240 if ( 'repeater' == $meta_type ) {240 if ( 'repeater' === $meta_type ) { 241 241 $fields = CPT_Field_Repeater::get_repeater_fields_map( $field_group['fields'] )[ $meta_key ]['fields']; 242 242 $meta_value = CPT_Field_Repeater::sanitize_recursive( $meta_value, $meta_key, $meta_type, $field_group, $content_type, $content_id, $fields ); -
custom-post-types/trunk/includes/fields/class-cpt-field-time.php
r2989869 r3055467 72 72 } 73 73 $config_format = get_option( 'time_format' ); 74 return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value; 74 return ! empty( $config_format ) ? date( $config_format, strtotime( $meta_value ) ) : $meta_value; //phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date 75 75 } 76 76 } -
custom-post-types/trunk/includes/templates/modal-feedback.php
r2989869 r3055467 1 1 <?php 2 // phpcs:ignoreFile 2 3 3 4 defined( 'ABSPATH' ) || exit; -
custom-post-types/trunk/includes/templates/page-tools.php
r2989869 r3055467 1 1 <?php 2 // phpcs:ignoreFile 2 3 3 4 defined( 'ABSPATH' ) || exit; … … 9 10 ); 10 11 11 $requested_page = ! empty( $_GET['action'] ) && array_key_exists( $_GET['action'], $pages ) ? $_GET['action'] : 'main'; 12 $requested_page = ! empty( $_GET['action'] ) && array_key_exists( $_GET['action'], $pages ) ? $_GET['action'] : 'main'; //phpcs:ignore WordPress.Security.NonceVerification 12 13 13 14 $page_url = function ( $slug ) use ( $pages ) { -
custom-post-types/trunk/readme.txt
r3048971 r3055467 5 5 Requires at least: 4.0 6 6 Tested up to: 6.4 7 Stable tag: 5.0. 27 Stable tag: 5.0.3 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Custom Post Types, Custom Fields, Custom Taxonomies, Custom Templates, Custom Admin Pages and Custom Admin Notices easily, directly from the WordPress dashboard without writing code.12 Custom Post Types, Custom Fields, Custom Taxonomies, Custom Templates, Custom Admin Pages, Custom Admin Notices. Directly from the WP dashboard. 13 13 14 14 == Description == … … 188 188 == Changelog == 189 189 190 = 5.0.3 - 2024-03-20 = 191 * FIX: improve plugin bug feedback; 192 190 193 = 5.0.2 - 2024-03-11 = 191 194 * FIX: improve plugin self-request security;
Note: See TracChangeset
for help on using the changeset viewer.