承接 mainstreamct/laravel-wp-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mainstreamct/laravel-wp-api

Composer 安装命令:

composer require mainstreamct/laravel-wp-api

包简介

Laravel package for the Wordpress JSON REST API forked from threesquared then forked from mattwilding, adding support for WP Multisite configs.

README 文档

README

Latest Stable Version

Forked originally from mattwilding/laravel-wp-api

Laravel 6+ package for the Wordpress JSON REST API, with support for MultiSite tenant management automation. Uses multisite-json-api on the WordPress side of things.

Install

Simply add the following line to your composer.json and run install/update:

"mainstreamct/laravel-wp-api": "~2.0"

Configuration

You will need to add the service provider and optionally the facade alias to your config/app.php:

'providers' => array(
  MainstreamCT\WordPressAPI\WordPressAPIServiceProvider::class
)

'aliases' => array(
  'WordPressAPI' => MainstreamCT\WordPressAPI\Facades\WordPressAPI::class
),

And publish the package config files to configure the location of your Wordpress install:

php artisan vendor:publish

Provide the following in your .env file:

  WP_API_ENDPOINT=your_site_name
  WP_API_USERNAME=your_site_admin_username
  WP_API_PASSWORD=your_site_admin_password

Don't forget to re-cache your configuration!

php artisan config:cache

Usage

The package provides a simplified interface to some of the existing api methods documented here. You can either use the Facade provided or inject the MainstreamCT\WordPressAPI\WordPressAPI class.

Getters

Posts

WordPressAPI::getPosts($page);

Pages

WordPressAPI::getPages($page);

Post

WordPressAPI::getPostBySlug($slug);
WordPressAPI::getPostByID($id);

Categories

WordPressAPI::getCategories();

Tags

WordPressAPI::getTags();

Category posts

WordPressAPI::getPostsByCategory($slug, $page);

Author posts

WordPressAPI::getPostsByAuthor($slug, $page);

Tag posts

WordPressAPI::getPostsByTags($tags, $page);

Search

WordPressAPI::searchPosts($query, $page);

Archive

WordPressAPI::getPostsByDate($year, $month, $page);

Other methods

Deploy Multisite tenant

WordPressAPI::deploy($site_name, $blog_title, $email, $password);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固