# Starter Configuration

## General
- Enable plugins needed in composer json.
- Copy auth.json.example to auth.json and replace placeholders with your own.
- Replace PROJECT_ACRONYM by the project's acronym: A project named "Project Acronym" has "pa" as acronym.
- Replace PROJECT_NAME by the project's name: A project named "Project Acronym" has "project-acronym" as name.
- Rename the theme ddev-bedrock-starter for what you need (the project acronym for example)

## Environment file sample
```php
DB_NAME='db'
DB_USER='db'
DB_PASSWORD='db'

# Optionally, you can use a data source name (DSN)
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'

# Optional database variables
DB_HOST='db'
DB_PREFIX='PROJECT_ACRONYM_'

WP_ENV='development'
WP_HOME="${DDEV_PRIMARY_URL}"
WP_SITEURL="${WP_HOME}/wp"
WP_POST_REVISIONS=2

# Specify optional debug.log path
# WP_DEBUG_LOG='/path/to/debug.log'

# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='XXXX'
SECURE_AUTH_KEY='XXXX'
LOGGED_IN_KEY='XXXX'
NONCE_KEY='XXXX'
AUTH_SALT='XXXX'
SECURE_AUTH_SALT='XXXX'
LOGGED_IN_SALT='XXXX'
NONCE_SALT='XXXX'

# WPML
WPML_USER_ID=XXXXXX
WPML_SUBSCRIPTION_KEY=XXXXXX
```

## Admin
A configuration option page is created here with:
- Google Recaptcha settings
- Mailjet SMTP settings
- Admin Notification settings

A basic toolbar for ACF WYSIWYG field is created.

Custom admin columns are defined to have clean and specific admin tables for each Custom Post Types with sorter feature.

## Exports
A contact requests export exist and could be override or duplicate for your own CPT export.

## Mailing
- Some mailing functions exist in app/mailing.php file
- a demo email for contact admin notification exists in resources/emails
  - a MJML template
  - a TXT template
  - a HTML file exported from MJML version
- Images for emails live in resources/emails/images like the demo logo.png used in contact admin notification

## Custom Post Types
A contact_request post type is created here

## Ajax
Some methods to save contact request from a front form

## Archive Page System
A system to create an archive page using WordPress page for any Custom Post Type

## Attachments file to hide in media
Sometimes users can upload files from a front form but we don't want to show thoses files in the Media Administration.
- uncomment lines 158 to 229
- replace line 212 CPT_NAME by the CPT concerned
- add any CPT using a file uploaded by user
When a file is uploaded by users, the taxonomy `hidden_attachment_taxonomy` is added to the media and won't show up in the Media Administration.

## WPML
If you need WPML: 
- uncomment the line in composer.json to require the package.
- add configuration in .env file:
```
# WPML
WPML_USER_ID=XXXXXX
WPML_SUBSCRIPTION_KEY=XXXXXX
```

## Favicons
- relace all favicons in resources/images/favicon

## Images Sizes
Define the differents images sizes used in the theme to add them with the WP add_image_size function.
This could be done in app/setup.php file:
- line 197 `$w_sizes` : image with a specific width, height is defined by ratio.
- line 198 `$h_sizes` : image with a specific height, width is defined by ratio.
- line 199 `$square_sizes` : image with a specific width/height, the image will be cropped if needed.

## Helpers
Some helpers functions are defined in app/helpers.php file.

## Filters
Some filters are defined in app/filters.php file.

<p align="center">
  <a href="https://roots.io/bedrock/">
    <img alt="Bedrock" src="https://cdn.roots.io/app/uploads/logo-bedrock.svg" height="100">
  </a>
</p>

<p align="center">
  <a href="https://packagist.org/packages/roots/bedrock">
    <img alt="Packagist Installs" src="https://img.shields.io/packagist/dt/roots/bedrock?label=projects%20created&colorB=2b3072&colorA=525ddc&style=flat-square">
  </a>

  <a href="https://packagist.org/packages/roots/wordpress">
    <img alt="roots/wordpress Packagist Downloads" src="https://img.shields.io/packagist/dt/roots/wordpress?label=roots%2Fwordpress%20downloads&logo=roots&logoColor=white&colorB=2b3072&colorA=525ddc&style=flat-square">
  </a>
  
  <img src="https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/roots/bedrock/master/composer.json&label=wordpress&logo=roots&logoColor=white&query=$.require[%22roots/wordpress%22]&colorB=2b3072&colorA=525ddc&style=flat-square">

  <a href="https://github.com/roots/bedrock/actions/workflows/ci.yml">
    <img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/roots/bedrock/ci.yml?branch=master&logo=github&label=CI&style=flat-square">
  </a>

  <a href="https://twitter.com/rootswp">
    <img alt="Follow Roots" src="https://img.shields.io/badge/follow%20@rootswp-1da1f2?logo=twitter&logoColor=ffffff&message=&style=flat-square">
  </a>
</p>

<p align="center">WordPress boilerplate with Composer, easier configuration, and an improved folder structure</p>

<p align="center">
  <a href="https://roots.io/bedrock/">Website</a> &nbsp;&nbsp; <a href="https://roots.io/bedrock/docs/installation/">Documentation</a> &nbsp;&nbsp; <a href="https://github.com/roots/bedrock/releases">Releases</a> &nbsp;&nbsp; <a href="https://discourse.roots.io/">Community</a>
</p>

## Sponsors

Bedrock is an open source project and completely free to use. If you've benefited from our projects and would like to support our future endeavors, please consider [sponsoring Roots](https://github.com/sponsors/roots).

<div align="center">
<a href="https://carrot.com/"><img src="https://cdn.roots.io/app/uploads/carrot.svg" alt="Carrot" width="120" height="90"></a> <a href="https://wordpress.com/"><img src="https://cdn.roots.io/app/uploads/wordpress.svg" alt="WordPress.com" width="120" height="90"></a> <a href="https://worksitesafety.ca/careers/"><img src="https://cdn.roots.io/app/uploads/worksite-safety.svg" alt="Worksite Safety" width="120" height="90"></a> <a href="https://www.itineris.co.uk/"><img src="https://cdn.roots.io/app/uploads/itineris.svg" alt="Itineris" width="120" height="90"></a> <a href="https://bonsai.so/"><img src="https://cdn.roots.io/app/uploads/bonsai.svg" alt="Bonsai" width="120" height="90"></a> <a href="https://fusepress.co/sp/sign-up/"><img src="https://cdn.roots.io/app/uploads/fusepress.svg" alt="FusePress" width="120" height="90"></a>
</div>

## Overview

Bedrock is a WordPress boilerplate for developers that want to manage their projects with Git and Composer. Much of the philosophy behind Bedrock is inspired by the [Twelve-Factor App](http://12factor.net/) methodology, including the [WordPress specific version](https://roots.io/twelve-factor-wordpress/).

- Better folder structure
- Dependency management with [Composer](https://getcomposer.org)
- Easy WordPress configuration with environment specific files
- Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv)
- Autoloader for mu-plugins (use regular plugins as mu-plugins)
- Enhanced security (separated web root and secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt))

## Getting Started

See the [Bedrock installation documentation](https://roots.io/bedrock/docs/installation/).

## Stay Connected

- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
- Participate on [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Read the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/newsletter/)
