Contact notes are private: epl_is_contact_note and helpers
Description
Contact notes and activities (notes, calls, emails, meetings) from the EPL Contacts system are private records. They're stored as WordPress comments on the listing they belong to, and Easy Property Listings keeps them out of every comment list, comment feed and the REST API outside wp-admin. These helpers identify them.
---
Functions
epl_is_contact_note( $comment ): is this comment a contact note or activity? Use it in your own comment code to skip them.epl_contact_note_agents(): the labels contact notes are saved with (easy-property-listings, andeplon very old notes).epl_can_see_contact_notes(): true for staff in wp-admin (users who can edit posts).
Hooked by EPL: epl_hide_contact_notes_from_comment_queries() on comments_clauses and epl_hide_contact_notes_from_comment_feeds() on comment_feed_where, using epl_exclude_contact_notes_sql().
---
Examples
Skip contact notes in your own comment loop
foreach ( get_comments( array( 'post_id' => $listing_id, 'type' => 'all' ) ) as $comment ) {
if ( epl_is_contact_note( $comment ) ) {
continue;
}
// Show the comment.
}
---
Source
lib/includes/template-functions.php. Since 3.6.