Skip to content

Instantly share code, notes, and snippets.

Miguel Estrada mae829

Block or report user

Report or block mae829

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mae829 / gulp.config.js
Last active Mar 17, 2020
Gulp project setup
View gulp.config.js
* WPGulp Configuration File
* 1. Edit the variables as per project requirements.
* 2. Everything else is in the gulpfile to keep it consistent across our projects.
// Define the default project configuration.
let projectConfig = {
// Local project URL of your already running WordPress site. Could be something like wpgulp.local or localhost:3000 depending upon your local WordPress setup.
mae829 / upload-resources-message-filter.php
Last active Aug 15, 2017
WordPress - Filters to let your user know about image/PDF compression resources at the upload screens
View upload-resources-message-filter.php
* Image and PDF compression resources message at upload screens.
function upload_suggestions_message() { ?>
<h3>Uploading Files Guide</h3>
<p class="upload-html-bypass hide-if-no-js">Here are a few options to reduce the size of images/files before uploading them (please always do this to help load the site faster for visitors!!).</p>
<li><a href="" target="_blank"> - Compress all your images with this site.</a></li>
<li><a href="" target="_blank"> - Compress those PDFs as well for clients or on page display.</a></li>
mae829 / get-primary-category.php
Created Aug 15, 2017
WordPress helper function to retrieve an attribute (or the whole category object) of the primary category. Should be used inside the lop.
View get-primary-category.php
* Get Primary Category
* Get the primary category of the post.
* Should be used inside the loop.
* @param string $att Attribute of the category that is desired (if 'all' is passed, will return whole object)
* @param boolean $wpseo Whether or not to use WPSEO (if it's on/installed)
mae829 / has-gallery.php
Created Aug 15, 2017
WordPress - function to detect if a page/post has a gallery
View has-gallery.php
mae829 / wp-remove-featured-image.php
Last active Aug 15, 2017
WordPress - Remove the featured image from the content in feeds
View wp-remove-featured-image.php
mae829 / array-deep-key-search.php
Last active Nov 24, 2019
Code to check for a key inside a deep array
View array-deep-key-search.php
//deep search array for key
function multi_key_exists( array $arr, $key ){
// is in base array?
if ( array_key_exists($key, $arr) ) return true;
// check arrays contained in this array
foreach( $arr as $element ){
if( is_array($element) && multi_key_exists($element, $key) ){
You can’t perform that action at this time.