Making WordPress.org


Ignore:
Timestamp:
03/04/2024 04:45:48 AM (21 months ago)
Author:
dd32
Message:

Plugin Directory: Readme Validator: Show the correct limit for the FAQ/Changelog section.

See #7477.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php

    r13237 r13266  
    201201        foreach ( $trimmed_sections as $section_name => $dummy ) {
    202202            $section_name = str_replace( 'trimmed_section_', '', $section_name );
     203
     204            $max_length_field = "section-{$section_name}";
     205            if ( ! isset( $this->maximum_field_lengths[ $max_length_field ] ) ) {
     206                $max_length_field = 'section';
     207            }
     208
    203209            $warnings[]   = sprintf(
    204210                /* translators: %s: section title */
    205211                __( 'The %s section is too long and was truncated. A maximum of %s words is supported.', 'wporg-plugins' ),
    206212                '<code>' . esc_html( ucwords( str_replace( '_', ' ', $section_name ) ) ) . '</code>',
    207                 number_format_i18n( $readme->maximum_field_lengths[ 'section' ] )
     213                number_format_i18n( $readme->maximum_field_lengths[ $max_length_field ] )
    208214            );
    209215        }
Note: See TracChangeset for help on using the changeset viewer.