Skip to content

Instantly share code, notes, and snippets.

💭
Working on @impress-org Stuff

Matt Cromwell mathetos

💭
Working on @impress-org Stuff
Block or report user

Report or block mathetos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mathetos
mathetos / shortcode-donor-wall.php
Created Nov 15, 2019
Add Form Title to Donor Wall Card
View shortcode-donor-wall.php
<?php
/**
* This template is used to display the donation grid with [give_donor_wall]
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@mathetos
mathetos / row_classes.php
Last active Oct 2, 2019
Add .documents class to specific rows of a Caldera Form
View row_classes.php
// Add .documents class to divs of the Employee Onboarding Caldera Form
add_action( 'caldera_forms_grid_row_class', function($rowClass, $row, $config ){
//Change your field ID here
if('CF5d8ceba87e343' == $config[ 'form_id' ]){
if( $row==4 || $row==5 ) {
$rowClass .= ' documents';
}
}
@mathetos
mathetos / site-health-curl-test.php
Last active May 9, 2019
Add cURL test to WP 5.2 Site Health tests
View site-health-curl-test.php
<?php
/**
* Adds a cURL version test to Site Health
*
* Info here: https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/
* NOTE: Requires version 5.2+ of WordPress
*
**/
@mathetos
mathetos / fields.php
Created Jan 18, 2019
GiveWP Custom field with validation
View fields.php
/**
* Add Custom Donation Form Fields
*
* @param $form_id
*/
function give_myprefix_custom_form_fields( $form_id ) {
if ( $form_id == 8) {
//$forms = array( 8 );
?>
@mathetos
mathetos / give-ify-github.css
Last active Sep 7, 2018
Give-ify your Github
View give-ify-github.css
/*
* Give-ify your Github
* Preview: https://cloudup.com/cGiBiRpMd3B
*
* Step 1: Install the "Refined Github" browser extension: https://github.com/sindresorhus/refined-github
* Step 2: Use it's Custom CSS field to paste the following.
*/
@font-face {
font-family: give-icomoon;
@mathetos
mathetos / zap.js
Last active Feb 15, 2018 — forked from kevinwhoffman/zap.js
Get Unassigned from HelpScout
View zap.js
/*
* HelpScout Zap: Get Number of Unassigned in a Specific Mailbox
* Use Zapier's "Code" Action to trigger this
* This only works with Zapier, it depends on the "callback" functions
*/
var btoa = function (str) {return new Buffer(str).toString('base64');};
fetch('https://api.helpscout.net/v1/mailboxes/{HELPSCOUT_MAILBOX_ID}/folders.json', {
cache: 'no-cache',
@mathetos
mathetos / cf-entries.php
Last active Oct 8, 2017
Caldera Forms Entries Shortcode
View cf-entries.php
<?php
add_shortcode('cf_entries', 'mc_cfes_output');
function mc_cfes_output($atts) {
$atts = shortcode_atts( array(
'id' => '',
'number' => '999'
), $atts, 'cf_entries' );
@mathetos
mathetos / functions.php
Last active Mar 15, 2017
Count open child bbPress forums
View functions.php
<?php
$i = 0;
$children = bbp_forum_get_subforums( array( 'post_parent' => $forum_id ) );
foreach ($children as $child) :
if ( bbp_is_forum_open( $forum_id = $child->ID ) ) {
$i++;
$status = bbp_get_forum_status( $forum_id = $child->ID );
@mathetos
mathetos / give5stars.php
Last active Aug 30, 2018
Shortcode to display number of 5-star ratings of a plugin on the WordPress.org Plugin Directory (aka Plugin Repo)
View give5stars.php
<?php
add_shortcode( 'give5stars', 'get_give_five_stars' );
function get_give_five_stars() {
$plugin_slug = 'give';
// Get any existing copy of our transient data
if ( false === ( $cachedresults = get_transient( 'wp-plugin-repo-data-' . $plugin_slug ) ) ) {
// It wasn't there, so regenerate the data and save the transient
@mathetos
mathetos / shortcode.php
Last active Nov 14, 2016
Maps Builder Mashup Location Shortcode
View shortcode.php
<?php
/**
* Displays the map
*
* @access private
* @since 1.0
* @return void
*/
function gmbsimple_map_shortcode( $atts ) {
You can’t perform that action at this time.