Skip to content

Commit

Permalink
Release (#618)
Browse files Browse the repository at this point in the history
<!--
Filling out this template is required. Any PR that does not include
enough information to be reviewed may be closed at a maintainers'
discretion. All new code requires documentation and tests to ensure
against regressions.
-->

### Description of the Change
<!--
We must be able to understand the design of your change from this
description. The maintainer reviewing this PR may not have worked with
this code recently, so please provide as much detail as possible.

Where possible, please also include:
- verification steps to ensure your change has the desired effects and
has not introduced any regressions
- any benefits that will be realized
- any alternative implementations or possible drawbacks that you
considered
- screenshots or screencasts
-->

<!-- Enter any applicable Issue number(s) here that will be
closed/resolved by this PR. -->
Closes #

### How to test the Change
<!-- Please provide steps on how to test or validate that the change in
this PR works as described. -->

### Changelog Entry
<!--
Please include a summary for this PR, noting whether this is something
being Added / Changed / Deprecated / Removed / Fixed / or Security
related. You can replace the sample entries after this comment block
with the single changelog entry line for this PR. -->
> Added - New feature
> Changed - Existing functionality
> Deprecated - Soon-to-be removed feature
> Removed - Feature
> Fixed - Bug fix
> Security - Vulnerability


### Credits
<!-- Please list any and all contributors on this PR so that they can be
added to this projects CREDITS.md file. -->
Props @username, @username2, ...


### Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you are unsure about any of these, please ask for
clarification. We are here to help! -->
- [ ] I agree to follow this project's [**Code of
Conduct**](https://github.com/10up/.github/blob/trunk/CODE_OF_CONDUCT.md).
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my change.
- [ ] All new and existing tests pass.
  • Loading branch information
nicholasio authored Oct 16, 2023
2 parents fec6e4e + db83381 commit fd304e6
Show file tree
Hide file tree
Showing 22 changed files with 370 additions and 153 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-cheetahs-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/core": patch
---

Adding support for basic auth
20 changes: 20 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@headstartwp/core": "1.1.1",
"@10up/react-hooks": "1.2.3",
"@headstartwp/next": "1.1.3",
"@10up/next-redis-cache-provider": "0.1.5",
"@10up/headless-docs": "1.0.0",
"@10up/wp-multisite-i18n-nextjs": "0.2.0",
"@10up/wp-multisite-nextjs": "0.2.0",
"@10up/wp-nextjs": "0.2.0",
"@10up/wp-nextjs-ts": "0.2.1-next.2",
"@headstartwp/headstartwp": "1.0.9"
},
"changesets": [
"eighty-cheetahs-wonder",
"wild-pandas-tickle"
]
}
5 changes: 5 additions & 0 deletions .changeset/wild-pandas-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/core": patch
---

Fix: fetchHookData with usePosts and throwIfNotFound set to false will crash the application if no results are found
2 changes: 1 addition & 1 deletion docs/documentation/01-Getting Started/headless-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ After adding a custom taxonomy to the config, you will be able to filter posts b

```js
usePost({ postType: ['book'], genre: 'action' });
usePosts({ postType:'book', genre: 'action' perPage: 10 });
usePosts({ postType:'book', genre: 'action', perPage: 10 });
useTerms({ taxonomy: 'genre' });
```

Expand Down
19 changes: 19 additions & 0 deletions docs/documentation/06-WordPress Integration/basic-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
slug: /wordpress-integration/basic-auth
---

# Basic Auth

If WordPress is protected by Basic Auth (which is common during development) you can tell HeadstartWP the basic auth creds so that all
REST API requests include them. To do so, simply add the following env variables:

```
WP_BASIC_AUTH_USERNAME=username
WP_BASIC_AUTH_PASSWORD=password
```

:::caution
The above env variables will only be accessible server-side and therefore any client-side requests made directly to WordPress will fail. This happens because Next.js only includes env variables prefixed with `NEXT_PUBLIC_` in the browser bundle.

If you want your client-side requests to work, prefix the above variables with `NEXT_PUBLIC_`. But note that the basic auth creds will be leaked to the public.
:::caution
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fd304e6

Please sign in to comment.