WordPress.org

Support

Support » Plugins and Hacks » bug:the “post_link” filter using function can not use the get_permalink()

bug:the “post_link” filter using function can not use the get_permalink()

  • 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!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘bug:the “post_link” filter using function can not use the get_permalink()’ is closed to new replies.