Skip to content

Instantly share code, notes, and snippets.

@nicdford
nicdford / script.js
Last active Aug 28, 2020
JS to convert Make Page Builder sections into Accordion Items
View script.js
const accordion_items = document.querySelectorAll('.wsu-js-accordion-item');
accordion_items.forEach(item => {
// Set initial state
const child_divs = Array.from(item.children);
child_divs.forEach(element => {
if (element.classList.contains('column') && !element.classList.contains('toggle-visible')) {
element.classList.add('toggle-visible');
View gist:d312c29b9d3eecb778eb7bd951d8bcf1
const path = require('path');
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
console.log();
console.log('nic look here')
module.exports = {
...defaultConfig,
module: {
View class-gf-field-likert.php
// Line 143 - Missing input labels
$content .= sprintf( "<td data-label='%s' class='%s'><label for='%s'><span class='screen-reader-text'>%s</span></label><input name='%s' type='radio' title='test' value='%s' %s id='%s' %s %s %s/></input></td>", esc_attr( wp_strip_all_tags( $choice['text'], true ) ), $cell_class, $input_id, $input_name, $input_name, esc_attr( $field_value ), $checked, $input_id, $disabled_text, $this->get_tabindex(), $logic_event );
// Line 95 - Missing table header
$content .= "<th scope='col' class='gsurvey-likert-row-label'><span class='screen-reader-text'>Column selection options</span></th>";
View cloudSettings
{"lastUpload":"2020-09-23T23:40:53.110Z","extensionVersion":"v3.4.3"}
@nicdford
nicdford / gist:adcb40396eaffadf242636a3936a5172
Created Sep 5, 2019
Shortcode to display posts headlines by category
View gist:adcb40396eaffadf242636a3936a5172
[wsuwp_json host="provost.wsu.edu" category="faculty-development" count="10" output="headlines" cache_bust="0"]
View gist:7b5dcf3b44431e590057626aa69578c2
/**
* Create excerpt from content
*/
function pac_create_exerpt( $content ) {
return wp_trim_words($content, 15, '...');
}
@nicdford
nicdford / gist:a19eec2de96209e319ab0eabb8721109
Created Mar 20, 2018
Custom Simple Relationship where param list pods values
View gist:a19eec2de96209e319ab0eabb8721109
<?php
$params = array(
'limit' => 3,
'where' => "source.meta_value = 'google'" // Relationship (Custom Simple)
);
$pods = pods( 'testimony', $params );
if ( !empty( $pods ) ) {
while ($pods->fetch()){
@nicdford
nicdford / gist:9e715f9661aa6fd0f688cc03c6e8064b
Created May 4, 2016
Add Pods Shortcode Wizard to Beaver Builder Text Editer Module
View gist:9e715f9661aa6fd0f688cc03c6e8064b
function show_pods_modal_button() {
$fl_builder = pods_v('fl_builder', 'get', 'url');
if (empty($fl_builder)) {
pods_view( PODS_DIR . 'ui/admin/shortcode.php', compact( array_keys( get_defined_vars() ) ) );
echo '<a href="#TB_inline?width=640&inlineId=pods_shortcode_form" class="thickbox button" id="add_pod_button" title="Pods Shortcode"><img style="padding: 0px 6px 0px 0px; margin: -3px 0px 0px;" src="' . PODS_URL . 'ui/images/icon16.png" alt="' . __('Pods Shortcode' ,'pods') . '" />' . __('Pods Shortcode' ,'pods') . '</a>';
}
}
@nicdford
nicdford / page-resources.php
Created Dec 3, 2015
A Pods Example on running a loop inside a loop.
View page-resources.php
<?php
/**
* Template Name: Library Resource List
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package asotin_county_library
@nicdford
nicdford / filters
Last active Feb 24, 2016
filters setup
View filters
<?php
$things_to_do = pods( 'things_to_do' );
$limit = 9;
$params = array(
'fields' => array(
'region',
'activity',
'legend_items'
),
You can’t perform that action at this time.