registered[ $handler ] ); } /** * Enqueues an array of items * The items must be in the "(int)enqueue_order => (array)$args" format * - $args must be in the wp_register_style / wp_register_script format * * @param array $items The array of items that need to be enqueued * @param string $type Either 'script' or 'style' * @return void * @author Alex Ciobica **/ function placester_enqueue( $items, $type, $replace = TRUE ) { $supported_types = array( 'style', 'script' ); if ( !in_array( $type, $supported_types) ) return; ksort( $items ); // sort by key foreach ( $items as $key => $args ) { if ( is_enqueued( $args[0], $type ) ){ if ( $replace ) { // Reregister only if replace is set (default behavior) call_user_func( 'wp_deregister_' . $type, $args[0] ); call_user_func_array( 'wp_register_' . $type, $args ); } } else { call_user_func_array( 'wp_register_' . $type, $args ); } call_user_func( 'wp_enqueue_' . $type, $args[0] ); } }