wp_iframe [ WordPress Function ]
wp_iframe ( $content_func )
| Parameters: |
|
| Defined at: |
|
{@internal Missing Short Description}}
Wrap iframe content (produced by $content_func) in a doctype, html head/body etc any additional function args will be passed to content_func.
Source
<?php
function wp_iframe($content_func /* ... */) {
_wp_admin_html_begin();
?>
<title><?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — <?php _e('WordPress'); ?></title>
<?php
wp_enqueue_style( 'colors' );
// Check callback name for 'media'
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
|| ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) )
wp_enqueue_style( 'media' );
wp_enqueue_style( 'ie' );
?>
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
isRtl = <?php echo (int) is_rtl(); ?>;
//]]>
</script>
<?php
do_action('admin_enqueue_scripts', 'media-upload-popup');
do_action('admin_print_styles-media-upload-popup');
do_action('admin_print_styles');
do_action('admin_print_scripts-media-upload-popup');
do_action('admin_print_scripts');
do_action('admin_head-media-upload-popup');
do_action('admin_head');
if ( is_string($content_func) )
do_action( "admin_head_{$content_func}" );
?>
</head>
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="no-js">
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js', 'js');
</script>
<?php
$args = func_get_args();
$args = array_slice($args, 1);
call_user_func_array($content_func, $args);
do_action('admin_print_footer_scripts');
?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
<?php
}
?>
Examples [ wp-snippets.com ]
Top Google Search Results
- wp_iframe | A HitchHackers guide through WordPress
Feb 12, 2011 ... Defined actions. admin_xml_ns do_action('admin_xml_ns');; admin_enqueue_scripts do_action('admin_enqueue_scripts' ...
hitchhackerguide.com - PHPXRef 0.7 : WordPress : Function Reference: wp_iframe()
Function and Method Cross Reference. wp_iframe(). Defined at: /wp-admin/ includes/media.php -> line 314. Referenced 4 times: /wp-admin/includes/media. php ...
phpxref.ftwr.co.uk - #17473 (Add JS detection to wp_iframe output) – WordPress Trac
Currently any page in the admin area includes the necessary script to add the js and no-js classes to the body (from admin-header.php), but this code is missing ...
core.trac.wordpress.org - How to add a new tab in Media Upload page in wordpress « Bạch ...
Sep 6, 2010 ... Yes, it's because when you call wp_iframe, wordpress check to see if call back function is starting with media! if yes, it will add css for media ...
axcoto.com