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
| #!/usr/bin/python | |
| """ | |
| advanced-flood.py | |
| @author: Randall Degges | |
| @email: rdegges@gmail.com | |
| @date: 11-20-09 | |
| This program floods the specified phone number and spoofs caller ID making it |
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
| version: '2' | |
| services: | |
| db: | |
| image: mysql:5.7 | |
| volumes: | |
| - "./.data/db:/var/lib/mysql" | |
| ports: | |
| - "[YOUR_DESIRED_SQL_PORT]:3306" | |
| environment: | |
| MYSQL_ROOT_PASSWORD: wordpress |
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 default values to ACF Repeater Fields | |
| I came across this solution when I had about a ton of posts (200+) with values in various PDFs. I didn't want to have to spend time filling out the same values over and over again. | |
| ## Walkthrough | |
| This case is pretty straight forward; I have one repeater field *field_123a56b7cb890* that has a text fields inside it (*field_588a24c3cb782*). I haven't tried any other types like post objects or radio buttons, but I'm sure it can be done. | |
| **Step 1.** Hook into **acf/load_value** on your repeater field. You can use type/key/name as desired here. |
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 | |
| add_filter('acf/load_field/name=field_name', function($field) { | |
| global $post; | |
| // variant 1 (use get_post_meta instead of get_field to avoid conflicts) | |
| if( get_post_meta($post->ID, 'field_name', true) == '' ) { | |
| $field['value'] = 'FOO'; | |
| } | |
| // variant 2 |
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 | |
| function mytheme_block_templates( $args, $post_type ) { | |
| // Only add template to 'post' post type | |
| // Change for your post type: eg 'page', 'event', 'product' | |
| if ( 'post' == $post_type ) { | |
| // Optionally lock templates from further changes | |
| // Change to 'insert' to allow adding other blocks, but lock defined blocks |
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
| /** | |
| * Checks if the supplied address is a valid autoship address. | |
| * @param array $address | |
| */ | |
| function xx_autoship_valid_shipping_address( $address ){ | |
| // Add Any Address Checks to filter here ( i.e. valid city, state, zip, country ) | |
| return apply_filters( 'xx_autoship_valid_shipping_address', 'US' == $address['shipping_country'], $address ); |
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
| import { | |
| useRef, useCallback, useEffect, useState | |
| } from 'react'; | |
| import smoothscroll from 'smoothscroll-polyfill'; | |
| smoothscroll.polyfill(); | |
| function useSmoothScroll() { | |
| const scrollRafPending = useRef(false); | |
| const scrollRafInstance = useRef(false); |
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
| /** | |
| * @snippet Add Stock Filter to Products page in WordPress admin | WooCommerce | |
| * @comment Localization is automatic if you have localized WooCommerce to your language | |
| * @source https://gist.github.com/vyskoczilova/fbc9dd818af20ff514cdb2d50eab410a | |
| * @updatedversionof https://popoleodesigns.com/add-inout-of-stock-filter-to-wordpress-admin/ | |
| * @author Karolína Vyskočilová | |
| * @testedwith WooCommerce 3.0.7 | |
| */ | |
| // ------------------- |
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 our Custom Fields to simple products | |
| */ | |
| function mytheme_woo_add_custom_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; | |
| // Text Field |