In previous version i set a new check field into the media window with a simple code
function ab_prettyphoto_attachment_fields_to_edit( $form_fields, $post ) {
$my_form_fields = array(
'ab_prettyphoto' => array(
'label' => __('Automatic Zoom on click', 'ab_prettyphoto'),
'input' => 'html',
'html' => "
<input type="checkbox" name="ab_prettyphoto-{$post->ID}" id='ab_prettyphoto-{$post->ID}' value="1" />
<label for="ab_prettyphoto-{$post->ID}">" . __('Enable zoom', 'ab_prettyphoto') . "</label>" )
);
if( $post->post_mime_type == 'image/jpeg' OR $post->post_mime_type == 'image/gif' OR $post->post_mime_type == 'image/png' OR $post->post_mime_type == 'image/tiff')
return array_merge( $form_fields, $my_form_fields );
else
return $form_fields;
}
add_filter( 'attachment_fields_to_edit', 'ab_prettyphoto_attachment_fields_to_edit', 100, 2 );
And i send to the editor the value of the check with
function ab_prettyphoto_send_to_editor( $html, $send_id, $attachment ) {
if( isset($_POST["ab_prettyphoto-$send_id"]) )
$title=($_POST['attachments'][$send_id]['post_title']);
return str_replace('<a', '<a rel="prettyPhoto-img" title="'.$title.'"', $html);
}
else
return $html;
}
add_filter( 'media_send_to_editor', 'ab_prettyphoto_send_to_editor', 66, 3 );
In the new WP35 the attachment_fields_to_edit work, but the media_send_to_editor not: into the $_POST array the key “ab_prettyphoto-$send_id” not exists and i have see with Firebug a wp-ajax.php call when i click on the checkbox.
The values of $_SPOST array into the ab_prettyphoto_send_to_editor function (launched by media_send_editor) are (the value as for example)
Array
(
[nonce] => 125ece740a
[attachment] => Array
(
[id] => 4
[post_content] =>
[post_excerpt] =>
[url] => http://localhost:8888/wpn/wp-content/uploads/2012/12/fotohome.jpg
[align] => left
[image-size] => thumbnail
[image_alt] => fotohome
)
=> <a href=\"http://localhost:8888/wpn/wp-content/uploads/2012/1/fotohome.jpg\"><img src width=\"150\" height=\"150\" alt=\"fotohome\" class=\"wp-image-4 alignleft size-thumbnail\" /></a>
[post_id] => 1
[action] => send-attachment-to-editor
)
The $_POST[ab_pretthyphoto….] is not send
I have found some docs into the web about the problem but i have not f