How to i18n slugs for templates?

Filter template_include: add_filter( ‘template_include’, ‘prefix_translate_template’ ); function prefix_translate_template( $template ) { if ( ‘category-‘ . __( ‘news’, ‘your_textdomain’ ) . ‘.php’ === $template ) return ‘category-news.php’; return $template; } But I think templates based on slugs are not a good idea in that case.

Why don’t WordPress post slugs allow accents?

The sanitize_title() function uses remove_accents() right away. Both of these functions date way back to <= v1.2.1. The remove_accents() function is a hard coded list of accent characters to explicitly replace a handful of characters in a few specific languages. The inline comment and function reference simply say: Converts all accent characters to ASCII characters. … Read more

Exclude specific slug in ‘get_terms’

The get_terms() (see docs) function accepts the same args as WP_Term_Query(see docs) You have to get those terms Ids first and then pass it to the exclude arg: // default to not exclude terms $ids_to_exclude = array(); $get_terms_to_exclude = get_terms( array( ‘fields’ => ‘ids’, ‘slug’ => array( ‘graduate’, ‘job-market-candidate’, ‘graduate-student’, ‘research’ ), ‘taxonomy’ => ‘role’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)