Skip to content

Instantly share code, notes, and snippets.

View christopherarter's full-sized avatar
❤️
You are not an imposter. You belong, and we're lucky to have you.

Chris Arter christopherarter

❤️
You are not an imposter. You belong, and we're lucky to have you.
View GitHub Profile
add_action( 'gform_after_submission_1', 'after_submission', 10, 2 );
function after_submission() {
// TEARDOWN POST TYPE STARTS HERE
$td_post_args = array(
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_author' => $user_ID,
'post_title' => $entry[1],
'post_status' => 'draft',
'post_type' => 'teardown',
<?php
add_action( 'engineCronHook', 'engineDaysToGoCountdown' );
if( !wp_next_scheduled( 'engineCronHook' ) ) {
wp_schedule_event( time(), 'daily', 'engineCronHook' );
}
// Countdown function
register_activation_hook(__FILE__, 'tdengine_my_activation');
add_action('tdengine_my_daily_event', 'tdengine_do_this_daily');
function tdengine_my_activation() {
wp_schedule_event(time(), 'daily', 'tdengine_my_daily_event');
}
function tdengine_do_this_daily() {
$engineArgs = array(
/*
* Dropit v1.1.0
* http://dev7studios.com/dropit
*
* Copyright 2012, Dev7studios
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
;(function($) {
@christopherarter
christopherarter / gist:4bec4b550bf90fcfde07
Last active October 1, 2015 13:10
Trying to add comment
<form action="" id="new_comment" name="new_comment" method="POST">
<textarea rows="3" cols="50" id="commentContent" name="commentContent" placeholder="Type notes about this APU" name="commentContent"></textarea>
<button type="submit" style="float:right; margin:10px;"><i class="fa fa-comments fa-lg" style="margin-right:10px;"></i> Add Note</button>
</form>';
// END FORM HTML
@christopherarter
christopherarter / example.php
Last active October 6, 2015 17:37
Set wp-login.php as index page in Wordpress
<?php
/*
This is a solution to a site I was buildling that required the entire site to available to only logged in users. I wanted to re-direct all users to the login page if they weren't logged in. This code solved a redirect loop problem by changing the hook from 'init' to 'wp'. This is tested and working. Change the desired url to anything you like.
*/
add_action('wp','restrictEnterSite');
<?php
/**
* Include any file and pass values to it.
*/
class TemplateEngine {
@christopherarter
christopherarter / vd_var_dump_helper.php
Created November 2, 2017 13:33
PHP Var_dump wrapper helper
/**
* A <pre> formatted return wrapper for var_dump()
* @param Input $input Input to be var_dumped
* @return Formatted Input Formatted Input
*/
function vd($input){
echo "<pre>";
var_dump($input);
echo "</pre>";
@christopherarter
christopherarter / TemplateEngine.php
Last active May 30, 2019 19:07
TemplateEngine for Wordpress
<?php
/**
* Include any file and pass values to it.
*
* Written by Chris Arter
*/
class TemplateEngine {
/**
<?php
/**
*
*
* IceScheme - A full-flavored dynamic schema generator for WordPress
*
* carter@launchthat.com
*
*
* */