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
const fs = require( 'fs' ); | |
const path = require( 'path' ); | |
const themeJsonPath = path.join( __dirname, 'theme.json' ); | |
const themeJson = fs.readFileSync( themeJsonPath ); | |
const theme = JSON.parse( themeJson ); | |
const { palette } = theme.settings.color; | |
const colors = palette.reduce(( acc, item ) => { | |
const [color, number] = item.slug.split( '-' ); |
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 | |
// Display specific ACF groups on selected sites only for Multisite. | |
if ( is_multisite() ) : | |
add_filter( 'acf/location/rule_types', 'acf_location_rule_type_multisite' ); | |
add_filter( 'acf/location/rule_values/site', 'acf_location_rule_values_multisites' ); | |
add_filter( 'acf/location/rule_match/site', 'acf_location_rules_match_site', 10, 3 ); | |
endif; | |
function acf_location_type_multisite( $choices ) { | |
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 | |
/** | |
* Create the WordPress rewrite rule to handle third level slugs for videos. | |
* | |
*/ | |
function video_cpt_generating_rule( $wp_rewrite ) { | |
$rules = []; | |
$terms = get_terms( [ | |
'taxonomy' => 'series', | |
'hide_empty' => false, |
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 | |
/** | |
* Populate ACF select field options with Gravity Forms form ID | |
*/ | |
function acf_populate_gf_forms_ids( $field ) { | |
if ( class_exists( 'GFFormsModel' ) ) { | |
$choices = []; | |
foreach ( \GFFormsModel::get_forms() as $form ) { | |
$choices[ $form->id ] = $form->title; |
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 | |
/** | |
* Show all posts based on taxonomy meta key. | |
* | |
* @return WP_Query $courses New WP_Query containing courses. | |
*/ | |
function display_posts_taxonomy_order() { | |
$term_args = array( | |
'taxonomy' => 'discipline', |
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
/** | |
* File search.js | |
* | |
* Scroll to div on load. | |
* | |
*/ | |
const divToScroll = document.getElementById( 'scroll-here' ); | |
document.addEventListener( 'DOMContentLoaded', function ( event ) { |
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 | |
/** | |
* MODULE - Wistia Player. | |
* | |
* Autoplay nuted Wistia Video in the background and remove from DOM when done. | |
*/ | |
/** | |
* Accepts 'class','wistia_id'. | |
*/ |
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 | |
/** | |
* Shortcode to display Vimeo video. | |
* | |
* @param array $args Parameters include vimeo_id and more. | |
* @author JC Palmes | |
*/ | |
function embed_vimeo_video( $args = [] ) { | |
// Set defaults. |
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 | |
/** | |
* Limit the content length. | |
* | |
* @author JC Palmes | |
* | |
* @param array $args Parameters include length and more. | |
* | |
* @return string The content. | |
*/ |
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 | |
/** | |
* Load icons dynamically into the `icon_picker` select field. | |
* | |
* @param array $field field options. | |
* @return array new field choices. | |
* | |
* @author JC Palmes | |
*/ | |
function acf_load_icon_picker_field_choices( $field ) { |
NewerOlder