Skip to content

Instantly share code, notes, and snippets.

section.part header h1,
section.chapter header h1,
.front-matter h5,
.part h5,
.chapter h5,
.back-matter h5,
body#tinymce.wp-editor h5,
.front-matter h2,
.part h2,
.chapter h2,
@woodwardtw
woodwardtw / escape-the-panopticon.js
Created July 1, 2022 18:36
bookmarklet to download Panopto videos in playlist
javascript: (() => {var tableRows = document.querySelector('.session-list').querySelectorAll('tr');tableRows.forEach((row) => {if(row.dataset){var dlUrl = 'https://midd.hosted.panopto.com/Panopto/Podcast/Download/'+row.dataset.id+'.mp4?mediaTargetType=videoPodcast';window.open(dlUrl);}});})();
<?php
//simple GF merge field modifier that replaces the space with a dash
add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value, $format ) {
if ( $merge_tag != 'all_fields' && $modifier == 'urlmaker' ) {
$value = str_replace(" ", "-", $value);
}
return $value;
}, 10, 6 );
@woodwardtw
woodwardtw / gf_to_events_calendar.php
Last active June 30, 2022 19:22
makes a live event that does require manual update
<?php
add_action( 'gform_after_submission_3', function ( $entry ) {
if ( ! function_exists( 'tribe_create_event' ) ) {
return;
}
$start_date = rgar( $entry, '2' );
$start_time = rgar( $entry, '3' );
$end_date = rgar( $entry, '4' );
$end_time = rgar( $entry, '5' );
@woodwardtw
woodwardtw / sensus.php
Created June 17, 2022 12:15
index builder for sensus access data
<h1>SensusAccess Stats Index</h1>
<?php
function create_file_name($string){
$name = str_replace('middlebury-report-','', $string);
$name = substr($name,0,10);
return $name;
}
$files = scandir('.');
@woodwardtw
woodwardtw / functions.php
Created June 15, 2022 19:56
messed up river functions
<?php
/**
* UnderStrap functions and definitions
*
* @package UnderStrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
#intro .intro-inner {
padding: 30px;
}
#main .entry-content p {
font-size: 1.5rem;
}
.intro-special {
padding: 70px;
@woodwardtw
woodwardtw / fwp-gf-url-adder.php
Created May 19, 2022 19:35
for a gravity form with the ID of 1, adds a URL to feedwordpress assuming the fields are in the order presented
add_action( 'gform_after_submission_1', 'fwp_gf_url_adder', 10, 2 );
function fwp_gf_url_adder($entry, $form){
$url = rgar( $entry, '1' );
$name = rgar( $entry, '2');
$cat = rgar($entry, '3');
$linkdata = array("link_url" => $url,
@woodwardtw
woodwardtw / fwp-fi-example.php
Last active May 17, 2022 10:58
takes a custom field named enclosure that holds a string of data with the first element being the URL of an image and make it a featured image for the post
add_action( 'publish_post', 'fwp_fi_update', 10, 1 );
function fwp_fi_update ($post_id){
if (get_post_meta( $post_id, 'enclosure', true )) {
$messy_data = get_post_meta( $post_id, 'enclosure', true);
$array_data = explode(PHP_EOL, $messy_data);
$img_url = $array_data[0];
$img_id = fwp_fi_add_img($img_url, $post_id);
@woodwardtw
woodwardtw / style.css
Last active May 12, 2022 19:17
temporary custom css for formofawesome.com
.gquiz-answer-explanation {
margin: 20px 0;
padding: 10px;
border: 2px solid yellow;
border-radius: 5px;
transition: all .5s ease;
}
.twins {
width: 500px;