GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nunopress/silex-wpapi-service-provider: WordPress API Service Provider for Silex

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

Introduction

This is a Service Provider for Silex and added the access to WordPress API websites easy.

Installation

You can simply install with composer:

composer require nunopress/silex-wpapi-service-provider

In your Silex application register the service provider:

$app->register(new NunoPress\Silex\WpApi\Provider\WpApiServiceProvider());

Configuration

You can configure this items inside the container:

wpapi.client

With default the service provider use GuzzleHttp client, but you can use what you want, you need to implement our NunoPress\Silex\WpApi\WpApiClientInterface.

wpapi.client.option

If you use our client you can pass GuzzleHttp options here, most useful for the base_uri instead to use all times the full uri or for the authentication.

Usage

This is our interface for get default WordPress API endpoint's and we added one method for call the Advanced Custom Fields API (you need a WordPress plugin ACF Rest API).

Example for get the first page from pages in order by menu_order and asc:

$wpapi->getItems('pages', 'menu_order', 'asc', 1)

If you want get the Advanced Custom Fields options page you can do it:

$wpapi->getAcf('options')

API

/**
 * @param string $type
 * @param string $orderBy
 * @param string $order
 * @param int $page
 *
 * @return array
*/
public function getItems($type = 'posts', $orderBy = 'menu_order', $order = 'desc', $page = 1)
/**
 * @param string $type
 * @param null|int $id
 *
 * @return array
 */
public function getAcf($type, $id = null)

About

WordPress API Service Provider for Silex

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.