Skip to content

Instantly share code, notes, and snippets.

View smbrown's full-sized avatar

Sean M. Brown smbrown

View GitHub Profile
@smbrown
smbrown / class-widget.diff
Created July 25, 2015 18:41
yarpp 4.0.6 fix for WP_Widget notice agains WP 4.3b4
--- a/content/plugins/yet-another-related-posts-plugin/class-widget.php
+++ b/content/plugins/yet-another-related-posts-plugin/class-widget.php
@@ -4,7 +4,7 @@
// http://msafi.com/fix-yet-another-related-posts-plugin-yarpp-widget-and-add-it-to-the-sidebar/
class YARPP_Widget extends WP_Widget {
function YARPP_Widget() {
- parent::WP_Widget(false, $name = __('Related Posts (YARPP)','yarpp'));
+ parent::__construct(false, $name = __('Related Posts (YARPP)','yarpp'));
}
@smbrown
smbrown / YARPP_Widget.diff
Created July 25, 2015 18:05
YARPP_Widget [WordPress] Git Info: On branch update-plugins — 441c97ec Version 4.3-beta4-33415
# without this change, [25-Jul-2015 17:54:51 UTC] PHP Notice: The called constructor method for WP_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /Users/smbrown/smr/wp/wp-includes/functions.php on line 3457
index 97cc0d7..88bb09d 100644
--- a/content/plugins/yet-another-related-posts-plugin/classes/YARPP_Widget.php
+++ b/content/plugins/yet-another-related-posts-plugin/classes/YARPP_Widget.php
@@ -6,7 +6,7 @@
class YARPP_Widget extends WP_Widget {
public function __construct() {
- parent::WP_Widget(false, 'Related Posts (YARPP)', array('description' => 'Related Posts and/or Sponsored Content'));
+ WP_Widget::__construct(false, 'Related Posts (YARPP)', array('description' => 'Related Posts and/or Sponsored Content'));
<!-- Begin dataLayer Handler -->
<script type="text/javascript">
function tagLinkEvent(name)
{
dataLayer.push({'event': name});
}
dataLayer = [{
'User Type':'Subscriber',
'Topic':'sustainability/business-the-environment',
'Section':'Magazine/2013-fall',
@smbrown
smbrown / wp comment no html
Created December 30, 2011 00:25
display wp comment form without html notes after text area box
<?php comment_form( array('comment_notes_after' => '') ); ?>
import cloudfiles
conn = cloudfiles.get_connection('johnsmith', '123477777889000')
cont = cloudfiles.connection.Connection.get_container(conn,'.CDN_ACCESS_LOGS')
for obj in cont.get_objects():
obj.save_to_filename(obj.etag + '.gz')
print obj.etag
@smbrown
smbrown / find dot files.sh
Created May 13, 2009 19:50
find dot files
# find all dot files, but omit the pesky OS X .DS_Store files
find . -name ".*" -type f ! -name ".DS_Store"