Instructions for how to install a WordPress plugin that is stored in a Gist (example).
There are three ways to do it:
Instructions for how to install a WordPress plugin that is stored in a Gist (example).
There are three ways to do it:
| // Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting | |
| /** | |
| * Remove Woocommerce Select2 - Pre WC 3.2.1-ish | |
| */ | |
| function woo_dequeue_select2() { | |
| if ( class_exists( 'woocommerce' ) ) { | |
| wp_dequeue_style( 'select2' ); | |
| wp_deregister_style( 'select2' ); |
| <?php | |
| add_filter( 'wpforms_email_headers', function ( $headers, $emails ) { | |
| // APPLY THE BCC TO THIS FORM ID ONLY. | |
| // CHANGE THE ID TO THE FORM YOU NEED. OR REMOVE THE WHOLE IF BLOCK IF NEEDED FOR ALL FORMS. | |
| if ( 384 !== $emails->form_data['id'] ) { | |
| return $headers; | |
| } | |
| // CHANGE THIS EMAIL ADDRESS TO YOURS: |
| <?php | |
| /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
| /* | |
| * Replace Disallow with Allow Generated Robots.txt | |
| * Credit: Unknown | |
| * Last Tested: June 09 2020 using WordPress 5.4.1 | |
| */ | |
| add_filter('robots_txt','custom_robots'); |
| sudo yum install -y cloud-utils-growpart | |
| # You can use lsblk command to check the total available space of you disk. | |
| # growpart is used to to expand a partition to the whole disk (expand sda1 to sda) | |
| # xfs_growfs is used to resize and apply the changes | |
| # df -h | |
| # For more informations : https://blog.myduniahosting.com/how-to-resize-your-root-diskpartition-online-for-linux/ | |
| part=`df --output=source / |grep "/dev/"` | |
| if [ ! -z "$part" ] ; then | |
| len=${#part} |
| /** | |
| * My Account | |
| */ | |
| .woocommerce-account .woocommerce-MyAccount-navigation { | |
| width: 20%; | |
| } | |
| .woocommerce-account .woocommerce-MyAccount-content { | |
| display: inline-block; |
| <?php | |
| /** | |
| * Redirect users to custom URL based on their role after login | |
| * | |
| * @param string $redirect | |
| * @param object $user | |
| * @return string | |
| */ | |
| function wc_custom_user_redirect( $redirect, $user ) { | |
| // Get the first of all the roles assigned to the user |
| <select name="estados-brasil"> | |
| <option value="AC">Acre</option> | |
| <option value="AL">Alagoas</option> | |
| <option value="AP">Amapá</option> | |
| <option value="AM">Amazonas</option> | |
| <option value="BA">Bahia</option> | |
| <option value="CE">Ceará</option> | |
| <option value="DF">Distrito Federal</option> | |
| <option value="ES">Espírito Santo</option> | |
| <option value="GO">Goiás</option> |
| <?php | |
| $file = '/path/to/file.png'; | |
| $filename = basename($file); | |
| $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
| if (!$upload_file['error']) { | |
| $wp_filetype = wp_check_filetype($filename, null ); | |
| $attachment = array( | |
| 'post_mime_type' => $wp_filetype['type'], | |
| 'post_parent' => $parent_post_id, |
These set of scripts are for Magento 1. For Magento 2, see this Gist.