/** * Plugin Name: Küchenlatein Fediverse-Schranke (MU) * Description: Blockiert Timeline-Pushs für alles vor 2026 und alle Updates. */ // Wir nutzen hohe Priorität (999), um das letzte Wort zu haben add_action( 'plugins_loaded', function() { // REGEL 1: Alles vor 2026 -> Keine Aktivität erzeugen (Stumm schalten) add_filter( 'activitypub_activity', function( $activity, $object_id, $activity_type ) { $post = get_post( $object_id ); if ( ! $post ) return $activity; $post_date = strtotime( $post->post_date ); $cutoff = strtotime( '2026-01-01 00:00:00' ); if ( $post_date < $cutoff ) { return false; // Stoppt den Push für alte Rezepte komplett } // REGEL 2: Ab 2026 -> Nur 'Create' erlauben, 'Update' (Bearbeitung) blockieren if ( in_array( $activity_type, array( 'Update', 'Edit' ) ) ) { return false; // Stoppt den Push bei nachträglichen Korrekturen } return $activity; }, 999, 3 ); // ZUSATZ-RIEGEL: Sagt dem System direkt: Vor 2026 wird nicht aktiv gefunkt add_filter( 'activitypub_is_post_federated', function( $is_federated, $post_id ) { $post = get_post( $post_id ); if ( $post && strtotime( $post->post_date ) < strtotime( '2026-01-01 00:00:00' ) ) { return false; } return $is_federated; }, 999, 2 ); }, 20 );