LPH
Well-known member
I have a class, which sits outside of XenForo, and is called to change an author url link in WordPress. Today I decided to work on building the link using XenForo methods rather than manually building. However, I'm getting something REALLY strange.
Here is the class:
Line 44 is the getThreadById.
The error being returned is ...
As you can see, Dark_PostRating_Model isn't being called. I'm stumped. Any ideas?
Here is the class:
PHP:
class Author_Link {
public function __construct() {
add_filter( 'author_link', array( $this, 'xenword_author_link' ), 100 );
}
public function xenword_author_link() {
global $post;
$thread_id = get_post_meta( $post->ID, 'thread_id', true );
$threadModel = XenForo_Model::create('XenForo_Model_Post');
$thread = $threadModel->getThreadById($thread_id);
$xf_author_link = XenWord::getBoardUrl() . '/' . XenForo_Link::buildPublicLink('members', $thread);
return $xf_author_link;
}
}
new Author_Link();
Line 44 is the getThreadById.
The error being returned is ...
Code:
An exception occurred: Call to undefined method Dark_PostRating_Model_Post::getThreadById()
As you can see, Dark_PostRating_Model isn't being called. I'm stumped. Any ideas?