mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 02:01:18 +03:00
Views: Modularize success/error notices for DRYness.
This commit is contained in:
parent
7e89d1794a
commit
963dbd41e3
3 changed files with 42 additions and 14 deletions
34
plugins/wporg-5ftf/views/partial-result-messages.php
Normal file
34
plugins/wporg-5ftf/views/partial-result-messages.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
||||
/**
|
||||
* @var array $messages
|
||||
* @var array $errors
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<div id="form-messages">
|
||||
<?php if ( ! empty( $messages ) ) : ?>
|
||||
<div id="success-messages" class="notice notice-success notice-alt">
|
||||
<?php foreach ( $messages as $message ) : ?>
|
||||
<p>
|
||||
<?php echo wp_kses_post( $message ); ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $errors ) ) : ?>
|
||||
<div id="error-messages" class="notice notice-error notice-alt">
|
||||
<?php foreach ( $errors as $error ) : ?>
|
||||
<p>
|
||||
<?php echo wp_kses_post( $error ); ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue