Plugin Directory

Changeset 370946


Ignore:
Timestamp:
04/09/2011 04:35:18 PM (15 years ago)
Author:
beatpanda
Message:

convert any post type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wordpress-wiki/trunk/controllers/wiki_admin.php

    r348407 r370946  
    186186            $update_post = get_post($id_we_are_changing, 'ARRAY_A');
    187187            //The hackiest hack that ever hacked
    188             $this->convert_pages_recursively($id_we_are_changing);
     188            if ( !empty($id_we_are_changing) )
     189                $this->convert_pages_recursively($id_we_are_changing);
     190               
    189191            $update_post['post_type'] = 'wiki';
    190192            $update_post['post_status'] = 'publish';
     
    215217        //Wordpress 2.6 + -- this is the only one we need
    216218        global $wp_version;
     219   
    217220        if ($wp_version < 3.0) {
    218             add_meta_box( 'wpw_meta_box', __( 'Wiki Options', 'wp-wiki' ),
     221            add_meta_box( 'wpw_meta_box', __( 'Wiki Options', 'wp-wiki' ),
    219222                        array($this, 'meta_box_inner'), 'page', 'side', 'high' );
     223            add_meta_box( 'wpw_meta_box', __( 'Wiki Options', 'wp-wiki' ),
     224                        array($this, 'meta_box_inner_pages'), 'post', 'side', 'high' );
    220225        } else {
    221             add_meta_box( 'wpw_meta_box', __( 'Wiki Options', 'wp-wiki' ),
    222                         array($this, 'meta_box_inner'), 'wiki', 'side', 'high' );
    223    
    224             add_meta_box( 'wpw_meta_box', __( 'Wiki Options', 'wp-wiki' ),
    225                         array($this, 'meta_box_inner_pages'), 'page', 'side', 'high' );
     226            $post_types = get_post_types(array('show_ui'=>true));
     227            foreach($post_types as $pt) {
     228                if ($pt == 'wiki')
     229                    continue;   
     230                add_meta_box( 'wpw_meta_box', __( 'Wiki Options', 'wp-wiki' ),
     231                            array($this, 'meta_box_inner_pages'), $pt, 'side', 'high' );
     232            }
    226233        }
    227234    }
     
    261268        global $wp_version;
    262269    ?>
    263             <h5><?php _e('Wiki Page'); ?></h5> 
     270            <h5><?php _e('Wiki Page'); ?></h5>
    264271            <input type="checkbox" name="wpw_change_to_wiki" value="true" />
    265272            <label for="wpw_change_to_wiki"><?php _e('Convert this page and all of its subpages to Wikis.'); ?></label>
Note: See TracChangeset for help on using the changeset viewer.