Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 91
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * Jetpack_Flickr_Widget settings form output.
4 *
5 * @html-template Jetpack_Flickr_Widget::form
6 * @package automattic/jetpack
7 */
8
9if ( ! defined( 'ABSPATH' ) ) {
10    exit( 0 );
11}
12
13// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- HTML template, let Phan handle it.
14
15?>
16<p>
17    <label>
18        <?php esc_html_e( 'Title:', 'jetpack' ); ?>
19    </label>
20    <input
21        class="widefat"
22        name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
23        type="text"
24        value="<?php echo esc_attr( $instance['title'] ); ?>"
25    />
26</p>
27
28<p>
29    <label>
30        <?php esc_html_e( 'Flickr RSS URL:', 'jetpack' ); ?>
31    </label>
32    <input
33        class="widefat"
34        name="<?php echo esc_attr( $this->get_field_name( 'flickr_rss_url' ) ); ?>"
35        type="text"
36        value="<?php echo esc_attr( $instance['flickr_rss_url'] ); ?>"
37    />
38</p>
39<p>
40    <small>
41        <?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' ); ?>
42    </small>
43</p>
44<p>
45    <small>
46        <?php
47        printf(
48            wp_kses(
49                /* Translators: %s is the URL to an example Flickr RSS feed. */
50                __( 'Leave the Flickr RSS URL field blank to display <a target="_blank" href="%s">interesting</a> Flickr photos.', 'jetpack' ),
51                array(
52                    'a' => array(
53                        'href'   => array(),
54                        'target' => array(),
55                    ),
56                )
57            ),
58            'https://www.flickr.com/explore/interesting'
59        );
60        ?>
61    </small>
62</p>
63
64<p>
65    <label>
66        <?php esc_html_e( 'How many photos would you like to display?', 'jetpack' ); ?>
67    </label>
68    <select name="<?php echo esc_attr( $this->get_field_name( 'items' ) ); ?>">
69        <?php for ( $i = 1; $i <= 10; ++$i ) { ?>
70            <option
71                <?php selected( $instance['items'], $i ); ?>
72                value="<?php echo esc_attr( $i ); ?>"
73            >
74                <?php echo esc_html( $i ); ?>
75            </option>
76        <?php } ?>
77    </select>
78</p>
79
80<p>
81    <label>
82        <input
83            type="checkbox"
84            name="<?php echo esc_attr( $this->get_field_name( 'target' ) ); ?>"
85            <?php checked( $instance['target'] ); ?>
86        />
87        <?php esc_html_e( 'Open images in new tab?', 'jetpack' ); ?>
88    </label>
89</p>
90<p>
91    <div>
92        <?php esc_html_e( 'What size photos would you like to display?', 'jetpack' ); ?>
93    </div>
94    <ul>
95        <li>
96            <label>
97                <input
98                    <?php checked( $instance['flickr_image_size'], 'thumbnail' ); ?>
99                    name="<?php echo esc_attr( $this->get_field_name( 'flickr_image_size' ) ); ?>"
100                    type="radio"
101                    value="thumbnail"
102                />
103                <?php esc_html_e( 'Thumbnail', 'jetpack' ); ?>
104            </label>
105        </li>
106        <li>
107            <label>
108                <input
109                    <?php checked( $instance['flickr_image_size'], 'small' ); ?>
110                    name="<?php echo esc_attr( $this->get_field_name( 'flickr_image_size' ) ); ?>"
111                    type="radio"
112                    value="small"
113                />
114                <?php esc_html_e( 'Medium', 'jetpack' ); ?>
115            </label>
116        </li>
117        <li>
118            <label>
119                <input
120                    <?php checked( $instance['flickr_image_size'], 'large' ); ?>
121                    name="<?php echo esc_attr( $this->get_field_name( 'flickr_image_size' ) ); ?>"
122                    type="radio"
123                    value="large"
124                />
125                <?php esc_html_e( 'Large', 'jetpack' ); ?>
126            </label>
127        </li>
128    </ul>
129</p>