Download the PHP package moxie-lean/wp-endpoints-post without Composer

On this page you can find all versions of the php package moxie-lean/wp-endpoints-post. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-endpoints-post

WP Endpoints: View

This package is depreciated. LEAN now uses the WordPress REST API plugins instead

Generic but customisable view endpoint to expose our content via WP-API. This extension will create an endpoint (at by default) which returns all the data required by a front-end app to render a view.

The endpoint takes a slug parameter (e.g. ) and returns the following data for a single post:

Note: currently it just works for single posts (including pages and cpt's). We need to consider the best solution for other types of views, such as archive pages.

Getting Started

The easiest way to install this package is by using composer from your terminal:

Or by adding the following lines on your composer.json file

This will download the files from the packagist site and set you up with the latest version located on master branch of the repository.

After that you can include the autoload.php file in order to be able to autoload the class during the object creation.

Finally you need to initialise the endpoint by adding this to your code:

Usage

The extension has a number of filters which can be used to customised the output. In addition it does some useful extra manipulation of ACF data to make it more useful to a front-end app.

Filters

Common parameters passed by many filers are:

ln_endpoints_api_namespace

Customise the API namespace ('leean' in )

ln_endpoints_api_version

Customise the API version ('v1' in )

ln_endpoints_query_args

Customise the query args before the post is queried using WP_Query. $request is the WP_REST_Request object received by endpoint handler.

ln_endpoints_data

Customise the results just before they are sent.

On the previous two filters {endpoint} is the name of your endpoint in this case is post, so for example ln_endpoints_data_post is the name of the filter you should use to filter the data.

ln_endpoints_acf

Customise the value of an ACF field.

ln_endpoints_acf_image_size

Set the image size to use. Only activated for image fields whose return format is set to 'id'. Note that $sub_field is only used for images within repeaters.

ln_endpoints_acf_repeater_as_array

Whether to return a repeater as an array. Only activated for repeater fields with exactly one value.

ACF Manipulations

Posts

Activated when the ACF field type is 'Post Object' and the return format is 'id'. Gets all the content for the post (including its ACF fields). If the 'select multiple values' option is set, then it returns an array of post data.

Images

Activated when the ACF field type is 'Image' and the return format is 'id'. The image size must be set using the filter. Returns the image url, width, height and alt.

Repeaters

Activated when the ACF field type is 'Repeater' and there is exactly one item. It passes a filter, which returns an object instead of an array if false.


All versions of wp-endpoints-post with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
moxie-lean/wp-acf Version 1.*.*
moxie-lean/wp-endpoint Version 1.*.*
moxie-lean/wp-utils Version 1.*.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moxie-lean/wp-endpoints-post contains the following files

Loading the files please wait ....