This file contains 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
// remove relevanssi | |
remove_filter('posts_request', 'relevanssi_prevent_default_request'); | |
remove_filter('the_posts', 'relevanssi_query'); |
This file contains 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
<body> | |
<h1>Repro Safari IndexedDB autoIncrement bug</h1> | |
<div id="logger"></div> | |
<script> | |
var dbname = 'time_' + Date.now() + '_'; | |
function log(msg) { | |
document.getElementById("logger").innerHTML += msg + "<br>"; | |
} |
This file contains 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
/** | |
* Change default filter of orders in WP admin | |
* add this to your functions.php file | |
*/ | |
add_action( 'admin_menu', 'change_default_order_filter', 99 ); | |
function change_default_order_filter() { | |
global $submenu; | |
if (isset($submenu['woocommerce'])) { | |
$submenu['woocommerce'][1][2] = 'edit.php?post_type=shop_order&shop_order_status=pending,processing'; | |
} |
This file contains 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_order_add_product', 'my_custom_product_meta'); | |
function my_custom_product_meta($id, $item_id, $product) { | |
wc_add_order_item_meta($item_id, 'serial', $product->get_sku()); | |
} |
This file contains 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 | |
$conn = new mysqli($WORDPRESS_DB_HOST, $WORDPRESS_DB_USER, $WORDPRESS_DB_PASSWORD); | |
if(!mysqli_select_db($conn , $WORDPRESS_TESTS_DB_NAME)){ | |
$sql = "CREATE DATABASE $WORDPRESS_TESTS_DB_NAME"; | |
if ($conn->query($sql) === TRUE) { | |
echo "Database created successfully"; | |
} else { | |
echo "Error creating database: " . $conn->error; | |
} |
This file contains 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 | |
// change the CASHIER_ID, and | |
// add to your functions.php file | |
add_filter('map_meta_cap', 'wc_pos_map_meta_cap', 10, 3); | |
function wc_pos_map_meta_cap($caps, $cap, $user_id){ | |
if(is_pos() && $cap == 'edit_users' && $user_id === CASHIER_ID){ | |
$caps = array('edit_users'); |
This file contains 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 this to your functions.php file | |
add_filter('woocommerce_pos_i18n', 'my_custom_woocommerce_pos_i18n'); | |
function my_custom_woocommerce_pos_i18n(array $translations){ | |
$translations['buttons']['shipping'] = 'Livraison'; | |
return $translations; | |
} |
This file contains 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
<tr> | |
<td class="product"> | |
{{name}} | |
{{#with meta}} | |
<dl class="meta"> | |
{{#each []}} | |
<dt>{{label}}:</dt> | |
<dd>{{value}}</dd> | |
{{/each}} | |
</dl> |
This file contains 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 | |
/* | |
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" /> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Multiple Class Inheritance In Backbone Collections</title> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"></script> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.3.3/backbone-min.js"></script> | |
</head> | |
<body> |