WordPress.org

Plugin Directory

Changeset 445842


Ignore:
Timestamp:
09/30/11 19:40:56 (3 years ago)
Author:
ozh
Message:

1.5.3:
Fixed: metaboxes now appear on custom post type pages

Location:
yourls-wordpress-to-twitter/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • yourls-wordpress-to-twitter/trunk/inc/options.php

    r398386 r445842  
    453453function wp_ozh_yourls_addbox() { 
    454454    // What page are we on? (new Post, new Page, new custom post type?) 
    455     $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : 'post' ; 
    456     add_meta_box( 'yourlsdiv', 'YOURLS', 'wp_ozh_yourls_drawbox', $post_type, 'side', 'default' ); 
    457      
    458     // TODO: do something with links. Or wait till they're considered custom post types. 
     455    if( isset ( $_GET["post"] ) ) { 
     456        $post_id   = (int)$_GET["post"]; 
     457        $post_type = get_post_type( $post_id ); 
     458    } else { 
     459        $post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : 'post' ; 
     460    } 
     461     
     462    if ( wp_ozh_yourls_generate_on( $post_type ) ) { 
     463        add_meta_box( 'yourlsdiv', 'YOURLS', 'wp_ozh_yourls_drawbox', $post_type, 'side', 'default' ); 
     464    } 
     465     
     466    // TODO: do something with links. Or wait till they're considered custom post types. Yeah, we'll wait. 
    459467} 
    460468 
  • yourls-wordpress-to-twitter/trunk/plugin.php

    r445481 r445842  
    66Author: Ozh 
    77Author URI: http:/ozh.org/ 
    8 Version: 1.5.2 
     8Version: 1.5.3 
    99*/ 
    1010 
     
    5454              Fixed: Compatibility with P2 theme. Thanks Milan Petrovic! 
    5555 * 1.5.2:     Added: Spanish translation. Thanks myhosting.com team! 
     56 * 1.5.3:     Fixed: metaboxes now appear on custom post type pages 
    5657 */ 
    5758 
Note: See TracChangeset for help on using the changeset viewer.