This file contains 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 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; | |
} |
This file contains 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 | |
$user = get_user_by( 'id', get_the_author_meta( 'ID' ) ); | |
?> | |
<a href="<?php echo wpum_get_user_profile_url( $user ); ?>">Custom Text Here</a> |
This file contains 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 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' ); |
This file contains 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 wpum_add_custom_directory_template( $templates ) { | |
$templates['custom'] = 'Custom Template'; | |
return $templates; | |
} | |
add_filter( 'wpum_get_directory_templates', 'wpum_add_custom_directory_template' ); |
This file contains 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 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 ) { |
This file contains 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 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' ); |
This file contains 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 wprm_change_admin_email_address( $email ) { | |
return '[email protected]'; | |
} | |
add_filter('wprm_admin_booking_notification_sendto_mail', 'wprm_change_admin_email_address'); |
This file contains 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
/** | |
* Enable Taxonomy Archive | |
* @since 1.0.0 | |
*/ | |
function tdp_wprm_enable_taxonomy_archive($args) { | |
$args['exclude_from_search'] = false; | |
return $args; | |
} |
This file contains 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
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 ) { |
This file contains 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_filter('wp_dropdown_users', 'tdp_custom_wp_dropdown_users'); | |
function tdp_custom_wp_dropdown_users($output) { | |
global $post; | |
$users = get_users(); | |
$output = "<select id=\"post_author_override\" name=\"post_author_override\" class=\"\">"; | |
$output .= "<option value=\"1\">Admin</option>"; | |
foreach($users as $user) { | |
$sel = ($post->post_author == $user->ID)?"selected='selected'":''; | |
$output .= '<option value="'.$user->ID.'"'.$sel.'>'.$user->user_login.'</option>'; | |
} |