Automattic / Automattic/babble
Always undefined $leavename variable.
- Dominant language
- PHP
- Stars
- 250
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
Why do you have a 100% undeclared variable? It will never be declared in this function.
```
/**
* Hooks the get_sample_permalink filter to provide a correct sample permalink
* in situations where the post_name has been hacked for a particular context.
*
* @filter get_sample_permalink (not yet in existence, see http://core.trac.wordpress.org/attachment/ticket/22338)
*
* @param array $permalink The array, like array( $permalink, $post_name )
* @param string $title A desired title (could be null)
* @param string $name A desired post name (could be null)
* @param int $id The Post ID
* @param object $post A (hacked) Post object
* @return array The array, like array( $permalink, $post_name )
*/
public function get_sample_permalink( $permalink, $title, $name, $id, $post ) {
$permalink[ 0 ] = $this->post_type_link( $permalink[ 0 ], $post, $leavename );
return $permalink;
}
```
Contributor guide
Research direction
Locate the get_sample_permalink method shown in the issue and inspect how post_type_link is defined and called. Verify the intended handling of its third argument, then confirm the change removes the undefined-variable warning without altering the returned permalink; no test file is mentioned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100