Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Polls use a predefined list of colours to display poll choices results. List of colours is controlled can be controlled using the filter ‘gdpol_poll_color_palette‘. This filter returns a plain array of hexadecimal colours.

This filter provides 1 argument.

Arguments

  • $colors: array with a hexadecimal list of colours.

You can return any number of colours you want. Default list has 13 colours.

Example

add_filter('gdpol_poll_color_palette', 'custom__poll_color_palette');
function custom__poll_color_palette($colors) {
  $colors = array(
    '#8e44ad', '#2c3e50', '#d35400', '#16a085'
  );
  return $colors;
}
0
0
442
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply