Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Gadon rgadon107

View GitHub Profile
@rgadon107
rgadon107 / setup-phpunit.sh
Created Mar 30, 2020 — forked from keesiemeijer/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
View setup-phpunit.sh
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@rgadon107
rgadon107 / single-event.php
Created Aug 19, 2018
Render an event venue when calling 'single-event.php'.
View single-event.php
add_action( 'genesis_entry_header', __NAMESPACE__ . '\add_content_wrap_markup_open', 3 );
/*
* Add content wrap around Event entry_header & render post thumbnail on single.
*
* @since 1.0.0
*
* return void
*/
function add_content_wrap_markup_open() {
$event_id = (int) get_the_ID();
View pum-click-open-jquery-3.html
// You asked for an anonymous jQuery function to use the PUM.open() method.
// Does that function get passed into the HTML link attribute?
<a href="jQuery('#some-element').on('click', function () {
PUM.open(123);
});
">Sign Up For Our Newsletter!</a>
View pum-click-open-jquery-2.html
// Does this link use the PUM jQuery method correctly?
<a href="#" onclick="PUM.open(123)">Sign Up For Our Newsletter!</a>
View pum-click-open-jquery-1.html
// Is this the correct way to express the link?
<a href="javascript:PUM.open(123)">Sign Up For Our Newsletter!</a>
// OR, should it be written like this?
<a href="PUM.open(123)">Sign Up For Our Newsletter!</a>
@rgadon107
rgadon107 / Triggers.php
Last active Feb 8, 2018
Change contextual description for Click Open trigger Extra CSS Selectors custom field
View Triggers.php
<?php
// In '/Popup-Maker-release-1.7/classes/Triggers.php’, targeting lines 132 - 148.
// Target the following array element for change:
// $triggers[‘click_open’][‘fields’][‘general’][‘extra_selectors’][‘desc’];
// see lines 19 & 20 below.
/**
* Registers all known triggers when called.
*/
public function register_triggers() {
$triggers = apply_filters( 'pum_registered_triggers', array(
@rgadon107
rgadon107 / Popups.php
Last active Feb 7, 2018
Reorder Option Tabs in Popup Settings Box of Popup Editor
View Popups.php
<?php
// Target file: '/Popup-Maker-release-1.7/classes/Admin/Popups.php
// Target code between lines 260 - 672
// Reorder 'tabs' and 'sections' in Popup Settings box to improve plugin user experience setting up plugin.
// Modify select section labels to improve the intent described for that section.
/**
* List of tabs & labels for the settings panel.
*
* @return array
@rgadon107
rgadon107 / Popups.php
Last active Feb 6, 2018
Add a contextual message beneath the 'popup_title' custom field in the Popup Editor
View Popups.php
<?php
/* Add a contextual message beneath the 'popup_title' custom field in
* '/popup-maker-release-1.7/classes/Admin/Popups.php',
*
* On line 86, add the following:
*/
?>
<label><span class="pum-desc desc">
<?php sprintf( _e( '(Optional) Display a title inside the popup container. May be left empty.', 'popup-maker') ); ?>
</span></label>
@rgadon107
rgadon107 / gist:d7e749a4b42dc0e0e913a4680e2b3056
Created Feb 6, 2018
Add a contextual description beneath the popup 'post_title' custom field
View gist:d7e749a4b42dc0e0e913a4680e2b3056
<?php
add_action( 'edit_form_before_permalink', 'popup_post_title_contextual_message' );
/**
* Add a contextual description beneath the popup 'post_title' custom field.
*
* @since 1.7
*
* @param WP_Post $post Post object.
*
* @return string
@rgadon107
rgadon107 / api.php
Last active Jan 5, 2018
reusable-metabox-plugin
View api.php
<?php
/**
* Public API to interact with the ConfigStore.
*
* @package spiralWebDB\ConfigStore;
*
* @since 1.0.0
*
* @author Robert A. Gadon
*
You can’t perform that action at this time.