Install from Wordpress Plugins or clone the master branch from this repository
Plugin for polls based on regular Wordpress and acf (advanced custom fields) functionalities using WP REST API and Javascript methods. Feel free to submit a Pull Request.
The main goal of ACF Onyx Poll is to be totally free, lightweight and simple. No fancy, colorful and polluted options or donate screens.
This plugin is based on Twitter poll cards style.
- Use the shortcode
[onyx-poll]to get the latest poll - To add a specific poll, assign the option ID with the requested poll to the shortcode:
[onyx-poll id=XX] - You can align the poll container with the option class in the shortcode:
[onyx-poll class=left]. Available options areleft, right, full - To select which style you want:
[onyx-poll class="twitter|standard"] - Is it possible to combine style and aligment. Ex:
[onyx-poll class="standard left"] - To include a widget, your theme need to support it. Go to Appereance > Widgets and select Poll widget from from ACF Onyx Poll
- Gutemberg Block with live preview
- Include poll with a shortcode (ommit the ID to get the latest poll)
[onyx-poll id=XX class="left|right|full"] - One click to vote
- Works with cache plugins
- Multiple polls per page
- Support for images and custom sizes
- Native widget for sidebar
- Multiple style options
[onyx-poll class="twitter|standard"] - Show poll in a modal
- Show poll results on widget after expired
- Highlight choosed choice in results area
- Limit vote by device or time
- Poll activation/expiration schedule
- Results in percentage, numbers or both
- Show/Hide results
- Customize css with css variables
- Disable all plugin CSS and use your own
- Custom columns on Wordpress data table admin area
- Translations support
- Improve/Cache REST API response for better performance on high traffic sites
- Inject javascript only if current page has a poll
- Documentation/Wiki for users and developers
- Integration with Google reCaptcha
- Email notification when poll is expired (considering)
- Support for AMP Pages (considering)
- Select multiple options to vote (considering)
- Javascript Refactoring for better code view and maintenance (after first release)
-
I don't support Internet Explorer Browser and all PR's related will be rejected. One of the goals of this plugin is to be js/css lightweight and jQuery free.
-
ACF Onyx Poll register fields via php to be able to use Wordpress translation functions for field labels. So you won't be able to view/edit the fields inside ACF Custom Fields Settings.
-
To enable a better/faster CRON you need to manually set your host cronjob to get https://domain.tld/wp-json/onyx/polls/cron endpoint or disable WP-Cron
define('DISABLE_WP_CRON', true);inside your wp-config and manually create the cron in your host/server-
Option 1: To run every hour set the cron:
0 * * * * wget -q -O - https://domain.tld/wp-json/onyx/polls/cron > /dev/null 2>&1 -
Option 2: if you disable the default WP-Cron:
0 * * * * wget -q -O - https://domain.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
-
You can do some customization by overriding some CSS variables inside your css file.
.onyx-poll {
--pollWidgetWidth: 400px;
--borderColor: #dbe9f5;
--boxShadow: 0 4px 12px 6px rgba(31,70,88,0.04);
--modalBorderRadius: 4px;
--questionColor: #333;
--choiceColor: #333;
--buttonColor: #333;
--choiceHoverBG: #f5f5f5;
--choiceBarColor: #e0e0e0;
--choiceBorderRadius: 100px;
--closeBorderRadius: 100px;
--loaderBorderColor: rgb(209, 226, 240);
--loaderBG: #a3caec;
}Maybe you will have to set the font-family and font-size for some elements to match your theme style.
If you need a more advanced attributes, the CSS source is located on assets/css/onyx-poll.css. You can use as a guide but never override the original files.
At the database side, ACF Onyx Poll uses the default ACF/Wordpress structure to store data (the meta fields). Nothing to worry about here.
For privacy, ACF Onyx Poll does not store any user data like ip address, usernames etc...
The only things the plugin saves in the user's browser is some cookies to check the user choice for specific poll, if the modal was previously showed/closed and a timer. You can check the cookies by looking for onyx_poll_limit_XX, onyx_poll_modal and onyx_poll_choice_XX.
![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|
| ✔ | ✔ | ✔ | ✔ | ✘ |








