marlemiesz/wp-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

marlemiesz/wp-sdk

最新稳定版本:v0.1

Composer 安装命令:

composer require marlemiesz/wp-sdk

包简介

The WP API SDK for PHP is a client library that makes it easy to interact with the WordPress REST API from a PHP application. This SDK provides an easy-to-use interface for sending HTTP requests and handling the responses, and also includes convenient methods for accessing common API endpoints and d

README 文档

README

Require this package in your composer.json and update composer.

"marlemiesz/wp-sdk": "dev-master"

OR

composer require marlemiesz/wp-sdk: dev-master

Docs

Authentication

To use the SDK, you need to create an instance of the Wordpress class and pass it your credentials.

use Marlemiesz\SdkWordpress\Wordpress;
$wp = new Wordpress('http://example.com', 'username', 'password');

Categories

Api Reference: https://developer.wordpress.org/rest-api/reference/categories/

Get all categories

$categories = $wp->getCategories();

Posts

Api Reference: https://developer.wordpress.org/rest-api/reference/posts/

Get all posts

$posts = $wp->getPosts();

Add new post

$post = $wp->addPost(
    'Post title',
    'Post content',
    \Marlemiesz\WpSDK\Enum\PostStatuses::PUBLISH,
    [1, 2, 3],
        )?->getFirstItem();

Update post

$post = $wp->updatePost(
    1,
    'Post title',
    'Post content',
    \Marlemiesz\WpSDK\Enum\PostStatuses::PUBLISH,
    [1, 2, 3],
        )?->getFirstItem();

Delete post

$wp->deletePost(1);

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-02-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固