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 | |
| /** | |
| * Inspired from: https://gist.github.com/dazecoop/548b2621e86fb030da8e5adb1bfe484f | |
| * | |
| * How to use: | |
| * - add to your function.php or related | |
| * | |
| * What you can use it for: | |
| * Variable products: | |
| * - you have variable product with some attributes not used for variations |
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
| #!/bin/sh | |
| DEVDIR="web/app/uploads/" | |
| DEVSITE="https://example.dev" | |
| PRODDIR="[email protected]:/srv/www/example.com/shared/uploads/" | |
| PRODSITE="https://example.com" | |
| STAGDIR="[email protected]:/srv/www/example.com/shared/uploads/" | |
| STAGSITE="https://staging.example.com" |
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 example_ajax_enqueue() { | |
| // Enqueue javascript on the frontend. | |
| wp_enqueue_script( | |
| 'example-ajax-script', | |
| get_template_directory_uri() . '/js/simple-ajax-example.js', | |
| array( 'jquery' ) | |
| ); |
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_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
| function woo_add_custom_general_fields() { | |
| global $woocommerce, $post; | |
| echo '<div class="options_group">'; | |
| woocommerce_wp_checkbox( | |
| array( | |
| 'id' => '_no_free_shipping_checkbox', |
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 | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| class CsvController extends Controller | |
| { | |
| /** | |
| * Get a CSV file from an array |
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 python | |
| import argparse | |
| import sys | |
| import jinja2 | |
| import markdown | |
| TEMPLATE = """<!DOCTYPE html> | |
| <html> |
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
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |