Skip to content

Instantly share code, notes, and snippets.

View anderly's full-sized avatar

Adam Anderly anderly

View GitHub Profile
@anderly
anderly / showdown.md
Last active September 17, 2016 19:10
Ideas for making ShowDown extensible

Ideas for making ShowDown extensible:

I recently had to customize your plugin a bit for a client but wanted to suggest a few hooks and filters that could be added to the plugin to create some extensibility points for your customers.

Here are the hooks I added which would be great if you could add them into the main plugin so I could still get updates without having to do diffs when the plugin gets updated.

1st set of changes: Adding hooks to Anti-Cheat settings

File: wpshowdown.php
@anderly
anderly / FrmProEntriesController.php
Created April 9, 2012 21:53
Changed set_cookie() function to use new cookie_expiration option.
/* AJAX */
function set_cookie($entry_id, $form_id){
global $frm_form;
$form = $frm_form->getOne($form_id);
$form->options = stripslashes_deep(maybe_unserialize($form->options));
$expires = time() + 30000000;
if ( $form->options['cookie_expiration'] == 'midnight' ) {
$expires = mktime( 23, 59, 59, date( 'm' ), date( 'd' ), date( 'y' ) );
} elseif ( $form->options['cookie_expiration'] == 'one-day-from-now' ) {
$expires = time() + 60 * 60 * 24 * 1;