Skip to main content

Run your own code when a show’s Content Calendar content types are saved

Premium Intermediate Content Calendar

Two actions, ( array $types, int $show_id ), around a save of a show’s list from the Content Types panel or PUT …/types (see Read or change a show’s Content Calendar content types):

Neither fires for a request refused before the write.

Code

<?php
add_action( 'benecaster_content_calendar_after_save_content_types', function ( array $types, int $show_id ): void {
    update_post_meta( $show_id, '_my_addon_calendar_type_count', count( $types ) );
}, 10, 2 );

View on GitHub →

Hooks Used

Need this built rather than just documented? See our services →