Remove slugs of old and unused custom post type
Found the old page in the wp_post table and deleted that row
Found the old page in the wp_post table and deleted that row
‘/(ṁ|ṭ|ḍ|ṇ|ṅ|ñ|ḷ|ṃ)/’ is a valid regex to process what you want. $string = ‘/(ṁ|ṭ|ḍ|ṇ|ṅ|ñ|ḷ|ṃ)/ is my regex and my chosen string is: ṁ, ṭ, ḍ, ṇ, ṅ, ñ, ḷ, ṃ’; echo preg_replace( ‘/(ṁ|ṭ|ḍ|ṇ|ṅ|ñ|ḷ|ṃ)/’, ”, $string, ); // Returns ‘/(|||||||)/ is my regex and my chosen string is: , , , , , , , ‘ EDIT: … Read more
I would recommend using get_pages() rather than wp_list_pages() for this purpose. The get_pages() function will return an array of objects of Pages, and you can use the array data to build your own HTML list. e.g.: <?php // Wrap in a function, for later output; function wpse47989_list_pages() { // Get an array of pages using … Read more
Developers can use the following filter: /** * Filters the post slug before it is generated to be unique. * * Returning a non-null value will short-circuit the * unique slug generation, returning the passed value instead. * * @since 5.1.0 * * @param string|null $override_slug Short-circuit return value. * @param string $slug The desired … Read more
I will agree with King Li. Furthermore there is a very old plugin you can download from my dropbox that is still functional and will be of great help to you. What it does is changing the greek slugs to latin characters (greeklish) automatically for all new posts/pages/custom posts . You will have to manually … Read more
Slugs need to be unique-ish. The function that determines what a slug will be is called, appropriately enough, wp_unique_post_slug. Attachment slugs need to be unique across the whole set of slugs. Meaning that they cannot be shared with anybody, anywhere. Page slugs (or any hierarchical post type) needs to be unique within that specific post … Read more
As long as haven’t touched the slug WordPress will generate a new one after you entered a title. Update To change other peoples slugs use a filter (not tested!): add_filter( ‘wp_insert_post_data’, ‘prevent_numeric_slugs’, 10, 1 ); function prevent_numeric_slugs( $post_data ) { if ( ! isset ( $post_data[‘post_title’] ) or ! is_numeric( $post_data[‘post_name’] ) ) { // … Read more
I think you should be able to do this using the wp_unique_post_slug filter (which is applied in the function of the same name): add_filter(“wp_unique_post_slug”, function($slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug) { if($meta = get_post_meta($post_ID, “my-meta”, true)) { $slug = $meta . ‘-‘ . $slug; } return $slug; }, 10, 6); As this is applied at … Read more
This is more of a PHP question, but the solution is simple – you need to use a foreach-loop on $getslug, because you just echo the slug of the first taxonomy. The function wp_get_post_terms() does not return a single object, but an array of objects. You are right with the [0], this indicates that you … Read more
Modification of a slug happens when wordpress detect that the slug is already in use. “In use” in this case includes the posts that are trashed. In your case if you don’t need the id to be associated with the date then you might get better result by using the post id as the id, … Read more