Hi Janneke,
The second argument isn’t mandatory — do you have a use case where it would be needed?
Thread Starter
Ella
(@ellatrix)
Hey Lance,
I’m hooking in the title with
add_filter( 'the_title', array( $this, 'the_title' ), 20, 2 );
,
but the $id is missing and I need it. 🙂
Can you explain a bit more? Why do you need the post ID?
Thread Starter
Ella
(@ellatrix)
Sorry for the late reply. I’m working on the front-end editor, and it needs to filter the title only when the $post->ID matches the $id of the title because otherwise it would filter titles from other posts that might be called inside the loop.
https://github.com/avryl/wp-front-end-editor/blob/master/class-wp-front-end-editor.php#L351
Cool — thanks for explaining this. We’ll add the ID argument in the next version of P2.