Skip to content

Instantly share code, notes, and snippets.

View CookiesForDevo's full-sized avatar

Devon Crosby CookiesForDevo

View GitHub Profile
@normanlolx
normanlolx / iterm2-oh-my-fish.md
Last active May 5, 2024 13:53
iTerm2 Solarized Dark theme + Fish shell + oh-my-fish /// macOS High Sierra
@RadGH
RadGH / rs_upload_from_path.php
Last active November 2, 2023 17:52
Upload a local file as a WordPress attachment, placing it in the Media library. Supports images, PDFs, and other file types.
<?php
/**
* This function uploads from a local file path.
* To upload from a URL instead
* @see: https://gist.github.com/RadGH/966f8c756c5e142a5f489e86e751eacb
*
* Example usage: Upload photo from file, display the attachment as as html <img>
* $attachment_id = rs_upload_from_path( "/images/photo.png" );
* echo wp_get_attachment_image( $attachment_id, 'large' );