Skip to content

fix: correct slugifyTitle hook example in documentation#16306

Open
AntonAmbarov wants to merge 1 commit intopayloadcms:mainfrom
AntonAmbarov:main
Open

fix: correct slugifyTitle hook example in documentation#16306
AntonAmbarov wants to merge 1 commit intopayloadcms:mainfrom
AntonAmbarov:main

Conversation

@AntonAmbarov
Copy link
Copy Markdown

What?

Fixed incorrect return statement in the slugifyTitle field hook example in the official documentation.

The example was generating a properly formatted slug but then incorrectly returning the original value instead of the slugified result.

Why?

This was a bug in the documentation that could mislead developers implementing automatic slug generation. The hook appeared to work, but in reality did nothing useful.

How?

  • Changed return value to return slug in the example

Before/After

Before:

const slug = value.toLowerCase()... 
return value // ← bug

**Aftere:**
```ts
const slug = value.toLowerCase()... 
return slug

- Fixed incorrect return statement in slugifyTitle example
- Now properly returns generated slug instead of original value
@AntonAmbarov AntonAmbarov changed the title fix(docs): correct slugifyTitle hook example in documentation fix: correct slugifyTitle hook example in documentation Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant