Code style correction for widget backend
This commit is contained in:
parent
f5c087b5b2
commit
b8d371999d
@ -13,12 +13,7 @@
|
|||||||
|
|
||||||
<!-- Compliance with WordPress Coding Standard -->
|
<!-- Compliance with WordPress Coding Standard -->
|
||||||
<config name="minimum_supported_wp_version" value="4.0"/>
|
<config name="minimum_supported_wp_version" value="4.0"/>
|
||||||
<rule ref="WordPress">
|
<rule ref="WordPress"/>
|
||||||
<!-- Makes view HTML code messy -->
|
|
||||||
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd"/>
|
|
||||||
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen"/>
|
|
||||||
<exclude name="Squiz.PHP.EmbeddedPhp.ContentAfterOpen"/>
|
|
||||||
</rule>
|
|
||||||
|
|
||||||
<!-- PHP compatibility level -->
|
<!-- PHP compatibility level -->
|
||||||
<config name="testVersion" value="5.2-"/>
|
<config name="testVersion" value="5.2-"/>
|
||||||
|
@ -42,49 +42,25 @@ defined( 'ABSPATH' ) || exit;
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'count' ) ); ?>">
|
<select id="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'count' ) ); ?>">
|
||||||
<option value="-1"<?php if ( '-1' === $count ) {
|
<option value="-1"
|
||||||
echo ' selected="selected"';
|
<?php
|
||||||
} ?>><?php esc_html_e( 'all', 'wplt2' ); ?></option>
|
if ( '-1' === $count ) {
|
||||||
<option value="1"<?php if ( '1' === $count ) {
|
echo ' selected="selected"';
|
||||||
echo ' selected="selected"';
|
}
|
||||||
} ?>>1
|
?>
|
||||||
</option>
|
>
|
||||||
<option value="2"<?php if ( '2' === $count ) {
|
<?php esc_html_e( 'all', 'wplt2' ); ?>
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>2
|
|
||||||
</option>
|
|
||||||
<option value="3"<?php if ( '3' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>3
|
|
||||||
</option>
|
|
||||||
<option value="4"<?php if ( '4' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>4
|
|
||||||
</option>
|
|
||||||
<option value="5"<?php if ( '5' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>5
|
|
||||||
</option>
|
|
||||||
<option value="6"<?php if ( '6' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>6
|
|
||||||
</option>
|
|
||||||
<option value="7"<?php if ( '7' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>7
|
|
||||||
</option>
|
|
||||||
<option value="8"<?php if ( '8' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>8
|
|
||||||
</option>
|
|
||||||
<option value="9"<?php if ( '9' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>9
|
|
||||||
</option>
|
|
||||||
<option value="10"<?php if ( '10' === $count ) {
|
|
||||||
echo ' selected="selected"';
|
|
||||||
} ?>>10
|
|
||||||
</option>
|
</option>
|
||||||
|
<?php
|
||||||
|
for ( $i = 1; $i <= 10; $i ++ ) {
|
||||||
|
printf(
|
||||||
|
'<option value="%d"%s>%d</option>',
|
||||||
|
$i,
|
||||||
|
( $i === $count ) ? ' selected' : '',
|
||||||
|
intval( $i )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -101,9 +77,14 @@ defined( 'ABSPATH' ) || exit;
|
|||||||
<label for="<?php echo esc_attr( $this->get_field_id( 'highlight' ) ); ?>"><?php esc_html_e( 'Highlight new:', 'wplt2' ); ?></label>
|
<label for="<?php echo esc_attr( $this->get_field_id( 'highlight' ) ); ?>"><?php esc_html_e( 'Highlight new:', 'wplt2' ); ?></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'highlight' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'highlight' ) ); ?>" type="checkbox" value="1" <?php if ( '1' === $highlight ) {
|
<?php
|
||||||
echo ' checked="checked"';
|
echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'highlight' ) ) . '"
|
||||||
} ?> /></td>
|
name="' . esc_attr( $this->get_field_name( 'highlight' ) ) . '"
|
||||||
|
type="checkbox"
|
||||||
|
value="1"
|
||||||
|
' . ( ( '1' === $highlight ) ? ' checked' : '' ) . '/>';
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@ -118,9 +99,15 @@ defined( 'ABSPATH' ) || exit;
|
|||||||
<label for="<?php echo esc_attr( $this->get_field_id( 'ajax' ) ); ?>"><?php esc_html_e( 'Auto refresh:', 'wplt2' ); ?></label>
|
<label for="<?php echo esc_attr( $this->get_field_id( 'ajax' ) ); ?>"><?php esc_html_e( 'Auto refresh:', 'wplt2' ); ?></label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'ajax' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'ajax' ) ); ?>" type="checkbox" value="1"<?php if ( '1' === $ajax ) {
|
<?php
|
||||||
echo ' checked="checked"';
|
echo '<input class="widefat"
|
||||||
} ?> />
|
id="' . esc_attr( $this->get_field_id( 'ajax' ) ) . '"
|
||||||
|
name="' . esc_attr( $this->get_field_name( 'ajax' ) ) . '"
|
||||||
|
type="checkbox"
|
||||||
|
value="1"
|
||||||
|
' . ( ( '1' === $ajax ) ? ' checked' : '' ) . '/>';
|
||||||
|
|
||||||
|
?>
|
||||||
<small><?php esc_html_e( '(enables ajax)', 'wplt2' ); ?></small>
|
<small><?php esc_html_e( '(enables ajax)', 'wplt2' ); ?></small>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user