REST API blocks
A simple plugin to add block data in json format into the rest api. Once installed, there will be two new fields added to the rest api, has_blocks and blocks. For example output. "has_blocks": true, "block_data": [ { "blockName": "core/image", "attrs": { "url": "https://www.spacedmonkey.com/wp-content/uploads/2018/12/test-image.jpg", "alt": "Terminal de aeropuerto", "caption": "fsfsdfdsfdssfd", "href": "https://www.spacedmonkey.com/test-image", "rel": "noreferrer noopener", "linkClass": "jonny-123", "linkTarget": "_blank", "id": 147355, "width": 582, "height": 327, "linkDestination": "attachment" }, "innerBlocks": [ ], "innerHTML": "\n fsfsdfdsfdssfd \n", "innerContent": [ "\n fsfsdfdsfdssfd \n" ], "rendered": "\n fsfsdfdsfdssfd \n" } ], Technical Notes Requires PHP 5.6+. Requires WordPress 5.5+. Issues and Pull requests welcome on the GitHub repository: https://github.com/spacedmonkey/wp-rest-blocks Development This plugin uses @wordpress/env for local development and testing. Prerequisites Node.js 20+ and npm Docker Desktop (must be installed and running) Setup Clone the repository Install dependencies: bash npm install composer install Start the WordPress environment: bash npm run env:start This will start a local WordPress instance at http://localhost:8888 (admin: http://localhost:8888/wp-admin with username admin and password password) Note: Docker must be running for this to work. The first time you run this, it will download WordPress and set up the database, which may take a few minutes. Available Commands npm run env:start – Start the WordPress environment npm run env:stop – Stop the WordPress environment npm run env:reset – Reset the environment (clean database) npm run env:destroy – Destroy the environment completely npm run test:php – Run PHPUnit tests npm run test:php:multisite – Run PHPUnit tests in multisite mode npm run lint:php – Run PHP CodeSniffer npm run lint:php:fix – Fix PHP coding standards issues automatically Running Tests After starting the environment with npm run env:start, you can run the tests: `bash npm run test:php ` For multisite tests: `bash npm run test:php:multisite ` Accessing the Site Development site: http://localhost:8888 Admin dashboard: http://localhost:8888/wp-admin (admin/password) Test site: http://localhost:8889 Test admin: http://localhost:8889/wp-admin (admin/password)
WPGet API – Connect to any external REST API
Connect WordPress to external APIs, without code. Easily send data to any API and get data from unlimited 3rd party REST APIs. Format and display the returned data on your WordPress website using a shortcode or a template tag. WPGet API supports virtually all authentication methods including API keys, bearer tokens, basic auth, username/password and OAuth 2.0 authorization. Live Examples View our live examples of connecting to several different APIs and displaying the data in various unique ways including charts, graphs, tables and weather forecasts. LIVE EXAMPLES – Connecting WordPress to external APIs Major Features Connect your WordPress website to any REST API Unlimited APIs & endpoints No coding required Display API data using a template tag or shortcode GET, POST, PUT, PATCH & DELETE methods Add query string, header & body parameters Documentation We have tons of articles and help available. Quick Start Guide Step by Step Example Frequently Asked Questions Will this work with my API? Extending WPGet API PRO Plugin The PRO Plugin provides many extra features that allow you to do some more advanced things with your APIs. Features of the PRO Plugin include: Actions – automate your API when an action happens on your site Tokens – grab dynamic data without code and send to your API Dynamic variables – a PHP solution for grabbing dynamic values Chain API calls Cache API calls Format API data into HTML Retrieve nested data Base64 encoded auth XML format API to Posts Plugin The API to Posts Plugin allows you to import API data and create WooCommerce products or custom posts from this API data. Features of the API to Posts Plugin include: Import API data Import from unlimited endpoints Map API data to WordPress fields Supports custom fields, ACF, tags, categories, custom taxonomies, images and more Supports all standard WooCommerce fields Create WooCommerce products from API data Sync API to WooCommerce products & posts Set interval of sync from every minutes up to once a week OAuth 2.0 Authorization The OAuth 2.0 Authorization plugin allows authorization of your API through the OAuth 2.0 method. WPGet API Integrations WPGet API integrates extremely well with other WordPress plugins, allowing you to do some very cool things with your API. Click the links below for more info on these integrations. WooCommerce to API WooCommerce API Product Sync Contact Form 7 send data to API WPForms send data to API Gravity Forms send data to API Charts & Tables from API data using wpDataTables Translating WPGet API You can translate WPGet API into your own language on translate.wordpress.org Here is an article to help get started with translations