
Via the admin page added by the plugin, Comments -> Commenter Emails, admin users are presented with the following information:
The plugin only considers approved comments and does not exclude from its listing any known email addresses (i.e. admin and post author email addresses).
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
The plugin exposes six filters for hooking. Code using these filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain). Less ideally, you could put them in your active theme’s functions.php file.
c2c_commenter_emails_show_csv_button (filter)
The ‘c2c_commenter_emails_show_csv_button’ hook allows you to customize whether the button to download a CSV file of the commenter emails list should be present on the plugin’s admin settings page. By default this is true.
Arguments:
Example:
// Disable the download button
add_filter( 'c2c_commenter_emails_show_csv_button', '__return_false' );
c2c_commenter_emails_show_emails (filter)
The ‘c2c_commenter_emails_show_emails’ hook allows you to customize whether the listing of emails should appear on the plugin’s admin settings page. By default this is true.
Arguments:
Example:
// Disable showing the emails listing
add_filter( 'c2c_commenter_emails_show_emails', '__return_false' );
c2c_commenter_emails_filename (filter)
The ‘c2c_commenter_emails_filename’ hook allows you to customize the name used for the .csv file when being downloaded. By default this is ‘commenter-emails.csv’.
Arguments:
Example:
/**
* Change the default filename to embed today's date for the Commenter Emails plugin.
*
* @param string $filename The filename for the CSV file.
* @return string.
*/
function change_ce_filename( $filename ) {
$date = date('m-d-Y', strtotime('today')); // Get today's date in m-d-Y format (i.e. 02-25-2010)
return "emails-$date.csv";
}
add_filter( 'c2c_commenter_emails_filename', 'change_ce_filename' );
manage_commenter_emails_options (filter)
The ‘manage_commenter_emails_options’ hook allows you to customize the capability required to access the commenter emails admin page. You should be certain that you’ve created the capability and assigned that capability to the desired user(s). By default this is the ‘manage_options’ capability.
Arguments:
Example:
/**
* Change the capability needed to see the Commenter Emails admin page for the Commenter Emails plugin.
*
* @param string $capability The necessary capability.
* @return string
*/
function change_ce_cap( $capability ) {
return 'manage_commenter_emails';
}
add_filter( 'manage_commenter_emails_options', 'change_ce_cap' );
c2c_commenter_emails_fields (filter)
The ‘c2c_commenter_emails_fields’ hook allows you to customize the user fields included in the download CSV file. By default the CSV file includes comment_author and comment_author_email.
Arguments:
array( 'comment_author', 'comment_author_email' ). Whether explicitly included or not, ‘comment_author_email’ will always be output in the CSV.Example:
/**
* Include the commenter's IP address in the download CSV for the Commenter Emails plugin.
*
* @param array $fields The comment email fields to include in the CSV output.
* @return array
*/
function change_ce_fields( $fields ) {
$fields[] = 'comment_author_IP';
return $fields;
}
add_filter( 'c2c_commenter_emails_fields', 'change_ce_fields' );
c2c_commenter_emails_field_separator (filter)
The ‘c2c_commenter_emails_field_separator’ hook allows you to customize the separator used in the CSV file.
Arguments:
Example:
/**
* Change the data fields separator to '|' for Commenter Emails plugin.
*
* @param string $separator The defautl separator.
* @return string
*/
function change_ce_field_separator( $separator ) {
return '|';
}
add_filter( 'c2c_commenter_emails_field_separator', 'change_ce_field_separator' );
Download & install the zip archive
The plugin package installer can be downloaded from the WP2E project tab called “code”.
1 – Select the version to download if this option is available otherwise the “latest” version of the main plugin will be used.
2 – After downloading the zip archive install the plugin package installer in you local environment and activate the script from the plugin list.
3 – Under the section “Plugins” of the admin dashboard you should see a new “Dependencies & Licenses” link. Follow the instructions from this panel to finalize the installation of the missing dependencies.
Tips: Use the WP2E panel to add/suggest new dependencies to the local installation. Press F5 in the list of dependencies if the changes are not displayed right away.