This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Render fields at the bottom of variations - does not account for field group order or placement. | |
| add_action( 'woocommerce_product_after_variable_attributes', function( $loop, $variation_data, $variation ) { | |
| global $abcdefgh_i; // Custom global variable to monitor index | |
| $abcdefgh_i = $loop; | |
| // Add filter to update field name | |
| add_filter( 'acf/prepare_field', 'acf_prepare_field_update_field_name' ); | |
| // Loop through all field groups | |
| $acf_field_groups = acf_get_field_groups(); | |
| foreach( $acf_field_groups as $acf_field_group ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| This script will allow you to send a custom email from anywhere within wordpress | |
| but using the woocommerce template so that your emails look the same. | |
| Created by craig@123marbella.com on 27th of July 2017 | |
| Put the script below into a function or anywhere you want to send a custom email | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE wp_users SET user_nicename = "new_username", user_login = "new_username" WHERE user_login = "old_username"; | |
| SELECT * FROM wp_users WHERE user_login = "new_username"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.location.search | |
| .replace('?', '') | |
| .split('&') | |
| .filter(str => !!str) | |
| .forEach(str => { | |
| const [k, v] = str.split('=') | |
| const input = document.querySelector(`[name="${k}"`) | |
| input && (input.value = v) | |
| }, {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // add to functions.php or a plugin. | |
| // render js composer shortcodes to html in graphql response | |
| add_action('graphql_register_types', function() { | |
| function vsCodeShortcodesToHTML( $post ) { | |
| if(class_exists('WPBMap') && method_exists('WPBMap', 'addAllMappedShortcodes')) { | |
| WPBMap::addAllMappedShortcodes(); | |
| } | |
| return do_shortcode(get_post($post->ID)->post_content); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Disable new divi crazy crap code for CPT | |
| **/ | |
| function disable_cptdivi() | |
| { | |
| remove_action( 'wp_enqueue_scripts', 'et_divi_replace_stylesheet', 99999998 ); | |
| } | |
| add_action('init', 'disable_cptdivi'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.from( document.querySelectorAll('input, textarea') ).forEach(function(el) { | |
| if (el.type === 'text' || el.tagName === 'TEXTAREA') { | |
| el.value = 'test' | |
| } else if (el.type === 'number' || el.type === 'tel') { | |
| el.value = 100 | |
| } else if (el.type === 'date') { | |
| el.value = '2020-10-20' | |
| } else if (el.type === 'checkbox') { | |
| el.checked = true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const inputToFill = document.getElementById('390') | |
| const presentation = getQueryVariable('presentation') | |
| function unSlugify(slug) { | |
| var title = slug.split('-').join(' '); | |
| var firstLetterCapital = title.charAt(0).toUpperCase(); | |
| var theRest = title.substring(1); | |
| return firstLetterCapital + theRest; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dataDump = props => <pre>{JSON.stringify(props, null, 2)}</pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.IO; | |
| using System.Net; | |
| namespace ConsoleApp1 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; |