Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created February 19, 2015 12:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save strangerstudios/2a9f1922ff8cafd0222b to your computer and use it in GitHub Desktop.
Save strangerstudios/2a9f1922ff8cafd0222b to your computer and use it in GitHub Desktop.
<?php
/*
PMPro Reports Extras
Title: pmpro_reports_extras
Slug: pmpro_reports_extras
For each report, add a line like:
global $pmpro_reports;
$pmpro_reports['slug'] = 'Title';
For each report, also write two functions:
* pmpro_report_{slug}_widget() to show up on the report homepage.
* pmpro_report_{slug}_page() to show up when users click on the report page widget.
*/
global $pmpro_reports;
$pmpro_reports['sample'] = __('My Sample Report', 'pmpro-reports-extras');
function pmpro_report_sample_widget()
{
?>
<p>Hi! I'm a sample report!</p>
<?php
}
function pmpro_report_sample_page()
{
?>
<h2>
<?php _e('This is a Sample', 'pmpro-reports-extras');?>
</h2>
<p>This report demonstrates how to add a custom report to PMPro. Enjoy!.</p>
<hr />
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment