This file contains 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
/* | |
* Give-ify your Github | |
* Preview: https://cloudup.com/cGiBiRpMd3B | |
* | |
* Step 1: Install the "Refined Github" browser extension: https://github.com/sindresorhus/refined-github | |
* Step 2: Use it's Custom CSS field to paste the following. | |
*/ | |
@font-face { | |
font-family: give-icomoon; |
This file contains 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
/* | |
* HelpScout Zap: Get Number of Unassigned in a Specific Mailbox | |
* Use Zapier's "Code" Action to trigger this | |
* This only works with Zapier, it depends on the "callback" functions | |
*/ | |
var btoa = function (str) {return new Buffer(str).toString('base64');}; | |
fetch('https://api.helpscout.net/v1/mailboxes/{HELPSCOUT_MAILBOX_ID}/folders.json', { | |
cache: 'no-cache', |
This file contains 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 | |
add_shortcode('cf_entries', 'mc_cfes_output'); | |
function mc_cfes_output($atts) { | |
$atts = shortcode_atts( array( | |
'id' => '', | |
'number' => '999' | |
), $atts, 'cf_entries' ); |
This file contains 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 | |
$i = 0; | |
$children = bbp_forum_get_subforums( array( 'post_parent' => $forum_id ) ); | |
foreach ($children as $child) : | |
if ( bbp_is_forum_open( $forum_id = $child->ID ) ) { | |
$i++; | |
$status = bbp_get_forum_status( $forum_id = $child->ID ); |
This file contains 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 | |
add_shortcode( 'give5stars', 'get_give_five_stars' ); | |
function get_give_five_stars() { | |
$plugin_slug = 'give'; | |
// Get any existing copy of our transient data | |
if ( false === ( $cachedresults = get_transient( 'wp-plugin-repo-data-' . $plugin_slug ) ) ) { | |
// It wasn't there, so regenerate the data and save the transient |
This file contains 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 | |
/** | |
* Displays the map | |
* | |
* @access private | |
* @since 1.0 | |
* @return void | |
*/ | |
function gmbsimple_map_shortcode( $atts ) { |
This file contains 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 | |
/** | |
* Dequeue GMB script for certain pages | |
* | |
* Hooked to the wp_print_scripts action, with a late priority (100), | |
* so that it is after the script was enqueued. | |
*/ | |
function gmb_dequeue_script() { | |
global $post; |
This file contains 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 | |
/* | |
* Example Shortcode and Globally Enqueued Stylesheet | |
* | |
*/ | |
// Our Shortcode function | |
function hiroy_shortcode( $content = null ) { | |
// Enqueue the stylesheet now | |
wp_enqueue_style( 'hiroy-css' ); |
This file contains 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 | |
/* | |
* Example Shortcode and Globally Enqueued Stylesheet | |
* | |
*/ | |
// Our Shortcode function | |
function hiroy_shortcode( $content = null ) { | |
// do something to $content | |
$content = '<h2>Hi Roy!</h2>'; |
This file contains 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 | |
// Enqueue this stylesheet globally for the front-end | |
add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_style' ); | |
function themeslug_enqueue_style() { | |
wp_enqueue_style( 'my-theme-css', 'style.css', 'parent-stylesheet', '1.0', all ); | |
} |