Title: bug:the &#8220;post_link&#8221; filter using function can not use the get_permalink()
Last modified: August 18, 2016

---

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

 *  [iaskie](https://wordpress.org/support/users/iaskie/)
 * (@iaskie)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/bugthe-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)

 *  Thread Starter [iaskie](https://wordpress.org/support/users/iaskie/)
 * (@iaskie)
 * [18 years, 9 months ago](https://wordpress.org/support/topic/bugthe-post_link-filter-using-function-can-not-use-the-get_permalink/#post-599581)
 * no one know?

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.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [post_link](https://wordpress.org/support/topic-tag/post_link/)

 * 1 reply
 * 1 participant
 * Last reply from: [iaskie](https://wordpress.org/support/users/iaskie/)
 * Last activity: [18 years, 9 months ago](https://wordpress.org/support/topic/bugthe-post_link-filter-using-function-can-not-use-the-get_permalink/#post-599581)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
