PluginProbe
Friends / 4.3.1
Friends v4.3.1
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 4.3.1, at templates/admin/settings.php

345 lines 14.0 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 <tr>
16 <th><?php esc_html_e( 'Retention', 'friends' ); ?></th>
17 <td>
18 <fieldset>
19 <div>
20 <input type="checkbox" name="friends_enable_retention_days" id="friends_enable_retention_days" value="1" <?php checked( '1', $args['retention_days_enabled'] ); ?> />
21 <span id="friends_enable_retention_days_line" class="<?php echo esc_attr( $args['retention_days_enabled'] ? '' : 'disabled' ); ?>">
22 <?php
23 echo '<span>';
24 echo wp_kses(
25 sprintf(
26 // translators: %s is an input field that allows specifying a number.
27 __( 'Only keep posts for %s days.', 'friends' ),
28 '<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">'
29 ),
30 array(
31 'input' => array(
32 'type' => array(),
33 'min' => array(),
34 'id' => array(),
35 'name' => array(),
36 'value' => array(),
37 'size' => array(),
38 'disabled' => array(),
39 ),
40 )
41 );
42 echo '</span> <span>';
43 echo esc_html(
44 sprintf(
45 // translators: %s is a date.
46 __( 'Earliest post: %s', 'friends' ),
47 /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ date_i18n( __( 'F j, Y' ), $args['earliest_post_date'] )
48 )
49 );
50 echo '</span>';
51 ?>
52 </span>
53 </div>
54 <div>
55 <input type="checkbox" name="friends_enable_retention_number" id="friends_enable_retention_number" value="1" <?php checked( '1', $args['retention_number_enabled'] ); ?> />
56 <span id="friends_enable_retention_number_line" class="<?php echo esc_attr( $args['retention_number_enabled'] ? '' : 'disabled' ); ?>">
57 <?php
58 echo '<span>';
59 echo wp_kses(
60 sprintf(
61 // translators: %s is an input field that allows specifying a number.
62 __( 'Only keep the last %s posts.', 'friends' ),
63 '<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">'
64 ),
65 array(
66 'input' => array(
67 'type' => array(),
68 'min' => array(),
69 'id' => array(),
70 'name' => array(),
71 'value' => array(),
72 'size' => array(),
73 'disabled' => array(),
74 ),
75 )
76 );
77 echo '</span> <span>';
78 echo esc_html(
79 sprintf(
80 // translators: %s is a date.
81 __( 'Current number of posts: %s', 'friends' ),
82 number_format_i18n( $args['post_count'] )
83 )
84 );
85 echo '</span>';
86 ?>
87 </span>
88 </div>
89 <div>
90 <input type="checkbox" name="retention_delete_reacted" id="retention_delete_reacted" value="1" <?php checked( ! $args['retention_delete_reacted'] ); ?> />
91 <label for="retention_delete_reacted"><?php esc_html_e( 'Protect posts from deletion that I have reacted on.', 'friends' ); ?></label>
92 </div>
93 </fieldset>
94 <p class="description">
95 <?php
96 echo esc_html(
97 sprintf(
98 // translators: %s is a size in bytes or kilo bytes (kB).
99 __( 'Currently the posts use %s of disk space.', 'friends' ),
100 size_format( $args['total_size'], 1 )
101 )
102 );
103 ?>
104 </p>
105 <p class="description">
106 <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>
107 <span>
108 <?php
109 esc_html_e( 'The next auto-delete will kick in when refreshing the feeds.', 'friends' );
110 ?>
111 </span>
112 </p>
113 <p class="description">
114 <?php
115 esc_html_e( 'You can also specify this for individual friends.', 'friends' );
116 ?>
117 </p>
118 </td>
119 </tr>
120 <?php if ( current_user_can( 'manage_options' ) ) : ?>
121 <tr>
122 <th scope="row"><?php esc_html_e( 'Post Formats', 'friends' ); ?></th>
123 <td>
124 <fieldset>
125 <label for="force_enable_post_formats">
126 <input name="force_enable_post_formats" type="checkbox" id="force_enable_post_formats" value="1" <?php checked( '1', $args['force_enable_post_formats'] ); ?>>
127 <span><?php esc_html_e( 'Always enable Post Formats, regardless of the theme support.', 'friends' ); ?></span>
128 <p class="description">
129 <?php
130 echo wp_kses(
131 __( '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' ),
132 array(
133 'a' => array(
134 'href' => array(),
135 'rel' => array(),
136 'target' => array(),
137 ),
138 )
139 );
140 ?>
141 </p>
142 </label><br/>
143
144 <label for="expose_post_format_feeds">
145 <?php if ( current_theme_supports( 'post-format-feeds' ) ) : ?>
146 <span><?php esc_html_e( 'Your theme already supports exposing Post Formats as alternate feeds on your homepage.', 'friends' ); ?></span>
147 <?php else : ?>
148 <input name="expose_post_format_feeds" type="checkbox" id="expose_post_format_feeds" value="1" <?php checked( '1', $args['expose_post_format_feeds'] ); ?>>
149 <span>
150 <?php
151 // translators: %s is a HTML snippet.
152 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() ) );
153 ?>
154 </span>
155 <?php endif; ?>
156 </fieldset>
157 </td>
158 </tr>
159 <?php endif; ?>
160 <?php if ( current_user_can( 'manage_options' ) ) : ?>
161 <tr id="compose">
162 <th scope="row"><?php esc_html_e( 'Compose', 'friends' ); ?></th>
163 <td>
164 <fieldset>
165 <label for="friends_compose_post_format">
166 <span><?php esc_html_e( 'Default post format for new posts:', 'friends' ); ?></span>
167 <select name="friends_compose_post_format" id="friends_compose_post_format">
168 <?php foreach ( get_post_format_strings() as $format => $label ) : ?>
169 <option value="<?php echo esc_attr( $format ); ?>"<?php selected( $args['compose_post_format'], $format ); ?>><?php echo esc_html( $label ); ?></option>
170 <?php endforeach; ?>
171 </select>
172 </label>
173 <br/><br/>
174 <label for="friends_exclude_compose_format_from_feed">
175 <input name="friends_exclude_compose_format_from_feed" type="checkbox" id="friends_exclude_compose_format_from_feed" value="1" <?php checked( '1', $args['exclude_compose_format_from_feed'] ); ?>>
176 <span><?php esc_html_e( 'Exclude posts in this format from the main RSS feed.', 'friends' ); ?></span>
177 </label>
178 <p class="description">
179 <?php esc_html_e( 'This prevents short status posts from appearing in your regular blog RSS feed.', 'friends' ); ?>
180 </p>
181 </fieldset>
182 </td>
183 </tr>
184 <?php endif; ?>
185 <tr>
186 <th scope="row"><?php esc_html_e( 'Reactions', 'friends' ); ?></th>
187 <td>
188 <fieldset>
189 <span><?php esc_html_e( 'Allow these emojis for reactions:', 'friends' ); ?></span>
190
191 <ol id="available-emojis">
192 <?php
193 foreach ( Friends\Reactions::get_available_emojis() as $_id => $data ) {
194 Friends\Friends::template_loader()->get_template_part(
195 'admin/add-reaction-li',
196 null,
197 array(
198 'id' => $_id,
199 'emoji' => $data->char,
200 )
201 );
202 }
203 ?>
204 </ol>
205 <a href="" id="admin-add-emoji"><?php esc_html_e( 'Add an emoji', 'friends' ); ?></a>
206 <?php Friends\Friends::template_loader()->get_template_part( 'admin/reactions-picker' ); ?>
207 <?php if ( class_exists( 'Activitypub\Activitypub' ) ) : ?>
208 <p class="description"><?php esc_html_e( 'This will always send a "Like" on ActivityPub but you can use different reactions to distinguish them for yourself. For example ⭐️ for bookmarks and ❤️ for likes.', 'friends' ); ?></p>
209 <?php endif; ?>
210 </fieldset>
211 </td>
212 </tr>
213 <tr>
214 <th scope="row"><?php esc_html_e( 'Auto-Tagging', 'friends' ); ?></th>
215 <td>
216 <fieldset>
217 <label for="disable_auto_tagging">
218 <input name="disable_auto_tagging" type="checkbox" id="disable_auto_tagging" value="1" <?php checked( '1', $args['disable_auto_tagging'] ); ?> />
219 <span><?php esc_html_e( 'Disable automatic tagging of incoming posts with hashtags.', 'friends' ); ?></span>
220 </label>
221 <p class="description">
222 <?php
223 esc_html_e( 'When incoming friend posts are tagged based on contained hashtags, you can filter by tag.', 'friends' );
224 echo ' ';
225 esc_html_e( 'These tags are separate from the tags you use for your own posts.', 'friends' );
226 echo '<br>';
227 esc_html_e( 'If you like to avoid an increased number of taxonomy terms in your database, you can disable this, although tags indicating a mention for local users will always be applied.', 'friends' );
228 ?>
229 </p>
230 </fieldset>
231 </td>
232 </tr>
233 <tr>
234 <th scope="row"><?php esc_html_e( 'Link Previews', 'friends' ); ?></th>
235 <td>
236 <fieldset>
237 <label for="disable_link_previews">
238 <input name="disable_link_previews" type="checkbox" id="disable_link_previews" value="1" <?php checked( '1', $args['disable_link_previews'] ); ?> />
239 <span><?php esc_html_e( 'Disable link previews for incoming posts.', 'friends' ); ?></span>
240 </label>
241 <p class="description">
242 <?php
243 esc_html_e( 'When a status contains a link but no image or video of its own, a preview card with the linked page\'s title, description and image can be shown below the post.', 'friends' );
244 echo '<br>';
245 esc_html_e( 'To do so, your site downloads the linked page in the background, so disable this if you\'d rather not have your site contact the linked websites.', 'friends' );
246 ?>
247 </p>
248 </fieldset>
249 </td>
250 </tr>
251 <tr>
252 <th scope="row" rowspan="3"><?php esc_html_e( 'Frontend', 'friends' ); ?></th>
253 <td>
254 <fieldset>
255 <label for="frontend-default-view">
256 <span><?php esc_html_e( 'Default view:', 'friends' ); ?></span>
257 <select name="frontend_default_view" id="frontend-default-view">
258 <option value="expanded"<?php selected( $args['frontend_default_view'], 'expanded' ); ?>><?php esc_html_e( 'Expanded mode', 'friends' ); ?></option>
259 <option value="collapsed"<?php selected( $args['frontend_default_view'], 'collapsed' ); ?>><?php esc_html_e( 'Compact mode', 'friends' ); ?></option>
260 </select>
261 </label>
262 </fieldset>
263 </td>
264 </tr>
265 <tr>
266 <td>
267 <fieldset>
268 <label for="frontend-theme">
269 <span><?php esc_html_e( 'Main Theme:', 'friends' ); ?></span>
270 <select name="friends_frontend_theme" id="frontend-theme">
271 <?php foreach ( Friends\Frontend::get_themes() as $theme => $theme_name ) : ?>
272 <option value="<?php echo esc_attr( $theme ); ?>"<?php selected( $args['frontend_theme'], $theme ); ?>><?php echo esc_html( $theme_name ); ?></option>
273 <?php endforeach; ?>
274 </select>
275 </label>
276 <details><summary>Post Type Themes</summary>
277 <table>
278 <?php foreach ( $args['post_format_strings'] as $post_type_slug => $post_type_title ) : ?>
279 <tr>
280 <td><label for="frontend-theme-<?php echo esc_attr( $post_type_slug ); ?>"><?php echo esc_html( $post_type_title ); ?></label></td>
281 <td>
282 <select name="friends_frontend_theme_<?php echo esc_attr( $post_type_slug ); ?>" id="frontend-theme-<?php echo esc_attr( $post_type_slug ); ?>">
283 <option value=""><?php esc_html_e( 'Main Theme', 'friends' ); ?></option>
284 <?php foreach ( Friends\Frontend::get_themes() as $theme => $theme_name ) : ?>
285 <option value="<?php echo esc_attr( $theme ); ?>"<?php selected( $args[ 'frontend_theme_' . $post_type_slug ], $theme ); ?>><?php echo esc_html( $theme_name ); ?></option>
286 <?php endforeach; ?>
287 </select>
288 </td>
289 </tr>
290 <?php endforeach; ?>
291 </table>
292 </details>
293 </fieldset>
294 <p>
295 <?php
296 echo wp_kses_post(
297 sprintf(
298 // translators: %1$s is a link, %2$s is a link.
299 __( 'Check out the <a href=%1$s>available themes</a>, or <a href=%2$s>write your own</a>.', 'friends' ),
300 '"https://github.com/akirk/friends/blob/main/THEMES.md"',
301 '"https://github.com/akirk/friends/wiki/Writing-Themes"'
302 )
303 );
304 ?>
305 </p>
306 </td>
307 </tr>
308 </tbody>
309 </table>
310 <?php do_action( 'friends_settings_form_bottom' ); ?>
311 <p class="submit">
312 <input type="submit" id="submit" class="button button-primary" value="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Save Changes' ); ?>">
313 </p>
314 <?php if ( ! current_user_can( 'manage_options' ) ) : ?>
315 <p class="description">
316 <?php esc_html_e( 'Administrators have access to these additional settings:', 'friends' ); ?>
317 <ul class="ul-disc">
318 <?php
319 foreach ( array(
320 __( 'Comments' ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain
321 __( 'Post Formats', 'friends' ),
322 __( 'Compose', 'friends' ),
323 ) as $setting ) :
324 ?>
325 <li><?php echo esc_html( $setting ); ?></li>
326 <?php endforeach; ?>
327 </ul>
328 </p>
329 <?php endif; ?>
330 </form>
331 <?php if ( current_user_can( 'manage_options' ) ) : ?>
332 <h2><?php esc_html_e( 'Advanced', 'friends' ); ?></h2>
333 <p>
334 <?php
335 printf(
336 /* translators: %s is a link to the migrations page. */
337 esc_html__( 'Database migrations can be managed on the %s page.', 'friends' ),
338 '<a href="' . esc_url( admin_url( 'admin.php?page=friends-migrations' ) ) . '">' . esc_html__( 'Migrations', 'friends' ) . '</a>'
339 );
340 ?>
341 </p>
342 <?php endif; ?>
343 <?php
344 do_action( 'friends_settings_after_form' );
345