PHPackages                             polar/events - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. polar/events

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

polar/events
============

A WordPress plugin to manage events

023↓50%PHP

Since May 11Pushed 2mo agoCompare

[ Source](https://github.com/usepolar/wp-events)[ Packagist](https://packagist.org/packages/polar/events)[ RSS](/packages/polar-events/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Polar Events
============

[](#polar-events)

A comprehensive WordPress plugin for managing events with different date configurations (single day, multiple days, recurring) and displaying them in a calendar or list format.

Features
--------

[](#features)

### Event Types

[](#event-types)

- **Simple Events** - Single day or date range events
- **Recurring Events** - Weekly or monthly recurring events with complex patterns
- **Multiple Date Events** - Events occurring on specific non-consecutive dates

### Event Management

[](#event-management)

- Advanced Custom Fields (ACF) integration for event configuration
- Conditional field logic based on event type
- Time-based events with all-day support
- Custom database table for efficient date-range queries

### Recurring Event Patterns

[](#recurring-event-patterns)

- **Weekly**: Select specific days of the week
- **Monthly**: "First Tuesday of month" style patterns
- Smart date calculation with edge case handling

### REST API

[](#rest-api)

Endpoint: `/wp-json/polar-events/v1/agenda`

**Parameters:**

- `days` - Number of days to return (default: 7)
- `offset` - Days to skip from today (pagination)
- `date` - Custom start date (Y-m-d format)
- `event_category` - Filter by event category slug

**Response Features:**

- Events grouped by day
- Smart date labels ("Avui", "Demà", or formatted date)
- Rich event data (images, excerpts, categories, times)
- Multilingual date formatting

### Template Functions

[](#template-functions)

#### Date &amp; Time Functions

[](#date--time-functions)

```
// Get full date + time string
polar_get_date_range_string($post, $shortFormat = false)

// Get concise date string
polar_get_short_date_range_string($post)

// Get time-only string
polar_get_time_string($post, $concise = false)
```

#### Event Query Functions

[](#event-query-functions)

```
// Get events in date range
polar_get_events_in_range($startDate, $endDate, $args = [])

// Get upcoming events
polar_get_upcoming_events($days = 7, $args = [])

// Get events for specific day
polar_get_events_for_day($date, $args = [])
```

#### Event Data Functions

[](#event-data-functions)

```
// Get array of days event occurs (Ymd format)
polar_get_event_days($post)

// Group events by day with smart labels
polar_group_events_by_day($events)

// Get localized day labels
polar_get_day_label($date)
```

#### Event Properties

[](#event-properties)

```
// Check event properties
polar_is_event_today($post)
polar_is_event_upcoming($post)
polar_is_all_day_event($post)
polar_get_event_type($post) // simple|recurring|multiple
```

### Database Schema

[](#database-schema)

The plugin creates a custom table `wp_polar_events` for efficient event indexing:

```
CREATE TABLE wp_polar_events (
    event_id bigint(20) NOT NULL AUTO_INCREMENT,
    post_id bigint(20) NOT NULL,
    event_type varchar(20) NOT NULL DEFAULT 'simple',
    event_start_date date NOT NULL,
    event_end_date date NOT NULL,
    created_at timestamp DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (event_id),
    KEY post_id (post_id),
    KEY event_type (event_type),
    KEY date_range (event_start_date, event_end_date)
);
```

### ACF Field Configuration

[](#acf-field-configuration)

The plugin automatically registers the following ACF fields for the `polar_event` post type:

- **Event Type** (Radio) - simple|recurring|multiple
- **Start/End Dates** (Date Pickers) - conditional on event type
- **Start/End Times** (Time Pickers) - conditional on all-day setting
- **All Day Event** (True/False)
- **Multiple Dates** (Textarea) - for multiple event type, one date per line
- **Recurrence Frequency** (Radio) - weekly|monthly
- **Days of Week** (Checkbox) - for weekly recurrence
- **Week of Month** (Radio) - 1st|2nd|3rd|4th|last for monthly
- **Day of Week** (Radio) - for monthly recurrence

### Frontend Display

[](#frontend-display)

The plugin includes CSS classes for styling events:

```

    Today

        Event Title
        2:00 PM - 5:00 PM
        Event description...

```

Installation
------------

[](#installation)

1. Upload the plugin files to `/wp-content/plugins/polar-events/`
2. Activate the plugin through the WordPress admin
3. Ensure Advanced Custom Fields (ACF) is installed and active
4. Start creating events using the "Events" post type

Requirements
------------

[](#requirements)

- WordPress 6.0+
- PHP 8.4+
- Advanced Custom Fields plugin

Post Types &amp; Taxonomies
---------------------------

[](#post-types--taxonomies)

- **Post Type**: `polar_event` with archive support
- **Taxonomy**: `polar_event_category` for event categorization

API Usage Example
-----------------

[](#api-usage-example)

```
// Get next 7 days of events
fetch('/wp-json/polar-events/v1/agenda?days=7')
  .then(response => response.json())
  .then(data => {
    console.log(data.data); // Events grouped by day
  });

// Get events for specific category
fetch('/wp-json/polar-events/v1/agenda?event_category=workshops&days=14')
  .then(response => response.json())
  .then(data => {
    // Handle filtered events
  });
```

License
-------

[](#license)

GPL-2.0-or-later

Author
------

[](#author)

Victor Guerrero -

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8974623?v=4)[Victor Guerrero](/maintainers/vguerrerobosch)[@vguerrerobosch](https://github.com/vguerrerobosch)

---

Top Contributors

[![vguerrerobosch](https://avatars.githubusercontent.com/u/8974623?v=4)](https://github.com/vguerrerobosch "vguerrerobosch (6 commits)")

### Embed Badge

![Health badge](/badges/polar-events/health.svg)

```
[![Health](https://phpackages.com/badges/polar-events/health.svg)](https://phpackages.com/packages/polar-events)
```

###  Alternatives

[innmind/immutable

Immutable PHP primitive wrappers

74228.5k84](/packages/innmind-immutable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
