Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖

Ryan Niswonger rniswonger

🖖
View GitHub Profile
@rniswonger
rniswonger / functions.php
Last active Mar 27, 2021
Gravity Forms: Replace the submit <input> with a <button>
View functions.php
/**
* Gravity Forms: Filters the submit button.
* Replaces the <input> button with a <button> while maintaining attributes from original <input>.
*
* @param string $button Contains the <input> tag to be filtered.
* @param object $form Contains all the properties of the current form.
*
* @return string The filtered button.
*
* GF provides sample code for doing this under Examples at the following link but this dodn't work in my environment.
@rniswonger
rniswonger / custom.css
Created Oct 28, 2020
Avada Theme: Equal height Content Boxes
View custom.css
/*
Add this code to the Avada Custom CSS.
Add the class "equal-height" to your Content Boxes Options container, not a single Content Box.
The editor preview will not show the change but reload the live page to see the results.
*/
.fusion-content-boxes.equal-height {
display: flex;
align-items: stretch;
flex-wrap: wrap;
@rniswonger
rniswonger / copy-me-into-the-css-editor.css
Last active May 28, 2020
boardgameareana.com - Dark theme (WIP)
View copy-me-into-the-css-editor.css
/*
# To do:
* Chat windows
* Settings page
* ... probably a lot more
# Note:
After saving the custom CSS in BGA, the format of this code will be altered
and these comments will be removed. This is expected.
Also, some games define their own colors which will cause some contrast issues.
*/
@rniswonger
rniswonger / 7zip-all-subfolders.bat
Created Nov 9, 2019
Use 7zip to archive all subfolders in their own zip file
View 7zip-all-subfolders.bat
for /d %%X in (*) do "c:\Program Files\7-Zip\7z.exe" a "%%X.zip" "%%X\"
@rniswonger
rniswonger / adobe-hd-fix.reg
Created Oct 9, 2019
Fix Adobe CS5 Photoshop and Illustrator scaling issues in Windows 10
View adobe-hd-fix.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
"PreferExternalManifest"=dword:00000001
@rniswonger
rniswonger / functions.php
Last active Jul 27, 2019
WordPress: Add admin columns for a custom post type
View functions.php
<?php
/**
* CPT: Custom columns for post_slug
* replace all occurances of "post_slug" with your post type's slug and "theme_domain" with your theme's domain
*/
function set_custom_edit_post_slug_columns( $columns ) {
// unset( $columns['date'] ); // disable existing column
$columns['image'] = __( 'Image', 'theme_domain' );
$columns['date'] = __( 'Custom Date', 'theme_domain' );
@rniswonger
rniswonger / functions.php
Created Jul 27, 2019
WordPress: Export into theme all "Custom Post Type UI" post types and taxonomies
View functions.php
/**
* Saves post type and taxonomy data to JSON files in the theme directory.
* @param array $data Array of post type data that was just saved.
* Code originally provided by the author of the plugin
*/
function cptui_local_json( $data = array() ) {
$theme_dir = get_stylesheet_directory();
// Create our directory if it doesn't exist
if ( ! is_dir( $theme_dir .= '/cptui-json' ) ) {
mkdir( $theme_dir );
@rniswonger
rniswonger / functions.php
Last active Aug 8, 2019
WordPress: Disable/activate plugins in development environment
View functions.php
<?php
/**
* Setup development environment by manipulating plugin activation
* Replace the dev URLs and plugin paths accordingly
*/
function mysite_development_environment_setup() {
// define the development sites
$dev_envs = array(
'http://localhost:8888',