Skip to content

Instantly share code, notes, and snippets.

@johnalarcon
Last active April 2, 2019 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnalarcon/828848be6122bfd5f1493310a22a9292 to your computer and use it in GitHub Desktop.
Save johnalarcon/828848be6122bfd5f1493310a22a9292 to your computer and use it in GitHub Desktop.
Filter examples for the Discourse Stats plugin for ClassicPress. These code snips can be added to a functionality plugin or the functions.php file.
<?php
// Change the update interval of the Discourse Stats plugin widgets.
function codepotent_discourse_stats_update_interval($seconds) {
return 86400; // 1 day
}
add_filter('codepotent_discourse_stats_update_interval', 'codepotent_discourse_stats_update_interval');
// Change the date format for the "Join date" of the Discourse Stats plugin for ClassicPress.
// See https://www.php.net/manual/en/function.date.php for all the possible date tokens.
function codepotent_discourse_stats_date_format() {
return 'j M Y'; // 13 JAN 2019
}
add_filter('codepotent_discourse_stats_date_format', 'codepotent_discourse_stats_date_format');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment