Disciple_Tools_Notifications

Class Disciple_Tools_Notifications

package

Disciple_Tools\Notifications

Methods

Constructor function.

__construct() 
access

public

since 0.1.0

Delete all notifications for a post with a certain notification name

delete_by_post(array $args) : void
static
since 0.1.0

Arguments

$args

array

Delete single notification

delete_notification(array $args) : void
static
since 0.1.0

Arguments

$args

array

Format comment replacing @mentions with a readable value

format_comment( $comment_content) : mixed
static

Arguments

$comment_content

Response

mixed

Get user notifications

get_new_notifications_count() : integer
static

Response

integer

get_notification_message_html

get_notification_message_html( $notification, boolean $html = true) : string
static

Arguments

$notification

$html

boolean

Response

string

$notification_note the return value is expected to contain HTML.

Get notifications

get_notifications(boolean $all, integer $page, integer $limit) : array
static

Arguments

$all

boolean

$page

integer

$limit

integer

Response

array

Insert statement

insert_notification(array $args) : void
static
since 0.1.0

Arguments

$args

array

Insert notification for assignment_declined

insert_notification_for_assignment_declined(integer $user_who_declined, integer $new_assigned_to, integer $post_id) 
static

Arguments

$user_who_declined

integer

$new_assigned_to

integer

$post_id

integer

insert_notification_for_new_post

insert_notification_for_new_post( $post_type,  $fields,  $post_id) 
static

Arguments

$post_type

$fields

$post_id

insert_notification_for_post_update

insert_notification_for_post_update( $post_type,  $fields,  $old_fields,  $fields_changed_keys) 
static

Arguments

$post_type

$fields

$old_fields

$fields_changed_keys

Insert notification for share

insert_notification_for_share(integer $user_id, integer $post_id) 
static

Arguments

$user_id

integer

$post_id

integer

Insert notification for subassigned

insert_notification_for_subassigned(integer $user_id, integer $post_id) 
static

Arguments

$user_id

integer

$post_id

integer

Main Disciple_Tools_Notifications Instance Ensures only one instance of Disciple_Tools_Notifications is loaded or can be loaded.

instance() : \Disciple_Tools_Notifications
static
since 0.1.0
static

Response

\Disciple_Tools_Notifications

instance

Mark all as viewed by user_id

mark_all_viewed( $user_id) : array
static

Arguments

$user_id

int

Response

array

Mark the is_new field to 0 after user has viewed notification

mark_unread( $notification_id) : array
static

Arguments

$notification_id

Response

array

Mark the is_new field to 0 after user has viewed notification

mark_viewed( $notification_id) : array
static

Arguments

$notification_id

Response

array

Pretty time stamp helper function

pretty_timestamp( $timestamp) : false|string
static

Arguments

$timestamp

Response

false|string

Process post notifications for a user who has visited the post. This removes the new status for all notifications for this post

process_new_notifications( $post_id) 
static

Arguments

$post_id

send_notification_on_channels

send_notification_on_channels( $user_id,  $notification,  $notification_type,  $already_sent = array()) 
static

Arguments

$user_id

$notification

$notification_type

$already_sent

Properties

Disciple_Tools_Admin_Menus The single instance of Disciple_Tools_Admin_Menus.

_instance : object
static
var
access

private

since

Type(s)

object