Skip to content
This repository was archived by the owner on Jun 28, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## 3.0.0

Upgrade to WordPress 6.0.0 and PHP 8.0

## < 3.0.0

Check our Wiki for all features.
111 changes: 91 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

A highly opinionated WordPress Pro scaffold. It includes:

- Dependency management via [Composer](https://getcomposer.org/)
- [Twig](https://twig.symfony.com/) templates via [Timber](https://github.com/timber/timber/)
- Front-end tooling using [@grrr/gulpfile](https://github.com/grrr-amsterdam/gulpfile/)
- Application deployments via [Capistrano](https://github.com/capistrano/capistrano)
- Static site generation and deployments via [Simply Static Deploy](https://github.com/grrr-amsterdam/simply-static-deploy)
- Advanced [ACF](https://www.advancedcustomfields.com/) integrations
- Dependency management via [Composer](https://getcomposer.org/)
- [Twig](https://twig.symfony.com/) templates via [Timber](https://github.com/timber/timber/)
- Front-end tooling using [@grrr/gulpfile](https://github.com/grrr-amsterdam/gulpfile/)
- Application deployments via [Capistrano](https://github.com/capistrano/capistrano)
- Static site generation and deployments via [Simply Static Deploy](https://github.com/grrr-amsterdam/simply-static-deploy)
- Advanced [ACF](https://www.advancedcustomfields.com/) integrations

## Developed with ❤️ by [GRRR](https://grrr.nl)

- GRRR is a [B Corp](https://grrr.nl/en/b-corp/)
- GRRR has a [tech blog](https://grrr.tech/)
- GRRR is [hiring](https://grrr.nl/en/jobs/)
- [@GRRRTech](https://twitter.com/grrrtech) tweets
- GRRR is a [B Corp](https://grrr.nl/en/b-corp/)
- GRRR has a [tech blog](https://grrr.tech/)
- GRRR is [hiring](https://grrr.nl/en/jobs/)
- [@GRRRTech](https://twitter.com/grrrtech) tweets

## Requirements

- PHP 7.1+ with Composer
- Node 8+ with Yarn (front-end tooling)
- Ruby 2.2+ with Bundler (deploying)
- PHP 7.1+ with Composer
- Node 8+ with Yarn (front-end tooling)
- Ruby 2.2+ with Bundler (deploying)

View the [prerequisites](https://github.com/grrr-amsterdam/wordpress-scaffold/wiki/Prerequisites) in the wiki for more details.

Expand All @@ -44,17 +44,88 @@ This will trigger an interactive shell, which will prompt you with questions. Th

[View the wiki](https://github.com/grrr-amsterdam/wordpress-scaffold/wiki) for more instructions, usage examples and conventions.

# Using WordPress headless including Advanced Custom Fields (ACF)

<!-- @TODO This should be added to the Wiki (Github) -->

## Why not using GraphQL

[Explain that we organically moved to some standards from a different approach.]

## Using the WordPress REST API

With the [WordPress REST API Handbook](https://developer.wordpress.org/rest-api/) and the [WordPress REST API Reference](https://developer.wordpress.org/rest-api/reference/) as your guidance, here is a nice summary.

### Pages

Retrieve a collection of pages [(reference)](https://developer.wordpress.org/rest-api/reference/pages/#list-pages)

```
/wp-json/wp/v2/pages
```

Retrieve a single page [(reference)](https://developer.wordpress.org/rest-api/reference/pages/#retrieve-a-page)

```
/wp-json/wp/v2/pages/<id>
```

### Posts

Retrieve a collection of posts [(reference)](https://developer.wordpress.org/rest-api/reference/posts/#list-posts)

```
/wp-json/wp/v2/posts
```

Retrieve a single page [(reference)](https://developer.wordpress.org/rest-api/reference/posts/#retrieve-a-post)

```
/wp-json/wp/v2/posts/<id>
```

### Endpoint for custom post types

When registering the custom post type you should specify that it should be able to appear in the WordPress REST API.
You can do this by setting the `show_in_rest` argument on `true`.

**important** Don't forget to also set the `rest_base` argument to the plural form when you want to adhere to the JSON API standard.

example

```
'post_type' => 'example',
'show_in_rest' => true,
'rest_base' => 'examples',
```

### Advanced Custom Fields

You must enable a field group to have it been exposed by the api. You can find this setting within a field group's settings.

[[https://github.com/USERNAME/REPOSITORY/blob/upgrade/img/enable-acf-in-rest-api.png|alt="Enable ACF in rest api"]]

### Menus

### Multilingual using Polylang

## Next steps

---

This scaffold is inspired by:

- [roots/bedrock](https://github.com/roots/bedrock/)
- [roots/bedrock-capistrano](https://github.com/roots/bedrock-capistrano/)
- [roots/sage](https://github.com/roots/sage/)
- [roots/bedrock](https://github.com/roots/bedrock/)
- [roots/bedrock-capistrano](https://github.com/roots/bedrock-capistrano/)
- [roots/sage](https://github.com/roots/sage/)

The scaffold and theme rely heavily on:

- [timber/timber](https://github.com/timber/timber/)
- [@grrr/gulpfile](https://github.com/grrr-amsterdam/gulpfile/)
- [@grrr/hansel](https://github.com/grrr-amsterdam/hansel/)
- [@grrr/utils](https://github.com/grrr-amsterdam/grrr-utils/)
- [timber/timber](https://github.com/timber/timber/)
- [@grrr/gulpfile](https://github.com/grrr-amsterdam/gulpfile/)
- [@grrr/hansel](https://github.com/grrr-amsterdam/hansel/)
- [@grrr/utils](https://github.com/grrr-amsterdam/grrr-utils/)

```

```
47 changes: 29 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@
],
"config": {
"platform": {
"php": "7.1"
"php": "8.0"
},
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"johnpbloch/wordpress-core-installer": true,
"wikimedia/composer-merge-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -37,37 +42,37 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.4",
"composer/installers": "^1.2.0",
"drewm/mailchimp-api": "^2.5",
"grrr-amsterdam/garp-functional": "^4.0",
"grrr-amsterdam/garp-functional": "^5.0",
"grrr-amsterdam/simply-static": "^3.0",
"grrr-amsterdam/simply-static-deploy": "^1.0",
"johnpbloch/wordpress": "^5.0.0",
"grrr-amsterdam/simply-static-deploy": "dev-feature/php80",
"johnpbloch/wordpress": "6.0.*",
"oscarotero/env": "^2.0",
"roots/soil": "^3.7",
"roots/soil": "^4.0",
"roots/wp-password-bcrypt": "^1.0.0",
"sentry/sdk": "^2.0",
"spatie/schema-org": "^2.7",
"sentry/sdk": "^3.0",
"spatie/schema-org": "^3.0",
"vlucas/phpdotenv": "^4.0.0",
"wikimedia/composer-merge-plugin": "^1.4",
"wpackagist-plugin/acf-content-analysis-for-yoast-seo": "^2.0",
"wikimedia/composer-merge-plugin": "v2.0.*",
"wpackagist-plugin/acf-content-analysis-for-yoast-seo": "^3.0",
"wpackagist-plugin/admin-menu-editor": "^1.6",
"wpackagist-plugin/amazon-s3-and-cloudfront": "^2.0",
"wpackagist-plugin/better-search-replace": "^1.3",
"wpackagist-plugin/classic-editor": "^1.3",
"wpackagist-plugin/safe-svg": "^1.9",
"wpackagist-plugin/safe-svg": "^2.0",
"wpackagist-plugin/timber-library": "^1.8",
"wpackagist-plugin/wordpress-seo": "^14.0",
"wpackagist-plugin/wordpress-seo": "^19.0",
"wpackagist-plugin/wp-ses": "^1.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0",
"wp-cli/wp-cli-bundle": "^2.3"
"wp-cli/wp-cli-bundle": "^2.0"
},
"autoload": {
"psr-4": {
"Grrr\\Root\\" : "lib/"
"Grrr\\Root\\": "lib/"
}
},
"extra": {
Expand All @@ -84,9 +89,15 @@
"merge-scripts": false
},
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
"web/app/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
],
"web/app/plugins/{$name}/": [
"type:wordpress-plugin"
],
"web/app/themes/{$name}/": [
"type:wordpress-theme"
]
},
"wordpress-install-dir": "web/wp"
},
Expand Down
Loading