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
/** | |
* I was a tad agitated when I realized Twitter had auto-added | |
* 500+ interests to some weird list in my profile. Manually | |
* unchecking all of the boxes would've taken forever. | |
* | |
* https://twitter.com/settings/your_twitter_data/twitter_interests | |
* | |
* I wrote this script to help me auto-uncheck the | |
* boxes cause ain't nobody got time for that. | |
* |
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 | |
function article_get_header_regex( $level ) { | |
$level = (int) $level; | |
return '/^\<h' . $level . '[^\>]*\>(.*)\<\/?h' . $level . '\>/i'; | |
} | |
function article_get_end_of_url( $url ) { | |
// Remove trailing "/". | |
$last_chr = substr( $url, -1 ); |
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
<div class="si-toggle-container si-pos-side si-pos-east"> | |
<div class="si-drag-container si-pos-side si-pos-east"> | |
<div class="si-drag-box si-pos-side si-pos-east"> | |
<div class="si-drag-dots si-pos-side si-pos-east"></div> | |
</div> | |
</div> | |
<div class="si-boxes-container si-pos-side si-pos-east"> |
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
//Rock the Slackbot Customizations | |
add_filter( 'rock_the_slackbot_notification', 'edd_sales_slack_notification', 10, 3 ); | |
function edd_sales_slack_notification( $notification, $notification_event, $event_args ) { | |
echo "<pre>"; | |
print_r( $notification ); | |
echo "</pre>"; | |
exit; | |
// Change the pieces |
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 allowed query vars for the REST API. | |
* | |
* This filter allows you to add or remove query vars from the final allowed | |
* list for all requests, including unauthenticated ones. To alter the | |
* vars for editors only, {@see rest_private_query_vars}. | |
* | |
* @param array { |
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 | |
/* | |
* Dependent Plugin Activation/Deactivation | |
* | |
* Sources: | |
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/ | |
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/ | |
* | |
*/ | |
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
// We have to remove the default shortcode filter | |
remove_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop() | |
// Strips extra space around and within shortcodes | |
add_filter( 'the_content', 'shortcode_cleanup', 11 ); | |
function shortcode_cleanup( $content ) { | |
// Clean it | |
$content = strtr( $content, array( "\n[" => '[', "]\n" => ']', '<p>[' => '[', ']</p>' => ']', ']<br>' => ']', ']<br />' => ']' ) ); |
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 | |
HAS BEEN MOVED TO https://github.com/bamadesigner/pocket-to-wordpress. | |
/** | |
* This adventure into the Pocket API was inspired | |
* because I wanted to get all of my Pocket items | |
* that were tagged "reading" and display them as | |
* a reading list on my website. | |
* |
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
/** | |
* This function allows you to retrieve the wp_get_attachment_image_src() | |
* data for any post's featured image on your network. If you are running | |
* a multisite network, you can supply another blog's ID to retrieve a post's | |
* featured image data from another site on your WordPress multisite network. | |
* | |
* Does not take care of icon business (at this time). | |
* | |
* If successful, this function returns an array of the following: | |
* [0] => url |