Regenerate Slugs From Title of Posts

Yes, it is possible. Sample code, has to be tested and refined: // get all posts $posts = get_posts( array ( ‘numberposts’ => -1 ) ); foreach ( $posts as $post ) { // check the slug and run an update if necessary $new_slug = sanitize_title( $post->post_title ); if ( $post->post_name != $new_slug ) { … Read more

Theme localization of “slugs” (custom post types, taxonomies)

I wouldn’t try to localize your slugs. Instead, why not give your users the option to change them by adding another field to the permalink settings page? Hook into load-options-permalink.php and set up some things to catch the $_POST data to save your slug. Also add a settings field to the page. <?php add_action( ‘load-options-permalink.php’, … Read more

How does WordPress generate URL slugs?

As per @SinisterBeard‘s very valid comment to the question already a couple of years back now, this answer has long been outdated and the mentioned function(s) hence been replaced by a newer API: See wp_unique_post_slug. Original Answer Off the bat, I can’t give you a page/tutorial/documentation on how WP slugs are generated, but take a … Read more

How to get a taxonomy term name by the slug?

The function you are looking for is get_term_by. You would use it as such: <?php $term = get_term_by(‘slug’, ‘my-term-slug’, ‘category’); $name = $term->name; ?> This results in $term being an object containing the following: term_id name slug term_group term_taxonomy_id taxonomy description parent count The codex does a great job explaining this function: https://developer.wordpress.org/reference/functions/get_term_by/

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