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

Custom Countries

function pw_edd_custom_countries( $countries = array() ) { $countries = array( ‘US’ => ‘United States’, ‘CA’ => ‘Canada’ ); return $countries; } add_filter( ‘edd_countries’, ‘pw_edd_custom_countries’ );Continue reading

Remove Gutenberg Block CSS

//Remove Gutenberg Block Library CSS from loading on the frontend function smartwp_remove_wp_block_library_css(){ wp_dequeue_style( ‘wp-block-library’ ); wp_dequeue_style( ‘wp-block-library-theme’ ); } add_action( ‘wp_enqueue_scripts’, ‘smartwp_remove_wp_block_library_css’ );Continue reading