Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('admin_menu', 'campos_fuentes');
- function campos_fuentes() {
- add_meta_box('aniadirfuntes','Fuentes','func_camp_fuentes','post','normal','high');
- }
- global $wpdb, $post;
- function func_camp_fuentes() {
- $value1 = (get_post_meta($post->ID, aniadirfuntes, true));
- echo '<input type="text" name="fuente[]" id="aniadirfuntes" value="'.htmlspecialchars($value1).'" style="width: 200px;" />';
- }
- function aniadirfuentes(){
- $fuente=$_POST['fuente'];
- foreach($fuente as $url ) {
- $salidaenlace=parse_Url($url, PHP_URL_HOST);
- print '<a href='.$url .'>'.ucfirst($salidaenlace).'</a>';
- echo ", ";
- }
- }
- add_filter ('the_content', 'aniadirfuentes');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement