WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am generating the following notice in the options-framework.php.

Notice: Undefined index: in options-framework.php

I believe it is something to do with sanitization, but do not know how to resolve this issue.

I have the following arrays defined in options.php

// Pull all the custom taxonomies into an array
$options_password_taxonomies = array();
$taxonomies_password_terms_obj = get_terms('password_gallery_category');
foreach ( $taxonomies_password_terms_obj as $taxonomy) {
    if( isset( $taxonomy->term_id ) ){
        $options_password_taxonomies[$taxonomy->term_id] = $taxonomy->name;

 // Select a Category for your Client Area
$options[] = array(
    'name' => __('Password Protected Galleries', 'shutter'),
    'desc' => __('Choose a category for password protected client galleries.', 'shutter'),
    'id' => 'client_area',
    'type' => 'select',
    'options' => $options_password_taxonomies);


// For a value to be submitted to database it must pass through a sanitization filter
    if ( has_filter( 'of_sanitize_' . $option['type'] ) ) {
        $clean[$id] = apply_filters( 'of_sanitize_' . $option['type'],   $input[$id], $option );
share|improve this question
up vote 0 down vote accepted

Most likely you have an undefined array index. You can check if the array index exists with isset() like this:



So check all your arrays in the options-framework.php file.

You can try for example:

if ( isset($option['type']) && isset($input[$id]) && has_filter( 'of_sanitize_' . $option['type'] ) ) {
        $clean[$id] = apply_filters( 'of_sanitize_' . $option['type'],   $input[$id], $option );
share|improve this answer
Thank you so much! It worked perfectly! – Dean McCann Feb 27 '13 at 13:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.