How to use wordpress functions in an ajax call

前端 未结 3 1429
既然无缘
既然无缘 2020-12-24 09:02

I wanted to know if there is a way to use function like query_post() in an ajax call ?

Let\'s say i\'m calling the file _inc/ajax.php

I want to be abble to

3条回答
  •  难免孤独
    2020-12-24 09:47

    I highly recommend the JSON API plugin: http://wordpress.org/extend/plugins/json-api/. It provides a RESTful interface for the most common WordPress functions including query_post and allows you to add your own actions.

提交回复
热议问题