WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
1391 | * @param unknown_type $errors |
1392 | * @param unknown_type $id |
1393 | */ |
1394 | function media_upload_type_form($type = 'file', $errors = null, $id = null) { |
1395 | media_upload_header(); |
1396 |
|
1397 | $post_id = intval($_REQUEST['post_id']); |
1398 |
|
1399 | $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); |
1400 | $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); |
1401 | ?> |
1402 |
|
1403 | <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form"> |
1404 | <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> |
1405 | <?php wp_nonce_field('media-form'); ?> |
1406 |
|
1407 | <h3 class="media-title"><?php _e('Add media files from your computer'); ?></h3> |
1408 |
|
1409 | <?php media_upload_form( $errors ); ?> |
Line | Code |
1447 | * @param unknown_type $errors |
1448 | * @param unknown_type $id |
1449 | */ |
1450 | function media_upload_type_url_form($type = 'file', $errors = null, $id = null) { |
1451 | media_upload_header(); |
1452 |
|
1453 | $post_id = intval($_REQUEST['post_id']); |
1454 |
|
1455 | $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); |
1456 | $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); |
1457 |
|
1458 | $callback = "type_url_form_$type"; |
1459 | ?> |
1460 |
|
1461 | <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form"> |
1462 | <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" /> |
1463 | <?php wp_nonce_field('media-form'); ?> |
1464 |
|
1465 | <?php if ( is_callable($callback) ) { ?> |