<!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>[706] sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook: Handbook plugin: misc fixes and tweaks.</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">
<dt>Revision</dt> <dd><a href="http://meta.trac.wordpress.org/changeset/706">706</a></dd>
<dt>Author</dt> <dd>coffee2code</dd>
<dt>Date</dt> <dd>2014-06-17 00:00:42 +0000 (Tue, 17 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Handbook plugin: misc fixes and tweaks. Fixes <a href="http://meta.trac.wordpress.org/ticket/250">#250</a>

* Fix to set object post_type variable when post_type is 'handbook'
* Fix to use get_post_type() instead of referencing no-long-existing object variable
* Don't append suffix for 'page' post_type (for ToC and widgets)
* Honor before_widget and after_widget config for widget
* More succinct and thorough array typecasting
* Internationalize strings
* Minor spacing and code formatting tweaks</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginshandbookhandbookphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginshandbookinctableofcontentsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginshandbookincwidgetsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginshandbookhandbookphp"></a>
<div class="modfile"><h4>Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php (705 => 706)</h4>
<pre class="diff"><span>
<span class="info">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php   2014-06-16 23:56:42 UTC (rev 705)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php      2014-06-17 00:00:42 UTC (rev 706)
</span><span class="lines">@@ -19,22 +19,17 @@
</span><span class="cx"> 
</span><span class="cx">  static function init() {
</span><span class="cx"> 
</span><del>-               $post_types = 'handbook';
</del><ins>+                $post_types = (array) apply_filters( 'handbook_post_types', array( 'handbook' ) );
</ins><span class="cx"> 
</span><del>-               $post_types = apply_filters( 'handbook_post_types', $post_types );
-
-               if ( ! is_array( $post_types ) ) {
-                       $post_types = (array) $post_types;
-               }
-
</del><span class="cx">           new WPorg_Handbook_TOC( $post_types );
</span><span class="cx"> 
</span><span class="cx">          foreach ( $post_types as $type ) {
</span><span class="cx">                  new WPorg_Handbook( $type );
</span><del>-
</del><span class="cx">           }
</span><span class="cx">  }
</span><ins>+
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> add_action( 'after_setup_theme', array( 'WPorg_Handbook_Init', 'init' ) );
</span><span class="cx"> 
</span><span class="cx"> class WPorg_Handbook {
</span><span class="lines">@@ -60,30 +55,38 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function __construct( $type ) {
</span><del>-               if ( 'handbook' != $type )
</del><ins>+                if ( 'handbook' != $type ) {
</ins><span class="cx">                   $this->post_type = $type . '-handbook';
</span><ins>+               } else {
+                       $this->post_type = $type;
+               }
</ins><span class="cx"> 
</span><span class="cx">          $this->label = ucwords( str_replace( array( '-', '_' ), ' ', $this->post_type ) );
</span><del>-               add_filter( 'user_has_cap', array( $this, 'grant_handbook_caps' ) );
-               add_filter( 'init', array( $this, 'register_post_type' ) );
-               add_action( 'admin_page_access_denied', array( $this, 'admin_page_access_denied' ) );
-               add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 2 );
-               add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
-               add_action( 'widgets_init', array( $this, 'handbook_sidebar' ), 11 ); // After P2
</del><ins>+
+               add_filter( 'user_has_cap',                       array( $this, 'grant_handbook_caps' ) );
+               add_filter( 'init',                               array( $this, 'register_post_type' ) );
+               add_action( 'admin_page_access_denied',           array( $this, 'admin_page_access_denied' ) );
+               add_filter( 'post_type_link',                     array( $this, 'post_type_link' ), 10, 2 );
+               add_filter( 'pre_get_posts',                      array( $this, 'pre_get_posts' ) );
+               add_action( 'widgets_init',                       array( $this, 'handbook_sidebar' ), 11 ); // After P2
</ins><span class="cx">           add_action( 'wporg_email_changes_for_post_types', array( $this, 'wporg_email_changes_for_post_types' ) );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function grant_handbook_caps( $caps ) {
</span><del>-               if ( ! is_user_member_of_blog() )
</del><ins>+                if ( ! is_user_member_of_blog() ) {
</ins><span class="cx">                   return $caps;
</span><ins>+               }
+
</ins><span class="cx">           foreach ( self::caps() as $cap ) {
</span><span class="cx">                  $caps[ $cap ] = true;
</span><span class="cx">          }
</span><ins>+
</ins><span class="cx">           if ( ! empty( $caps['edit_pages'] ) ) {
</span><span class="cx">                  foreach ( self::editor_caps() as $cap ) {
</span><span class="cx">                          $caps[ $cap ] = true;
</span><span class="cx">                  }
</span><span class="cx">          }
</span><ins>+
</ins><span class="cx">           return $caps;
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -93,27 +96,28 @@
</span><span class="cx">          } else {
</span><span class="cx">                  $slug = 'handbook';
</span><span class="cx">          }
</span><ins>+
</ins><span class="cx">           register_post_type( $this->post_type, array(
</span><span class="cx">                  'labels' => array(
</span><del>-                               'name' => "{$this->label} Pages",
-                               'singular_name' => "{$this->label} Page",
-                               'menu_name' => "{$this->label}",
-                               'all_items' => "{$this->label} Pages",
</del><ins>+                                'name'          => sprintf( __( '%s Pages', 'wporg' ), $this->label ),
+                               'singular_name' => sprintf( __( '%s Page', 'wporg' ), $this->label ),
+                               'menu_name'     => $this->label,
+                               'all_items'     => sprintf( __( '%s Pages', 'wporg' ), $this->label ),
</ins><span class="cx">                   ),
</span><del>-                       'public' => true,
-                       'show_ui' => true,
-                       'capability_type' => 'handbook_page',
-                       'map_meta_cap' => true,
-                       'has_archive' => true,
-                       'hierarchical' => true,
-                       'menu_position' => 11,
-                       'rewrite'     => array(
-                               'feeds'      => false,
-                               'slug'       => $slug,
-                               'with_front' => false,
</del><ins>+                        'public'            => true,
+                       'show_ui'           => true,
+                       'capability_type'   => 'handbook_page',
+                       'map_meta_cap'      => true,
+                       'has_archive'       => true,
+                       'hierarchical'      => true,
+                       'menu_position'     => 11,
+                       'rewrite' => array(
+                               'feeds'         => false,
+                               'slug'          => $slug,
+                               'with_front'    => false,
</ins><span class="cx">                   ),
</span><del>-                       'delete_with_user' => false,
-                       'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
</del><ins>+                        'delete_with_user'  => false,
+                       'supports'          => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
</ins><span class="cx">           ) );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -125,8 +129,10 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function post_type_link( $link, $post ) {
</span><del>-               if ( $post->post_type === $this->post_type && $post->post_name === $this->post_type )
</del><ins>+                if ( $post->post_type === $this->post_type && $post->post_name === $this->post_type ) {
</ins><span class="cx">                   return get_post_type_archive_link( $this->post_type );
</span><ins>+               }
+
</ins><span class="cx">           return $link;
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -137,14 +143,20 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function handbook_sidebar() {
</span><del>-               register_sidebar( array( 'id' => $this->post_type, 'name' => $this->label, 'description' => "Used on {$this->label} pages" ) );
</del><ins>+                register_sidebar( array(
+                       'id'          => $this->post_type,
+                       'name'        => $this->label,
+                       'description' => sprintf( __( 'Used on %s pages', 'wporg' ), $this->label ),
+               ) );
</ins><span class="cx">           require_once dirname( __FILE__ ) . '/inc/widgets.php';
</span><span class="cx">          register_widget( 'WPorg_Handbook_Pages_Widget' );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function wporg_email_changes_for_post_types( $post_types ) {
</span><del>-               if ( ! in_array( $this->post_type, $post_types ) )
</del><ins>+                if ( ! in_array( $this->post_type, $post_types ) ) {
</ins><span class="cx">                   $post_types[] = $this->post_type;
</span><ins>+               }
+
</ins><span class="cx">           return $post_types;
</span><span class="cx">  }
</span><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginshandbookinctableofcontentsphp"></a>
<div class="modfile"><h4>Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php (705 => 706)</h4>
<pre class="diff"><span>
<span class="info">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php      2014-06-16 23:56:42 UTC (rev 705)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php 2014-06-17 00:00:42 UTC (rev 706)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">  protected $styles = '<style> .toc-jump { text-align: right; font-size: 12px; } .page .toc-heading { margin-top: -50px; padding-top: 50px !important; }</style>';
</span><span class="cx"> 
</span><span class="cx">  function __construct( $post_types ) {
</span><del>-               $this->post_types = $post_types;
</del><ins>+                $this->post_types = (array) $post_types;
</ins><span class="cx">           add_action( 'template_redirect', array( $this, 'load_filters' ) );
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="lines">@@ -22,8 +22,9 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function append_suffix( $t ) {
</span><del>-               if ( 'handbook' == $t )
</del><ins>+                if ( in_array( $t, array( 'handbook', 'page' ) ) ) {
</ins><span class="cx">                   return $t;
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return $t . '-handbook';
</span><span class="cx">  }
</span><span class="lines">@@ -41,13 +42,13 @@
</span><span class="cx">          else
</span><span class="cx">                  $pages_header = 'h3';
</span><span class="cx"> 
</span><del>-               if ( $pages = wp_list_pages( array( 'child_of' => get_the_ID(), 'echo' => false, 'title_li' => false, 'post_type' => $this->post_type ) ) )
</del><ins>+                if ( $pages = wp_list_pages( array( 'child_of' => get_the_ID(), 'echo' => false, 'title_li' => false, 'post_type' => get_post_type() ) ) )
</ins><span class="cx">                   $toc .= "<$pages_header>Pages</$pages_header><ul class=\"items\">$pages</ul>";
</span><span class="cx"> 
</span><span class="cx">          if ( $items ) {
</span><span class="cx">                  $toc .= $this->styles;
</span><span class="cx">                  $toc .= '<div class="table-of-contents">';
</span><del>-                       $toc .= "<$contents_header>Contents</$contents_header><ul class=\"items\">";
</del><ins>+                        $toc .= "<$contents_header>" . __( 'Topics', 'wporg' ) . "</$contents_header><ul class=\"items\">";
</ins><span class="cx">                   $last_item = false;
</span><span class="cx">                  foreach ( $items as $item ) {
</span><span class="cx">                          if ( $last_item ) {
</span><span class="lines">@@ -78,7 +79,7 @@
</span><span class="cx">                  $id = sanitize_title_with_dashes($item[2]);
</span><span class="cx"> 
</span><span class="cx">                  if ( ! $first ) {
</span><del>-                               $replacement .= '<p class="toc-jump"><a href="#top">Top &uarr;</a></p>';
</del><ins>+                                $replacement .= '<p class="toc-jump"><a href="#top">' . __( 'Top &uarr;', 'wporg' ) . '</a></p>';
</ins><span class="cx">                   } else {
</span><span class="cx">                          $first = false;
</span><span class="cx">                  }
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginshandbookincwidgetsphp"></a>
<div class="modfile"><h4>Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php (705 => 706)</h4>
<pre class="diff"><span>
<span class="info">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php        2014-06-16 23:56:42 UTC (rev 705)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php   2014-06-17 00:00:42 UTC (rev 706)
</span><span class="lines">@@ -2,31 +2,36 @@
</span><span class="cx"> 
</span><span class="cx"> class WPorg_Handbook_Widget extends WP_Widget {
</span><span class="cx"> 
</span><del>-       protected $post_types = 'handbook';
</del><ins>+        protected $post_types = array( 'handbook' );
</ins><span class="cx"> 
</span><span class="cx">  function __construct() {
</span><del>-               $this->post_types = apply_filters( 'handbook_post_types', $this->post_types );
-               if ( ! is_array( $this->post_types ) ) {
-                       $this->post_types = (array) $this->post_types;
-               }
</del><ins>+                $this->post_types = (array) apply_filters( 'handbook_post_types', $this->post_types );
</ins><span class="cx">           $this->post_types = array_map( array( $this, 'append_suffix' ), $this->post_types );
</span><del>-               parent::__construct( 'handbook', 'Handbook Tools', array( 'classname' => 'widget_wporg_handbook', 'description' => 'Shows watch/unwatch links for handbook pages.' ) );
</del><ins>+                parent::__construct( 'handbook', __( 'Handbook Tools', 'wporg' ), array( 'classname' => 'widget_wporg_handbook', 'description' => __( 'Shows watch/unwatch links for handbook pages.', 'wporg' ) ) );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><del>-       function widget() {
</del><ins>+        function widget( $args ) {
</ins><span class="cx">           if ( ! is_user_logged_in() )
</span><span class="cx">                  return;
</span><span class="cx"> 
</span><span class="cx">          $post = get_post();
</span><span class="cx">          if ( $post->post_type == 'page' || ( in_array( $post->post_type, $this->post_types ) && ! is_post_type_archive( $this->post_types ) ) ) {
</span><span class="cx">                  $watchlist = get_post_meta( $post->ID, '_wporg_watchlist', true );
</span><ins>+                       if ( isset( $args['before_widget'] ) && $args['before_widget'] ) {
+                               echo $args['before_widget'];
+                       }
+                       echo '<p>';
</ins><span class="cx">                   if ( $watchlist && in_array( get_current_user_id(), $watchlist ) ) {
</span><del>-                               printf( '<p>You are watching this page. <a href="%s">Unwatch</a></p>',
</del><ins>+                                printf( __( 'You are watching this page. <a href="%s">Unwatch</a>', 'wporg' ),
</ins><span class="cx">                           wp_nonce_url( admin_url( 'admin-post.php?action=wporg_watchlist&post_id=' . $post->ID ), 'unwatch-' . $post->ID ) );
</span><span class="cx">                  } else {
</span><del>-                               printf( '<p><a href="%s">Watch this page</a></p>',
</del><ins>+                                printf( __( '<a href="%s">Watch this page</a>', 'wporg' ),
</ins><span class="cx">                           wp_nonce_url( admin_url( 'admin-post.php?action=wporg_watchlist&watch=1&post_id=' . $post->ID ), 'watch-' . $post->ID ) );
</span><span class="cx">                  }
</span><ins>+                       echo '</p>';
+                       if ( isset( $args['after_widget'] ) && $args['after_widget'] ) {
+                               echo $args['after_widget'];
+                       }
</ins><span class="cx">           } else {
</span><span class="cx">                  return;
</span><span class="cx">          }
</span><span class="lines">@@ -34,8 +39,9 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function append_suffix( $t ) {
</span><del>-               if ( 'handbook' == $t )
</del><ins>+                if ( in_array( $t, array( 'handbook', 'page' ) ) ) {
</ins><span class="cx">                   return $t;
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return $t . '-handbook';
</span><span class="cx">  }
</span><span class="lines">@@ -43,20 +49,20 @@
</span><span class="cx"> 
</span><span class="cx"> class WPorg_Handbook_Widget_for_Pages extends WPorg_Handbook_Widget {
</span><span class="cx"> 
</span><del>-       protected $post_type = 'page';
</del><ins>+        protected $post_types = array( 'page' );
</ins><span class="cx"> 
</span><span class="cx">  function __construct() {
</span><del>-               WP_Widget::__construct( 'handbook_for_pages', 'Handbook Tools (for Pages)', array( 'classname' => 'widget_wporg_handbook', 'description' => 'Shows watch/unwatch links for Pages.' ) );
</del><ins>+                WP_Widget::__construct( 'handbook_for_pages', __( 'Handbook Tools (for Pages)', 'wporg' ), array( 'classname' => 'widget_wporg_handbook', 'description' => __( 'Shows watch/unwatch links for Pages.', 'wporg' ) ) );
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class WPorg_Handbook_Pages_Widget extends WP_Widget_Pages {
</span><span class="cx"> 
</span><del>-       protected $post_types = 'handbook';
</del><ins>+        protected $post_types = array( 'handbook' );
</ins><span class="cx"> 
</span><span class="cx">  function __construct() {
</span><del>-               $widget_ops = array('classname' => 'widget_wporg_handbook_pages', 'description' => __( 'Your site&#8217;s Handbook Pages') );
-               WP_Widget::__construct('handbook_pages', __('Handbook Pages'), $widget_ops);
</del><ins>+                $widget_ops = array('classname' => 'widget_wporg_handbook_pages', 'description' => __( 'Your site&#8217;s Handbook Pages', 'wporg' ) );
+               WP_Widget::__construct( 'handbook_pages', __( 'Handbook Pages', 'wporg' ), $widget_ops );
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx">  function widget( $args, $instance ) {
</span><span class="lines">@@ -68,10 +74,7 @@
</span><span class="cx">  function handbook_post_type( $args ) {
</span><span class="cx">          $post = get_post();
</span><span class="cx"> 
</span><del>-               $this->post_types = apply_filters( 'handbook_post_types', $this->post_types );
-               if ( ! is_array( $this->post_types ) ) {
-                       $this->post_types = (array) $this->post_types;
-               }
</del><ins>+                $this->post_types = (array) apply_filters( 'handbook_post_types', $this->post_types );
</ins><span class="cx">           $this->post_types = array_map( array( $this, 'append_suffix' ), $this->post_types );
</span><span class="cx"> 
</span><span class="cx">          if ( in_array( $post->post_type, $this->post_types ) ) {
</span><span class="lines">@@ -81,9 +84,10 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  function append_suffix( $t ) {
</span><del>-               if ( 'handbook' == $t )
</del><ins>+                if ( in_array( $t, array( 'handbook', 'page' ) ) ) {
</ins><span class="cx">                   return $t;
</span><ins>+               }
</ins><span class="cx"> 
</span><span class="cx">          return $t . '-handbook';
</span><span class="cx">  }
</span><del>-}
</del><span class="cx">\ No newline at end of file
</span><ins>+}
</ins></span></pre>
</div>
</div>

</body>
</html>