Documentation

All the information you need in one place

How to add additional events to the editorial calendar

In addition to allowing you to add external calendars and display their events in the Nelio Content editorial calendar, you can add additional events to your own calendar thanks to the nelio_content_internal_events filter.

By default, Nelio Content extends the editorial calendar if you have installed the MailPoet and/or The Events Calendar plugins to display MailPoet newsletters and events from The Events Calendar:

Editorial calendar with events from MailPoet and The Events Calendar.
Editorial calendar with events from MailPoet and The Events Calendar.

But if you want to add any other event in a personalized way, as we have said before, you can do it using the nelio_content_internal_events filter. In the following PHP code snippet you can see how to use this filter to add an additional event:

add_filter( 'nelio_content_internal_events', function( $events ) {
	return array_merge( $events, array(
		array(
			'id'              => 'my-custom-id-1',
			'date'            => '2023-01-01 12:00:00',
			'start'           => '2023-01-01 12:00:00',
			'end'             => '2023-01-01 14:00:00',
			'description'     => 'Event description',
			'color'           => '#fff',
			'backgroundColor' => '#000',
			'editLink'        => admin_url( 'post.php?post=1&action=edit' ),
			'isDayEvent'      => false,
			'title'           => 'My custom event',
			'type'            => 'my-custom-events'
		)
	) );
} );

As you can see, in the filter you have $events as a parameter, which is the list of additional events to show in the calendar. To this list we have added another list with a single element that has the following attributes:

  • id: (string) identifier of the event.
  • date: (string) date of the event.
  • start: (string, optional) start date of the event.
  • end: (string, optional) end date of the event.
  • description: (string, optional) description of the event.
  • color: (string, optional) hexadecimal representation of the color of the event text.
  • backgroundColor: (string, optional) hexadecimal representation of the background color of the event.
  • editLink: (string, optional) if the event is editable, the event’s edit URL.
  • isDayEvent: (boolean, optional) Indicates whether the event is for the whole day.
  • title: (string) title of the event.
  • type: (string) type of the event, used to group events of the same type, such as "mailpoet-newsletter".

Therefore, it is easy to extend the editorial calendar of Nelio Content to add additional events that you are interested in showing. This is especially useful for including in the calendar events from other plugins that you have installed in your WordPress or that you use in an external tool that has an access API.

Person writing a new WordPress post on a MacBook

Looking for popups?

We have the best plugin to create popups for WordPress in minutes.

Request Customized Enterprise Pricing

10
200000

With your express consent, we handle the information provided for the purpose of contacting you and until you ask us to delete it.

70% OF YOUR VISITORS DO EXACTLY WHAT
YOU JUST DID AND NEVER COME BACK!

KEEP THEM
ON YOUR SITE
LONGER WITH
NELIO POPUPS

Claim Your Discount Now

Image with a 10%-off coupon

WAIT! BEFORE YOU GO...

Get this awesome discount now!

No, I don't want to save money

Image with a 10%-off coupon

WAIT! BEFORE YOU GO...

Get this awesome discount now!

No, I don't want to save money

YOUR COOKIE SETTINGS


This site uses proprietary operational cookies that have a purely functional purpose and third-party cookies that help us understand how visitors interact with the site by collecting and presenting information anonymously. To get more information about these cookies and the processing of your personal data, check our Privacy & Cookie Policy. Do you accept these cookies and the processing of personal data involved?


If you don’t, you can reject non-operational cookies and continue browsing this site by clicking here.