The Highlite Pro plugin provides a flexible settings panel where you can control key aspects of how the highlighter behaves. This configuration page allows site administrators to:
- Limit how many words users can highlight in a single selection.
- Choose which post types support frontend text highlighting (e.g., Posts, Pages, or Custom Post Types).
🔍 Accessing the Settings Panel #
- Log in to your WordPress dashboard.
- Go to Settings > Highlite (visible only to administrators with
manage_options
capability).
You’ll see a settings form with two main sections:
✏️ 1. Max Highlight Words #
- Purpose: Restrict users from highlighting large chunks of text.
- Field Type: Number input.
- Default Value: 100 words.
- How it works:
- If a user tries to highlight more than this limit, a warning message is shown using SweetAlert2, and the highlight is rejected.
- Helps maintain focus and prevent excessive database usage.
✅ Example Use Case: #
If you want users to highlight only short passages, set the limit to 25
words.
📄 2. Enable Highlighting for Specific Post Types #
- Purpose: Control which post types allow the highlighting feature.
- Field Type: List of checkboxes (one per public post type).
- Available Options:
- Posts (
post
) - Pages (
page
) - Any other custom post types registered on your site (e.g.,
docs
,courses
, etc.)
- Posts (
✅ How it works: #
- Only selected post types will load the highlighting script and styles.
- If a post type is unchecked, Highlite Pro will skip loading its JavaScript/CSS on that post type’s pages.
⚠️ Tip: #
Leave this list lean — enabling highlighting only on necessary post types improves performance.
💾 Saving Changes #
- Adjust the Max Word Limit as needed.
- Check/uncheck the post types you want to enable.
- Click Save Changes.
A green success message will confirm that your settings have been saved.
🔄 Setting Persistence #
- All settings are saved using the WordPress
options
API. - They persist across theme changes, plugin updates, and cache clears.
🧪 Testing Your Configuration #
After saving:
- Visit a post/page of a type you’ve enabled.
- Try highlighting a passage under the word limit.
- Verify that the floating 🖍️ Highlight button appears and works as expected.