register_nav_menus( array(
'top' => esc_html__( 'Top Menu', 'theme-slug' ),
'social' => esc_html__( 'Social Menu', 'theme-slug' ),
) );
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
# Originally -- Dave Deriso -- [email protected] | |
# Contributor -- G. Richard Bellamy -- [email protected] | |
# If you contribute, put your name here! | |
# To get your team ID: | |
# 1. Go to your GitHub profile, select 'Personal Access Tokens', and create an Access token | |
# 2. curl -H "Authorization: token <very-long-access-token>" https://api.github.com/orgs/<org-name>/teams | |
# 3. Find the team name, and grabulate the Team ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter Gravity Forms select field display to wrap optgroups where defined | |
* USE: | |
* set the value of the select option to `optgroup` within the form editor. The | |
* filter will then automagically wrap the options following until the start of | |
* the next option group | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Send a Message to a Slack Channel. | |
* | |
* In order to get the API Token visit: | |
* | |
* 1.) Create an APP -> https://api.slack.com/apps/ | |
* 2.) See menu entry "Install App" | |
* 3.) Use the "Bot User OAuth Token" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the excerpt of a paragraph or string of long text. | |
* | |
* Get the shortened version of text for the wyisiwig. Use with custom wysiwyg (e.g. Advanced Custom Fields). This will print the paragraph and breaks tag but will strip all other tags | |
* | |
* @since 2014-11-06 | |
* @version 2016-03-09 | |
* @author De'Yonte W.<[email protected]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#place above all other rewrite rules if using a cms or program that redirects all request to index.php file (e.g. WordPress, Drupal, Laravel, etc...) | |
#if a file or directory does not exist on the local host, 302 redirect the request to the production host so the browser doesn't cache the file in case you replace the file locally | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
#Redirect WordPress uploads | |
#Prevent infinite redirect. Only apply this if not on any subdomains of the live domain. Comment out line if not needed | |
RewriteCond %{HTTP_HOST} !^(.*)example\.com | |
#Prevent infinite redirect. Only apply this if not on the root domain of the live domain. Uncomment line if needed | |
#RewriteCond %{HTTP_HOST} !^example\.com [NC] | |
#Prevent infinite redirect. Only apply this if not on the www version of the exact domain of the live domain. Uncomment line if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SVG Fixer | |
* | |
* Fixes references to inline SVG elements when the <base> tag is in use. | |
* Firefox won't display SVG icons referenced with | |
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page. | |
* | |
* More info: | |
* - http://stackoverflow.com/a/18265336/796152 | |
* - http://www.w3.org/TR/SVG/linking.html |