Show User Name

function show_loggedin_function( $atts ) { global $current_user, $user_login; get_currentuserinfo(); add_filter(‘widget_text’, ‘do_shortcode’); if ($user_login) return ‘Welcome ‘ . $current_user->display_name . ‘!’; else return ‘Login‘; } add_shortcode( ‘show_loggedin_as’, ‘show_loggedin_function’ );Continue reading

Publish Future Posts

function fulano_prevent_future_type( $post_data ) { if ( $post_data[‘post_status’] == ‘future’ ) { $post_data[‘post_status’] = ‘publish’; } return $post_data; } add_filter(‘wp_insert_post_data’, ‘fulano_prevent_future_type’); remove_action(‘future_post’, ‘_future_post_hook’);Continue reading

Force Minimum Password Length in Profile Editor

function pd_edd_pre_update_user_profile( $user_id, $userdata ) { // How many characters should the password be? $length = 8; $password = isset( $_POST[‘edd_new_user_pass1’] ) ? $_POST[‘edd_new_user_pass1’] : ”; if ( ! empty( $password ) && ( strlen( $password ) < $length )…Continue reading

Alter Payment List Quick Actions

/* Remove the ‘Delete’ option from the Payment List Quick Action * This can require a fine tuning of the user roles, typically handeled in a plugin * Example: http://wordpress.org/plugins/user-role-editor/ * * Source of snippet: https://easydigitaldownloads.com/support/topic/custom-payment-history-view-per-user-role/ */ function ck_edd_remove_order_trash_action( $row_actions,…Continue reading

Modify User Verification URL Expiration

function kjm_modify_user_verification_url_expiration( $url ) { // EDD default is ‘+24 hours’. ‘days’ also works $url = add_query_arg( ‘ttl’, strtotime( ‘+48 hours’ ), $url ); return $url; } add_filter( ‘edd_get_user_verification_url’, ‘kjm_modify_user_verification_url_expiration’ );Continue reading