
內容簡介
此外掛可以自動將 WordPress REST API 的文章(/wp-json/wp/v2/posts)或頁面(/wp-json/wp/v2/pages) POST 中的 meta 欄位所包含的元數據自動存儲於建立的頁面或文章相關聯的元數據中,使用 update_post_meta 函式。在 REST POST 中傳送的鍵/值資訊存儲於 both ‘key’ and ‘_key’,以支援不同的外掛格式。
例如,如果嘗試在使用 REST API 建立頁面時動態設置 YOAST SEO 外掛值,只需將這些欄位添加到 REST POST 資料的 meta 欄位中,然後外掛值將被添加到頁面中:
{
...
'meta': {
'yoast_wpseo_title': "從 REST 呼叫中設定標題"
'yoast_wpseo_metadesc': "從 REST 呼叫中設置的元描述"
}
...
}
使用此外掛程式在 WordPress REST API 動態建立頁面時,以支援修改使用 REST API 建立的頁面/文章外掛程式設定!
有關如何使用此外掛程式從 REST API 生成已配置外掛程式的頁面/文章的指南在 Pericror 可用。
於 WordPress REST API版本2 套用。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Automatically stores the meta data from the meta field of a wordpress REST API posts (/wp-json/wp/v2/posts) or pages (/wp-json/wp/v2/pages) POST in the meta data associated with the created page or post using update_post_meta. The key / value information sent in the REST POST ‘meta’ object field is stored as both ‘key’ and ‘_key’ to support different plugin formats.
For example, if trying to set the YOAST SEO Plugin values dynamically when creating a page from the REST API, you would simply add the fields to the meta field of the REST POST data when you POST the endpoint, and the plugin values will be added to the page:
{
...
'meta': {
'yoast_wpseo_title': "Title set from REST call"
'yoast_wpseo_metadesc': "Meta description set from REST call"
}
...
}
Use this plugin when dynamically creating pages with the WordPress REST API to support modifying plugin settings for pages/posts created using the REST API!
A guide on how to use this plugin to generate a page/post with plugins configured from the REST API is available at Pericror.
Inspired as a broader alternative to wp-api-yoast-meta.
Compatible with the wordpress rest api version 2.
