Embed Snippet on Your Site
Convert headings to sentence case
If you like your headings in sentence case this works. No changes WP Database: if snippet deactivated then text reverts to original form.
Dual Protection System:
1. Automatic Exceptions (No tags needed)
Words in the exceptions array are automatically protected:
- `'THIS API GUIDE'` → `'This API guide'` (API automatically stays caps)
- `'WORDPRESS TUTORIAL'` → `'WordPress tutorial'` (WordPress keeps proper case)
2. Manual Tags (For specific cases)
Use `[keep]` tags for one-off protections or words not in your exceptions list:
- `'CONTACT [kp]ABC Corp[/kp] TODAY'` → `'Contact ABC Corp today'`
- `'NEW [kp]iPhone 15[/kp] REVIEW'` → `'New iPhone 15 review'`
When to Use Each:
Exceptions Array: For words you use frequently across your site
- Technical terms: API, HTML, CSS, PHP
- Company names: WordPress, MySQL, AWS
- Titles: CEO, CTO, CFO
Tags: For occasional or unique cases
- Specific brand names not in your list
- Product names with special capitalization
- Unique proper nouns
Adding to Exceptions Array:
Just edit this line in the code to add your commonly used words:
```php
$exceptions = array(
'API', 'URL', 'HTML', 'CSS', 'PHP', 'SQL', 'XML', 'JSON', 'HTTP', 'HTTPS',
'CEO', 'CTO', 'CFO', 'USA', 'UK', 'EU', 'AI', 'ML', 'IoT', 'GPS',
'FAQ', 'PDF', 'SEO', 'ROI', 'KPI', 'B2B', 'B2C', 'SaaS',
'WordPress', 'WooCommerce', 'jQuery', 'JavaScript', 'MySQL', 'AWS',
'YOUR_WORD_HERE', 'ANOTHER_EXCEPTION'
);
```
This gives you the best of both worlds - automatic protection for common terms and manual control for special cases!
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments