WordPress.org

Ready to get started?Download WordPress

Forums

ajax api to add custom fields (2 posts)

  1. beny_mcde
    Member
    Posted 6 years ago #

    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 ;)

  2. beny_mcde
    Member
    Posted 6 years ago #

    anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic