WordPress.org

Plugin Directory

We The People

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

How do I prevent We The People from loading the bundled scripts and styles?

The We The People stylesheet and JavaScript file are enqueued in typical WordPress fashion when the plugin is loaded on WordPress init. Dropping this function in your WordPress theme should prevent the default We The People assets from loading:

/**
 * Prevent We The People from loading scripts and styles.
 */
function mytheme_disable_wtp_scripts_styles() {
  wp_dequeue_script( 'we-the-people' );
  wp_dequeue_style( 'we-the-people' );
}
add_action( 'init', 'mytheme_disable_wtp_scripts_styles' );

Since version 2.0, there are also two filters that can also be used to disable the scripts/styles:

add_filter( 'wethepeople_load_scripts', '__return_false' );
add_filter( 'wethepeople_load_styles', '__return_false' );

Can visitors sign a petition using the plugin?

Version 2.0 of the plugin uses the new Write API to enable you to collect signatures on We The People petitions. In order to activate this functionality, you'll need to apply for a We The People API key and add it to WordPress either through the plugin settings page (Settings > We The People) or in your wp-config.php file (see "API Keys" for more information).

I just upgraded and am getting errors about a $we_the_people variable being undefined

Version 2.0 of the plugin replaced the global $we_the_people variable with the cleaner $GLOBALS['we-the-people']. You can safely replace instances of the former with the latter, though it's unnecessary to have a global $GLOBALS['we-the-people'] declaration in your theme. If this change affects you, a simple (temporary) fix would be to add the following to your theme's functions.php file:

// Alias $we_the_people to $GLOBALS['we-the-people']
global $we_the_people;
$we_the_people = $GLOBALS['we-the-people']

Requires: 3.5.1 or higher
Compatible up to: 4.1.5
Last Updated: 2015-1-25
Active Installs: 30+

Ratings

0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

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

100,1,1