Skip to content

Instantly share code, notes, and snippets.

@alcaudon89
Last active March 22, 2020 12:05
Show Gist options
  • Save alcaudon89/6efdcb159a719bfa95c9f116c1088681 to your computer and use it in GitHub Desktop.
Save alcaudon89/6efdcb159a719bfa95c9f116c1088681 to your computer and use it in GitHub Desktop.
Cambiar la url que genera WordPress por una personalizada
<?php
/**
* Plugin Name: Cambio url Autores
* Plugin URI: https://www.davidrd.es/trucos-wordpress/cambiar-url-autores-por-defecto-wordpresss
* Description: Cambiar la url que genera WordPress por una personalizada.
* Version: 1.0
* Author: alcaudon89
* Author URI: https://davidrd.es/
* License: GPLv3 or later
*
* Agradecimientos: https://stackoverflow.com/a/903970
*
**/
add_filter( 'author_link', 'admin_author_link', 10, 3);
function admin_author_link($link, $author_id, $author_nicename) {
if( $author_id==1 ) {
$link = 'http://site.com/company/';
}
return $link;
if( $author_id==2 ) {
$link = 'http://site.com/company/';
}
return $link;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment