Skip to content

Instantly share code, notes, and snippets.

Jamie O Idealien

Block or report user

Report or block Idealien

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
@Idealien
Idealien / functions.php
Created Oct 5, 2019
Gravity Flow - Assignee Field based access control via summary shortcode
View functions.php
<?php
add_filter( 'gravityflow_search_criteria_status', 'jo_status_scenario_search_criteria', 10, 1 );
function jo_status_scenario_search_criteria( $search_criteria ) {
if ( ! isset( $_SERVER['REQUEST_URI'] ) && strpos( strtolower( $_SERVER['REQUEST_URI'] ), '/status-check-64/' ) !== false ) {
return $search_criteria;
}
$current_user = wp_get_current_user();
@Idealien
Idealien / functions.php
Created Sep 26, 2018
Example of post-workflow step calculations
View functions.php
<?php
add_action( 'gravityflow_post_webhook', 'sh_action_gravityflow_post_webhook', 10, 4 );
function sh_action_gravityflow_post_webhook( $response, $args, $entry, $current_step ) {
//Replace step ID and fields for calculation to match your use case.
if ( $current_step->get_id() == 77 && is_numeric( $entry['3'] ) && is_numeric( $entry['16'] ) ) {
$entry['14'] = round( $entry['3'] * $entry['16'], 2);
$result = GFAPI::update_entry( $entry );
}
}
View majorupdates.drama
• Changing running websites without the consent of their owners is just like putting your hand on the oven.
• Are you suggesting forced auto-updates to newer major versions? If so, then I think you’re setting yourself up for disaster.
• What happens if the outage causes financial issues to the owner?
• I would propose to drop this idea completely, for lack of realism.
• In the area of small businesses losing contact to the admin happens regularly, either because of distrust or because of the admin changing his professional focus or lack of money. This plan will put all of those site owners at risk, and more of them with every step up the update ladder.
• Put an alarm system into the next minor.
• Absence of an answer does not indicate consent.
• In reality, choices are never between a purely good thing and a purely bad thing; they’re always between competing tradeoffs.
• If you think that I’m going to miss even one opportunity to pick up half-a-knot boat speed, you’re absolutely out of your mind. When it cost
@Idealien
Idealien / style.css
Created Apr 12, 2019
GravityFlow - CSS to turn table view into multi-column (approval and step complete)
View style.css
/*Modify the gform_20 to match to your form ID (or remove to have it apply to all)
#gform_20 table.gravityflow-step-approval tbody tr,
#gform_20 table.gravityflow-workflow-complete tbody tr {
width: 25%;
display: inline-block;
}
#gform_20 table.gravityflow-step-approval tbody tr td.entry-view-field-name,
#gform_20 table.gravityflow-workflow-complete tbody tr td.entry-view-field-name {
@Idealien
Idealien / functions.php
Created Mar 17, 2018
Gravity Flow - Custom Column for status table based on creator, assignee, etc
View functions.php
<?php
add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 );
function custom_column_titles( $columns, $args, $table ) {
$new_column = array(
'user_action' => 'User Action',
);
$pre_columns = array_slice( $columns, 0, 2 );
$post_columns = array_slice( $columns, 2 );
$columns = array_merge( $pre_columns, $new_column, $post_columns );
return $columns;
@Idealien
Idealien / .lando.yml
Last active Mar 13, 2019
Lando .yml with separate DB for phpunit testing
View .lando.yml
name: local
recipe: wordpress
config:
webroot: .
xdebug: true
services:
appserver:
type: php
@Idealien
Idealien / install.sh
Created Dec 6, 2018 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
View install.sh
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@Idealien
Idealien / functions.php
Created Sep 27, 2018
Remove a Gravity Form entry immediately after submission
View functions.php
<?php
add_action( 'gform_after_submission_3', 'remove_entry_magic', 10, 2);
function remove_entry_magic( $entry ) {
GFAPI::delete_entry( $entry['id'] );
}
View ACF-conditional-display-for-non-select-fields.js
(function($) {
acf.add_action('ready', function( $el ){
//Identify the field you want to check against.
//Use a class to handle scenarios involving repeater / flexible content where multiple instances exist
var $field = $('.example input');
$field.on('change', function (evt) {
@Idealien
Idealien / functions.php
Created Sep 11, 2018
Core pieces to get assignee info into Gravity Flow status
View functions.php
<?php
add_filter( 'gravityflow_columns_status_table', 'custom_column_titles', 10, 3 );
function custom_column_titles( $columns, $args, $table ) {
$new_column = array(
'assignees' => 'Assignee(s)',
);
$pre_columns = array_slice( $columns, 0, 2 );
$post_columns = array_slice( $columns, 2 );
$columns = array_merge( $pre_columns, $new_column, $post_columns );
You can’t perform that action at this time.