AnsPress_Notification_Query::get_permalink()
Description #
Get the permalink of notification based on ref_id and ref_type.
Source #
File: addons/free/notification/query.php
public function get_permalink() { if ( in_array( $this->get_ref_type(), [ 'question', 'answer', 'post' ], true ) ) { return ap_get_short_link( [ 'ap_p' => $this->get_ref_id() ] ); } elseif ( 'comment' === $this->get_ref_type() ) { return ap_get_short_link( [ 'ap_c' => $this->get_ref_id() ] ); } elseif ( 'reputation' === $this->get_ref_type() ) { return ap_get_short_link( [ 'ap_u' => $this->object->noti_user_id, 'sub' => 'reputations' ] ); } }
Expand full source code Collapse full source code View on GitHub: addons/free/notification/query.php:235
Add your comment