La vida vista con mis manos.

Change the wordpress preview link

By on 26 julio, 2016 in Coding with 0 Comments

Sometimes you Preview link gets broken or you need a custom structure, so using this wordpress/php function you can nail it..

function preview_link() {
    $id = get_the_ID();
    $domain = "http://mydomain.co";
    $posttype = get_post_type($id);
    $previewurl = "$domain/?post_type=$posttype&p=$id&preview=true";
    return "$previewurl";
}
add_filter( 'preview_post_link', 'preview_link' );

Its done….

Tags: , , ,

About the Author

About the Author: Ing. Sistemas ... Programador, @Koombea RockStar | Soy un Zombie | Amo el Café | Ciclomontañista | Nunca Duermo | #PizzaBrain .

Subscribe

If you enjoyed this article, subscribe now to receive more just like it.

Top