PluginProbe
ActivityPub / 2.6.0
ActivityPub v2.6.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / templates / settings.php

settings.php in ActivityPub 2.6.0, at templates/settings.php

271 lines 12.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 \load_template(
3 __DIR__ . '/admin-header.php',
4 true,
5 array(
6 'settings' => 'active',
7 'welcome' => '',
8 'followers' => '',
9 )
10 );
11 ?>
12
13 <div class="activitypub-settings activitypub-settings-page hide-if-no-js">
14 <form method="post" action="options.php">
15 <?php \settings_fields( 'activitypub' ); ?>
16
17 <div class="box">
18 <h3><?php \esc_html_e( 'Profiles', 'activitypub' ); ?></h3>
19 <table class="form-table">
20 <tbody>
21 <tr>
22 <th scope="row">
23 <?php \esc_html_e( 'Enable profiles by type', 'activitypub' ); ?>
24 </th>
25 <td>
26 <p>
27 <label>
28 <input type="checkbox" name="activitypub_enable_users" id="activitypub_enable_users" value="1" <?php echo \checked( '1', \get_option( 'activitypub_enable_users', '1' ) ); ?> />
29 <?php \esc_html_e( 'Enable authors', 'activitypub' ); ?>
30 </label>
31 </p>
32 <p class="description">
33 <?php echo \wp_kses( \__( 'Every author on this blog (with the <code>activitypub</code> capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?>
34 <?php // translators: %s is a URL. ?>
35 <strong><?php echo \wp_kses( sprintf( \__( 'You can add/remove the capability in the <a href="%s">user settings.</a>', 'activitypub' ), admin_url( '/users.php' ) ), array( 'a' => array( 'href' => array() ) ) ); ?></strong>
36 <?php echo \wp_kses( \__( 'Select all the users you want to update, choose the method from the drop-down list and click on the "Apply" button.', 'activitypub' ), array( 'code' => array() ) ); ?>
37 </p>
38 <p>
39 <label>
40 <input type="checkbox" name="activitypub_enable_blog_user" id="activitypub_enable_blog_user" value="1" <?php echo \checked( '1', \get_option( 'activitypub_enable_blog_user', '0' ) ); ?> />
41 <?php \esc_html_e( 'Enable blog', 'activitypub' ); ?>
42 </label>
43 </p>
44 <p class="description">
45 <?php \esc_html_e( 'Your blog becomes an ActivityPub profile.', 'activitypub' ); ?>
46 </p>
47 </td>
48 </tr>
49 <tr>
50 <th scope="row">
51 <?php \esc_html_e( 'Change blog profile ID', 'activitypub' ); ?>
52 </th>
53 <td>
54 <label for="activitypub_blog_user_identifier">
55 <input class="blog-user-identifier" name="activitypub_blog_user_identifier" id="activitypub_blog_user_identifier" type="text" value="<?php echo esc_attr( \get_option( 'activitypub_blog_user_identifier', \Activitypub\Model\Blog::get_default_username() ) ); ?>" />
56 @<?php echo esc_html( \wp_parse_url( \home_url(), PHP_URL_HOST ) ); ?>
57 </label>
58 <p class="description">
59 <?php \esc_html_e( 'This profile name will federate all posts written on your blog, regardless of the author who posted it.', 'activitypub' ); ?>
60 </p>
61 <p>
62 <strong>
63 <?php \esc_html_e( 'Please avoid using an existing author’s name as the blog profile ID. Fediverse platforms might use caching and this could break the functionality completely.', 'activitypub' ); ?>
64 </strong>
65 </p>
66 </td>
67 </tr>
68 </tbody>
69 </table>
70
71 <?php \do_settings_fields( 'activitypub', 'user' ); ?>
72 </div>
73
74 <div class="box">
75 <h3><?php \esc_html_e( 'Activities', 'activitypub' ); ?></h3>
76 <table class="form-table">
77 <tbody>
78 <tr>
79 <th scope="row">
80 <?php \esc_html_e( 'Activity-Object-Type', 'activitypub' ); ?>
81 </th>
82 <td>
83 <p>
84 <label for="activitypub_object_type_note">
85 <input type="radio" name="activitypub_object_type" id="activitypub_object_type_note" value="note" <?php echo \checked( 'note', \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ); ?> />
86 <?php \esc_html_e( 'Note (default)', 'activitypub' ); ?>
87 -
88 <span class="description">
89 <?php \esc_html_e( 'Should work with most platforms.', 'activitypub' ); ?>
90 </span>
91 </label>
92 </p>
93 <p>
94 <label>
95 <input type="radio" name="activitypub_object_type" id="activitypub_object_type" value="wordpress-post-format" <?php echo \checked( 'wordpress-post-format', \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ); ?> />
96 <?php \esc_html_e( 'WordPress Post-Format', 'activitypub' ); ?>
97 -
98 <span class="description">
99 <?php \esc_html_e( 'Maps the WordPress Post-Format to the ActivityPub Object Type.', 'activitypub' ); ?>
100 </span>
101 </label>
102 </p>
103
104 </td>
105 </tr>
106 <?php // phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace ?>
107 <tr <?php if ( 'wordpress-post-format' === \get_option( 'activitypub_object_type', ACTIVITYPUB_DEFAULT_OBJECT_TYPE ) ) { echo 'style="display: none"'; } ?>>
108 <th scope="row">
109 <?php \esc_html_e( 'Post content', 'activitypub' ); ?>
110 </th>
111 <td>
112 <p><strong><?php \esc_html_e( 'These settings only apply if you use the "Note" Object-Type setting above.', 'activitypub' ); ?></strong></p>
113 <p>
114 <label for="activitypub_post_content_type_title_link">
115 <input type="radio" name="activitypub_post_content_type" id="activitypub_post_content_type_title_link" value="title" <?php echo \checked( 'title', \get_option( 'activitypub_post_content_type', 'content' ) ); ?> />
116 <?php \esc_html_e( 'Title and link', 'activitypub' ); ?>
117 -
118 <span class="description">
119 <?php \esc_html_e( 'Only the title and a link.', 'activitypub' ); ?>
120 </span>
121 </label>
122 </p>
123 <p>
124 <label for="activitypub_post_content_type_excerpt">
125 <input type="radio" name="activitypub_post_content_type" id="activitypub_post_content_type_excerpt" value="excerpt" <?php echo \checked( 'excerpt', \get_option( 'activitypub_post_content_type', 'content' ) ); ?> />
126 <?php \esc_html_e( 'Excerpt', 'activitypub' ); ?>
127 -
128 <span class="description">
129 <?php \esc_html_e( 'A content summary without markup (truncated if no excerpt is provided).', 'activitypub' ); ?>
130 </span>
131 </label>
132 </p>
133 <p>
134 <label for="activitypub_post_content_type_content">
135 <input type="radio" name="activitypub_post_content_type" id="activitypub_post_content_type_content" value="content" <?php echo \checked( 'content', \get_option( 'activitypub_post_content_type', 'content' ) ); ?> />
136 <?php \esc_html_e( 'Content (default)', 'activitypub' ); ?>
137 -
138 <span class="description">
139 <?php \esc_html_e( 'The full content.', 'activitypub' ); ?>
140 </span>
141 </label>
142 </p>
143 <p>
144 <label for="activitypub_post_content_type_custom">
145 <input type="radio" name="activitypub_post_content_type" id="activitypub_post_content_type_custom" value="custom" <?php echo \checked( 'custom', \get_option( 'activitypub_post_content_type', 'content' ) ); ?> />
146 <?php \esc_html_e( 'Custom', 'activitypub' ); ?>
147 -
148 <span class="description">
149 <?php \esc_html_e( 'Use the text area below, to customize your activities.', 'activitypub' ); ?>
150 </span>
151 </label>
152 </p>
153 <p>
154 <textarea name="activitypub_custom_post_content" id="activitypub_custom_post_content" rows="10" cols="50" class="large-text" placeholder="<?php echo wp_kses( ACTIVITYPUB_CUSTOM_POST_CONTENT, 'post' ); ?>"><?php echo esc_textarea( wp_kses( \get_option( 'activitypub_custom_post_content', ACTIVITYPUB_CUSTOM_POST_CONTENT ), 'post' ) ); ?></textarea>
155 <details>
156 <summary><?php esc_html_e( 'See a list of ActivityPub Template Tags.', 'activitypub' ); ?></summary>
157 <div class="description">
158 <ul>
159 <li><code>[ap_title]</code> - <?php \esc_html_e( 'The post\'s title.', 'activitypub' ); ?></li>
160 <li><code>[ap_content]</code> - <?php \esc_html_e( 'The post\'s content.', 'activitypub' ); ?></li>
161 <li><code>[ap_excerpt]</code> - <?php \esc_html_e( 'The post\'s excerpt (may be truncated).', 'activitypub' ); ?></li>
162 <li><code>[ap_permalink]</code> - <?php \esc_html_e( 'The post\'s permalink.', 'activitypub' ); ?></li>
163 <li><code>[ap_shortlink]</code> - <?php echo \wp_kses( \__( 'The post\'s shortlink. I can recommend <a href="https://wordpress.org/plugins/hum/" target="_blank">Hum</a>.', 'activitypub' ), 'default' ); ?></li>
164 <li><code>[ap_hashtags]</code> - <?php \esc_html_e( 'The post\'s tags as hashtags.', 'activitypub' ); ?></li>
165 </ul>
166 <p><?php \esc_html_e( 'You can find the full list with all possible attributes in the help section on the top-right of the screen.', 'activitypub' ); ?></p>
167 </div>
168 </details>
169 </p>
170 </td>
171 </tr>
172 <tr>
173 <th scope="row">
174 <?php \esc_html_e( 'Media attachments', 'activitypub' ); ?>
175 </th>
176 <td>
177 <input value="<?php echo esc_attr( \get_option( 'activitypub_max_image_attachments', ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS ) ); ?>" name="activitypub_max_image_attachments" id="activitypub_max_image_attachments" type="number" min="0" />
178 <p class="description">
179 <?php
180 echo \wp_kses(
181 \sprintf(
182 // translators:
183 \__( 'The number of media (images, audio, video) to attach to posts. Default: <code>%s</code>', 'activitypub' ),
184 \esc_html( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS )
185 ),
186 'default'
187 );
188 ?>
189 </p>
190 <p class="description">
191 <em>
192 <?php
193 esc_html_e( 'Note: audio and video attachments are only supported from Block Editor.', 'activitypub' );
194 ?>
195 </em>
196 </p>
197 </td>
198 </tr>
199 <tr>
200 <th scope="row"><?php \esc_html_e( 'Supported post types', 'activitypub' ); ?></th>
201 <td>
202 <fieldset>
203 <?php \esc_html_e( 'Automatically publish items of the selected post types to the fediverse:', 'activitypub' ); ?>
204
205 <?php $post_types = \get_post_types( array( 'public' => true ), 'objects' ); ?>
206 <?php $support_post_types = \get_option( 'activitypub_support_post_types', array( 'post' ) ) ? \get_option( 'activitypub_support_post_types', array( 'post' ) ) : array(); ?>
207 <ul>
208 <?php // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?>
209 <?php foreach ( $post_types as $post_type ) { ?>
210 <li>
211 <input type="checkbox" id="activitypub_support_post_type_<?php echo \esc_attr( $post_type->name ); ?>" name="activitypub_support_post_types[]" value="<?php echo \esc_attr( $post_type->name ); ?>" <?php echo \checked( \in_array( $post_type->name, $support_post_types, true ) ); ?> />
212 <label for="activitypub_support_post_type_<?php echo \esc_attr( $post_type->name ); ?>"><?php echo \esc_html( $post_type->label ); ?></label>
213 <span class="description">
214 <?php echo \esc_html( \Activitypub\get_post_type_description( $post_type ) ); ?>
215 </span>
216 </li>
217 <?php } ?>
218 </ul>
219 </fieldset>
220 </td>
221 </tr>
222 <tr>
223 <th scope="row">
224 <?php \esc_html_e( 'Hashtags', 'activitypub' ); ?>
225 </th>
226 <td>
227 <p>
228 <label><input type="checkbox" name="activitypub_use_hashtags" id="activitypub_use_hashtags" value="1" <?php echo \checked( '1', \get_option( 'activitypub_use_hashtags', '1' ) ); ?> /> <?php echo wp_kses( \__( 'Add hashtags in the content as native tags and replace the <code>#tag</code> with the tag link.', 'activitypub' ), 'default' ); ?></label>
229 </p>
230 </td>
231 </tr>
232 </tbody>
233 </table>
234
235 <?php \do_settings_fields( 'activitypub', 'activity' ); ?>
236 </div>
237
238 <div class="box">
239 <h3><?php \esc_html_e( 'Server', 'activitypub' ); ?></h3>
240 <table class="form-table">
241 <tbody>
242 <tr>
243 <th scope="row">
244 <?php \esc_html_e( 'Blocklist', 'activitypub' ); ?>
245 </th>
246 <td>
247 <p class="description">
248 <?php
249 echo \wp_kses(
250 \sprintf(
251 // translators: %s is a URL.
252 \__( 'To block servers, add the host of the server to the "<a href="%s">Disallowed Comment Keys</a>" list.', 'activitypub' ),
253 \esc_attr( \admin_url( 'options-discussion.php#disallowed_keys' ) )
254 ),
255 'default'
256 );
257 ?>
258 </p>
259 </td>
260 </tr>
261 </tbody>
262 </table>
263
264 <?php \do_settings_fields( 'activitypub', 'server' ); ?>
265 </div>
266 <?php \do_settings_sections( 'activitypub' ); ?>
267
268 <?php \submit_button(); ?>
269 </form>
270 </div>
271