View _box.scss
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
$spacing: ( | |
xs: 0.25rem, | |
sm: 0.5rem, | |
md: 0.75rem, | |
lg: 1rem, | |
xl: 1.5rem, | |
xxl: 2rem | |
); | |
$colours: ( |
View typechecker.test.ts
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
import savedArtists from '../json-data/test/artists.json' assert { type: 'json'}; | |
import { getType } from './typechecker'; | |
// NOTE: These tests are a work in progress, | |
as I have so far only completed work with the "Artist" type on the project at the time of writing | |
describe('Typechecker', () => { | |
it('Correctly identifies and Artist', () => { | |
const item = savedArtists[0]; | |
const type = getType(item); |
View class-unhooky-plugin-custom-admin-stuff.php
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
/** | |
* Job listings functionality for Client Website | |
* Note: Requires Ninja Forms plugin | |
* Note: Truncated for use in a gist to demonstrate unhooking a Ninja Forms function | |
* | |
* @since 1.0.0 | |
* @package MyPlugin | |
* @subpackage MyPlugin/admin | |
*/ | |
class MyPlugin_Jobs extends MyPlugin_Settings { |
View YearbookClasses.jsx
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
/** | |
* Custom Image Catalog script that runs for all subfolders in a selected folder. | |
* Lays out each folder of images in the specified number of rows and columns, 2 folders per page, shows an alert if there's more images than allowed for, | |
* labels each group with the folder name, creates paragraph styles for the captions and group headings, and saves the file. | |
* | |
* Based on the built-in Image Catalog script but modified and simplified (e.g. hard-coding the settings) for my use case. | |
* Could be modified to suit different numbers of folders per page, different image quantities etc by changing the settings at the top | |
* and making tweaks to other code as needed. | |
* | |
* Could also be extended to show one dialog for settings prior to the loop, |
View cpt-case_study.php
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 | |
// Register Custom Post Type | |
// Note: Using woocommerce_after_register_taxonomy hook instead of init because we're using a product attribute taxonomy with this CPT | |
function doublee_cpt_case_study() { | |
$labels = array( | |
'name' => _x('Case studies', 'Post Type General Name', 'doubleedesign'), | |
'singular_name' => _x('Case study', 'Post Type Singular Name', 'doubleedesign'), | |
'menu_name' => __('Case studies', 'doubleedesign'), | |
'name_admin_bar' => __('Case study', 'doubleedesign'), |
View functions.php
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 | |
function doublee_log_all_actions() { | |
foreach($GLOBALS['wp_actions'] as $action => $count) { | |
error_log(print_r($action, true)); | |
} | |
} | |
add_action('shutdown', 'doublee_log_all_actions'); |
View filter-orders-by-role.php
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 role drop-down to orders screen | |
*/ | |
function doublee_add_order_user_role_filter_selectbox() { | |
global $typenow, $wp_query; | |
if (in_array($typenow, wc_get_order_types('order-meta-boxes'))) : | |
$user_role = ''; |
View widget-product-categories.php
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 | |
/** | |
* Product Categories Widget | |
* Modifies the WooCommerce product categories widget to display as a Bootstrap accordion. | |
* | |
* @package WooCommerce/Widgets | |
* @version 2.3.0 | |
*/ | |
defined( 'ABSPATH' ) || exit; |
View create-zip.php
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 | |
/** | |
* Utility function to create a zip file from an array of file URLs | |
* Used for download links in emails | |
* @param array $files | |
* @param string $filename | |
* | |
* @return string | |
*/ | |
function doublee_zip_order_files(array $files, string $filename) { |
View acf-tsf-integration.php
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 | |
/** | |
* The SEO Framework + ACF flexible content integration | |
* TSF will look at the excerpt and then the content to generate the default meta description. | |
* If both of those are empty, this code looks for ACF flexible modules to get it from. | |
* // TODO: Make this work with archives as well as posts | |
* @param $description | |
* @param $args | |
* | |
* @return mixed|string |
NewerOlder