First create global variables (in functions.php or as a mu-plugin):
<?php
/*
* CUSTOM GLOBAL VARIABLES
*/
function wtnerd_global_vars() {
<?php | |
/* | |
Template Name: Stock Report :) | |
*/ | |
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.'); | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
<?php | |
ini_set('max_execution_time', 0); | |
class GW2SpidyDataset { | |
protected $data; | |
public function getItemById($id) { | |
if (!$this->data) { | |
$this->getData(); |
//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> |
<?php | |
// Place the following code in your theme's functions.php file | |
// override the quantity input with a dropdown | |
function woocommerce_quantity_input() { | |
global $product; | |
$defaults = array( | |
'input_name' => 'quantity', | |
'input_value' => '1', | |
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ), |
First create global variables (in functions.php or as a mu-plugin):
<?php
/*
* CUSTOM GLOBAL VARIABLES
*/
function wtnerd_global_vars() {
// config/passport.js | |
// load all the things we need | |
var LocalStrategy = require('passport-local').Strategy; | |
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ | |
host : 'localhost', | |
user : 'root', |
##Angular Directive Priority - Quick Reference
When there are multiple directives defined on a single DOM element, sometimes it is necessary to specify the order in which the directives are applied. The priority is used to sort the directives before their compile
functions get called. Priority is defined as a number. Directives with greater numerical priority
are compiled first. Pre-link functions are also run in priority order, but post-link functions are run in reverse order. The order of directives with the same priority
is undefined. The default priority
is 0
.
For a brief description of each directive, click here.
Directive | Priority | Terminal | Creates new scope | Can be used as multiElement ---------- | :---------: | :---------: | :---------------
This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
function addLibraryFileFromPlugin(context) { | |
var sketch = context.api(); | |
var libSourceFile = "libraries/myLibrary.sketch"; // The file with the symbols for your library; should located in the plugin's resources folder | |
var libSourcePath = context.plugin.urlForResourceNamed(libSourceFile).path(); | |
if(libSourcePath) { | |
var libURL = NSURL.fileURLWithPath(libSourcePath); | |
var libPaneIdentifier = MSAssetLibrariesPreferencePane.identifier(); | |
var libPane = MSPreferencesController.sharedController().preferencePanes().objectForKey(libPaneIdentifier); | |
// Set a minimum amount of oder based on shipping zone before checking out | |
add_action( 'woocommerce_check_cart_items', 'cw_min_num_products' ); | |
// Only run in the Cart or Checkout pages | |
function cw_min_num_products() { | |
if( is_cart() || is_checkout() ) { | |
global $woocommerce; |