2022-12-02 20:44:56 +01:00
< ? php
\load_template (
\dirname ( __FILE__ ) . '/admin-header.php' ,
true ,
array (
'settings' => 'active' ,
'welcome' => '' ,
)
);
2023-01-13 21:47:13 +01:00
$image_sizes = wp_get_registered_image_subsizes ();
2023-01-22 07:25:50 +01:00
$thumbnail_size = $image_sizes [ 'thumbnail' ][ 'width' ] . 'x' . $image_sizes [ 'thumbnail' ][ 'height' ] . ' px' ;
$registered_sizes = '' ;
foreach ( $image_sizes as $name => $size ) {
$registered_sizes .= $name . ', ' ;
}
$registered_sizes = trim ( $registered_sizes , ', ' );
$registered_sizes .= '.' ;
2023-01-13 21:47:13 +01:00
2022-12-02 20:44:56 +01:00
?>
2018-12-20 11:33:08 +01:00
2022-11-15 18:22:08 +01:00
< div class = " privacy-settings-body hide-if-no-js " >
2022-11-19 21:28:39 +01:00
< div class = " notice notice-info " >
2022-12-02 20:44:56 +01:00
< p >
< ? php
2022-12-05 18:37:12 +01:00
echo \wp_kses (
2022-12-02 20:44:56 +01:00
\sprintf (
2022-12-05 18:37:12 +01:00
// translators:
\__ ( 'If you have problems using this plugin, please check the <a href="%s">Site Health</a> to ensure that your site is compatible and/or use the "Help" tab (in the top right of the settings pages).' , 'activitypub' ),
\esc_url_raw ( \admin_url ( 'site-health.php' ) )
2022-12-02 20:44:56 +01:00
),
2022-12-05 18:37:12 +01:00
'default'
2022-12-02 20:44:56 +01:00
);
?>
</ p >
2022-11-19 21:28:39 +01:00
</ div >
2022-12-02 20:44:56 +01:00
< p >< ? php \esc_html_e ( 'Customize your ActivityPub settings to suit your needs.' , 'activitypub' ); ?> </p>
2018-12-20 11:33:08 +01:00
< form method = " post " action = " options.php " >
2019-09-27 11:36:52 +02:00
< ? php \settings_fields ( 'activitypub' ); ?>
2018-12-20 11:33:08 +01:00
2022-11-15 18:22:08 +01:00
< h3 >< ? php \esc_html_e ( 'Activities' , 'activitypub' ); ?> </h3>
2018-12-28 22:40:57 +01:00
2019-09-27 11:36:52 +02:00
< p >< ? php \esc_html_e ( 'All activity related settings.' , 'activitypub' ); ?> </p>
2018-12-28 22:40:57 +01:00
< table class = " form-table " >
< tbody >
< tr >
< th scope = " row " >
2020-05-12 20:30:06 +02:00
< ? php \esc_html_e ( 'Post-Content' , 'activitypub' ); ?>
2018-12-28 22:40:57 +01:00
</ th >
< td >
2020-02-11 10:14:21 +01:00
< p >
< label >< 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' ) ); ?> /> <?php \esc_html_e( 'Title and link', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'Only the title and a link.', 'activitypub' ); ?></span>
2020-07-21 09:23:35 +02:00
</ p >
2020-02-11 10:14:21 +01:00
< p >
2019-09-27 11:36:52 +02:00
< label >< 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' ) ); ?> /> <?php \esc_html_e( 'Excerpt', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'A content summary, shortened to 400 characters and without markup.', 'activitypub' ); ?></span>
2019-01-04 19:57:33 +01:00
</ p >
< p >
2019-09-27 11:36:52 +02:00
< label >< 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' ) ); ?> /> <?php \esc_html_e( 'Content (default)', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'The full content.', 'activitypub' ); ?></span>
2019-01-16 21:50:45 +01:00
</ p >
2020-07-21 09:23:35 +02:00
< p >
< label >< 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' ) ); ?> /> <?php \esc_html_e( 'Custom', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'Use the text-area below, to customize your activities.', 'activitypub' ); ?></span>
</ p >
< p >
2022-12-05 18:37:12 +01:00
< 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 wp_kses ( \get_option ( 'activitypub_custom_post_content' , ACTIVITYPUB_CUSTOM_POST_CONTENT ), 'post' ); ?> </textarea>
2022-11-19 13:26:00 +01:00
< details >
2023-01-13 21:47:13 +01:00
< summary >< ? php esc_html_e ( 'See the complete list of activitypub shortcodes.' , 'activitypub' ); ?> </summary>
2022-11-19 13:26:00 +01:00
< div class = " description " >
2023-01-13 22:11:52 +01:00
< p >< ? php esc_html_e ( 'You may use any shortcode normally available to you on your site, however be aware that shortcodes may significantly increase the size of your content depending on what they do. ' ); ?>
< p >< ? php esc_html_e ( 'In addition, the following shortcodes are available during an activitypub post:' ); ?>
2022-11-19 13:26:00 +01:00
< ul >
2023-01-13 22:11:52 +01:00
< li >< code > [ ap_title ] </ code > - < ? php \esc_html_e ( 'The post\'s title.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_content ] </ code > - < ? php \esc_html_e ( 'The post\'s content.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_excerpt < i > lenght = nnn </ i > ] </ code > - < ? php \esc_html_e ( 'The post\'s excerpt (default 400 chars). length parameter is optional.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_permalink ] </ code > - < ? php \esc_html_e ( 'The post\'s permalink.' , 'activitypub' ); ?> </li>
2022-12-02 20:44:56 +01:00
< ? php // translators: ?>
2023-01-13 22:11:52 +01:00
< 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>, to prettify the Shortlinks' , 'activitypub' ), 'default' ); ?> </li>
< li >< code > [ ap_hashtags ] </ code > - < ? php \esc_html_e ( 'The post\'s tags as hashtags.' , 'activitypub' ); ?> </li>
2023-01-13 21:47:13 +01:00
< li >< code > [ ap_hashcats ] </ code > - < ? php \esc_html_e ( 'The post\'s categories as hashtags.' , 'activitypub' ); ?> </li>
2023-01-22 07:25:50 +01:00
< li >< code > [ ap_image < i > size = xxx </ i > ] </ code > - < ? php \esc_html_e ( 'The URL for the post\'s featured image, defaults to full size. The size attribute can be any of the following: ' , 'activitypub' ); echo esc_html ( $registered_sizes ); ?> </li>
< li >< code > [ ap_thumbnail ] </ code > - < ? php echo \wp_kses ( sprintf ( __ ( 'The URL for the post\'s featured image thumbnail size (%s).' , 'activitypub' ), $thumbnail_size ), 'default' ); ?> </li>
2023-01-13 21:47:13 +01:00
< li >< code > [ ap_author ] </ code > - < ? php \esc_html_e ( 'The author\'s name.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_authorurl ] </ code > - < ? php \esc_html_e ( 'The URL to the author\'s profile page.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_date ] </ code > - < ? php \esc_html_e ( 'The post\'s date.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_time ] </ code > - < ? php \esc_html_e ( 'The post\'s time.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_datetime ] </ code > - < ? php \esc_html_e ( 'The post\'s date/time formated as "date @ time".' , 'activitypub' ); ?> </li>
< li >< code > [ ap_blogurl ] </ code > - < ? php \esc_html_e ( 'The URL to the site.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_blogname ] </ code > - < ? php \esc_html_e ( 'The name of the site.' , 'activitypub' ); ?> </li>
< li >< code > [ ap_blogdesc ] </ code > - < ? php \esc_html_e ( 'The description of the site.' , 'activitypub' ); ?> </li>
2022-11-19 13:26:00 +01:00
</ ul >
2023-01-23 09:37:40 +01:00
< p >< ? php esc_html_e ( 'Note: the old template codes are now deprecated and automatically converted to the new shortcodes.' , 'activitypub' ); ?>
2022-11-19 13:26:00 +01:00
</ div >
</ details >
2020-07-21 09:23:35 +02:00
</ p >
2022-12-02 20:44:56 +01:00
< ? php // translators: ?>
2022-12-05 18:37:12 +01:00
< p >< ? php echo \wp_kses ( \__ ( '<a href="https://github.com/pfefferle/wordpress-activitypub/issues/new" target="_blank">Let me know</a> if you miss a template pattern.' , 'activitypub' ), 'default' ); ?> </p>
2018-12-28 22:40:57 +01:00
</ td >
</ tr >
2023-01-07 15:35:14 +01:00
< tr >
< th scope = " row " >
< ? php \esc_html_e ( 'Number of images' , 'activitypub' ); ?>
</ th >
< td >
2023-01-13 08:56:38 +01:00
< 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 " />
2023-01-07 15:35:14 +01:00
< p class = " description " >
< ? php
echo \wp_kses (
\sprintf (
// translators:
\__ ( 'The number of images to attach to posts. Default: <code>%s</code>' , 'activitypub' ),
2023-01-12 21:29:21 +01:00
\esc_html ( ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS )
2023-01-07 15:35:14 +01:00
),
'default'
);
?>
</ p >
</ td >
</ tr >
2018-12-28 22:40:57 +01:00
< tr >
< th scope = " row " >
2019-09-27 11:36:52 +02:00
< ? php \esc_html_e ( 'Activity-Object-Type' , 'activitypub' ); ?>
2018-12-28 22:40:57 +01:00
</ th >
< td >
< p >
2019-09-27 11:36:52 +02:00
< label >< input type = " radio " name = " activitypub_object_type " id = " activitypub_object_type_note " value = " note " < ? php echo \checked ( 'note' , \get_option ( 'activitypub_object_type' , 'note' ) ); ?> /> <?php \esc_html_e( 'Note (default)', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'Should work with most platforms.', 'activitypub' ); ?></span>
2018-12-28 22:40:57 +01:00
</ p >
< p >
2019-09-27 11:36:52 +02:00
< label >< input type = " radio " name = " activitypub_object_type " id = " activitypub_object_type_article " value = " article " < ? php echo \checked ( 'article' , \get_option ( 'activitypub_object_type' , 'note' ) ); ?> /> <?php \esc_html_e( 'Article', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'The presentation of the "Article" might change on different platforms. Mastodon for example shows the "Article" type as a simple link.', 'activitypub' ); ?></span>
2018-12-28 22:40:57 +01:00
</ p >
< p >
2019-09-27 11:36:52 +02:00
< label >< 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' , 'note' ) ); ?> /> <?php \esc_html_e( 'WordPress Post-Format', 'activitypub' ); ?></label> - <span class="description"><?php \esc_html_e( 'Maps the WordPress Post-Format to the ActivityPub Object Type.', 'activitypub' ); ?></span>
2018-12-28 22:40:57 +01:00
</ p >
</ td >
</ tr >
2019-09-27 15:00:07 +02:00
< tr >
< th scope = " row " >< ? php \esc_html_e ( 'Supported post types' , 'activitypub' ); ?> </th>
< td >
< fieldset >
< ? php \esc_html_e ( 'Enable ActivityPub support for the following post types:' , 'activitypub' ); ?>
< ? php $post_types = \get_post_types ( array ( 'public' => true ), 'objects' ); ?>
< ? php $support_post_types = \get_option ( 'activitypub_support_post_types' , array ( 'post' , 'page' ) ) ? \get_option ( 'activitypub_support_post_types' , array ( 'post' , 'page' ) ) : array (); ?>
< ul >
2022-12-02 20:44:56 +01:00
< ? php // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?>
2019-09-27 15:00:07 +02:00
< ? php foreach ( $post_types as $post_type ) { ?>
< li >
2019-12-01 21:20:26 +01:00
< input type = " checkbox " id = " activitypub_support_post_types " name = " activitypub_support_post_types[] " value = " <?php echo \ esc_attr( $post_type->name ); ?> " < ? php echo \checked ( true , \in_array ( $post_type -> name , $support_post_types , true ) ); ?> />
2019-09-27 15:00:07 +02:00
< label for = " <?php echo \ esc_attr( $post_type->name ); ?> " >< ? php echo \esc_html ( $post_type -> label ); ?> </label>
</ li >
< ? php } ?>
</ ul >
</ fieldset >
</ td >
</ tr >
2019-02-17 21:27:20 +01:00
< tr >
< th scope = " row " >
2023-01-16 20:23:05 +01:00
< ? php \esc_html_e ( 'Hashtags (beta)' , 'activitypub' ); ?>
2019-02-17 21:27:20 +01:00
</ th >
< td >
< p >
2023-01-16 20:23:05 +01:00
< 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. <strong>This feature is experimental! Please disable it, if you find any HTML or CSS errors.</strong>', 'activitypub' ), 'default' ); ?></label>
2019-02-17 21:27:20 +01:00
</ p >
2020-07-21 09:23:35 +02:00
</ td >
</ tr >
< tr >
< th scope = " row " >
2022-12-05 20:58:02 +01:00
< ? php \esc_html_e ( 'HTML Allowlist' , 'activitypub' ); ?>
2020-07-21 09:23:35 +02:00
</ th >
< td >
2022-12-02 20:44:56 +01:00
< textarea name = " activitypub_allowed_html " id = " activitypub_allowed_html " rows = " 3 " cols = " 50 " class = " large-text " >< ? php echo esc_html ( \get_option ( 'activitypub_allowed_html' , ACTIVITYPUB_ALLOWED_HTML ) ); ?> </textarea>
< p class = " description " >
< ? php
2022-12-05 20:26:49 +01:00
echo \wp_kses (
2022-12-02 20:44:56 +01:00
\sprintf (
2022-12-05 20:26:49 +01:00
// translators:
2022-12-05 20:58:02 +01:00
\__ ( 'A list of HTML elements, you want to allowlist for your activities. <strong>Leave list empty to support all HTML elements</strong>. Default: <code>%s</code>' , 'activitypub' ),
2022-12-02 20:44:56 +01:00
\esc_html ( ACTIVITYPUB_ALLOWED_HTML )
2022-12-05 20:26:49 +01:00
),
'default'
2022-12-02 20:44:56 +01:00
);
?>
</ p >
2019-02-17 21:27:20 +01:00
</ td >
</ tr >
</ tbody >
</ table >
2019-09-27 11:36:52 +02:00
< ? php \do_settings_fields ( 'activitypub' , 'activity' ); ?>
2019-02-17 21:27:20 +01:00
2022-11-15 18:22:08 +01:00
< h3 >< ? php \esc_html_e ( 'Server' , 'activitypub' ); ?> </h3>
2020-02-21 11:09:31 +01:00
< p >< ? php \esc_html_e ( 'Server related settings.' , 'activitypub' ); ?> </p>
< table class = " form-table " >
< tbody >
< tr >
< th scope = " row " >
2020-09-21 13:20:39 +02:00
< ? php \esc_html_e ( 'Blocklist' , 'activitypub' ); ?>
2020-02-21 11:09:31 +01:00
</ th >
< td >
2022-12-02 20:44:56 +01:00
< p class = " description " >
< ? php
2022-12-05 18:09:10 +01:00
echo \wp_kses (
2022-12-05 18:37:12 +01:00
\sprintf (
2022-12-05 18:09:10 +01:00
// translators: %s is a URL.
\__ ( 'To block servers, add the host of the server to the "<a href="%s">Disallowed Comment Keys</a>" list.' , 'activitypub' ),
\esc_attr ( \admin_url ( 'options-discussion.php#disallowed_keys' ) )
2022-12-02 20:44:56 +01:00
),
2022-12-05 18:09:10 +01:00
'default'
2022-12-02 20:44:56 +01:00
);
?>
</ p >
2020-02-21 11:09:31 +01:00
</ td >
</ tr >
</ tbody >
</ table >
< ? php \do_settings_fields ( 'activitypub' , 'server' ); ?>
2019-09-27 11:36:52 +02:00
< ? php \do_settings_sections ( 'activitypub' ); ?>
2018-12-20 11:33:08 +01:00
2019-09-27 11:36:52 +02:00
< ? php \submit_button (); ?>
2018-12-20 11:33:08 +01:00
</ form >
</ div >