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 | |
/** | |
* Check whether WPML is active for current site. Checking for the availability of the SitePress class is not enough, | |
* because the plugin can be deactivated for a certain site. Also, this behavior is not consistent when switching blogs. | |
* | |
* How *NOT* to do it: | |
* - `class_exists( 'SitePress' )` | |
* - `defined('ICL_LANGUAGE_CODE')` | |
* - ... | |
*/ |
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
# Helper function to automate openvpn3 connections that need SSO capabilities. | |
# Add it to your ~/.bashrc file using following code (and make sure to edit $OPENVPN3_CONFIG_NAME): | |
# source /path/to/openvpn3_sso.sh | |
# If using zsh, you can also save this to the `$ZSH/custom/openvpn3_sso.zsh` file. | |
# You can automatically have this run by calling ovpn3_sso_connect in your ~/.bashrc or ~/.zshrc file. | |
# WARNING: This has currently only been tested on zsh and bash. | |
# (c) Koen Van den Wijngaert <[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
### Keybase proof | |
I hereby claim: | |
* I am vdwijngaert on github. | |
* I am vdwijngaert (https://keybase.io/vdwijngaert) on keybase. | |
* I have a public key ASDcPQMBWUfa2dF_H-x8p856-k9Q476umGClgNmW05X__Ao | |
To claim this, I am signing this object: |
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 | |
/** | |
* @param string $tab | |
* @param int $offendingPriority | |
*/ | |
function my_prefix_undoTabRemoval($tab, $offendingPriority = 10) | |
{ | |
static $filterName = 'woocommerce_product_tabs'; | |
// Accessible variable for the tab content. |
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 | |
/** | |
* Populate ACF Select Field with WooCommerce Attributes. | |
*/ | |
add_filter('acf/load_field/name=featured_attributes', function($field) { | |
$taxonomies = get_taxonomies([ | |
'public' => false, | |
'_builtin' => false | |
], 'objects'); |
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 | |
class P4D_Siblings extends WP_Widget | |
{ | |
/** | |
* Sets up the widgets name etc | |
*/ | |
public function __construct() | |
{ | |
$widget_ops = array('classname' => 'p4d_siblings', 'description' => __('Use this widget to display a list of page siblings.')); |
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
/*! | |
* ProdChecker | |
* | |
* Copyright(c) Koen Van den Wijngaert | |
*/ | |
/*jshint node: true */ | |
'use strict'; | |
var http = require('http'); |
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
var $ = jQuery, | |
strings = []; | |
$("#icl_string_translations").find(">tbody>tr").each(function() { | |
var $tr = $(this), | |
$tds = $tr.find("td"), | |
trans = {}; | |
trans.context = $tds.get(1).innerText; |