Empty Admin Dashboard

add_action( ‘wp_dashboard_setup’, function () { global $wp_meta_boxes; $wp_meta_boxes[‘dashboard’] = array(); remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); }, 1000 );Continue reading

Disable Site Health

// Remove Tools Submenu Item for Site Health. add_action( ‘admin_menu’, function () { remove_submenu_page( ‘tools.php’, ‘site-health.php’ ); } ); // Prevent direct access to the Site Health page. add_action( ‘current_screen’, function () { $screen = get_current_screen(); if ( ‘site-health’ ===…Continue reading

Change Number of Downloads in Bundle Select

// Remove original bundle item select field which defaults to 30 items function kjm_remove_old_bundle_field() { remove_action( ‘edd_meta_box_files_fields’, ‘edd_render_products_field’, 10 ); } add_action( ‘plugins_loaded’, ‘kjm_remove_old_bundle_field’ ); // Add back bundle select field with ‘number’ specified function kjm_render_products_field( $post_id ) { $type…Continue reading

Retroactive Lifetime Licenses

/** * Add a metabox to initiate the action */ function eddrll_add_metabox() { $post_types = apply_filters( ‘edd_download_metabox_post_types’, array( ‘download’ ) ); foreach ( $post_types as $post_type ) { add_meta_box( ‘edd_retroactive_lifetime_licenses’, __( ‘Retroactive Lifetime Licenses’, ‘edd-retroactive-lifetime-licenses’ ), ‘eddrll_render_metabox’, $post_type, ‘advanced’, ‘low’…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