WordPress.org

Plugin Directory

Changeset 486231


Ignore:
Timestamp:
01/07/12 17:15:14 (2 years ago)
Author:
wpmuguru
Message:

update for 3.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genesis-simple-menus/trunk/simple-menu.php

    r411629 r486231  
    5959        add_action( 'wp_head', array( &$this, 'wp_head' ) ); 
    6060         
    61         $this->taxonomies = apply_filters( 'genesis_simple_menus_taxonomies', array( 'category', 'post_tag' ) ); 
    62         if( !empty( $this->taxonomies ) && is_admin() && is_array( $this->taxonomies ) ) { 
     61        $_taxonomies = get_taxonomies( array( 'show_ui' => true, 'public' => true ) ); 
     62        $this->taxonomies = apply_filters( 'genesis_simple_menus_taxonomies', array_keys( $_taxonomies ) ); 
     63        if( !empty( $this->taxonomies ) && is_array( $this->taxonomies ) ) { 
    6364            foreach( $this->taxonomies as $tax ) 
    6465                add_action( "{$tax}_edit_form", array( &$this, 'term_edit' ), 9, 2 ); 
     
    7879 */ 
    7980    function metabox() { 
    80         $this->print_nonce(); 
    8181?>  <p> 
    8282<?php       $this->print_menu_select( $this->field_name, genesis_get_custom_field( $this->field_name ), 'width: 99%;' ); ?> 
     
    108108            $option_style = sprintf(' style="%s"', esc_attr( $option_style ) ); 
    109109?> 
    110         <label for="<?php echo $fieldname; ?>"><span><?php _e( 'Secondary Navigation', 'genesis' ); ?><span></label> 
     110        <label for="<?php echo $field_name; ?>"><span><?php _e( 'Secondary Navigation', 'genesis' ); ?><span></label> 
    111111<?php       echo $after_label; ?> 
    112112        <select name="<?php echo $field_name; ?>" id="<?php echo $field_name; ?>"<?php echo $select_style; ?>> 
     
    121121 */ 
    122122    function save_post( $post_id, $post ) { 
    123         if ( !$this->verify_nonce() ) 
    124             return $post_id; 
    125123 
    126124        //  don't try to save the data under autosave, ajax, or future post. 
     
    128126        if ( defined('DOING_AJAX') && DOING_AJAX ) return; 
    129127        if ( defined('DOING_CRON') && DOING_CRON ) return; 
    130         if ( $post->post_type == 'revision' || $post->post_type == 'nav_menu_item' ) return; 
     128        if ( $post->post_type == 'revision' ) return; 
    131129 
    132         $perm = 'edit_' . ( 'page' == $_POST['post_type'] ? 'post' : $_POST['post_type'] ); 
     130        $perm = 'edit_' . ( 'page' == $post->post_type ? 'post' : $post->post_type ) . 's'; 
    133131        if ( current_user_can( $perm, $post_id ) ) { 
    134132            if( empty( $_POST[$this->field_name] ) ) 
     
    137135                update_post_meta( $post_id, $this->field_name, $_POST[$this->field_name] ); 
    138136        } 
    139         return $post_id; 
    140     } 
    141     function print_nonce() { ?> 
    142         <input type="hidden" name="<?php echo $this->nonce_key; ?>" value="<?php echo wp_create_nonce( $this->handle ); ?>" /> 
    143 <?php   } 
    144     function verify_nonce() { 
    145         return ( !isset($_POST[$this->nonce_key]) || wp_verify_nonce( $_POST[$this->nonce_key], $this->handle ) ); 
     137 
    146138    } 
    147139/* 
     
    172164        if( $term && isset( $term->meta[$this->field_name] ) ) 
    173165            $this->menu = $term->meta[$this->field_name]; 
    174  
    175166        if( $this->menu ) { 
    176167            add_filter( 'genesis_pre_get_option_subnav_type', array( &$this, 'pre_get_option_subnav_type' ) ); 
     
    192183    function theme_mod( $mods ) { 
    193184        if( $this->menu ) 
    194             $mods['secondary'] = $this->menu; 
     185            $mods['secondary'] = (int)$this->menu; 
    195186 
    196187        return $mods; 
Note: See TracChangeset for help on using the changeset viewer.