<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[12923] trunk/wp-includes: Permalinks for custom post types.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12923">12923</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-02-01 23:12:26 +0000 (Mon, 01 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Permalinks for custom post types. Props prettyboymp. see <a href="http://trac.wordpress.org/ticket/9674">#9674</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesclassesphp">trunk/wp-includes/classes.php</a></li>
<li><a href="#trunkwpincludeslinktemplatephp">trunk/wp-includes/link-template.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/classes.php (12922 => 12923)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/classes.php        2010-02-01 22:22:21 UTC (rev 12922)
+++ trunk/wp-includes/classes.php        2010-02-01 23:12:26 UTC (rev 12923)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx">          * @access public
</span><span class="cx">          * @var array
</span><span class="cx">          */
</span><del>-        var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage');
</del><ins>+        var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Private query variables.
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">                 // Fetch the rewrite rules.
</span><span class="cx">                 $rewrite = $wp_rewrite-&gt;wp_rewrite_rules();
</span><span class="cx"> 
</span><del>-                if (! empty($rewrite)) {
</del><ins>+                if ( ! empty($rewrite) ) {
</ins><span class="cx">                         // If we match a rewrite rule, this will be cleared.
</span><span class="cx">                         $error = '404';
</span><span class="cx">                         $this-&gt;did_permalink = true;
</span><span class="lines">@@ -203,12 +203,11 @@
</span><span class="cx"> 
</span><span class="cx">                                 // If the requesting file is the anchor of the match, prepend it
</span><span class="cx">                                 // to the path info.
</span><del>-                                if ((! empty($req_uri)) &amp;&amp; (strpos($match, $req_uri) === 0) &amp;&amp; ($req_uri != $request)) {
</del><ins>+                                if ( (! empty($req_uri)) &amp;&amp; (strpos($match, $req_uri) === 0) &amp;&amp; ($req_uri != $request) )
</ins><span class="cx">                                         $request_match = $req_uri . '/' . $request;
</span><del>-                                }
</del><span class="cx"> 
</span><del>-                                if (preg_match(&quot;#^$match#&quot;, $request_match, $matches) ||
-                                        preg_match(&quot;#^$match#&quot;, urldecode($request_match), $matches)) {
</del><ins>+                                if ( preg_match(&quot;#^$match#&quot;, $request_match, $matches) ||
+                                        preg_match(&quot;#^$match#&quot;, urldecode($request_match), $matches) ) {
</ins><span class="cx">                                         // Got a match.
</span><span class="cx">                                         $this-&gt;matched_rule = $match;
</span><span class="cx"> 
</span><span class="lines">@@ -225,10 +224,10 @@
</span><span class="cx"> 
</span><span class="cx">                                         // If we're processing a 404 request, clear the error var
</span><span class="cx">                                         // since we found something.
</span><del>-                                        if (isset($_GET['error']))
</del><ins>+                                        if ( isset($_GET['error']) )
</ins><span class="cx">                                                 unset($_GET['error']);
</span><span class="cx"> 
</span><del>-                                        if (isset($error))
</del><ins>+                                        if ( isset($error) )
</ins><span class="cx">                                                 unset($error);
</span><span class="cx"> 
</span><span class="cx">                                         break;
</span><span class="lines">@@ -236,14 +235,14 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         // If req_uri is empty or if it is a request for ourself, unset error.
</span><del>-                        if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) {
-                                if (isset($_GET['error']))
</del><ins>+                        if ( empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) {
+                                if ( isset($_GET['error']) )
</ins><span class="cx">                                         unset($_GET['error']);
</span><span class="cx"> 
</span><del>-                                if (isset($error))
</del><ins>+                                if ( isset($error) )
</ins><span class="cx">                                         unset($error);
</span><span class="cx"> 
</span><del>-                                if (isset($perma_query_vars) &amp;&amp; strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false)
</del><ins>+                                if ( isset($perma_query_vars) &amp;&amp; strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false )
</ins><span class="cx">                                         unset($perma_query_vars);
</span><span class="cx"> 
</span><span class="cx">                                 $this-&gt;did_permalink = false;
</span><span class="lines">@@ -256,17 +255,21 @@
</span><span class="cx">                         if ( $t-&gt;query_var )
</span><span class="cx">                                 $taxonomy_query_vars[$t-&gt;query_var] = $taxonomy;
</span><span class="cx"> 
</span><del>-                for ($i=0; $i&lt;count($this-&gt;public_query_vars); $i += 1) {
</del><ins>+                foreach ( $GLOBALS['wp_post_types'] as $post_type =&gt; $t )
+                        if ( $t-&gt;query_var )
+                                $post_type_query_vars[$t-&gt;query_var] = $post_type;
+
+                for ( $i = 0; $i &lt; count($this-&gt;public_query_vars); $i += 1 ) {
</ins><span class="cx">                         $wpvar = $this-&gt;public_query_vars[$i];
</span><del>-                        if (isset($this-&gt;extra_query_vars[$wpvar]))
</del><ins>+                        if ( isset($this-&gt;extra_query_vars[$wpvar]) )
</ins><span class="cx">                                 $this-&gt;query_vars[$wpvar] = $this-&gt;extra_query_vars[$wpvar];
</span><del>-                        elseif (isset($GLOBALS[$wpvar]))
</del><ins>+                        elseif ( isset($GLOBALS[$wpvar]) )
</ins><span class="cx">                                 $this-&gt;query_vars[$wpvar] = $GLOBALS[$wpvar];
</span><del>-                        elseif (!empty($_POST[$wpvar]))
</del><ins>+                        elseif ( !empty($_POST[$wpvar]) )
</ins><span class="cx">                                 $this-&gt;query_vars[$wpvar] = $_POST[$wpvar];
</span><del>-                        elseif (!empty($_GET[$wpvar]))
</del><ins>+                        elseif ( !empty($_GET[$wpvar]) )
</ins><span class="cx">                                 $this-&gt;query_vars[$wpvar] = $_GET[$wpvar];
</span><del>-                        elseif (!empty($perma_query_vars[$wpvar]))
</del><ins>+                        elseif ( !empty($perma_query_vars[$wpvar]) )
</ins><span class="cx">                                 $this-&gt;query_vars[$wpvar] = $perma_query_vars[$wpvar];
</span><span class="cx"> 
</span><span class="cx">                         if ( !empty( $this-&gt;query_vars[$wpvar] ) ) {
</span><span class="lines">@@ -274,14 +277,24 @@
</span><span class="cx">                                 if ( in_array( $wpvar, $taxonomy_query_vars ) ) {
</span><span class="cx">                                         $this-&gt;query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar];
</span><span class="cx">                                         $this-&gt;query_vars['term'] = $this-&gt;query_vars[$wpvar];
</span><ins>+                                } elseif ( in_array( $wpvar, $post_type_query_vars ) ) {
+                                        $this-&gt;query_vars['post_type'] = $post_type_query_vars[$wpvar];
+                                        $this-&gt;query_vars['name'] = $this-&gt;query_vars[$wpvar];
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+                // Limit publicly queried post_types to those that are publicly_queryable
+                if ( isset( $this-&gt;query_vars['post_type']) ) {
+                        $queryable_post_types =  get_post_types( array('publicly_queryable' =&gt; true) );
+                        if ( ! in_array( $this-&gt;query_vars['post_type'], $queryable_post_types ) )
+                                unset( $this-&gt;query_vars['post_type'] );
+                }
+
</ins><span class="cx">                 foreach ( (array) $this-&gt;private_query_vars as $var) {
</span><del>-                        if (isset($this-&gt;extra_query_vars[$var]))
</del><ins>+                        if ( isset($this-&gt;extra_query_vars[$var]) )
</ins><span class="cx">                                 $this-&gt;query_vars[$var] = $this-&gt;extra_query_vars[$var];
</span><del>-                        elseif (isset($GLOBALS[$var]) &amp;&amp; '' != $GLOBALS[$var])
</del><ins>+                        elseif ( isset($GLOBALS[$var]) &amp;&amp; '' != $GLOBALS[$var] )
</ins><span class="cx">                                 $this-&gt;query_vars[$var] = $GLOBALS[$var];
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/link-template.php (12922 => 12923)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/link-template.php        2010-02-01 22:22:21 UTC (rev 12922)
+++ trunk/wp-includes/link-template.php        2010-02-01 23:12:26 UTC (rev 12923)
</span><span class="lines">@@ -104,8 +104,10 @@
</span><span class="cx"> 
</span><span class="cx">         if ( $post-&gt;post_type == 'page' )
</span><span class="cx">                 return get_page_link($post-&gt;ID, $leavename, $sample);
</span><del>-        elseif ($post-&gt;post_type == 'attachment')
</del><ins>+        elseif ( $post-&gt;post_type == 'attachment' )
</ins><span class="cx">                 return get_attachment_link($post-&gt;ID);
</span><ins>+        elseif ( in_array($post-&gt;post_type, get_post_types( array('_builtin' =&gt; false) ) ) )
+                return get_post_link($post);
</ins><span class="cx"> 
</span><span class="cx">         $permalink = get_option('permalink_structure');
</span><span class="cx"> 
</span><span class="lines">@@ -160,6 +162,43 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Retrieve the permalink for a post with a custom post type.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id Optional. Post ID.
+ * @param bool $leavename Optional, defaults to false. Whether to keep post name.
+ * @param bool $sample Optional, defaults to false. Is it a sample permalink.
+ * @return string
+ */
+function get_post_link( $id = 0, $leavename = false, $sample = false  ) {
+        global $wp_rewrite;
+
+        $post = &amp;get_post($id);
+
+        if ( is_wp_error( $post ) )
+                return $post;
+
+        $post_link = $wp_rewrite-&gt;get_extra_permastruct($post-&gt;post_type);
+
+        $slug = $post-&gt;post_name;
+
+        if ( !empty($post_link) &amp;&amp; ( ( isset($post-&gt;post_status) &amp;&amp; 'draft' != $post-&gt;post_status &amp;&amp; 'pending' != $post-&gt;post_status ) || $sample ) ) {
+                $post_link = ( $leavename ) ? $post_link : str_replace(&quot;%$post-&gt;post_type%&quot;, $slug, $post_link);
+                $post_link = home_url( user_trailingslashit($post_link) );
+        } else {
+                $post_type = get_post_type_object($post-&gt;post_type);
+                if ( $post_type-&gt;query_var &amp;&amp; ( isset($post-&gt;post_status) &amp;&amp; 'draft' != $post-&gt;post_status &amp;&amp; 'pending' != $post-&gt;post_status ) )
+                        $post_link = &quot;?$post_type-&gt;query_var=$slug&quot;;
+                else
+                        $post_link = &quot;?post_type=$post-&gt;post_type&amp;p=$post-&gt;ID&quot;;
+                $post_link = home_url($post_link);
+        }
+
+        return apply_filters('post_type_link', $post_link, $id);
+}
+
+/**
</ins><span class="cx">  * Retrieve permalink from post ID.
</span><span class="cx">  *
</span><span class="cx">  * @since 1.0.0
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (12922 => 12923)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-02-01 22:22:21 UTC (rev 12922)
+++ trunk/wp-includes/post.php        2010-02-01 23:12:26 UTC (rev 12923)
</span><span class="lines">@@ -16,20 +16,26 @@
</span><span class="cx">  */
</span><span class="cx"> function create_initial_post_types() {
</span><span class="cx">         register_post_type( 'post', array(        'label' =&gt; __('Posts'),
</span><ins>+                                                                                'publicly_queryable' =&gt; true,
</ins><span class="cx">                                                                                 'exclude_from_search' =&gt; false,
</span><span class="cx">                                                                                 '_builtin' =&gt; true,
</span><span class="cx">                                                                                 '_edit_link' =&gt; 'post.php?post=%d',
</span><span class="cx">                                                                                 'capability_type' =&gt; 'post',
</span><span class="cx">                                                                                 'hierarchical' =&gt; false,
</span><ins>+                                                                                'rewrite' =&gt; false,
+                                                                                'query_var' =&gt; false,
</ins><span class="cx">                                                                                 'supports' =&gt; array('post-thumbnails', 'excerpts', 'trackbacks', 'custom-fields', 'comments', 'revisions')
</span><span class="cx">                                                                         ) );
</span><span class="cx"> 
</span><span class="cx">         register_post_type( 'page', array(        'label' =&gt; __('Pages'),
</span><ins>+                                                                                'publicly_queryable' =&gt; true,
</ins><span class="cx">                                                                                 'exclude_from_search' =&gt; false,
</span><span class="cx">                                                                                 '_builtin' =&gt; true,
</span><span class="cx">                                                                                 '_edit_link' =&gt; 'post.php?post=%d',
</span><span class="cx">                                                                                 'capability_type' =&gt; 'page',
</span><span class="cx">                                                                                 'hierarchical' =&gt; true,
</span><ins>+                                                                                'rewrite' =&gt; false,
+                                                                                'query_var' =&gt; false,
</ins><span class="cx">                                                                                 'supports' =&gt; array('post-thumbnails', 'page-attributes', 'custom-fields', 'comments', 'revisions')
</span><span class="cx">                                                                         ) );
</span><span class="cx"> 
</span><span class="lines">@@ -38,7 +44,9 @@
</span><span class="cx">                                                                                         '_builtin' =&gt; true,
</span><span class="cx">                                                                                         '_edit_link' =&gt; 'media.php?attachment_id=%d',
</span><span class="cx">                                                                                         'capability_type' =&gt; 'post',
</span><del>-                                                                                        'hierarchical' =&gt; false
</del><ins>+                                                                                        'hierarchical' =&gt; false,
+                                                                                        'rewrite' =&gt; false,
+                                                                                        'query_var' =&gt; false,
</ins><span class="cx">                                                                                 ) );
</span><span class="cx"> 
</span><span class="cx">         register_post_type( 'revision', array(        'label' =&gt; __('Revisions'),
</span><span class="lines">@@ -46,7 +54,9 @@
</span><span class="cx">                                                                                         '_builtin' =&gt; true,
</span><span class="cx">                                                                                         '_edit_link' =&gt; 'revision.php?revision=%d',
</span><span class="cx">                                                                                         'capability_type' =&gt; 'post',
</span><del>-                                                                                        'hierarchical' =&gt; false
</del><ins>+                                                                                        'hierarchical' =&gt; false,
+                                                                                        'rewrite' =&gt; false,
+                                                                                        'query_var' =&gt; false,
</ins><span class="cx">                                                                                 ) );
</span><span class="cx"> 
</span><span class="cx">         register_post_status( 'publish', array(        'label' =&gt; _x('Published', 'post'),
</span><span class="lines">@@ -686,7 +696,8 @@
</span><span class="cx">  *
</span><span class="cx">  * label - A descriptive name for the post type marked for translation. Defaults to $post_type.
</span><span class="cx">  * public - Whether posts of this type should be shown in the admin UI. Defaults to false.
</span><del>- * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true.
</del><ins>+ * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true if the type is not public, false if the type is public.
+ * publicly_queryable - Whether post_type queries can be performed from the front page.  Defaults to whatever public is set as.
</ins><span class="cx">  * inherit_type - The post type from which to inherit the edit link and capability type. Defaults to none.
</span><span class="cx">  * capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to &quot;post&quot;.
</span><span class="cx">  * hierarchical - Whether the post type is hierarchical. Defaults to false.
</span><span class="lines">@@ -701,19 +712,27 @@
</span><span class="cx">  * @param array|string $args See above description.
</span><span class="cx">  */
</span><span class="cx"> function register_post_type($post_type, $args = array()) {
</span><del>-        global $wp_post_types;
</del><ins>+        global $wp_post_types, $wp_rewrite, $wp;
</ins><span class="cx"> 
</span><del>-        if (!is_array($wp_post_types))
</del><ins>+        if ( !is_array($wp_post_types) )
</ins><span class="cx">                 $wp_post_types = array();
</span><span class="cx"> 
</span><span class="cx">         // Args prefixed with an underscore are reserved for internal use.
</span><del>-        $defaults = array('label' =&gt; false, 'exclude_from_search' =&gt; true, '_builtin' =&gt; false, '_edit_link' =&gt; 'post.php?post=%d', 'capability_type' =&gt; 'post', 'hierarchical' =&gt; false, 'public' =&gt; false, '_show' =&gt; false, 'supports' =&gt; array());
</del><ins>+        $defaults = array('label' =&gt; false, 'publicly_queryable' =&gt; null, 'exclude_from_search' =&gt; null, '_builtin' =&gt; false, '_edit_link' =&gt; 'post.php?post=%d', 'capability_type' =&gt; 'post', 'hierarchical' =&gt; false, 'public' =&gt; false, '_show' =&gt; false, 'rewrite' =&gt; true, 'query_var' =&gt; true, 'supports' =&gt; array());
</ins><span class="cx">         $args = wp_parse_args($args, $defaults);
</span><span class="cx">         $args = (object) $args;
</span><span class="cx"> 
</span><span class="cx">         $post_type = sanitize_user($post_type, true);
</span><span class="cx">         $args-&gt;name = $post_type;
</span><span class="cx"> 
</span><ins>+        // If not set, default to the setting for public.
+        if ( null === $args-&gt;publicly_queryable )
+                $args-&gt;publicly_queryable = $args-&gt;public;
+
+        // If not set, default to true if not public, false if public.
+        if ( null === $args-&gt;exclude_from_search )
+                $args-&gt;exclude_from_search = !$args-&gt;public;
+
</ins><span class="cx">         if ( false === $args-&gt;label )
</span><span class="cx">                 $args-&gt;label = $post_type;
</span><span class="cx"> 
</span><span class="lines">@@ -735,6 +754,24 @@
</span><span class="cx">                 unset($args-&gt;supports);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if ( false !== $args-&gt;query_var &amp;&amp; !empty($wp) ) {
+                if ( true === $args-&gt;query_var )
+                        $args-&gt;query_var = $post_type;
+                $args-&gt;query_var = sanitize_title_with_dashes($args-&gt;query_var);
+                $wp-&gt;add_query_var($args-&gt;query_var);
+        }
+
+        if ( false !== $args-&gt;rewrite &amp;&amp; '' != get_option('permalink_structure') ) {
+                if ( !is_array($args-&gt;rewrite) )
+                        $args-&gt;rewrite = array();
+                if ( !isset($args-&gt;rewrite['slug']) )
+                        $args-&gt;rewrite['slug'] = $post_type;
+                if ( !isset($args-&gt;rewrite['with_front']) )
+                        $args-&gt;rewrite['with_front'] = true;
+                $wp_rewrite-&gt;add_rewrite_tag(&quot;%$post_type%&quot;, '([^/]+)', $args-&gt;query_var ? &quot;{$args-&gt;query_var}=&quot; : &quot;post_type=$post_type&amp;name=&quot;);
+                $wp_rewrite-&gt;add_permastruct($post_type, &quot;/{$args-&gt;rewrite['slug']}/%$post_type%&quot;, $args-&gt;rewrite['with_front']);
+        }
+
</ins><span class="cx">         $wp_post_types[$post_type] = $args;
</span><span class="cx"> 
</span><span class="cx">         return $args;
</span></span></pre>
</div>
</div>

</body>
</html>