Plugin Directory

Test out the new Plugin Directory and let us know what you think.

We The People

Easily embed White House petitions from We The People into your WordPress site via shortcodes and widgets.


The plugin includes a number of different ways to embed petitions from We The People:


The simplest way to get started is through WordPress shortcodes. The syntax is as easy as: [wtp-petition id="123"].

Petitions IDs aren't especially easy to uncover from the We The People site so the We The People plugin includes a TinyMCE button to help you. Clicking the button will open an overlay that will let you search the We The People petitions by title to find your issue. You may also limit your search results to open petitions.


To add a We The People petition to a WordPress dynamic sidebar go to Appearance > Widgets and drag a "WTP Petition" widget into the desired sidebar. Like the TinyMCE button the widget allows you to search for your desired petition by title and show only open petitions.

$GLOBALS['we-the-people'] global variable (advanced)

If you're a developer and need more complete access to the We The People API you can use the api() method available through the $GLOBALS['we-the-people'] global variable. The api() method accepts two arguments: the API method to call ('retrieve' or 'index' in version 1.*) and an array of arguments to pass to the API.

Note: Before version 2.0, the plugin used a global $we_the_people variable. If you did customizations to We The People templates you'll want to be sure to update this reference.

Full API documentation is available on the We The People API page. More developer-oriented documentation can be found in this plugin's GitHub repository.

Styling the petition display

We The People has a built-in petition template but makes it easy to override in your theme. It may be easiest to copy templates/wtp-petition.php into your theme to get started but a very basic custom template might look something like this:

<div id="wtp-petition-<?php echo $petition->id; ?>" class="wtp-petition">
  <h2 class="petition-title"><?php echo $petition->title; ?></h2>
    <strong><?php printf( __( '%d signatures.', 'my-theme' ), $petition->signaturesNeeded ); ?></strong>
    <a href="<?php echo $petition->url; ?>" title="<?php echo esc_attr( __( 'Sign this petition on We The People', 'we-the-people' ) ); ?>" class="sign-btn" rel="external"><?php _e( 'Sign this petition' ); ?></a>
</div><!-- #wtp-petition-<?php echo $petition->id; ?> -->

We The People uses the following order to determine which template to use when displaying a petition:


  1. wtp-petition-{id}.php (child theme)
  2. wtp-petition.php (child theme)
  3. wtp-petition-{id}.php (parent theme)
  4. wtp-petition.php (parent theme)
  5. templates/wtp-petition.php (plugin)


  1. wtp-petition-widget-{id}.php (child theme)
  2. wtp-petition-widget.php (child theme)
  3. wtp-petition-widget-{id}.php (parent theme)
  4. wtp-petition-widget.php (parent theme)
  5. templates/wtp-petition-widget.php (plugin)

Requires: 3.5.1 or higher
Compatible up to: 4.1.14
Last Updated: 2 years ago
Active Installs: 40+


0 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.