Skip to content

Instantly share code, notes, and snippets.

@psflannery
psflannery / jetpack_manually_select_publicize.php
Created October 16, 2013 09:17
http://jetpack.me/2013/10/15/ever-accidentally-publicize-a-post-that-you-didnt/ Ever accidentally publicize a post that you didn’t mean to? This snippet will prevent the connections from being auto-selected, so you need to manually select them if you’d like to publicize something.
add_filter( 'publicize_checkbox_default', '__return_false' );
@psflannery
psflannery / jetpack_module_manual_activation.php
Created October 16, 2013 09:21
http://jetpack.me/2013/10/07/do-not-automatically-activate-the-widget-visibility-module/ This code can apply to any other module, and can be used as a replacement of the Manual Control plugin for example.
// To disable the auto-activation of Jetpack's Widget Visibility module:
add_filter( 'jetpack_get_default_modules', 'disable_jetpack_widget_visibility_autoactivate' );
function disable_jetpack_widget_visibility_autoactivate( $modules ) {
return array_diff( $modules, array( 'widget-visibility' ) );
}
// Or, to disable the functionality in your own plugin if the user activates it in Jetpack:
if ( ! class_exists( 'Jetpack' ) || ! Jetpack::is_module_active( 'widget-visibility' ) ) {
// It's not there, do as you like!
}
$(document).ready(function () {
WebFontConfig = {
google: {
families: ['Chivo']
},
active: function() {
$('#archive').imagesLoaded(function(){
$('#archive').masonry({
itemSelector : '.item',
<?phpfunction override_video_dimensions( $out, $pairs, $atts ) {
$out['width'] = '768'; $out['height'] = '583';
return $out;
}
add_filter( 'shortcode_atts_video', 'override_video_dimensions', 10, 3 );?>
require 'rubygems'
require 'mechanize'
agent = Mechanize.new
agent.set_proxy '78.186.178.153', 8080
page = agent.get('http://www.google.com/')
google_form = page.form('f')
google_form.q = 'new york city council'
<?php
$rss = new DOMDocument();
$rss->load('http://wordpress.org/news/feed/');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
@psflannery
psflannery / remove_jetpack_styles.php
Created December 4, 2013 11:02
Remove Jetpack styles - list of enqueued jetpack stylesheets to remove if necessary. via - http://www.tjkelly.com/blog/remove-wordpress-jetpack-css/
function remove_jetpack_styles(){
wp_deregister_style('AtD_style'); // After the Deadline
wp_deregister_style('jetpack-carousel'); // Carousel
wp_deregister_style('jetpack-slideshow'); // Jetpack Slideshow
wp_deregister_style('grunion.css'); // Grunion contact form
wp_deregister_style('the-neverending-homepage'); // Infinite Scroll
wp_deregister_style('infinity-twentyten'); // Infinite Scroll - Twentyten Theme
wp_deregister_style('infinity-twentyeleven'); // Infinite Scroll - Twentyeleven Theme
wp_deregister_style('infinity-twentytwelve'); // Infinite Scroll - Twentytwelve Theme
wp_deregister_style('noticons'); // Notes