Skip to content

Instantly share code, notes, and snippets.

public function getFeaturedImageAttribute() {
if (!empty($this->thumbnail)) {
return $this->thumbnail->size('original');
} else {
return null;
}
}
// Inject partials into main menu
add_filter('wp_nav_menu_items', function ($items, $args) {
if ($args->menu->name != 'Primary') {
return $items;
}
$dom = new DOMDocument();
$dom->loadHTML($items);
$xpath = new DOMXpath($dom);
$find = $xpath->query('//li[contains(@class, "product-menu")]|//li[contains(@class, "resource-menu")]');
/**
* Order details table shown in emails.
*
* CHANGES:
* 1. Remove Price Header in thead
* 2. Remove Totals Rows in tfoot
* 3. Remove colspan from Notes cell
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates/Emails
@nickstewart95
nickstewart95 / example.php
Created March 12, 2020 12:10
example.php
add_action('woocommerce_review_order_before_shipping', function() {
echo '<p>Due to the Corona virus, the shipping of goods have been disrupted and it may take longer to receive your purchase.</p>';
});
<table width="100%" align="center" border="0" style="width: 100%; border-collapse: collapse;">
<tr>
<td><div style="height: 10px;">&nbsp;</div></td>
</tr>
<tr>
<td>
<div style="width: 100%; text-align: center;">
<img src="https://alliantpurchasing.com/wp-content/uploads/2019/08/email_logo.png" height="70" align="center">
</div>
</td>
<template>
<Page @loaded="pageLoaded" class="page">
<ActionBar title="Sample App" class="action-bar" />
<StackLayout orientation="vertical">
<TabView>
<TabViewItem title="Countries">
<ListView class="list-group" for="country in countries"
style="height:1250px">
<v-template>
<FlexboxLayout flexDirection="row" class="list-group-item">
//The HubSpot cookie can be accessed from _COOKIE['hubspotutk'],
$form_data = [
'property_name' => 'property_value',
'hs_context' => json_encode([
'hutk' => $hubspotCookie,
'ipAddress' => $ipAddress,
'pageUrl' => 'https://viastudio.com',
'pageName' => 'VIA Studio'
])
$hubspot = $this->connect();
$properties = [
[
'property' => 'property_name',
'value' => 'property_value';
]
];
try {
function connect() {
$key = '';
$oauth = false;
$base_url = 'https://api.hubapi.com';
try {
$hubspot = new \SevenShores\Hubspot\Factory([
'key' => $key,
'oauth' => $oauth,
'base_url' => $base_url
<svg className="bb_illustration" id="BB_CHAPTER_1" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 383 513">
<g id="HAIR">
<path id="hair_right_side" />
<path id="hair_left_side" />
<path id="hair_fill_right_inside" />
<path id="hair_fill_left_inside" />
<path id="hair_strand_1" />
<path id="hair_strand_4" />
<path id="hair_strand_3" />
<path id="hair_strand_2" />