form.php
124 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack_Flickr_Widget settings form output. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | //phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 9 | ?> |
| 10 | <p> |
| 11 | <label> |
| 12 | <?php esc_html_e( 'Title:', 'jetpack' ); ?> |
| 13 | </label> |
| 14 | <input |
| 15 | class="widefat" |
| 16 | name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" |
| 17 | type="text" |
| 18 | value="<?php echo esc_attr( $instance['title'] ); ?>" |
| 19 | /> |
| 20 | </p> |
| 21 | |
| 22 | <p> |
| 23 | <label> |
| 24 | <?php esc_html_e( 'Flickr RSS URL:', 'jetpack' ); ?> |
| 25 | </label> |
| 26 | <input |
| 27 | class="widefat" |
| 28 | name="<?php echo esc_attr( $this->get_field_name( 'flickr_rss_url' ) ); ?>" |
| 29 | type="text" |
| 30 | value="<?php echo esc_attr( $instance['flickr_rss_url'] ); ?>" |
| 31 | /> |
| 32 | </p> |
| 33 | <p> |
| 34 | <small> |
| 35 | <?php esc_html_e( 'To find your Flickr RSS URL, go to your photostream, add "?details=1" to the URL, and hit enter. Scroll down until you see the RSS icon or the "Latest" link. Right-click on either options and copy the URL. Paste into the box above.', 'jetpack' ); ?> |
| 36 | </small> |
| 37 | </p> |
| 38 | <p> |
| 39 | <small> |
| 40 | <?php |
| 41 | echo sprintf( |
| 42 | wp_kses( |
| 43 | /* Translators: %s is the URL to an example Flickr RSS feed. */ |
| 44 | __( 'Leave the Flickr RSS URL field blank to display <a target="_blank" href="%s">interesting</a> Flickr photos.', 'jetpack' ), |
| 45 | array( |
| 46 | 'a' => array( |
| 47 | 'href' => array(), |
| 48 | 'target' => array(), |
| 49 | ), |
| 50 | ) |
| 51 | ), |
| 52 | 'https://www.flickr.com/explore/interesting' |
| 53 | ); |
| 54 | ?> |
| 55 | </small> |
| 56 | </p> |
| 57 | |
| 58 | <p> |
| 59 | <label> |
| 60 | <?php esc_html_e( 'How many photos would you like to display?', 'jetpack' ); ?> |
| 61 | </label> |
| 62 | <select name="<?php echo esc_attr( $this->get_field_name( 'items' ) ); ?>"> |
| 63 | <?php for ( $i = 1; $i <= 10; ++$i ) { ?> |
| 64 | <option |
| 65 | <?php selected( $instance['items'], $i ); ?> |
| 66 | value="<?php echo esc_attr( $i ); ?>" |
| 67 | > |
| 68 | <?php echo esc_html( $i ); ?> |
| 69 | </option> |
| 70 | <?php } ?> |
| 71 | </select> |
| 72 | </p> |
| 73 | |
| 74 | <p> |
| 75 | <label> |
| 76 | <input |
| 77 | type="checkbox" |
| 78 | name="<?php echo esc_attr( $this->get_field_name( 'target' ) ); ?>" |
| 79 | <?php checked( $instance['target'] ); ?> |
| 80 | /> |
| 81 | <?php esc_html_e( 'Open images in new tab?', 'jetpack' ); ?> |
| 82 | </label> |
| 83 | </p> |
| 84 | <p> |
| 85 | <div> |
| 86 | <?php esc_html_e( 'What size photos would you like to display?', 'jetpack' ); ?> |
| 87 | </div> |
| 88 | <ul> |
| 89 | <li> |
| 90 | <label> |
| 91 | <input |
| 92 | <?php checked( $instance['flickr_image_size'], 'thumbnail' ); ?> |
| 93 | name="<?php echo esc_attr( $this->get_field_name( 'flickr_image_size' ) ); ?>" |
| 94 | type="radio" |
| 95 | value="thumbnail" |
| 96 | /> |
| 97 | <?php esc_html_e( 'Thumbnail', 'jetpack' ); ?> |
| 98 | </label> |
| 99 | </li> |
| 100 | <li> |
| 101 | <label> |
| 102 | <input |
| 103 | <?php checked( $instance['flickr_image_size'], 'small' ); ?> |
| 104 | name="<?php echo esc_attr( $this->get_field_name( 'flickr_image_size' ) ); ?>" |
| 105 | type="radio" |
| 106 | value="small" |
| 107 | /> |
| 108 | <?php esc_html_e( 'Medium', 'jetpack' ); ?> |
| 109 | </label> |
| 110 | </li> |
| 111 | <li> |
| 112 | <label> |
| 113 | <input |
| 114 | <?php checked( $instance['flickr_image_size'], 'large' ); ?> |
| 115 | name="<?php echo esc_attr( $this->get_field_name( 'flickr_image_size' ) ); ?>" |
| 116 | type="radio" |
| 117 | value="large" |
| 118 | /> |
| 119 | <?php esc_html_e( 'Large', 'jetpack' ); ?> |
| 120 | </label> |
| 121 | </li> |
| 122 | </ul> |
| 123 | </p> |
| 124 |