Table of Contents
Hooks and Filters for the PublishPress Calendar
Using WordPress’ hooks and filters, you can extend the PublishPress calendar in the following ways:
pp_view_calendar_cap(filter) – Modify the capability or role required to view the calendar. By default, administrators, editors, authors and contributors can view the calendar. On install, PublishPress adds a capability of ‘pp_view_calendar’ to these roles.
pp_calendar_allow_ajax_to_set_timestamp(filter) – Whether or not dragging an unpublished post to a new date changes the publication timestamp for the post. This is off by default. You can enable it by placing the following in your theme’s functions.php file:
add_filter( 'pp_calendar_allow_ajax_to_set_timestamp', '__return_true');
pp_calendar_total_weeks(filter) – Number of weeks to show on the calendar. This will override the user’s screen options setting and lock the calendar to a specific range.
pp_calendar_weekend_days(filter) – Which days of the week are considered the weekend for the calendar. By default, this is Saturday and Sunday.
pp_calendar_item_information_fields(filter) – Post details to be presented in the overlay that appears when you click on the post title. You can unset default fields, or include your own.
pp_show_scheduled_as_unpublished(filter) – Include scheduled posts when filtering the calendar to display unpublished content. This is off by default.