Skip to content

Instantly share code, notes, and snippets.

View alessandrotesoro's full-sized avatar
👨‍💻
Probably coding right now...

Alessandro Tesoro alessandrotesoro

👨‍💻
Probably coding right now...
View GitHub Profile
@alessandrotesoro
alessandrotesoro / gist:3e80fc28da4d02f4e6ce
Created December 10, 2014 14:04
WPRM Move last custom field up at the top of the booking form
class WPRM_Move_last_custom_field_up extends WPRM_Custom_Fields {
/**
* Add new fields to the metaboxes in the admin panel
*
* @since 1.0.0
* @return void
*/
public function add_new_fields_to_booking_form( $booking_fields ) {
@alessandrotesoro
alessandrotesoro / gist:734c8149ca57176d2bd8
Created December 19, 2014 15:39
WPRM Enable Archive
/**
* Enable Taxonomy Archive
* @since 1.0.0
*/
function tdp_wprm_enable_taxonomy_archive($args) {
$args['exclude_from_search'] = false;
return $args;
}
@alessandrotesoro
alessandrotesoro / gist:a5b767bb2c5dddd822cd
Created April 16, 2015 11:00
WPRM Change admin email address for notifications.
function wprm_change_admin_email_address( $email ) {
return 'custom@email.com';
}
add_filter('wprm_admin_booking_notification_sendto_mail', 'wprm_change_admin_email_address');
function wprm_add_24_h( $late_bookings ) {
$late_bookings['1440'] = __( 'At least 24 hours in advance', 'wprm' ),
return $late_bookings;
}
add_filter( 'wprm_get_late_bookings', 'wprm_add_24_h' );
function wprm_add_menu_order( $args ) {
$args['supports'] = array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' );
return $args;
}
add_action( 'wprm_menu_post_type_args', 'wprm_add_menu_order' );
function wprm_change_items_order( $args ) {
@alessandrotesoro
alessandrotesoro / gist:c1401c359f83acffcb0e
Created July 20, 2015 12:09
Add custom directory template to dropdown
function wpum_add_custom_directory_template( $templates ) {
$templates['custom'] = 'Custom Template';
return $templates;
}
add_filter( 'wpum_get_directory_templates', 'wpum_add_custom_directory_template' );
function wprm_change_items_order( $args ) {
$args['orderby'] = 'date';
$args['order'] = 'DESC';
return $args;
}
add_filter( 'wprm_menu_category_args', 'wprm_change_items_order' );
add_filter( 'wprm_full_menu_args', 'wprm_change_items_order' );
@alessandrotesoro
alessandrotesoro / gist:8bd4286306d21a094a1d
Created August 26, 2015 22:16
WPUM Get user profile page by author ID
<?php
$user = get_user_by( 'id', get_the_author_meta( 'ID' ) );
?>
<a href="<?php echo wpum_get_user_profile_url( $user ); ?>">Custom Text Here</a>
@alessandrotesoro
alessandrotesoro / gist:dfe2940c58ebe78af0b0
Last active September 2, 2015 09:50
RSA plugin integration with WPUM - allow registration page to be visible
function wpum_rsa_access( $is_restricted, $wp ) {
// Get registration page slug
$page_id = wpum_get_core_page_id( 'register' );
$register_page = get_post( $page_id );
// check query variables to see if this is the registration page
if ( $wp->query_vars['pagename'] == $register_page->post_name ) {
$is_restricted = false;
}
@alessandrotesoro
alessandrotesoro / gist:6ac03a21c7f4f00e003c
Last active September 14, 2015 12:43
WPUM Hide remember me field from login form
function wpum_hide_remember_me( $args ) {
$args['remember'] = false;
return $args;
}
add_filter( 'wpum_login_shortcode_args', 'wpum_hide_remember_me' );