Title: Custom posts with &quot;-&quot; in post_type
Last modified: August 21, 2016

---

# Custom posts with "-" in post_type

 *  Resolved [IllusionMH](https://wordpress.org/support/users/illusionmh/)
 * (@illusionmh)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-posts-with-in-post_type/)
 * When I’m using TPV plugin in pages with custom posts that contain “-” (dash) 
   in post_type I have JS error in console, because JS engine interprets this as
   minus
 *     ```
       Uncaught exception: ReferenceError: Undefined variable: products
           cms_tpv_jsondata.companyname-products = [			{
       ```
   
 * I propose to change 864 line in functions.php
    from
 *     ```
       cms_tpv_jsondata.<?php echo $post_type ?> = <?php echo $json_data ?>;
       ```
   
 * to
 *     ```
       cms_tpv_jsondata["<?php echo $post_type ?>"] = <?php echo $json_data ?>;
       ```
   
 * [http://wordpress.org/extend/plugins/cms-tree-page-view/](http://wordpress.org/extend/plugins/cms-tree-page-view/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * (@eskapism)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-posts-with-in-post_type/#post-3648826)
 * Ah, didn’t think those could contain that. Nice catch, will test and add your
   fix to the next version.

Viewing 1 replies (of 1 total)

The topic ‘Custom posts with "-" in post_type’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cms-tree-page-view_f1f1f1.svg)
 * [CMS Tree Page View](https://wordpress.org/plugins/cms-tree-page-view/)
 * [Support Threads](https://wordpress.org/support/plugin/cms-tree-page-view/)
 * [Active Topics](https://wordpress.org/support/plugin/cms-tree-page-view/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cms-tree-page-view/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cms-tree-page-view/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Pär Thernström](https://wordpress.org/support/users/eskapism/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/custom-posts-with-in-post_type/#post-3648826)
 * Status: resolved