Skip to content

Instantly share code, notes, and snippets.

Taken from here
class Walker_Simple_Example extends Walker {
// Set the properties of the element which give the ID of the current item and its parent
var $db_fields = array( 'parent' => 'parent_id', 'id' => 'object_id' );
// Displays start of a level. E.g '<ul>'
// @see Walker::start_lvl()
function start_lvl(&$output, $depth=0, $args=array()) {
## Working locally
## Basics
### Conditional
{% if == 'elvis' %}
Hey Elvis
{% endif %}
WP cron hooks are stored in the options table in an option named cron. WooCommerce likes to fill this over time until it is too big to write.
While not perhaps optimal, what I do is just empty it:
UPDATE wp_2_options SET option_value = '' WHERE option_name = 'cron'
Extract from unencrypted PFX
openssl pkcs12 -in [file.pfx] -out keys_out.txt
Extract from encrypted PFX
openssl pkcs12 -in [file.pfx] -out keys.pem -nodes
$args = array(
'post__in' => $ids,
'post_type' => array(
'featured_item', // Include for its tag archive listing.
'numberposts' => -1,
'meta_key' => 'custom_post_date',
'orderby' => 'meta_value',
Ensure src attribute of video is empty. Then add something like this:
window.onload = function(){
document.getElementById("vidSrc").src = "mysrc.mp4";
// Get Product ID
$product->get_id(); (fixes the error: "Notice: id was called incorrectly. Product properties should not be accessed directly")
// Get Product General Info
* Add form fields to Checkout
add_filter('woocommerce_checkout_fields', 'wmco_woocommerce_checkout_fields');
function wmco_woocommerce_checkout_fields($fields){
$new_field['billing_org'] = [
'label' => __('Org no.', 'woocommerce'),
'placeholder' => _x('Org no.', 'placeholder', 'woocommerce'),
'required' => false,
Add to Htaccess:
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0```