Last active
April 2, 2019 05:17
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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