Last active
August 4, 2022 17:04
-
-
Save jchristopher/922d0a9396f72a44090c2af64561d71f to your computer and use it in GitHub Desktop.
Define an OrganizeWP Entry Pane Item to output the comment count for the current entry.
This file contains hidden or 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 | |
// Define an OrganizeWP Entry Pane Item to output the comment count for the current entry. | |
// @link https://organizewp.com/docs/entry-panel/ | |
class MyOwpPaneEntryCommentsCount extends \OrganizeWP\EntryPanelPaneItem { | |
function init() { | |
$this->name = 'entry_comments'; | |
$this->label = 'Comments'; | |
} | |
// Output HTML to the OrganizeWP Entry Pane. | |
function render() { | |
return 'Comments: <strong>' . get_comment_count( $this->entry->ID )['approved'] . '</strong>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment