five-for-the-future/plugins/wporg-5ftf/views/inputs-pledge-org-info.php
Kelly Dwan 60b5ca5d2a Manage Pledge: Enable Manage Form functionality
* Fix issue with fetching data in `get_pledge_meta` when no submission has been POST'd
* Rename to `subset`, since `context` is also used elsewhere
* Show form content when there are form errors
* Fix warnings on new pledge form
* Skip wpautop before save, so editors don’t need to edit HTML unless they want to
2019-11-26 13:08:42 -05:00

75 lines
1.7 KiB
PHP

<?php
namespace WordPressDotOrg\FiveForTheFuture\View;
/**
* @var array $data
* @var int $pledge_id
* @var bool $readonly
*/
?>
<div class="form-field">
<label for="5ftf-org-name">
<?php esc_html_e( 'Organization Name', 'wporg-5ftf' ); ?>
</label>
<input
type="text"
id="5ftf-org-name"
name="org-name"
value="<?php echo esc_attr( $data['org-name'] ); ?>"
required
<?php echo $readonly ? 'readonly' : ''; ?>
/>
</div>
<?php if ( ! is_admin() ) : ?>
<?php if ( has_post_thumbnail( $pledge_id ) ) : ?>
<div class="form-field form-field__logo-display">
<?php echo get_the_post_thumbnail( $pledge_id, 'pledge-logo' ); ?>
</div>
<?php endif; ?>
<div class="form-field form-field__logo">
<label for="5ftf-org-logo">
<?php esc_html_e( 'Logo', 'wporg-5ftf' ); ?>
</label>
<br />
<input
type="file"
id="5ftf-org-logo"
name="org-logo"
/>
</div>
<?php endif; ?>
<div class="form-field">
<label for="5ftf-org-url">
<?php esc_html_e( 'Website Address', 'wporg-5ftf' ); ?>
</label>
<input
type="url"
id="5ftf-org-url"
name="org-url"
placeholder="https://example.com"
value="<?php echo esc_attr( $data['org-url'] ); ?>"
required
<?php echo $readonly ? 'readonly' : ''; ?>
/>
</div>
<div class="form-field">
<label for="5ftf-org-description">
<?php esc_html_e( 'Organization Blurb', 'wporg-5ftf' ); ?>
</label>
<textarea
id="5ftf-org-description"
name="org-description"
rows="5"
required
<?php echo $readonly ? 'readonly' : ''; ?>
><?php /* phpcs:ignore -- php tags should be on the same line as textarea to prevent extra whitespace */
echo esc_html( $data['org-description'] );
/* phpcs:ignore */ ?></textarea>
</div>