• hi everyone,

    i’am currently workin on a theme/plugin bundle that will allow to assign teaser images to posts. teaser images will be displayed in the frontend. for better usability i added a new box under the richtexteditor in the admin area. opening the box will display an ajax filebrowser displaying all uploaded images. by clicking on an image you can assign it to the post.

    as mechanism to save the name of the assigned teaser image, i use the custom fields wich are ideal for such purposes. but currently everything is a bit sloppy. for illustration, here the js code that is executed if you select a teaser image.


    wpx_teaser_FileBrowser.fileCallback=function(file){
    $('metakeyinput').value="teaser";
    $('metavalue').value=file;
    $('post').submit();
    }

    So far it works. But the edit view is allways closed and if unsaved data exists it will be lost.

    I discovered that there is some kind of ajax api calling the ajax-admin.php file but i couldnt find any documentation. It would be great a posts teaser image without reloading the page.

    If someone would give a hint i would be thankfull ??

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘ajax api to add custom fields’ is closed to new replies.