Title: custom post-type triggers error in wp-includes/post.php
Last modified: August 20, 2016

---

# custom post-type triggers error in wp-includes/post.php

 *  Resolved [JuniperPaul](https://wordpress.org/support/users/juniperpaul/)
 * (@juniperpaul)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-triggers-error-in-wp-includespostphp/)
 * After I used CPT-onomies to create [this custom post type](http://juniperwebcraft.com/test/cpt-onomies/aq-screen-cptonomies-edit-cpt-2012-11-30.jpg),
   the following error appears at the top of every page both on the displayed site
   and in the admin interface:
 *     ```
       Notice: Undefined offset: 1 in /[...]/wp-includes/post.php on line 1155
       ```
   
 * which points to:
 *     ```
       1154	// Singular base for meta capabilities, plural base for primitive capabilities.
       1155	list( $singular_base, $plural_base ) = $args->capability_type;
       ```
   
 * This error message goes away if I deactivate CPT-onomies. (I deactivated all 
   other installed plugins, so the problem appears to be solely between CPT-onomies
   and WordPress 3.4.2.)
 * Please let me know if you see something to tweak either in your plugin or in 
   my CPT definition to work around this problem.
 * Thanks!
    Paul
 * [http://wordpress.org/extend/plugins/cpt-onomies/](http://wordpress.org/extend/plugins/cpt-onomies/)

Viewing 1 replies (of 1 total)

 *  [Rachel Cherry](https://wordpress.org/support/users/bamadesigner/)
 * (@bamadesigner)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-triggers-error-in-wp-includespostphp/#post-3233279)
 * Hi Paul!
 * This is actually a bug with the “Capability Type” setting which I’ve already 
   taken care of for the next version, which should hopefully be out within the 
   next week. But if you want to go ahead and patch it up, here’s what you do:
 * Open up ‘admin-settings.php’ and find the following lines, somewhere around 288:
 *     ```
       if ( isset( $cpt[ 'capability_type' ] ) && !empty( $cpt[ 'capability_type' ] ) ) {
          // can be separated by space or comma
          $cpt[ 'capability_type' ] = str_replace( ', ', ',', trim( $cpt[ 'capability_type' ] ) );
          $cpt[ 'capability_type' ] = str_replace( ' ', ',', trim( $cpt[ 'capability_type' ] ) );
          $cpt[ 'capability_type' ] = explode( ',', $cpt[ 'capability_type' ] );
       }
       ```
   
 * and replace it with:
 *     ```
       if ( isset( $cpt[ 'capability_type' ] ) && !empty( $cpt[ 'capability_type' ] ) ) {
          // can be separated by space or comma
          $cpt[ 'capability_type' ] = str_replace( ', ', ',', trim( $cpt[ 'capability_type' ] ) );
          $cpt[ 'capability_type' ] = str_replace( ' ', ',', trim( $cpt[ 'capability_type' ] ) );
          $cpt[ 'capability_type' ] = explode( ',', $cpt[ 'capability_type' ] );
          // only save as array if more than one capability type
          if ( count( $cpt[ 'capability_type' ] ) < 2 ) {
             if ( count( $cpt[ 'capability_type' ] ) == 1 )
                $cpt[ 'capability_type' ] = array_shift( $cpt[ 'capability_type' ] );
             else
                $cpt[ 'capability_type' ] = NULL;
          }
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘custom post-type triggers error in wp-includes/post.php’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cpt-onomies_f2f2f2.svg)
 * [CPT-onomies: Using Custom Post Types as Taxonomies](https://wordpress.org/plugins/cpt-onomies/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cpt-onomies/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cpt-onomies/)
 * [Active Topics](https://wordpress.org/support/plugin/cpt-onomies/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cpt-onomies/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cpt-onomies/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Rachel Cherry](https://wordpress.org/support/users/bamadesigner/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/custom-post-type-triggers-error-in-wp-includespostphp/#post-3233279)
 * Status: resolved