Title: WP-Polls (Ankety)
Author: Lester Chan
Published: <strong>3. 1. 2006</strong>
Last modified: 18. 1. 2025

---

Prohledat pluginy

![](https://ps.w.org/wp-polls/assets/banner-772x250.jpg?rev=1206760)

Plugin **nebyl testován na 3 nejnovějších verzích WordPressu.** Nemusí už být tedy
podporován a u novějších verzí WordPressu může mít problémy s kompatibilitou a může
být nestabilní.

![](https://ps.w.org/wp-polls/assets/icon.svg?rev=977996)

# WP-Polls (Ankety)

 Autor: [Lester Chan](https://profiles.wordpress.org/gamerz/)

[Stáhnout](https://downloads.wordpress.org/plugin/wp-polls.2.77.3.zip)

 * [Podrobnosti](https://cs.wordpress.org/plugins/wp-polls/#description)
 * [Hodnocení](https://cs.wordpress.org/plugins/wp-polls/#reviews)
 * [Vývojáři](https://cs.wordpress.org/plugins/wp-polls/#developers)

 [Podpora](https://wordpress.org/support/plugin/wp-polls/)

## Popis

WP-Polls is extremely customizable via templates and css styles and there are tons
of options for you to choose to ensure that WP-Polls runs the way you wanted. It
now supports multiple selection of answers.

### Vývoj

[https://github.com/lesterchan/wp-polls](https://github.com/lesterchan/wp-polls)

### Autoři

 * Plugin icon by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com)

### Donations

I spent most of my free time creating, updating, maintaining and supporting these
plugins, if you really love my plugins and could spare me a couple of bucks, I will
really appreciate it. If not feel free to use it without any obligations.

## Snímky obrazovky

 * [[
 * Admin – All Poll
 * [[
 * Admin – Manage Polls
 * [[
 * Admin – Poll Options
 * [[
 * Admin – Poll Templates
 * [[
 * Admin – Poll Widget
 * [[
 * Admin – Uninstall Poll
 * [[
 * Poll – Single Poll Answer
 * [[
 * Poll – Mutiple Poll Answers
 * [[
 * Poll – Results
 * [[
 * Poll – Archive

## Nejčastější dotazy

### General Usage (Without Widget)

    ```
    <?php if ( function_exists( 'vote_poll' ) && ! in_pollarchive() ): ?>
        <li>
            <h2>Polls</h2>
            <ul>
                <li><?php get_poll();?></li>
            </ul>
            <?php display_polls_archive_link(); ?>
        </li>
    <?php endif; ?>
    ```

 * To show specific poll, use `<?php get_poll(2); ?>` where 2 is your poll id.
 * To show random poll, use `<?php get_poll(-2); ?>`
 * To embed a specific poll in your post, use `[poll id="2"]` where 2 is your poll
   id.
 * To embed a random poll in your post, use `[poll id="-2"]`
 * To embed a specific poll’s result in your post, use `[poll id="2" type="result"]`
   where 2 is your poll id.

### General Usage (With Widget)

 1. Go to `WP-Admin -> Appearance -> Widgets`.
 2. You can add the Polls Widget by clicking on the ‚Add‘ link besides it.
 3. After adding, you can configure the Polls Widget by clicking on the ‚Edit‘ link
    besides it.
 4. Klikněte na ‚Uložit změny‘.
 5. Přejděte na stránce dolů a tam najdete pokyny k vytvoření archivu anket.

### Jak přidám anketu do archivu?

 1. Go to `WP-Admin -> Pages -> Add New`.
 2. Type any title you like in the post’s title area.
 3. If you ARE using nice permalinks, after typing the title, WordPress will generate
    the permalink to the page. You will see an ‚Edit‘ link just beside the permalink.
 4. Klikněte na tlačítko „Upravit“, potom do textového pole zadejte `pollsarchive` 
    a následně klikněte na tlačítko „Uložit“.
 5. Vložte kód `[page_polls]` do textu příspěvku či stránky.
 6. Klikněte na ‚Publikovat‘.

 * Pokud NEPOUŽÍVÁTE pěkné trvalé odkazy, musíte přejít do `WP-Admin -> Polls ->
   Poll Options` a v `Poll Archive -> Polls Archive URL` vyplnit již dříve vytvořenou
   URL stránky Archiv anket.

### Proč součet odpovědí v anketě není 100 %?

 * Je to kvůli problémům se zaokrouhlováním. Aby se vždy zaokrouhlilo na 100 %, 
   k poslední odpovědi v anketě se přičte zbývající procento. Chcete-li tuto funkci
   povolit, přidejte do souboru functions.php vašeho tématu tento řádek: `add_filter('
   wp_polls_round_percentage', '__return_true' );`

### Jak plugin načítá CSS?

 * Pokud existuje, tak plugin načte soubor `polls-css.css` z adresáře šablony.
 * Pokud neexistuje, načte se pouze výchozí soubor `polls-css.css`, který je součástí
   pluginu WP-Polls.
 * To vám umožní aktualizovat WP-Polls bez obav z přepsání již vytvořených stylů
   anket.

### Proč se v prohlížeči Internet Explorer (IE) text ankety zobrazuje zubatě?

 * Pro vyřešení tohoto problému otevřete soubor poll-css.css
 * Najděte: `/* background-color: #ffffff; */`
 * Nahraďte: `background-color: #ffffff;` (kde #ffffff je barva pozadí ankety.)

### Jak nastavit individuální barvy pro každý panel ankety?

 * S laskavým svolením Of [TreedBox.com](http://treedbox.com)
 * Otevřít poll-css.css
 * Přidat na konec souboru:

    ```
    .wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5}
    .wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8}
    .wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b}
    .wp-polls-ul li:nth-child(04) .pollbar{ background:#a61e2a}
    .wp-polls-ul li:nth-child(05) .pollbar{ background:#4ebbff}
    .wp-polls-ul li:nth-child(06) .pollbar{ background:#fbca54}
    .wp-polls-ul li:nth-child(07) .pollbar{ background:#aad34f}
    .wp-polls-ul li:nth-child(08) .pollbar{ background:#66cc9a}
    .wp-polls-ul li:nth-child(09) .pollbar{ background:#98CBCB}
    .wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
    .wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out }
    .wp-polls-ul li .pollbar:hover{ background:#F00 }
    ```

### Pro zobrazení celkového počtu anket

    ```
    <?php if ( function_exists( 'get_pollquestions' ) ): ?>
        <?php get_pollquestions(); ?>
    <?php endif; ?> 
    ```

### Pro zobrazení celkového počtu odpovědí

    ```
    <?php if ( function_exists( 'get_pollanswers' ) ): ?>
        <?php get_pollanswers(); ?>
    <?php endif; ?> 
    ```

### Pro zobrazení celkového počtu hlasů

    ```
    <?php if ( function_exists( 'get_pollvotes' ) ): ?>
        <?php get_pollvotes(); ?>
    <?php endif; ?> 
    ```

### Zobrazit výsledky ankety podle ID

    ```
    <?php if ( function_exists( 'get_pollvotes_by_id' ) ): ?>
        <?php get_pollvotes_by_id($poll_id); ?>
    <?php endif; ?>
    ```

### Pro zobrazení celkového počtu hlasujících

    ```
    <?php if ( function_exists( 'get_pollvoters' ) ): ?>
        <?php get_pollvoters(); ?>
    <?php endif; ?> 
    ```

### To Display Poll Time by ID and date format

    ```
    <?php if ( function_exists( 'get_polltime' ) ): ?>
        <?php get_polltime( $poll_id, $date_format ); ?>
    <?php endif; ?>
    ```

### Překládání šablony

Šablonu pluginu lze překládat pomocí proměnných šablon.
 Pro vlastní proměnné šablony
existují tyto filtry

    ```
    wp_polls_template_votebody_variables
    wp_polls_template_votefooter
    wp_polls_template_resultheader_variables
    wp_polls_template_resultbody_variables
    wp_polls_template_resultfooter_variables
    ```

Přidejte filtr do své šablony a zaregistrujte vlastní proměnnou, ke které přidáte
svůj překlad.
 Dobrým zvykem je používat proměnné s předponou `STR_`, kupříkladu`
STR_TOTAL_VOTERS`.

    ```
        /**
         * Localize wp_polls_template_resultfooter_variables.
         *
         * @param array $variables An array of template variables.
         * @return array $variables Modified template variables.
         */
        function wp_polls_template_resultfooter_variables( $variables ) {

            // Add strings.
            $variables['%STR_TOTAL_VOTERS%'] = __( 'Total voters', 'theme-textdomain' );

            return $variables;
        }

    // Trigger the filter
    add_filter( 'wp_polls_template_resultfooter_variables', 'wp_polls_template_resultfooter_variables' , 10, 1 );
    ```

V administraci jednoduše zavoláte vlastní proměnnou následujícím způsobem a proměnná
se přeloží do frontendu.
 ‚%STR_TOTAL_VOTERS%‘

## Recenze

![](https://secure.gravatar.com/avatar/e568a48fa12155130c23116d7be303764dca7638a7257f79507e1528954fd0f7?
s=60&d=retro&r=g)

### 󠀁[Thanks for the plugin and a suggestion](https://wordpress.org/support/topic/thanks-for-the-plugin-and-a-suggestion/)󠁿

 [joel05](https://profiles.wordpress.org/joel05/) 27. 9. 2025

This plugin is perfect. Thank you so much to the creators. The only thing that I
miss is being able to make anonymous polls, so I would like to be able to activate
an option in the poll for anonymous polls, in which the logs show all the votes 
together, without indicating what option each person has voted for.

![](https://secure.gravatar.com/avatar/76e56af37dbb9acd68eb7f218690807399384e9ffe79a100833efa7026bf3ad7?
s=60&d=retro&r=g)

### 󠀁[Awesome work!](https://wordpress.org/support/topic/awesome-work-150/)󠁿

 [Zeljko Jagust](https://profiles.wordpress.org/zjagust/) 22. 5. 2024

For the ones who know something about HTML and CSS syntax, this plugin is perfect!
It does exactly what is needed regarding polls, while the looks can be fully customized.
IMHO, a brilliant piece of work!

![](https://secure.gravatar.com/avatar/b386455620084633756983fc57b321d21ecfcba3a1be005259e7fd0fc9c5fce6?
s=60&d=retro&r=g)

### 󠀁[Used for long time, now got a problem](https://wordpress.org/support/topic/used-for-long-time-now-got-a-problem/)󠁿

 [Dani](https://profiles.wordpress.org/daniw42/) 29. 4. 2023

Hi there, I’ve been using this plugin and loved it for its simplicity alongside 
with the ability to customize the look and feel. Somehow, at some point, the admin
interface changed and I am now able to see the answers of all users. Before, I was
only able to see how many users voted for each answer, not who. This is a major 
problem for me. Is there any way to hide the usernames from the answers given? I
need to see which users voted, but not what answer they gave. The answers should
only be seen as a total for each option. Thanks

![](https://secure.gravatar.com/avatar/02b3df1cb95d3eac280f2a76c166cef531ca595427851155fbc424cf19f64c5e?
s=60&d=retro&r=g)

### 󠀁[Nice feature set, doesn’t work with cache](https://wordpress.org/support/topic/nice-feature-set-doesnt-work-with-cache/)󠁿

 [expirator](https://profiles.wordpress.org/expirator/) 21. 10. 2022

Love the feature set, easy to use, great to work with, but it fails with my cache
setup (standard Cloudflare) setup. Have to remove it a site and move to another 
solution, sadly this was after my install, setting up on my custom post types, etc.
Would love to see it updated in the future.

![](https://secure.gravatar.com/avatar/4dffc932532d29fddfdd3918d64e0b20c3206c568c90d7359df749a53f80b9f2?
s=60&d=retro&r=g)

### 󠀁[Excellent](https://wordpress.org/support/topic/excellent-12039/)󠁿

 [redima](https://profiles.wordpress.org/redima/) 23. 7. 2022

Excellent, easy going plugin. Thank you.

![](https://secure.gravatar.com/avatar/290933bdd0a253ba0036e5fc61dc9bb1e7c95d589406270ba0a69aeb6a9a1fb9?
s=60&d=retro&r=g)

### 󠀁[Only one question](https://wordpress.org/support/topic/only-one-question/)󠁿

 [astrodates](https://profiles.wordpress.org/astrodates/) 23. 3. 2022

You can have unlimited answers, but only one question?

 [ Přečtěte si všech 136 recenzí ](https://wordpress.org/support/plugin/wp-polls/reviews/)

## Autoři

WP-Polls (Ankety) je otevřený software. Následující lidé přispěli k vývoji tohoto
pluginu.

Spolupracovníci

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)

Plugin „WP-Polls (Ankety)“ byl přeložen do 16 jazyků. Děkujeme všem [překladatelům](https://translate.wordpress.org/projects/wp-plugins/wp-polls/contributors)
za jejich pomoc.

[Přeložte “WP-Polls (Ankety)” do svého jazyka.](https://translate.wordpress.org/projects/wp-plugins/wp-polls)

### Zajímá vás vývoj?

[Prohledejte kód](https://plugins.trac.wordpress.org/browser/wp-polls/), podívejte
se do [SVN repozitáře](https://plugins.svn.wordpress.org/wp-polls/), nebo se přihlaste
k[ odběru protokolu vývoje](https://plugins.trac.wordpress.org/log/wp-polls/) pomocí
[RSS](https://plugins.trac.wordpress.org/log/wp-polls/?limit=100&mode=stop_on_copy&format=rss).

## Přehled změn

### Version 2.77.3

 * FIXED: XSS In poll-logs.php.

### Version 2.77.2

 * FIXED: Read from default REMOTE_ADDR unless specified in options

### Version 2.77.1

 * FIXED: Support mutex lock for multi-site. Props @yrkmann.

### Version 2.77.0

 * NEW: Use mutex lock to prevent race condition.

### Version 2.76.0

 * NEW: Supports specifying which header to read the user’s IP from. Props Marc 
   Montpas.

### Version 2.75.6

 * NEW: New filter for template variables: wp_polls_template_votebody_variables,
   wp_polls_template_votefooter, wp_polls_template_resultheader_variables, wp_polls_template_resultbody_variables,
   wp_polls_template_resultfooter_variables. Props @Liblastic.
 * NEW: composer.json
 * FIXED: Missing space for check_voted_username MySQL query

### Version 2.75.5

 * NEW: New filter for templates: wp_polls_template_resultheader_markup, wp_polls_template_resultbody_markup,
   wp_polls_template_resultbody2_markup, wp_polls_template_resultfooter_markup, 
   wp_polls_template_resultfooter2_markup. Props @Jaska.

### Version 2.75.4

 * FIXED: Unable to edit poll because of class-wp-block-parser.php.

### Version 2.75.3

 * FIXED: Broken filter for templates
 * FIXED: Divison by 0 by totalvoters
 * FIXED: Add whitelist to sortby poll answers

### Versiob 2.75.2

 * FIXED: Missing str_replace for wp_polls_template filter

### Version 2.75.1

 * FIXED: Use array() instead of [] as a few users are still on < PHP 5.4. Props
   @bearlydoug.
 * FIXED: pollq_expiry is now 0 instead of blank string. Props @hpiirainen.

### Version 2.75

 * FIXED: Standardize all filters to begin with `wp_polls` rather than `poll`
 * NEW: Added `wp_polls_ipaddress` and `wp_polls_hostname` to allow user to overwrite
   it.

### Version 2.74.1

 * FIXED: Don’t use PHP 5.4 Short array syntax.
 * FIXED: Division by zero
 * FIXED: Wrong database column type for pollq_expiry

### Version 2.74

 * NEW: Hashed IP and anonymize Hostname to make it GDPR compliance
 * NEW: If Do Not Log is set in Poll Options, do not log to DB
 * NEW: Support %POLL_MULTIPLE_ANSWER_PERCENTAGE%. This is total votes divided by
   total voters.

### Version 2.73.8

 * FIXED: Bug fixes and stricter type checking

### Version 2.73.7

 * FIXED: Unable to save input HTML tags for footer templates

### Version 2.73.6

 * FIXED: Unable to vote for multiple answers
 * FIXED: input HTML tags being removed when saving templates

### Version 2.73.5

 * FIXED: Parsed error in SERVER variable.

### Version 2.73.4

 * FIXED: sanitize_key on top of intval.

### Version 2.73.3

 * NEW: Added sort by votes casted to poll answers.
 * NEW: For polls with mutiple answers, we divided by total votes instead of total
   voters. Props @ljxprime.
 * FIXED: Do not display poll option is not respected when poll is closed.
 * FIXED: pollip_qid, pollip_aid, pollip_timestamp are now int(10) in pollsip table.
 * FIXED: pollq_expiry is now int(10) in pollsq table.

### Version 2.73.2

 * NEW: Bump WordPress 4.7
 * FIXED: Change cron to hourly instead of twice daily.

### Version 2.73.1

 * FIXED: Allow local IP
 * FIXED: XSS on Poll bar option. Props [Netsparker Web Application Security Scanner](https://www.netsparker.com/)
 * FIXED: Stricter Poll pptions check

### Version 2.73

 * NEW: Display Poll Questions at the top of the Poll Logs table
 * FIXED: Remove slashes

### Version 2.72

 * NEW: Use translate.wordpress.org to translate the plugin
 * FIXED: SQL Injection fixes. Props [Jay Dansand](https://github.com/jaydansand)
 * FIXED: Use $wpdb->insert(), $wpdb->update() and $wpdb->delete() as much as possible
 * FIXED Remove poll_archive_show option from UI

### Version 2.71

 * FIXED: Use wp_kses_post() to get filter always bad tags

### Version 2.70

 * NEW: Add wp_polls_vote_poll_success action hook
 * NEW: Add wp_polls_add_poll, wp_polls_update_poll, wp_polls_delete_poll action
   hooks
 * FIXED: PHP Notices
 * FIXED: Removed not needed wp_print_scripts
 * FIXED: Use esc_attr() and esc_textarea() instead of htmlspecialchars(). Props
   [Govind Singh](https://in.linkedin.com/pub/govind-singh/21/1a9/bab)

## Meta

 *  Verze **2.77.3**
 *  Poslední aktualizace **před 1 rokem**
 *  Aktivních instalací **40 000+**
 *  Verze WordPressu ** 4.9.6 nebo novější **
 *  Testováno až do WordPressu **6.7.5**
 *  Jazyky
 * [Arabic](https://ar.wordpress.org/plugins/wp-polls/), [Bulgarian](https://bg.wordpress.org/plugins/wp-polls/),
   [Chinese (China)](https://cn.wordpress.org/plugins/wp-polls/), [Czech](https://cs.wordpress.org/plugins/wp-polls/),
   [Danish](https://da.wordpress.org/plugins/wp-polls/), [Dutch](https://nl.wordpress.org/plugins/wp-polls/),
   [English (US)](https://wordpress.org/plugins/wp-polls/), [French (France)](https://fr.wordpress.org/plugins/wp-polls/),
   [German](https://de.wordpress.org/plugins/wp-polls/), [Hungarian](https://hu.wordpress.org/plugins/wp-polls/),
   [Portuguese (Brazil)](https://br.wordpress.org/plugins/wp-polls/), [Russian](https://ru.wordpress.org/plugins/wp-polls/),
   [Spanish (Chile)](https://cl.wordpress.org/plugins/wp-polls/), [Spanish (Spain)](https://es.wordpress.org/plugins/wp-polls/),
   [Spanish (Venezuela)](https://ve.wordpress.org/plugins/wp-polls/), [Turkish](https://tr.wordpress.org/plugins/wp-polls/)
   a [Ukrainian](https://uk.wordpress.org/plugins/wp-polls/).
 *  [Přeložte do vašeho jazyka](https://translate.wordpress.org/projects/wp-plugins/wp-polls)
 * Štítků
 * [booth](https://cs.wordpress.org/plugins/tags/booth/)[poll](https://cs.wordpress.org/plugins/tags/poll/)
   [polling](https://cs.wordpress.org/plugins/tags/polling/)[polls](https://cs.wordpress.org/plugins/tags/polls/)
   [vote](https://cs.wordpress.org/plugins/tags/vote/)
 *  [Podrobnosti](https://cs.wordpress.org/plugins/wp-polls/advanced/)

## Hodnocení

 4.2 z 5 hvězdiček.

 *  [  93 5hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/wp-polls/reviews/?filter=5)
 *  [  15 4hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/wp-polls/reviews/?filter=4)
 *  [  4 3hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/wp-polls/reviews/?filter=3)
 *  [  4 2hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/wp-polls/reviews/?filter=2)
 *  [  20 1hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/wp-polls/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wp-polls/reviews/#new-post)

[Zobrazit všechny recenze](https://wordpress.org/support/plugin/wp-polls/reviews/)

## Spolupracovníci

 *   [ Lester Chan ](https://profiles.wordpress.org/gamerz/)

## Podpora

Potřebujete pomoc?

 [Fórum podpory](https://wordpress.org/support/plugin/wp-polls/)

## Dary

Chtěli byste podpořit vývoj tohoto pluginu?

 [ Přispět na tento plugin ](https://lesterchan.net/site/donation/)