Skip to content

Instantly share code, notes, and snippets.

@tenbits
tenbits / functions.php
Created July 15, 2019 12:35 — forked from lukecav/functions.php
Add Global Trade Identification Numbers (GTINs) to WooCommerce products
/**
* Render the Global Trade Identification Number (GTIN) meta field.
*/
function woocommerce_render_gtin_field() {
$input = array(
'id' => '_gtin',
'label' => sprintf(
'<abbr title="%1$s">%2$s</abbr>',
_x( 'Global Trade Identification Number', 'field label', 'my-theme' ),
_x( 'GTIN', 'abbreviated field label', 'my-theme' )
<html>
<script>
window.onload = function() {
nativeInterface.hideSplashScreen()
}
</script>
<style>
.with-css {
pointer-events: none;
var x = new RegExp( "/" )
console.log(x.test( "/hello" ));
var serializedRegexParser = /^\/(.+)\/(\w+)?$/
var serializedRegex = x.toString();
console.log('serializedRegex:', serializedRegex);
var matches = serializedRegexParser.exec(serializedRegex);
var [full, regexString, regexFlags] = matches;