WordPress.org

Ready to get started?Download WordPress

Forums

bug:the "post_link" filter using function can not use the get_permalink() (2 posts)

  1. iaskie
    Member
    Posted 6 years ago #

    this is my code:

    /*
    Plugin Name: TEST MYPERMALINK
    Plugin URI: http://www.pkphp.com/
    Description: Create every post to HTML cahe file, and refresh automatic.
    Version: 1.0
    Author: Askie
    Author URI: http://www.pkphp.com/
    */
    
    function Mypermalink($post_url,$post)
    {
    	if (false)
    	{
    		return "my permalink";
    	}
    	else
    	{
    		return get_permalink($post->ID);
    	}
    }
    
    add_filter('post_link',"Mypermalink",1,2);

    active the code ,the wordpress will return a blank screen !

    what i want is to write a real html cache plugin , and the bug is display when i try to change the default post permalink!

    someone want to test this code please save the code as a plugin file in you wp plugins folder and active the code ,then you visit your wp home page, the bug will display!

  2. iaskie
    Member
    Posted 6 years ago #

    no one know?

Topic Closed

This topic has been closed to new replies.

About this Topic