Changeset 49108 for trunk/src/wp-includes/widgets/class-wp-widget-links.php
- Timestamp:
- 10/08/2020 09:13:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-links.php
r47593 r49108 110 110 } 111 111 112 $instance['category'] = intval( $new_instance['category'] );113 $instance['limit'] = ! empty( $new_instance['limit'] ) ? intval( $new_instance['limit'] ): -1;112 $instance['category'] = (int) $new_instance['category']; 113 $instance['limit'] = ! empty( $new_instance['limit'] ) ? (int) $new_instance['limit'] : -1; 114 114 115 115 return $instance; … … 139 139 ); 140 140 $link_cats = get_terms( array( 'taxonomy' => 'link_category' ) ); 141 $limit = intval( $instance['limit'] );141 $limit = (int) $instance['limit']; 142 142 if ( ! $limit ) { 143 143 $limit = -1; … … 149 149 <option value=""><?php _ex( 'All Links', 'links widget' ); ?></option> 150 150 <?php foreach ( $link_cats as $link_cat ) : ?> 151 <option value="<?php echo intval( $link_cat->term_id ); ?>" <?php selected( $instance['category'], $link_cat->term_id ); ?>>151 <option value="<?php echo (int) $link_cat->term_id; ?>" <?php selected( $instance['category'], $link_cat->term_id ); ?>> 152 152 <?php echo esc_html( $link_cat->name ); ?> 153 153 </option> … … 182 182 <p> 183 183 <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label> 184 <input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo ( -1 !== $limit ) ? intval( $limit ): ''; ?>" size="3" />184 <input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo ( -1 !== $limit ) ? (int) $limit : ''; ?>" size="3" /> 185 185 </p> 186 186 <?php
Note: See TracChangeset
for help on using the changeset viewer.