Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category restrictions trows error notices (jop_checked) #49

Closed
kloneets opened this issue Jun 17, 2016 · 2 comments
Closed

Category restrictions trows error notices (jop_checked) #49

kloneets opened this issue Jun 17, 2016 · 2 comments
Labels
Milestone

Comments

@kloneets
Copy link

JW_SIMPLE_OPTIONS function jop_checked throws error on unchecked categories. Error notice:
Notice: Array to string conversion in ../wp-includes/general-template.php on line 3550

You need to stringify $haystack, if match is not met. My quick solution

function jop_checked( $haystack, $cur, $show = FALSE ) {
        if ( is_array( $haystack ) && in_array( $cur, $haystack ) ) {
            $cur = $haystack = 1;
        }
        if(is_array($haystack)) { //if $haystack is still an array, take first value
            $haystack = array_shift($haystack);
        }
        return checked( $haystack, $cur, $show );
    }
@JayWood
Copy link
Owner

JayWood commented Jun 20, 2016

@kloneets yea thanks, simple options is horribly outdated. It's on my radar. I plan on moving all settings to the WordPress settings API sometime in the near future.

@JayWood JayWood added the bug label Jun 20, 2016
@JayWood
Copy link
Owner

JayWood commented Sep 30, 2016

Related #45 - Tracking there

@JayWood JayWood added this to the 3.7.0 milestone Sep 30, 2016
JayWood added a commit that referenced this issue Sep 30, 2016
@JayWood JayWood closed this as completed Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants