In your command-line run the following commands:
brew doctorbrew update
| function disable_elementor_dashboard_overview_widget() { | |
| remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal'); | |
| } | |
| add_action('wp_dashboard_setup', 'disable_elementor_dashboard_overview_widget', 40); |
| If you are facing an error like that on new MacOS version. | |
| xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun | |
| It means that you need to install XCode command line, open a Terminal and run this command: | |
| $ xcode-select --install | |
| Note: | |
| If you want to download and install Command Line tools manually, it can be downloaded from: https://developer.apple.com/download/more/ |
In your command-line run the following commands:
brew doctorbrew update| function wc_bypass_logout_confirmation() { | |
| global $wp; | |
| if ( isset( $wp->query_vars['customer-logout'] ) ) { | |
| wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) ); | |
| exit; | |
| } | |
| } | |
| add_action( 'template_redirect', 'wc_bypass_logout_confirmation' ); |
| function wpseo_cdn_filter( $uri ) { | |
| return str_replace( 'https://domain.com', 'https://cdn.domain.com', $uri ); | |
| } | |
| add_filter( 'wpseo_xml_sitemap_img_src', 'wpseo_cdn_filter' ); |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
Next.js, Nginx with Reverse proxy, SSL certificate
| /** | |
| * @Title: Woocommerce Add a product to the cart programmatically | |
| * @Author: Mina Pansuriya | |
| * @Website: http://minapansuriya.com | |
| * @Blog URL: http://minapansuriya.com/woocommerce-add-a-product-to-the-cart-programmatically/ | |
| */ | |
| add_action( 'template_redirect', 'pbs_woo_add_gift_product_to_the_cart' ); | |
| function pbs_woo_add_gift_product_to_the_cart() { | |
| $isAddGiftF = false; | |
| // install | |
| // npm i gulp-cache gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy -f | |
| // node node_modules/jpegtran-bin/lib/install.js | |
| // node node_modules/gifsicle/lib/install.js | |
| // node node_modules/zopflipng-bin/lib/install.js | |
| // node node_modules/mozjpeg/lib/install.js | |
| // node node_modules/giflossy/lib/install.js | |
| // node node_modules/pngquant-bin/lib/install.js |