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