I am trying to save some pictures to the wordpress database within a plugin I am developing (with the help of a tutorial - when I attempt to save my 'slider' post type, I am presented with the following screen:
This is the code..
add_action('save_post', 'fwds_save_slider_info');
function fwds_save_slider_info($post_id) {
// verify nonce
if (isset($_POST['fwds_slider_box_nonce']) && !wp_verify_nonce( $_POST['fwds_slider_box_nonce'], basename(__FILE__) )) {
return $post_id;
}
// check autosave
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return $post_id;
}
// check permissions
if ('slidesjs_slider' == isset($_POST['post_type']) && current_user_can('edit_post', $post_id)) {
/* Save Slider Images */
print_r($_POST['gallery_img']);exit;
$gallery_images = (isset($_POST['gallery_img']) ? $_POST['gallery_img'] : '');
$gallery_images = strip_tags(json_encode($gallery_images));
update_post_meta($post_id, "_fwds_gallery_images", $gallery_images);
} else {
return $post_id;
}
}
When i go back and view the sliders I save, the images disappear; what am I doing wrong here?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire