Skip to content

Instantly share code, notes, and snippets.

add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1);
function espresso_create_wp_user($attendee_data) {
if( username_exists( $attendee_data['email'] ) == NULL ) {
global $org_options;
// Generate the password and create the user
$password = wp_generate_password( 12, false );
$user_id = wp_create_user( $attendee_data['email'], $password, $attendee_data['email'] );
// Set the users details
@Apina
Apina / template.php
Last active December 18, 2015 22:49 — forked from jazzsequence/template.php
Please see https://gist.github.com/joshfeck/52ac749150322a2e4221 --- Event Espresso invoice template including surcharge/VAT support. This file should go in your /wp-content/uploads/espresso/gateways/invoice directory.
Please see https://gist.github.com/joshfeck/52ac749150322a2e4221
@Apina
Apina / espresso_table_display_table_function.php
Created July 10, 2013 13:47 — forked from joshfeck/espresso_table_display_table_function.php
custom espresso_display_table function that makes it possible to order by time instead of ordering by date only. Replaces the function of the same name in the espresso_table.php template
/*
Shortcode Name: Espresso Table
Author: Seth Shoultes
Contact: [email protected]
Website: http://www.eventespresso.com
Description: Only show events in a CATEGORY within a certain number number of days into the future and a qty. The example below only shows events in a certain category that start within 30 days from the current date.
Usage Example: [ESPRESSO_TABLE max_days="30" qty="3" category_identifier="gracecard" order_by="state"]
Custom CSS for the table display
Notes: This file should be stored in your "/wp-content/uploads/espresso/templates/" folder and you should have the custom_includes.php files installed in your "/wp-content/uploads/espresso/" directory.
*/
@Apina
Apina / espresso_create_wp_user.php
Last active August 29, 2015 13:57 — forked from sethshoultes/espresso_create_wp_user.php
Swapped this to check for the email rather than username, and to dampen any errors due to duplicate username. The code can be added to the themes functions.php file though it is recommended to use a site specific plugin: http://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/
add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10,1 );
function espresso_create_wp_user($attendee_data) {
if( email_exists( $attendee_data['email'] ) == false ) {
global $org_options;
// Generate the password and create the user
$password = wp_generate_password( 12, false );
$user_id = wp_create_user( $attendee_data['fname'] . $attendee_data['lname'], $password, $attendee_data['email'] );
<?php
/**
* After creating the necessary table, run with `wp eval-file plugin-stats.php`
*/
use WP_CLI\Utils;
global $wpdb;
$original_request_url = 'https://wordpress.org/plugins/wp-json/plugins/v1/query-plugins?s=&posts_per_page=100';