Archives: Snippets
Untitled Snippet
https://www.highrevenuegate.com/vtih3qtws?key=9fcf513fba43e6344e324bc00d8881b4Continue reading
Untitled Snippet
https://www.highrevenuegate.com/vtih3qtws?key=9fcf513fba43e6344e324bc00d8881b4Continue 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
Admin Bar – Updates (copy)
function add_updates_admin_bar_menu() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘updates’, ‘title’ => ‘Updates’, ‘href’ => admin_url( ‘update-core.php’ ), ‘parent’ => ‘top-secondary’, ) ); } add_action( ‘wp_before_admin_bar_render’, ‘add_updates_admin_bar_menu’ );Continue reading
Untitled Snippet
Show Terms By Default
function sumobi_edd_show_terms_agreement() { global $edd_options; /*print_r($edd_options);*/ if ( isset( $edd_options[‘show_agree_to_terms’] ) ) { ?>Continue reading
Remove Decimals
function pw_edd_remove_decimals( $decimals ) { return 0; } add_filter( ‘edd_format_amount_decimals’, ‘pw_edd_remove_decimals’ );Continue reading
REST API Shopping Cart Endpoint for EDD
function totc_edd_rest_endpoints() { register_rest_route( ‘totc/1.0’, ‘/edd/cart’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘totc_edd_rest_cart’, ) ); } add_action( ‘rest_api_init’, ‘totc_edd_rest_endpoints’ ); /** * Respond to requests to the cart REST endpoint * * @param $request WP_REST_Request */ function totc_edd_rest_cart( WP_REST_Request $request…Continue reading
Change Registration Email Login URL
add_filter( ‘edd_user_registration_email_login_url’, ‘eddcustom_modify_user_login_url’ ); /** * Modifies the login URL for the default user registration email. * * @return string */ function eddcustom_modify_user_login_url() { return ‘https://www.google.com/login’; }Continue reading