Skip to content

Instantly share code, notes, and snippets.

View JRyven's full-sized avatar

James Ryven Valeii JRyven

View GitHub Profile
@JRyven
JRyven / sidr_example___functions.php
Last active June 26, 2019 09:26
Sidr Multipanel with Multiclose
// Bring in the resources //
<link rel="stylesheet" href="//cdn.jsdelivr.net/jquery.sidr/2.2.1/stylesheets/jquery.sidr.bare.css">
<script src="//cdn.jsdelivr.net/jquery.sidr/2.2.1/jquery.sidr.min.js"></script>
// Make the '60%' Sidr and style it //
<style>
.hide-on-desktop { display: none; }
.sidr.left { width: 60%; }
.sidr.left { left: -60%; }
.sidr.left { padding: 5%; background: rgba(0, 128, 176, 0.08); border-style: ridge; border-width: 0px 2px 0px 0px; border-color: #127ba3; }
@JRyven
JRyven / date___functions.php
Last active June 26, 2019 09:25
PHP Date Functions and Transformations
<?php
// Get the current date array | $thedate[0] contains the unix timestamp
$thedate = getdate();
// Make a date object using pretty much any human redable date/time
$date_object = strtotime(9-5-1985 1:00 AM);
// Format the date object
$date_formatted = date('Y-m-d', $date_object);
@JRyven
JRyven / gravity_froms__gravity_views__functions.php
Last active June 26, 2019 09:23
GravityViews GravityForms Restore Entry Author from No User "Changed entry creator from ... to No User"
<?php
/****
*
* Restore Gravity Forms Entry Author from "No Author"
*
* GravityViews plugin adds a helpful 'Change Entry Creator' dropdown to the Entry Editor Admin page for Gravity Forms.
* Unfortunately, if there are too many users on the site, the dropdown defaults to " - No User - ", disassociating
* the original entry creator upon Entry Update. When the Entry Creator is changed, a note is stored that states
* "Changed entry creator from [NAME] (ID #[###]) to No User". This function selects notes with such language, isolates