| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' ); |
| 3 |
|
| 4 |
/* |
| 5 |
* Add "Imagify" column in the Media Uploader |
| 6 |
* |
| 7 |
* @since 1.2 |
| 8 |
*/ |
| 9 |
add_filter( 'attachment_fields_to_edit', '_imagify_attachment_fields_to_edit', PHP_INT_MAX, 2 ); |
| 10 |
function _imagify_attachment_fields_to_edit( $form_fields, $post ) { |
| 11 |
global $pagenow; |
| 12 |
if ( 'post.php' == $pagenow ) { |
| 13 |
return $form_fields; |
| 14 |
} |
| 15 |
|
| 16 |
$form_fields['imagify'] = array( |
| 17 |
'label' => 'Imagify', |
| 18 |
'input' => 'html', |
| 19 |
'html' => get_imagify_media_column_content( $post->ID ), |
| 20 |
'show_in_edit' => true, |
| 21 |
'show_in_modal' => true, |
| 22 |
); |
| 23 |
|
| 24 |
return $form_fields; |
| 25 |
} |