Skip to content

Instantly share code, notes, and snippets.

View shaunandrews's full-sized avatar

Shaun Andrews shaunandrews

View GitHub Profile
.card {
background: rgba( #FFFFFF, 0.9 );
box-shadow: 0 0 0 1px rgba( $medium-gray, 0.3 ), 0 2px 1px 1px rgba( $medium-gray, 0.1 );
margin-bottom: 30px;
transition: all 0.1s ease-in-out;
@include responsive(one-col) {
margin-bottom: 20px;
margin-right: 5px;
margin-left: 5px;
// The Site Switcher
.wpcom-sidebar .wpcom-site-switcher {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 110px;
transition: all 0.15s ease-in-out;
#wpcom.mockup & {
<li class="card wpcom-site-switcher">
<div class="current-selected-site">
<!-- Single Site Selected
<img src="https://2.gravatar.com/avatar/209b35999dde0e838315ac6228060913?s=120" height="50" width="50">
<strong>Glittering Scrivener</strong>
<small><a href="http://glitteringscrivener.wordpress.com/" title="Visit Site">glitteringscrivener.wordpress.com</a></small>
-->
<strong class="all-my-sites">All My Sites</strong>
<small>Manage 3 sites</small>
function dp_comment_post_redirect( $location, $comment ) {
return get_comment_link( $comment, array( 'type' => 'comment' ) );
}
add_filter( 'comment_post_redirect', 'dp_comment_post_redirect', 10, 2 );
@shaunandrews
shaunandrews / better-widgets.diff
Created December 16, 2013 15:43
Making wp_widget_control() pluggable for the Better Widgets 0.2 plugin.
Index: src/wp-admin/includes/widgets.php
===================================================================
--- src/wp-admin/includes/widgets.php (revision 26862)
+++ src/wp-admin/includes/widgets.php (working copy)
@@ -136,6 +136,7 @@
return $number;
}
+if( ! function_exists('wp_widget_control') ) :
/**
@shaunandrews
shaunandrews / gist:6242580
Last active December 21, 2015 03:29
Widgets in 3.8

Widgets, Widgets, Widgets

What problem are you trying to solve?

This group will be focused on improving the process of adding and editing widgets in the WordPress admin. There's a few problems with the way things work now, including:

  • Widgets, sidebars, and their connection to themes is pretty confusing. There's no connection between the sidebar in wp-admin, and the area in your theme.
  • The current focus of the page is on available widgets. Sidebars only take up a small portion of the page.
  • Having more then 2 or 3 sidebars makes it terrible hard to drag-and-drop widgets around the screen.
  • Its not at all obvious how you install a new widget.
  • Its not possible (without code) to display widgets, or groups of widgets, based on certain conditions like, "only show on home" or, "don't show on single".