XPressME Integration Kit

Trac

Changeset 271


Ignore:
Timestamp:
Jun 9, 2009, 1:38:17 PM (15 years ago)
Author:
toemon
Message:

WP2011用にwp_parse_args() wp_parse_str()を追加 #130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/functions_for_wp20.php

    r262 r271  
    262262} 
    263263 
     264// ADD WP 2.2.0 
     265function wp_parse_args( $args, $defaults = '' ) { 
     266        if ( is_object( $args ) ) 
     267                $r = get_object_vars( $args ); 
     268        elseif ( is_array( $args ) ) 
     269                $r =& $args; 
     270        else 
     271                wp_parse_str( $args, $r ); 
     272 
     273        if ( is_array( $defaults ) ) 
     274                return array_merge( $defaults, $r ); 
     275        return $r; 
     276} 
     277 
     278// ADD WP 2.2.1 
     279function wp_parse_str( $string, &$array ) { 
     280        parse_str( $string, $array ); 
     281        if ( get_magic_quotes_gpc() ) 
     282                $array = stripslashes_deep( $array ); 
     283        $array = apply_filters( 'wp_parse_str', $array ); 
     284} 
    264285 
    265286/** 
Note: See TracChangeset for help on using the changeset viewer.