fix event category mapping when so categories are present
This commit is contained in:
parent
ef858c91e0
commit
df04913ba1
2 changed files with 5 additions and 0 deletions
|
@ -73,6 +73,9 @@ class Settings {
|
||||||
* @param array $event_category_mappings The settings value.
|
* @param array $event_category_mappings The settings value.
|
||||||
*/
|
*/
|
||||||
public static function sanitize_event_category_mappings( $event_category_mappings ) {
|
public static function sanitize_event_category_mappings( $event_category_mappings ) {
|
||||||
|
if ( empty( $event_category_mappings ) ) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
foreach ( $event_category_mappings as $taxonomy_slug => $event_category ) {
|
foreach ( $event_category_mappings as $taxonomy_slug => $event_category ) {
|
||||||
if ( ! self::is_allowed_event_category( $event_category ) ) {
|
if ( ! self::is_allowed_event_category( $event_category ) ) {
|
||||||
unset( $event_category_mappings[ $taxonomy_slug ] );
|
unset( $event_category_mappings[ $taxonomy_slug ] );
|
||||||
|
|
|
@ -93,6 +93,7 @@ $current_category_mapping = \get_option( 'activitypub_event_extensions_ev
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if( ! empty( $event_terms ) ) : ?>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h2> <?php esc_html_e( 'Advanced Event Category Settings', 'activitypub-event-extensions' ); ?> </h2>
|
<h2> <?php esc_html_e( 'Advanced Event Category Settings', 'activitypub-event-extensions' ); ?> </h2>
|
||||||
<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.' ); ?> </p>
|
<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.' ); ?> </p>
|
||||||
|
@ -128,6 +129,7 @@ $current_category_mapping = \get_option( 'activitypub_event_extensions_ev
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<?php \submit_button(); ?>
|
<?php \submit_button(); ?>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue