Plugin Directory

Changeset 481191


Ignore:
Timestamp:
12/27/2011 07:04:05 PM (14 years ago)
Author:
jaredh123
Message:

fix upload iframe for WordPress 3.3+

Location:
prophoto2-compatibility-patches/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • prophoto2-compatibility-patches/trunk/p2-wp-compatibility.php

    r412697 r481191  
    55Description: Only for users of version 2 of the ProPhoto theme. Contains patches required for compatibility with WordPress 3.0+
    66Author: ProPhotoBlogs
    7 Version: 1.2
     7Version: 1.3
    88*/
    99
    1010
    11 add_action( 'wp_loaded', 'p2_update_img_protection_opts' );
    12 add_action( 'wp_loaded', 'p2_update_img_protection_js' );
     11if ( get_option( 'template' ) == 'prophoto2' ) {
     12    add_action( 'wp_loaded', 'p2_update_img_protection_opts' );
     13    add_action( 'wp_loaded', 'p2_update_img_protection_js' );
     14    add_action( 'after_setup_theme', 'p2_fix_iframed_upload_windows' );
     15}
     16
     17
     18function p2_fix_iframed_upload_windows() {
     19    if ( p2_wp_version() > 229 ) {
     20        if ( $GLOBALS['pagenow'] == 'popup.php' ) {
     21            wp_enqueue_style( 'p2-compat-popup-css', plugin_dir_url( __FILE__ ) .'p2-compat-popup.css' );
     22            add_action( 'admin_head', create_function( '', "remove_action( 'post-upload-ui', 'media_upload_text_after', 5 );" ) );
     23        }
     24    }
     25}
     26
    1327
    1428
     
    118132
    119133
     134function p2_wp_version() {
     135    $version = str_pad( intval( str_replace( '.', '', $GLOBALS['wp_version'] ) ), 3, '0' );
     136    return ( $version == '000' ) ? 999 : intval( $version );
     137}
     138
     139
     140
Note: See TracChangeset for help on using the changeset viewer.