WordPress.org

Making WordPress.org

Changeset 5331


Ignore:
Timestamp:
04/14/2017 07:28:11 PM (3 years ago)
Author:
Otto42
Message:

Plugin Directory: Readme Validator, add output of some kind on success. May need additional styling. See #2705.

File:
1 edited

Legend:

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

    r4262 r5331  
    5353        }
    5454
     55        $output = '';
     56
    5557        $error_types = array(
    5658            'errors'   => __( 'Fatal Errors:', 'wporg-plugins' ),
     
    6062        foreach ( $error_types as $field => $warning_label ) {
    6163            if ( !empty( $errors[ $field ] ) ) {
    62                 echo "{$warning_label}\n<ul class='{$field} error'>\n";
     64                $output .= "{$warning_label}\n<ul class='{$field} error'>\n";
    6365                foreach ( $errors[ $field ] as $notice ) {
    64                     echo "<li>{$notice}</li>\n";
     66                    $output .= "<li>{$notice}</li>\n";
    6567                }
    66                 echo "</ul>\n";
     68                $output .= "</ul>\n";
    6769            }
    6870        }
     71
     72        if ( empty( $output ) ) {
     73            $output = __( 'No errors detected in the readme.txt file.', 'wporg-plugins' );
     74        }
     75
     76        echo $output;
    6977    }
    7078}
Note: See TracChangeset for help on using the changeset viewer.