Compare commits

..

1 commit

Author SHA1 Message Date
dddd3e395f Fix: hook for ActivityPub transformer might also return null (#81)
All checks were successful
PHP Code Checker / PHP Code Checker (push) Successful in 51s
PHPUnit / PHPUnit – PHP 7.4 (push) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.0 (push) Successful in 59s
PHPUnit / PHPUnit – PHP 8.1 (push) Successful in 58s
PHPUnit / PHPUnit – PHP 8.2 (push) Successful in 1m0s
PHPUnit / PHPUnit – PHP 8.3 (push) Successful in 1m1s
Reviewed-on: #81
Co-authored-by: André Menrath <andre.menrath@posteo.de>
Co-committed-by: André Menrath <andre.menrath@posteo.de>
2024-11-24 10:19:46 +01:00
6 changed files with 13 additions and 23 deletions

View file

@ -7,9 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
## Fixed
### Fixed
* Improved admin UI for event-category mapping
* Fixed that transformer hook function might also return `null`.
## [0.2.1] - 2024-11-16

View file

@ -100,6 +100,12 @@ We're always interested in your feedback. Feel free to reach out to us via [E-Ma
## Changelog ##
## Unreleased
### Fixed
* Fixed that transformer hook function might also return `null`.
### [0.2.1] 2024-11-16 ###
* Initial release on https://wordpress.org/

View file

@ -177,9 +177,3 @@ code.activitypub-event-bridge-settings-example-url {
overflow-x: auto;
word-break: break-all;
}
.activitypub-event-bridge-settings .select-cell::before {
content: "\21D2";
margin-right: 8px;
color: inherit;
}

View file

@ -252,7 +252,7 @@ class Setup {
*
* @return \Activitypub\Transformer\Base|null
*/
public function register_activitypub_event_transformer( $transformer, $wp_object, $object_class ): \Activitypub\Transformer\Base {
public function register_activitypub_event_transformer( $transformer, $wp_object, $object_class ): ?\Activitypub\Transformer\Base {
// If the current WordPress object is not a post (e.g., a WP_Comment), don't change the transformer.
if ( 'WP_Post' !== $object_class ) {
return $transformer;

View file

@ -62,17 +62,13 @@ $current_category_mapping = \get_option( 'activitypub_event_bridge_event_
</table>
<?php if ( ! empty( $event_terms ) ) : ?>
<h3> <?php esc_html_e( 'Fine-grained Event Category Settings', 'activitypub-event-bridge' ); ?> </h3>
<p> <?php esc_html_e( 'For any event category you have created on your WordPress site you can choose an event category which will be used in federation. This option lets you override the default selection above. ', 'activitypub-event-bridge' ); ?> </p>
<h3> <?php esc_html_e( 'Advanced Event Category Settings', 'activitypub-event-bridge' ); ?> </h3>
<p> <?php esc_html_e( 'Take more control by adjusting how your event categories are mapped to the basic category set used in ActivityPub. This option lets you override the default selection above, ensuring more accurate categorization and better visibility for your events.', 'activitypub-event-bridge' ); ?> </p>
<table class="form-table">
<tr>
<th> <?php esc_html_e( 'Event category on your site', 'activitypub-event-bridge' ); ?> </th>
<th> <?php esc_html_e( 'Fediverse event category', 'activitypub-event-bridge' ); ?> </th>
</tr>
<?php foreach ( $event_terms as $event_term ) { ?>
<tr>
<td scope="row"> <?php echo esc_html( $event_term->name ); ?> </td>
<td class="select-cell">
<th scope="row"> <?php echo esc_html( $event_term->name ); ?> </th>
<td>
<select name="activitypub_event_bridge_event_category_mappings[<?php echo esc_attr( $event_term->slug ); ?>]">
<?php
$current_mapping_is_set = false;

View file

@ -11,7 +11,6 @@ defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
use ActivityPub_Event_Bridge\Setup;
use ActivityPub_Event_Bridge\Admin\Settings_Page;
use ActivityPub_Event_Bridge\Admin\Health_Check;
use ActivityPub_Event_Bridge\Admin\General_Admin_Notices;
\load_template(
__DIR__ . '/admin-header.php',
@ -22,11 +21,6 @@ use ActivityPub_Event_Bridge\Admin\General_Admin_Notices;
);
$active_event_plugins = Setup::get_instance()->get_active_event_plugins();
if ( empty( $active_event_plugins ) ) {
return;
}
$activitypub_event_bridge_status_ok = true;
$example_event_post = Health_Check::get_most_recent_event_posts();