Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always undefined $leavename variable. #352

Open
rjksn opened this issue Jan 4, 2016 · 1 comment
Open

Always undefined $leavename variable. #352

rjksn opened this issue Jan 4, 2016 · 1 comment

Comments

@rjksn
Copy link

rjksn commented Jan 4, 2016

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;
    }
@benhuson
Copy link

Also noting here that $leavename is not an optional parameter when calling $this->post_type_link():

public function post_type_link( $post_link, $post, $leavename ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants