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/env bash | |
| # =============================================================================== | |
| # Script to install PHPUnit in the Local by Flywheel Mac app | |
| # These packages are installed | |
| # | |
| # PHPUnit, git, subversion, composer, curl and wget | |
| # | |
| # WordPress and the WP_UnitTestCase are installed in the /tmp directory | |
| # The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file |
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 # -*- coding: utf-8 -*- | |
| /** | |
| * Plugin Name: Plugin Class Demo | |
| * Description: How I am using the base class in plugins. | |
| * Plugin URI: | |
| * Version: 2012.09.29 | |
| * Author: Thomas Scholz | |
| * Author URI: http://toscho.de | |
| * License: GPL | |
| * Text Domain: plugin_unique_name |
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
| Step 1: | |
| Go to: \etc\hosts | |
| And add this to the bottom of the file: | |
| ============= | |
| 127.0.0.1 your.domain.com | |
| ============= | |
| Step 2: | |
| Go to [your XAMPP directory]/apache/conf/httpd.conf |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| #<type>(<scope>): <subject> | |
| #<BLANK LINE> | |
| #<body> | |
| #<BLANK LINE> | |
| #<footer> |
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
| //Display Fields | |
| add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 2 ); | |
| //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', 'variable_fields_process', 10, 1 ); | |
| function variable_fields( $loop, $variation_data ) { | |
| ?> | |
| <tr> |
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 | |
| /* | |
| Usage: | |
| $frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
| if ( !$frag->output() ) { // NOTE, testing for a return of false | |
| functions_that_do_stuff_live(); | |
| these_should_echo(); | |
| // IMPORTANT | |
| $frag->store(); | |
| // YOU CANNOT FORGET THIS. If you do, the site will break. |
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 debug_get_functions_for_hook( $hook ) { | |
| global $wp_filter; | |
| if( ! isset( $wp_filter[$hook] ) ) | |
| return; | |
| $functions = array(); | |
| foreach( (array) $wp_filter[$hook] as $key => $actions ) { | |
| //$functions = array_merge( $functions, $actions ); |
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 | |
| /** | |
| * Excel 2003 XML-Parser | |
| * | |
| * PHP library for parsing Microsoft Excel 2003 XML Spreadsheet | |
| * http://gist.github.com/862741 | |
| * | |
| * Copyright (c) 2011 Faisalman <[email protected]> | |
| * |
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 | |
| /** | |
| * Custom Loop Add to Cart. | |
| * | |
| * Template with quantity and ajax. | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. | |
| global $product; |
NewerOlder