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
//this function is set to run on each form submit and is tied to the spreadsheet where the entries go | |
function onSubmit(){ | |
let sheet = SpreadsheetApp.getActiveSheet(); | |
let rows = sheet.getDataRange(); | |
let lastRow = rows.getLastRow(); | |
let email = sheet.getRange(lastRow,2).getValue(); | |
let atSymbol = email.search('@'); | |
let cleanEmail = email.substring(0,atSymbol); | |
let title = sheet.getRange(lastRow,3).getValue(); | |
let content = sheet.getRange(lastRow,4).getValue(); |
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
function onEdit(){ | |
const ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
const entries = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("entries"); | |
const dropDowns = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("dropdowns"); | |
const activeCell = entries.getCurrentCell(); | |
const activity = activeCell.getValue(); | |
if(activeCell.getColumn() == 3 && activeCell.getRow() > 1){ | |
activeCell.offset(0,1).clearContent().clearDataValidations(); |
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 | |
/* | |
Plugin Name: Skidmore Multisite Helpers | |
Plugin URI: https://github.com/ | |
Description: A network activated plugin used to house small functions that apply to all sites. | |
Version: 1.0 | |
Author: Tom Woodward et al. | |
Author URI: https://tomwoodward.us | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
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 | |
class td_block1_widget extends td_block_widget { | |
var $td_block_id = 'td_block_1'; // change only the block id, the rest is autogenerated | |
} | |
add_action('widgets_init', function (){ | |
register_widget("td_block1_widget"); | |
} |
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
function pb_add_glossary_item(){ | |
if (($handle = fopen(plugin_dir_path(__FILE__) . "test.csv", "r")) !== FALSE) { | |
while (($data = fgetcsv($handle, 1000, "\t")) !== FALSE) { | |
ini_set('auto_detect_line_endings',TRUE); | |
foreach ($data as $key => $line) { | |
// code... | |
$data_array = explode(",", $line); | |
$args = array( | |
'post_title' => $data_array[0], | |
'post_content' => $data_array[1], |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
# Create a dictionary of GDP data for the USA and China from 2016 to 2020 | |
data = { | |
'Country': ['USA', 'China'], | |
'2016': [18624475, 11233273], | |
'2017': [19542968, 12408149], | |
'2018': [20580518, 13608152], | |
'2019': [21433226, 14271038], |
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 | |
//UPDATE wp_options with page count | |
function wmps_page_count(){ | |
$page_count = wp_count_posts('page')->publish; | |
if ( get_option( 'wpms_data_pages_count' ) !== false ) { | |
update_option('wpms_data_pages_count', $page_count); | |
} else { | |
add_option('wpms_data_pages_count', $page_count); | |
} | |
} |
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
/*---------------------------------JSON MOD FOR ADDITIONAL SITE INFO----------------------------------*/ | |
function extraJsonData($response){ | |
$blog_id = get_current_blog_id(); | |
$blog_details = get_blog_details($blog_id); | |
$data = $response->data; | |
$data['created'] =$blog_details->registered; | |
$data['last_updated'] =$blog_details->last_updated; | |
$data['post_count'] =$blog_details->post_count; | |
$data['page_count'] = wp_count_posts('page','publish'); |
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
/** | |
* these are two alternative settings for wp-config.php don't use both! | |
**/ | |
/** | |
* super shush any errors or warnings | |
**/ | |
ini_set('display_errors','Off'); | |
ini_set('error_reporting', E_ALL ); |
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
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
.h1 { | |
font-family: Domine, georgia, serif; | |
} | |
#app-header { |
NewerOlder