This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); } | |
| do_action('action_hook_espresso_log', __FILE__, 'FILE LOADED', ''); | |
| //As of version 3.0.17 | |
| //This is a logic file for displaying a registration form for an event on a page. This file will do all of the backend data retrieval functions. | |
| //There should be a copy of this file in your wp-content/uploads/espresso/ folder. | |
| //Note: This entire function can be overridden using the "Custom Files" addon | |
| if (!function_exists('register_attendees')) { | |
| function register_attendees($single_event_id = NULL, $event_id_sc =0, $reg_form_only = false) { | |
| //Declare the $data object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'] ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Estimated Read Time | |
| Plugin URI: http://www.apinapress.com/ | |
| Description: Adds an estimated read time to posts (just above post content) | |
| Version: 0.0.1 | |
| Author: Dean Robinson | |
| Author URI: http://www.apinapress.com | |
| License: GPL3 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: EE adds JavaScript to show the payment options automatically. | |
| Description: EE adds JavaScript to show the payment options automatically. | |
| */ | |
| /* Begin Adding Functions Below This Line */ | |
| function ee_1() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dr_validate() { | |
| wp_register_script( 'drvalid', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.0/jquery.validate.min.js', array('jquery'), '1.13.0', true ); | |
| wp_register_script( 'drvalid2', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.0/additional-methods.min.js', array('jquery'), '1.13.0', true ); | |
| wp_enqueue_script( 'jquery' ); | |
| wp_enqueue_script( 'drvalid' ); | |
| wp_enqueue_script( 'drvalid2' ); | |
| } | |
| add_action('wp_enqueue_scripts','dr_validate'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Please note that this is a non supported code snippet. Event Espresso will not provide general support for it, nor may it be updated. | |
| //Please only use as an example for your own code | |
| function espresso_make_additional_relay_teammates_free ($ext_att_data_source) { | |
| global $wpdb; | |
| //As this function is called for each attendee, lets bail if it's the primary attendee. | |
| if( $ext_att_data_source['is_primary'] == true ) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('AHEE__registration_page_attendee_information__start', 'dxxx', 10, 1 ); | |
| function dxxx($event_queue) { | |
| //var_dump($event_queue); | |
| $my_registrations = $event_queue['items']; foreach($my_registrations as $a_reg) { echo $a_reg[event] -> ID(); } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if ( get_post_type( $post ) == "espresso_events" || is_post_type_archive( "espresso_events" ) ) { | |
| //do something | |
| } else { | |
| //do something else | |
| } | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Associated Events for EE4 | |
| Plugin URI: | |
| Description: Adds an Associated Events meta baox to EE4 venues, which lists which events the venue has been attached to. | |
| Version: 0.0.1 | |
| Author: Dean Robinson | |
| Author URI: | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
| function change_reg_code($new_reg_code, $registration) { | |
| //create a new reg ID e.g. business-1598 | |
| $new_reg_code = "business-" . rand(1000, 10000); | |
| //send the new reg code back to be used. |