Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions src/wizard/class-instant-articles-option.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ public static function universal_render_handler( $args = null ) {

$placeholder = $args['placeholder'] ?? '';

$attr_disabled = isset( $args['disable'] ) && true === $args['disable']
? disabled()
: '';

$field_description = isset( $args['description'] )
? wp_kses(
$args['description'],
Expand Down Expand Up @@ -318,7 +314,7 @@ public static function universal_render_handler( $args = null ) {
name="<?php echo esc_attr( $name ) ?>"
id="<?php echo esc_attr( $id ) ?>"
<?php echo esc_attr( $attr_checked ); ?>
<?php echo esc_attr( $attr_disabled ); ?>
<?php disabled( isset( $args['disable'] ) && true === $args['disable'] ); ?>
/>
<?php echo esc_html( $field_checkbox_label ); ?>
</label>
Expand All @@ -335,18 +331,13 @@ public static function universal_render_handler( $args = null ) {
<select
id="<?php echo esc_attr( $id ) ?>"
name="<?php echo esc_attr( $name ) ?>"
<?php echo esc_html( $attr_disabled ) ?>
<?php disabled( isset( $args['disable'] ) && true === $args['disable'] ); ?>
>
<?php foreach ( $args['select_options'] as $option_key => $option_name ) : ?>
<option
value="<?php echo esc_attr( $option_key ) ?>"
<?php echo selected( $option_key, $option_value ) ?>
<?php echo isset( $args['disable'] )
&& is_array( $args['disable'] )
&& in_array( $option_key, $args['disable'], true )
? disabled()
: '';
?>
<?php disabled( isset( $args['disable'] ) && is_array( $args['disable'] ) && in_array( $option_key, $args['disable'], true ) ); ?>
>
<?php echo esc_html( $option_name ); ?>
</option>
Expand All @@ -368,7 +359,7 @@ public static function universal_render_handler( $args = null ) {
<?php if ( $placeholder ) : ?>
placeholder="<?php echo esc_attr( $placeholder ); ?>"
<?php endif; ?>
<?php echo esc_attr( $attr_disabled ); ?>
<?php disabled( isset( $args['disable'] ) && true === $args['disable'] ); ?>
class="large-text code"
rows="8"
><?php echo array_key_exists( 'double_encode', $args ) && $args[ 'double_encode' ] ? htmlspecialchars( $option_value ) : esc_html( $option_value ); ?></textarea>
Expand All @@ -391,7 +382,7 @@ class="large-text code"
<?php if ( $placeholder ) : ?>
placeholder="<?php echo esc_attr( $placeholder ) ?>"
<?php endif; ?>
<?php echo esc_attr( $attr_disabled ) ?>
<?php disabled( isset( $args['disable'] ) && true === $args['disable'] ); ?>
value="<?php echo esc_attr( $option_value ) ?>"
class="regular-text"
/>
Expand Down