WordPress.org

Forums

CMS Tree Page View
[resolved] Custom posts with "-" in post_type (2 posts)

  1. IllusionMH
    Member
    Posted 2 years ago #

    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/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 2 years ago #

    Ah, didn't think those could contain that. Nice catch, will test and add your fix to the next version.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CMS Tree Page View
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.