Type: php
Change Purchase Event to Subscribe
add_filter( ‘wpcode_pixel_event_name_facebook’, function ( $event_name, $event_key ) { if ( ‘purchase’ === $event_key ) { return ‘Subscribe’; } return $event_name; }, 10, 2 );Continue reading
User preferences
echo ‘The current logged in user ID is: ‘.get_current_user_id(); echo ; $all_meta_for_user = get_user_meta( get_current_user_id() ); print_r( $all_meta_for_user ); echo ; $last_name = $all_meta_for_user[‘last_name’][0]; echo ; echo ‘Last name:’.$last_name;Continue reading
Display WPForm Entries
/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading
How to Disable Comments on Event Posts? | Quick Event Manager
add_filter(‘comments_open’, function ($open, $post_id) { $post = get_post($post_id); if ($post->post_type == ‘event’) { return false; } return $open; }, 10, 2);Continue reading
Filter to change Custom Post Type settings | Quick Event Manager
add_filter( ‘qem_event_register’, /** * @param $args https://developer.wordpress.org/reference/functions/register_post_type/#parameters * * @return array */ function ( $args ) { $args[‘rewrite’] = array( ‘slug’ => ‘my_custom_event_slug’ ); return $args; }, 10, 1 );Continue reading
Filter to send admin confirms | Quick Event Manager
add_filter( /** * * Filter the decision to send an admin confirmation or not * * @param $bool * * @return bool overrides any logic if set to true, if set to false then standard rules apply */ ‘qem_registration_always_confirm_admin’, function…Continue reading
Filter the decision to send a user confirmation | Quick Event Manager
add_filter( /** * * Filter the decision to send a confirmation or not * * @param $bool * * @return bool overrides any logic if set to true, if set to false then standard rules apply */ ‘qem_registration_always_confirm’, function (…Continue reading
Filter the message generated for admin confirmation | Quick Event Manager
add_filter( /** * * Filter the message generated to email confirmation * * @param $message * @param $content * @param $details * @param $close * @param $id * @param $payment * * @return string output message for registration email */…Continue reading
Allow SVG Files Upload (copy)
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading