PluginProbe
Friends / 2.8.8
Friends v2.8.8
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / templates / admin / settings.php

settings.php in Friends 2.8.8, at templates/admin/settings.php

282 lines 10.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This template contains the Friends Settings.
4 *
5 * @package Friends
6 */
7
8 do_action( 'friends_settings_before_form' );
9
10 ?>
11 <form method="post">
12 <?php wp_nonce_field( 'friends-settings' ); ?>
13 <table class="form-table">
14 <tbody>
15 <?php if ( current_user_can( 'manage_options' ) ) : ?>
16 <tr>
17 <th scope="row"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Friendships' ); ?></th>
18 <td>
19 <fieldset>
20 <label for="enable_wp_friendships">
21 <input name="enable_wp_friendships" type="checkbox" id="enable_wp_friendships" value="1" <?php checked( '1', $args['enable_wp_friendships'] ); ?> />
22 <span><?php esc_html_e( 'Enable friendships between WordPresses.', 'friends' ); ?></span>
23 </label>
24 </fieldset>
25 </td>
26 </tr>
27 <?php
28 endif;
29 ?>
30 <tr>
31 <th><?php esc_html_e( 'Retention', 'friends' ); ?></th>
32 <td>
33 <fieldset>
34 <div>
35 <input type="checkbox" name="friends_enable_retention_days" id="friends_enable_retention_days" value="1" <?php checked( '1', $args['retention_days_enabled'] ); ?> />
36 <span id="friends_enable_retention_days_line" class="<?php echo esc_attr( $args['retention_days_enabled'] ? '' : 'disabled' ); ?>">
37 <?php
38 echo '<span>';
39 echo wp_kses(
40 sprintf(
41 // translators: %s is an input field that allows specifying a number.
42 __( 'Only keep posts for %s days.', 'friends' ),
43 '<input type="number" min="1" id="friends_retention_days" name="friends_retention_days" value="' . esc_attr( $args['retention_days'] ) . '"' . ( $args['retention_days_enabled'] ? '' : ' disabled="disabled"' ) . ' size="3">'
44 ),
45 array(
46 'input' => array(
47 'type' => array(),
48 'min' => array(),
49 'id' => array(),
50 'name' => array(),
51 'value' => array(),
52 'size' => array(),
53 'disabled' => array(),
54 ),
55 )
56 );
57 echo '</span> <span>';
58 echo esc_html(
59 sprintf(
60 // translators: %s is a date.
61 __( 'Earliest post: %s', 'friends' ),
62 /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ date_i18n( __( 'F j, Y' ), $args['earliest_post_date'] )
63 )
64 );
65 echo '</span>';
66 ?>
67 </span>
68 </div>
69 <div>
70 <input type="checkbox" name="friends_enable_retention_number" id="friends_enable_retention_number" value="1" <?php checked( '1', $args['retention_number_enabled'] ); ?> />
71 <span id="friends_enable_retention_number_line" class="<?php echo esc_attr( $args['retention_number_enabled'] ? '' : 'disabled' ); ?>">
72 <?php
73 echo '<span>';
74 echo wp_kses(
75 sprintf(
76 // translators: %s is an input field that allows specifying a number.
77 __( 'Only keep the last %s posts.', 'friends' ),
78 '<input type="number" min="1" id="friends_retention_number" name="friends_retention_number" value="' . esc_attr( $args['retention_number'] ) . '"' . ( $args['retention_number_enabled'] ? '' : ' disabled="disabled"' ) . ' size="3">'
79 ),
80 array(
81 'input' => array(
82 'type' => array(),
83 'min' => array(),
84 'id' => array(),
85 'name' => array(),
86 'value' => array(),
87 'size' => array(),
88 'disabled' => array(),
89 ),
90 )
91 );
92 echo '</span> <span>';
93 echo esc_html(
94 sprintf(
95 // translators: %s is a date.
96 __( 'Current number of posts: %s', 'friends' ),
97 number_format_i18n( $args['post_count'] )
98 )
99 );
100 echo '</span>';
101 ?>
102 </span>
103 </div>
104 </fieldset>
105 <p class="description">
106 <?php
107 echo esc_html(
108 sprintf(
109 // translators: %s is a size in bytes or kilo bytes (kB).
110 __( 'Currently the posts use %s of disk space.', 'friends' ),
111 size_format( $args['total_size'], 1 )
112 )
113 );
114 ?>
115 </p>
116 <p class="description">
117 <span><?php esc_html_e( 'If you need to limit the amount of space, choose one of the options above (they can be combined).', 'friends' ); ?></span>
118 <span>
119 <?php
120 esc_html_e( 'The next auto-delete will kick in when refreshing the feeds.', 'friends' );
121 ?>
122 </span>
123 </p>
124 <p class="description">
125 <?php
126 esc_html_e( 'You can also specify this for individual friends.', 'friends' );
127 ?>
128 </p>
129 </td>
130 </tr>
131 <?php if ( current_user_can( 'manage_options' ) ) : ?>
132 <tr>
133 <th scope="row"><?php esc_html_e( 'Post Formats', 'friends' ); ?></th>
134 <td>
135 <fieldset>
136 <label for="limit_homepage_post_format">
137 <?php
138 $select = '<select name="limit_homepage_post_format" id="limit_homepage_post_format">';
139 $select .= '<option value="0"' . selected( $args['limit_homepage_post_format'], false, false ) . '>' . esc_html( _x( 'All', 'All post-formats', 'friends' ) ) . '</option>';
140 foreach ( $args['post_format_strings'] as $format => $title ) {
141 // translators: %s is a post format title.
142 $select .= '<option value="' . esc_attr( $format ) . '"' . selected( $args['limit_homepage_post_format'], $format, false ) . '>' . esc_html( sprintf( _x( '%s only', 'post-format only', 'friends' ), $title ) ) . '</option>';
143 }
144 $select .= '</select>';
145
146 echo wp_kses(
147 sprintf(
148 // translators: %s is a Select dropdown of post formats, e.g. "All" or "Standard only" (see "post-format only").
149 __( 'On your homepage, show %s posts.', 'friends' ),
150 $select
151 ),
152 array(
153 'select' => array(
154 'name' => array(),
155 ),
156 'label' => array(),
157 'option' => array(
158 'value' => array(),
159 'selected' => array(),
160 ),
161 'a' => array(
162 'href' => array(),
163 'rel' => array(),
164 'target' => array(),
165 ),
166 )
167 );
168 ?>
169 </label>
170 <br/>
171
172 <label for="force_enable_post_formats">
173 <input name="force_enable_post_formats" type="checkbox" id="force_enable_post_formats" value="1" <?php checked( '1', $args['force_enable_post_formats'] ); ?>>
174 <span><?php esc_html_e( 'Always enable Post Formats, regardless of the theme support.', 'friends' ); ?></span>
175 <p class="description">
176 <?php
177 echo wp_kses(
178 __( 'With <a href="https://wordpress.org/support/article/post-formats/#supported-formats">Post Formats</a> you can categorize your content in a more detailed way. Examples for post formats are "photo" or "link."', 'friends' ),
179 array(
180 'a' => array(
181 'href' => array(),
182 'rel' => array(),
183 'target' => array(),
184 ),
185 )
186 );
187 ?>
188 </p>
189 </label><br/>
190
191 <label for="expose_post_format_feeds">
192 <?php if ( current_theme_supports( 'post-format-feeds' ) ) : ?>
193 <span><?php esc_html_e( 'Your theme already supports exposing Post Formats as alternate feeds on your homepage.', 'friends' ); ?></span>
194 <?php else : ?>
195 <input name="expose_post_format_feeds" type="checkbox" id="expose_post_format_feeds" value="1" <?php checked( '1', $args['expose_post_format_feeds'] ); ?>>
196 <span>
197 <?php
198 // translators: %s is a HTML snippet.
199 echo wp_kses( sprintf( __( 'Expose Post Formats as alternate feeds on your homepage (as %s).', 'friends' ), '<code>&lt;link rel="alternate"/ &gt;</code>' ), array( 'code' => array() ) );
200 ?>
201 </span>
202 <?php endif; ?>
203 </fieldset>
204 </td>
205 </tr>
206 <?php endif; ?>
207 <tr>
208 <th scope="row"><?php esc_html_e( 'Reactions', 'friends' ); ?></th>
209 <td>
210 <fieldset>
211 <span><?php esc_html_e( 'Allow these emojis for reactions:', 'friends' ); ?></span>
212
213 <ol id="available-emojis">
214 <?php
215 foreach ( Friends\Reactions::get_available_emojis() as $id => $data ) {
216 Friends\Friends::template_loader()->get_template_part(
217 'admin/add-reaction-li',
218 null,
219 array(
220 'id' => $id,
221 'emoji' => $data->char,
222 )
223 );
224 }
225 ?>
226 </ol>
227 <a href="" id="admin-add-emoji"><?php esc_html_e( 'Add an emoji', 'friends' ); ?></a>
228 <?php Friends\Friends::template_loader()->get_template_part( 'admin/reactions-picker' ); ?>
229 </fieldset>
230 </td>
231 </tr>
232 <tr>
233 <th scope="row" rowspan="2"><?php esc_html_e( 'Frontend', 'friends' ); ?></th>
234 <td>
235 <fieldset>
236 <label for="frontend-default-view">
237 <span><?php esc_html_e( 'Default view:', 'friends' ); ?></span>
238 <select name="frontend_default_view" id="frontend-default-view">
239 <option value="expanded"<?php selected( $args['frontend_default_view'], 'expanded' ); ?>><?php esc_html_e( 'Expanded', 'friends' ); ?></option>
240 <option value="collapsed"<?php selected( $args['frontend_default_view'], 'collapsed' ); ?>><?php esc_html_e( 'Collapsed', 'friends' ); ?></option>
241 </select>
242 </label>
243 </fieldset>
244 </td>
245 </tr>
246 <?php if ( ! function_exists( 'classicpress_version' ) ) : ?>
247 <tr>
248 <td>
249 <fieldset>
250 <label for="blocks_everywhere">
251 <input name="blocks_everywhere" type="checkbox" id="blocks_everywhere" value="1" <?php checked( '1', $args['blocks_everywhere'] ); ?> disabled="disabled" />
252 <span><?php esc_html_e( 'Unfortunately, Gutenberg on the frontend is currently unavailable.', 'friends' ); ?></span>
253 </label>
254 </fieldset>
255 </td>
256 </tr>
257 <?php endif; ?>
258 </tbody>
259 </table>
260 <?php do_action( 'friends_settings_form_bottom' ); ?>
261 <p class="submit">
262 <input type="submit" id="submit" class="button button-primary" value="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Save Changes' ); ?>">
263 </p>
264 <?php if ( ! current_user_can( 'manage_options' ) ) : ?>
265 <p class="description">
266 <?php esc_html_e( 'Administrators have access to these additional settings:', 'friends' ); ?>
267 <ul class="ul-disc">
268 <?php
269 foreach ( array(
270 __( 'Comments' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
271 __( 'Post Formats', 'friends' ),
272 ) as $setting ) :
273 ?>
274 <li><?php echo esc_html( $setting ); ?></li>
275 <?php endforeach; ?>
276 </ul>
277 </p>
278 <?php endif; ?>
279 </form>
280 <?php
281 do_action( 'friends_settings_after_form' );
282