<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[32589] trunk/src/wp-includes: Add missing doc blocks to `default-widgets.php`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32589">32589</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32589","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-24 21:27:12 +0000 (Sun, 24 May 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Add missing doc blocks to `default-widgets.php`.
Move `add_action()` for widgets to `default-filters.php` with its brethren.
See <a href="https://core.trac.wordpress.org/ticket/32444">#32444</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesdefaultfiltersphp">trunk/src/wp-includes/default-filters.php</a></li>
<li><a href="#trunksrcwpincludesdefaultwidgetsphp">trunk/src/wp-includes/default-widgets.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesdefaultfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/default-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/default-filters.php 2015-05-24 21:10:00 UTC (rev 32588)
+++ trunk/src/wp-includes/default-filters.php 2015-05-24 21:27:12 UTC (rev 32589)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,6 +382,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Nav menu
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Widgets
+add_action( 'init', 'wp_widgets_init', 1 );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Admin Bar
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't remove. Wrong way to disable.
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'template_redirect', '_wp_admin_bar_init', 0 );
</span></span></pre></div>
<a id="trunksrcwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/default-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/default-widgets.php 2015-05-24 21:10:00 UTC (rev 32588)
+++ trunk/src/wp-includes/default-widgets.php 2015-05-24 21:27:12 UTC (rev 32589)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,6 +18,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('pages', __('Pages'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,6 +71,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,6 +90,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> //Defaults
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'sortby' => 'post_title', 'title' => '', 'exclude' => '') );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,8 +130,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('links', __('Links'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> $show_description = isset($instance['description']) ? $instance['description'] : false;
</span><span class="cx" style="display: block; padding: 0 10px"> $show_name = isset($instance['name']) ? $instance['name'] : false;
</span><span class="cx" style="display: block; padding: 0 10px"> $show_rating = isset($instance['rating']) ? $instance['rating'] : false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -151,6 +166,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $new_instance = (array) $new_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,6 +189,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> //Defaults
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -227,8 +250,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/default-widgets.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,6 +269,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'title' => '') );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = $instance['title'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,6 +280,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $new_instance = wp_parse_args((array) $new_instance, array( 'title' => ''));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,6 +306,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('archives', __('Archives'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $c = ! empty( $instance['count'] ) ? '1' : '0';
</span><span class="cx" style="display: block; padding: 0 10px"> $d = ! empty( $instance['dropdown'] ) ? '1' : '0';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,6 +392,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -364,6 +407,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = strip_tags($instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -394,8 +440,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('meta', __('Meta'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/default-widgets.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', empty($instance['title']) ? __( 'Meta' ) : $instance['title'], $instance, $this->id_base );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -430,6 +479,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -437,6 +491,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = strip_tags($instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -458,8 +515,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('calendar', __('Calendar'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/default-widgets.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -473,6 +533,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,6 +545,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = strip_tags($instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -503,8 +571,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('text', __('Text'), $widget_ops, $control_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/default-widgets.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -526,6 +597,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -537,6 +613,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = strip_tags($instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -564,8 +643,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('categories', __('Categories'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/default-widgets.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title'], $instance, $this->id_base );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -644,6 +726,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -654,6 +741,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> //Defaults
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = wp_parse_args( (array) $instance, array( 'title' => '') );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -695,7 +785,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'switch_theme', array($this, 'flush_widget_cache') );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function widget($args, $instance) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
+ public function widget( $args, $instance ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $cache = array();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_preview() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache = wp_cache_get( 'widget_recent_posts', 'widget' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,6 +867,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -791,6 +890,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete('widget_recent_posts', 'widget');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -829,7 +931,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function recent_comments_style() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filter the Recent Comments default widget styles.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -850,6 +951,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_delete('widget_recent_comments', 'widget');
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @global array $comments
+ * @global object $comment
+ *
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $comments, $comment;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -927,6 +1035,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = $old_instance;
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags($new_instance['title']);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -940,6 +1053,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -966,8 +1082,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct( 'rss', __('RSS'), $widget_ops, $control_ops );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function widget($args, $instance) {
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
+ public function widget( $args, $instance ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset($instance['error']) && $instance['error'] )
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1019,15 +1138,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset($rss);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function update($new_instance, $old_instance) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
+ public function update( $new_instance, $old_instance ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $testurl = ( isset( $new_instance['url'] ) && ( !isset( $old_instance['url'] ) || ( $new_instance['url'] != $old_instance['url'] ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> return wp_widget_rss_process( $new_instance, $testurl );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function form($instance) {
-
- if ( empty($instance) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
+ public function form( $instance ) {
+ if ( empty( $instance ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $instance = array( 'title' => '', 'url' => '', 'items' => 10, 'error' => false, 'show_summary' => 0, 'show_author' => 0, 'show_date' => 0 );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> $instance['number'] = $this->number;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_widget_rss_form( $instance );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1261,6 +1388,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct('tag_cloud', __('Tag Cloud'), $widget_ops);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function widget( $args, $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $current_taxonomy = $this->_get_current_taxonomy($instance);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !empty($instance['title']) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1301,6 +1432,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $instance['title'] = strip_tags(stripslashes($new_instance['title']));
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1308,6 +1444,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $current_taxonomy = $this->_get_current_taxonomy($instance);
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1345,7 +1484,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function widget($args, $instance) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $args
+ * @param array $instance
+ */
+ public function widget( $args, $instance ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Get menu
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1384,6 +1527,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo $args['after_widget'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $new_instance
+ * @param array $old_instance
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function update( $new_instance, $old_instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $instance = array();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $new_instance['title'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1395,6 +1543,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $instance;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param array $instance
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function form( $instance ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = isset( $instance['title'] ) ? $instance['title'] : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1475,5 +1626,3 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'widgets_init' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-add_action('init', 'wp_widgets_init', 1);
</del></span></pre>
</div>
</div>
</body>
</html>