• Resolved EvGreen

    (@evgreen)


    Got mail this morning from user concerned that his blog is now displaying slider categories, which shouldn’t obv, because those were excluded in optiontree. Tested it on my server, and indeed 1.1.3 got something messed up with categories and they don’t work at all..

    I find it quite serious ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter EvGreen

    (@evgreen)

    it seems like the categories(and probably pages, posts) no longer return string of id numbers like 20,17,3 etc. but array by default, and even with $is_array set to false, it still returns array

    Plugin Author Derek Herman

    (@valendesigns)

    It’s returning an array because that was the original intended value. All checkbox types were intended to be an array and therefore should have been treated like an array. The second someone clicks save all changes with the latest version of OT the new value for any option type that uses a checkbox will be saved as an array of values. So regardless of if you tell the function not to return an array it’s an array and will be treated like one.

    What is the code you’re using to exclude the slider type, are you doing your own explode on the comma separated list? The get_option_tree() function did that for you so can you explain a bit more as to what exactly broke with the update.

    Plugin Author Derek Herman

    (@valendesigns)

    Also, the title of this post is misleading because categories work perfectly fine, it’s your themes implementation of them that broke.

    I’m uploading a patched v1.1.4 now to try and solve your issue by forcing the $is_array variable to need to be set to true or the values are indeed an array, but if new data is saved categories will become an array and the patch will no longer work.

    Plugin Author Derek Herman

    (@valendesigns)

    Uploading the patch now and should fix all your problems.

    Plugin Author Derek Herman

    (@valendesigns)

    In v1.1.4 if $is_array is set to false it will return a comma separated list of values.

    Thread Starter EvGreen

    (@evgreen)

    Hi Derek
    I am well aware thats an array, but in 1.1.1 and 1.1.2 a simple
    $categories = get_option_tree( ‘categories’, ”, true, false, -1 );
    would return and echo i.e. “20,11,3,2” etc
    and in 1.1.3 it was returning “Array”

    thus simpliest implementation of your plugin that I could think of:
    query_posts(‘cat=’ . $categories );
    stopped working.
    And since it wasn’t in the patchnotes I called it a bug.

    Thanks for 1.1.4, its back to way it was now ??

    Plugin Author Derek Herman

    (@valendesigns)

    Sorry for the confusion. Glad to know it’s all working correctly now.

    ok – i’m lost by this statement:

    but if new data is saved categories will become an array and the patch will no longer work.

    will this:
    $categories = get_option_tree( 'mycat', '', false, false, -1 );

    now and forever return:
    “20,11,3,2” ???

    Plugin Author Derek Herman

    (@valendesigns)

    @wiltwyck It will now, yes. The patch it permanent and will always return the comma separated list if you have array set to false. The statement was made before the patch was pushed to SVN and I updated it again after I said that. There isn’t an edit or delete comment in the forum unfortunately.

    thanks for the quick response Derek – much appreciated!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: OptionTree] Categories seem to not work anymore in 1.1.3’ is closed to new replies.