New answers tagged

0

Note if you are looking to get the plugin slug for use with the plugin update server (eg. for checking and displaying if your plugin has an update on a plugin screen) you should read this answer to a similar question: http://wordpress.stackexchange.com/a/216940/76440 So in that case this would work: function get_plugin_update_slugs(){ $plugin_array ...


0

Unfortunately the slug is returned via the Update API, the answer to this question is not so obvious unless you query the API itself. However, if you want to see a list of your current plugin slugs and related plugin data you can simply do: print_r(get_site_transient('update_plugins')); But, this will not have info on a newly installed plugin for another ...


0

The re-slug plugin can be fixed to work with Wordpress 4 and up. Edit line 13 of re-slug.php to read: $return = str_replace('Edit</button>', 'Edit</button> <button type="button" id="re-slug" class="edit-slug button button-small hide-if-no-js" style="display:inherit;"><a href="#re-slug">Re-slug</a></button>', $return); ...


0

First thing I would backup and restore the site on a local development environment. Then you can try use this tool on your local site: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Make sure that when you rename you are giving them something unique otherwise you may get in trouble.


0

global $wp_query; $post_id = $wp_query->post->ID $post = get_post( $post_id ); $slug = $post->post_name; echo $slug; This should be the best solution in case you have to ask for it from a secondary loop, and if you getting the wrong slug with only the global $post variable.


0

Use this function to remove the apostrophe: preg_replace( "/[:’]/", "", $title );


0

When you use the graphical interface, post_name is stored in the wp_posts table even for draft posts as soon as you modify the default value. I tried your code (case 2) and I actually see the new entry in the database, with the correct post_name. Perhaps your check to post_name is not correct ?



Top 50 recent answers are included