1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| $filters = array(
'post_link', // Normal post link
'post_type_link', // Custom post type link
'page_link', // Page link
'attachment_link', // Attachment link
'get_shortlink', // Shortlink
'post_type_archive_link', // Post type archive link
'get_pagenum_link', // Paginated link
'get_comments_pagenum_link', // Paginated comment link
'term_link', // Term link, including category, tag
'search_link', // Search link
'day_link', // Date archive link
'month_link',
'year_link',
);
foreach ( $filters as $filter ) {
add_filter( $filter, 'wp_make_link_relative' );
} |
Partager