<?php
/*
Plugin Name: Links
Plugin URI: http://forobeta.com/
Description: Encripta los links externos
Version: 0.1 Pajarraco
Author: forobeta
Author URI: http://forobeta.com/
*/
$_SITIOW = parse_url(home_url());
function ccw_post($POST){
return preg_replace_callback('#href="([^"]*)"#is', 'my_urlencode', $POST);
}
function my_urlencode($a){
global $post,$_SITIOW;
if (!get_post_meta($post->ID, "no_URL", true)) {
if(stripos($a[1],$_SITIOW['host'])===false && stripos($a[1],'javascript')===false){
return 'href="http://localhost/mega/go.php?url='. base64_encode(urlencode($a[1])).'" pepe="'.$_SITIOW['host'].'" target="_blank"';
}
}
return 'href="'.$a[1].'"';
}
?>