Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Pebblo / ee-event-roles.php
Last active December 12, 2019 22:24
This plugin adds 2 custom roles you can assign to users to provide access to Event Espresso. An Event Organizer should have capabilities to read, edit and publish their own events, they can also view their own events registrations/transactions and should not have access to others events, registration, transactions. Events Managers can view, edit…
<?php
/*
Plugin Name: EE Event Roles Plugin
Description: Creates the 'Event Organiser' and 'Events Maneger' roles for use within Event Espresso.
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
Version: 1.0.0
*/
function add_roles_on_plugin_activation() {
@Pebblo
Pebblo / tw_ee_default_post_content.php
Created December 31, 2019 11:54
Example of how to add a default description to EE events.
<?php // Please do not add the opening PHP tag if you already have one
add_filter('default_content', 'tw_ee_default_post_content', 2, 10);
function tw_ee_default_post_content($post_content, $post){
if(get_post_type($post) == 'espresso_events'){
$post_content = 'Add your default EE post content here';
}
return $post_content;
}