Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/widgets/gallery/template...
File: form.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Jetpack_Gallery_Widget backend settings form output.
[2] Fix | Delete
*
[3] Fix | Delete
* @html-template Jetpack_Gallery_Widget::form
[4] Fix | Delete
* @package automattic/jetpack
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[8] Fix | Delete
exit( 0 );
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- HTML template, let Phan handle it.
[12] Fix | Delete
[13] Fix | Delete
?>
[14] Fix | Delete
<p>
[15] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'jetpack' ); ?>
[16] Fix | Delete
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
[17] Fix | Delete
type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
[18] Fix | Delete
</label>
[19] Fix | Delete
</p>
[20] Fix | Delete
[21] Fix | Delete
<p>
[22] Fix | Delete
<label>
[23] Fix | Delete
<?php esc_html_e( 'Images:', 'jetpack' ); ?>
[24] Fix | Delete
</label>
[25] Fix | Delete
</p>
[26] Fix | Delete
[27] Fix | Delete
<div class="gallery-widget-thumbs-wrapper">
[28] Fix | Delete
<div class="gallery-widget-thumbs">
[29] Fix | Delete
<?php
[30] Fix | Delete
[31] Fix | Delete
// Add the thumbnails to the widget box.
[32] Fix | Delete
$attachments = $this->get_attachments( $instance );
[33] Fix | Delete
[34] Fix | Delete
foreach ( $attachments as $attachment ) {
[35] Fix | Delete
$url = add_query_arg(
[36] Fix | Delete
array(
[37] Fix | Delete
'w' => self::THUMB_SIZE,
[38] Fix | Delete
'h' => self::THUMB_SIZE,
[39] Fix | Delete
'crop' => 'true',
[40] Fix | Delete
),
[41] Fix | Delete
wp_get_attachment_url( $attachment->ID )
[42] Fix | Delete
);
[43] Fix | Delete
[44] Fix | Delete
?>
[45] Fix | Delete
[46] Fix | Delete
<img src="<?php echo esc_url( $url ); ?>" title="<?php echo esc_attr( $attachment->post_title ); ?>" alt="<?php echo esc_attr( $attachment->post_title ); ?>"
[47] Fix | Delete
width="<?php echo (int) self::THUMB_SIZE; // @phan-suppress-current-line PhanRedundantCondition -- phpcs wants an explicit cast, phan complains it's redundant. 🤷 ?>" height="<?php echo (int) self::THUMB_SIZE; ?>" class="thumb" />
[48] Fix | Delete
<?php } ?>
[49] Fix | Delete
</div>
[50] Fix | Delete
[51] Fix | Delete
<div style="clear: both;"></div>
[52] Fix | Delete
</div>
[53] Fix | Delete
[54] Fix | Delete
<p>
[55] Fix | Delete
<a class="button gallery-widget-choose-images"><span class="wp-media-buttons-icon"></span> <?php esc_html_e( 'Choose Images', 'jetpack' ); ?></a>
[56] Fix | Delete
</p>
[57] Fix | Delete
[58] Fix | Delete
<p class="gallery-widget-link-wrapper">
[59] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'link' ) ); ?>"><?php esc_html_e( 'Link To:', 'jetpack' ); ?></label>
[60] Fix | Delete
<select name="<?php echo esc_attr( $this->get_field_name( 'link' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'link' ) ); ?>" class="widefat">
[61] Fix | Delete
<?php foreach ( $allowed_values['link'] as $key => $label ) : ?>
[62] Fix | Delete
<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $instance['link'], $key ); ?>><?php echo esc_html( $label ); ?></option>
[63] Fix | Delete
<?php endforeach; ?>
[64] Fix | Delete
</select>
[65] Fix | Delete
</p>
[66] Fix | Delete
[67] Fix | Delete
<p>
[68] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'random' ) ); ?>"><?php esc_html_e( 'Random Order:', 'jetpack' ); ?></label>
[69] Fix | Delete
<input name="<?php echo esc_attr( $this->get_field_name( 'random' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'random' ) ); ?>" type="checkbox"<?php checked( ! empty( $instance['random'] ) ); ?>>
[70] Fix | Delete
</p>
[71] Fix | Delete
[72] Fix | Delete
<p class="gallery-widget-style-wrapper">
[73] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>"><?php esc_html_e( 'Style:', 'jetpack' ); ?></label>
[74] Fix | Delete
<select name="<?php echo esc_attr( $this->get_field_name( 'type' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>" class="widefat gallery-widget-style">
[75] Fix | Delete
<?php foreach ( $allowed_values['type'] as $key => $label ) : ?>
[76] Fix | Delete
<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $instance['type'], $key ); ?>><?php echo esc_html( $label ); ?></option>
[77] Fix | Delete
<?php endforeach; ?>
[78] Fix | Delete
</select>
[79] Fix | Delete
</p>
[80] Fix | Delete
[81] Fix | Delete
[82] Fix | Delete
<?php // Hidden input to hold the selected image ids as a csv list. ?>
[83] Fix | Delete
<input type="hidden" class="gallery-widget-ids" name="<?php echo esc_attr( $this->get_field_name( 'ids' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'ids' ) ); ?>" value="<?php echo esc_attr( $instance['ids'] ); ?>" />
[84] Fix | Delete
[85] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function