Once you fill in the URLs you want to snapshot, you can run the visual tests by:
- Setting your
PERCY_TOKENto a project in https://percy.io - Running
npm run percy(oryarn percy) - ??
- Get other work done (profit)!
That's about it :p
Once you fill in the URLs you want to snapshot, you can run the visual tests by:
PERCY_TOKEN to a project in https://percy.ionpm run percy (or yarn percy)That's about it :p
| // To easily view how a site looks when CSS Grid is not available, use this in the SASS file. | |
| // First you need this variable: | |
| $cssgrid: "(grid-template-rows:initial)"; | |
| // Then you can uncomment the below to re-declare the variable and so disable the @supports for every browser: | |
| // $cssgrid: "(display:no-css-grid-support)"; | |
| // Wrap every usage of CSS Grid in this: | |
| @supports(#{$cssgrid}) { |
| // License: GPLv2+ | |
| var el = wp.element.createElement, | |
| registerBlockType = wp.blocks.registerBlockType, | |
| ServerSideRender = wp.components.ServerSideRender, | |
| TextControl = wp.components.TextControl, | |
| InspectorControls = wp.editor.InspectorControls; | |
| /* | |
| * Here's where we register the block in JavaScript. |
| add_action('wp_footer', 'add_bronto_json'); | |
| function add_bronto_json() { | |
| $brontoItems = []; | |
| if( is_wc_endpoint_url( 'order-received' ) ): | |
| if(isset($_GET['view-order'])) { | |
| $order_id = $_GET['view-order']; |
| <?php | |
| wp_load_translations_early(); | |
| $protocol = wp_get_server_protocol(); | |
| header( "$protocol 503 Service Unavailable", true, 503 ); | |
| header( 'Content-Type: text/html; charset=utf-8' ); | |
| header( 'Retry-After: 30' ); | |
| ?> | |
| <!DOCTYPE html> | |
| <html> |
| <?php | |
| /** | |
| * Plugin Name: Convert ACF PHP to JSON | |
| * Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON. | |
| */ | |
| namespace ConvertAcfPhpToJson; | |
| /** | |
| * Add submenu item under 'Custom Fields' |
| <?php | |
| /** | |
| * Test a bunch of permutations of the password when logging into WordPress. | |
| * | |
| * Drop this file in your mu-plugins directory. | |
| * Inspired by Facebook: https://twitter.com/gcpascutto/status/821755332984717314/photo/1 | |
| * Works with any properly coded hashing pluggables, like Roots’ WP Password bcrypt. | |
| * | |
| * @author bjornjohansen | |
| * @version 0.1.4 |
| <?php | |
| class RW_GF_Total_Field_Logic { | |
| public function __construct() { | |
| add_action( 'init', array( $this, 'init' ) ); | |
| } | |
| function init() { | |
| if ( ! property_exists( 'GFForms', 'version' ) || ! version_compare( GFForms::$version, '1.9', '>=' ) ) { | |
| return; |
| add_filter("gform_field_validation_[FORM_ID]_[FIELD_ID]", "uk_postcode_validation", 10, 4); | |
| function uk_postcode_validation($result, $value, $form, $field){ | |
| //address field will pass $value as an array with each of the elements as an item within the array, the key is the field id | |
| $postcode = $value["[FIELD_ID].5"]; | |
| //the default regex is valid both with and without the space in the middle. | |
| //to force the space, replace with the following: | |
| //'#^(GIR ?0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]([0-9ABEHMNPRV-Y])?)|[0-9][A-HJKPS-UW]) [0-9][ABD-HJLNP-UW-Z]{2})$#' |
| <?php | |
| //Display Fields | |
| add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 ); | |
| //JS to add fields for new variations | |
| add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
| //Save variation fields | |
| add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 ); | |
| /** |