前言介紹
- 這款 WordPress 外掛「Copypress Rest API」是 2025-04-07 上架。
- 目前有 60 個安裝啟用數。
- 上一次更新是 2025-04-17,距離現在已有 16 天。
- 外掛最低要求 WordPress 6.4 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 7.3 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
tags | posts | rest-api | categories | image upload |
內容簡介
總結:「COPYPRESS REST API 外掛擴展了 WordPress REST API,提供自訂端點來管理文章、分類、標籤、文章類型以及分類法。」
問題與答案:
1. COPYPRESS REST API 外掛提供了哪些功能?
- 可以透過 REST API 創建、更新和刪除文章。
- 可以擷取分類、標籤、文章類型和分類法。
- 支援 CORS(跨源資源共享),允許從不同來源進行 API 請求。
- 可以透過 URL 附加圖像到文章中。
2. 可以透過哪些端點進行操作?
- POST /copypress-api/v1/posts:創建一篇新文章。
- PUT /copypress-api/v1/posts/{id}:更新現有文章。
- DELETE /copypress-api/v1/posts/{id}:刪除文章。
- GET /copypress-api/v1/categories:獲取所有分類。
- GET /copypress-api/v1/tags:獲取所有標籤。
- GET /copypress-api/v1/post-types:獲取所有公共文章類型。
- GET /copypress-api/v1/get-taxonomies/{post_type}:獲取與特定文章類型相關的所有分類法和標籤。
3. COPYPRESS REST API 外掛支援哪些 HTTP 方法和標頭?
- 允許的方法:GET、POST、PUT、DELETE。
- 允許的標頭:Content-Type、X-Custom-Header、x-csrf-token、Authorization。
4. 該外掛的使用方式是什麼?
- 啟用外掛後,可以使用自訂 API 路由與文章、分類、標籤、文章類型和分類法進行互動。可以從任何可以與 REST API 互動的外部應用程式或客戶端對相應端點進行請求。
原文外掛簡介
The COPYPRESS REST API plugin extends the WordPress REST API with custom endpoints for managing posts, categories, tags, post types, and taxonomies.
Features
Create, update, and delete posts via REST API.
Fetch categories, tags, post types, and taxonomies.
Supports CORS (Cross-Origin Resource Sharing) for making API requests from different origins.
Allows attaching images to posts via URLs.
Endpoints
/copypress-api/v1/login – Login with username and password to get a JWT token.
Request Body:
username (string): WordPress username
password (string): WordPress password
POST /copypress-api/v1/posts – Create a new post.
Request Body:
title (string): The title of the post.
content (string): The content of the post.
excerpt (string, optional): The excerpt of the post.
category (int, optional): The category ID of the post.
tags (string, optional): Comma-separated list of tag slugs.
image (string, optional): URL of an image to be set as the post’s featured image.
post_type (string, optional): The post type (default: post).
author_id (int, optional): The ID of the post author (default: current user).
post_status (string): Post publish status.
Response: Success message, HTTP status code, and created post object.
PUT /copypress-api/v1/posts/{id} – Update an existing post.
Request Body: Same as POST endpoint.
Response: Success message, HTTP status code, and updated post object.
DELETE /copypress-api/v1/posts/{id} – Delete a post.
Response: Success message and HTTP status code.
GET /copypress-api/v1/categories – Get all categories.
Response: Category ID, name, and slug.
GET /copypress-api/v1/tags – Get all tags.
Response: Tag ID, name, and slug.
GET /copypress-api/v1/post-types – Get all public post types.
Response: Post type name and label.
GET /copypress-api/v1/get-taxonomies/{post_type} – Get all taxonomies (categories and tags) associated with a specific post type.
Response: List of categories (hierarchical taxonomies) and tags (non-hierarchical taxonomies).
CORS Support
This plugin allows cross-origin requests for all the REST API endpoints, enabling requests from different domains.
Allowed Methods:
GET, POST, PUT, DELETE
Allowed Headers:
Content-Type, X-Custom-Header, x-csrf-token, Authorization
Allowed Origin:
* (Any domain)
Usage
Once the plugin is activated, the custom API routes are available for interaction with posts, categories, tags, post types, and taxonomies. You can make requests to the respective endpoints from any external application or client that can interact with REST APIs. To create or update posts, a valid JWT token must be provided in the Authorization header as:
Authorization: Bearer YOUR_TOKEN_HERE
License
This plugin is licensed under the GPLv2 license.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Copypress Rest API」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
WP Shortcodes Plugin — Shortcodes Ultimate 》Shortcodes Ultimate 是一個全面的視覺與功能性元素收集,您可以在文章編輯器、文字小工具甚至是範本檔案中使用。使用 Shortcodes Ultimate,您可以輕鬆地建...。
Post Duplicator 》這個外掛是用來製作選定文章的完全一模一樣複製。它支援自訂文章類型、自訂分類和自訂欄位。, *注意: 評論不會被複製到新文章。, 這個外掛的目的是為了快速且...。
GenerateBlocks 》將不同的功能整合至編輯器,但並不會因為過多的一維方塊造成內容過於臃腫。使用 GenerateBlocks,您只需深入學習少量的方塊,即可用於創建任何內容。, Genera...。
YARPP – Yet Another Related Posts Plugin 》WordPress 相關文章外掛, Yet Another Related Posts Plugin (YARPP) 是一個經過專業維護、高度自訂和功能豐富的外掛程式,可以顯示與當前文章相關的頁面、文...。
WP Meta and Date Remover 》移除點擊文章的Meta、作者和日期。 安裝、啟用,完成!, 如何移除文章和頁面的作者Meta和日期?, , 安裝 WP Meta and Date remover。, 啟用外掛。, 選擇隱藏...。
WordPress Popular Posts 》WordPress Popular Posts 是一個高度可定製的小工具,可以顯示您最受歡迎的文章。, 主要特點, , 多小工具功能 – 您可以在您的博客上擁有多個 WordPress...。
Public Post Preview 》此外掛可讓您分享一個鏈接給匿名使用者,以便他們在發布前預覽文章(或其他公開文章類型)。, 您是否曾經與沒有訪問您網站權限的人共同撰寫文章,並需要給予...。
List category posts 》List Category Posts 可以讓你透過使用 [catlist] 短碼在文章或頁面中按類別列出文章。在編輯頁面或文章時,直接插入短碼到文章中,文章就會被列出來。基本的...。
Display Posts – Easy lists, grids, navigation, and more 》Display Posts 讓您輕鬆地列出網站上的所有內容。首先在內容編輯器中新增此短碼,以列出最近的文章清單:, [display-posts], , 按類別篩選, 若只想顯示特定類...。
CMS Tree Page View 》將所有頁面和自訂文章以 CMS 樹狀概覽方式添加到 WordPress,類似於專注於頁面的 CMS 中經常找到的檢視方式。, 如果您的目標是將多個內容類型合併到單一檢視...。
Category Posts Widget 》Category Posts Widget是一個輕巧的小工具,設計用於一件事並且做得很好:顯示特定類別中最新的文章。, 基於詞語和類別的文章小工具, 這個免費小工具的高級版...。
WP Telegram (Auto Post and Notifications) 》完美整合 Telegram 至 WordPress,讓您完全掌握控制。, Telegram 的卓越 LIVER 支援, 加入聊天室, 我們在 Telegram 上有一個公開小組,提供協助設置外掛、討...。
WP Admin UI Customize 》, 儀表板, 顯示選項標籤, 輸出 - 元網站, 管理工具列 (Toolbar), 側邊選單 (Side menu), 元箱的管理, 登入畫面, 其他功能, , 這些自訂化都是可以實現的。, , ...。
Ultimate Post Kit Addons For Elementor – (Post Grid, Post Carousel, Post Slider, Category List, Post Tabs, Timeline, Post Ticker and Tag Cloud) 》Ultimate Post Kit Elementor 外掛程式是首個允許您全新且清新地設計部落格網站的外掛程式。這是博客作者、行銷人員和文章類型網站擁有者的最佳工具。, Ultim...。
Reading Time WP 》WP Reading Time 讓你輕鬆地在 WordPress 文章中加入預估閱讀時間。啟用這個外掛會自動在你的文章內容的開始加入閱讀時間。你可以在「閱讀時間」設定中取消這...。