Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Orlando Marconi

I know it doesn’t make sense to have BULK editor for SLUG.

But it would be very useful if I want to clear the SLUG column to generate new values from the changes I made to the names column.

It is possible?

3 months, 1 week ago
Stefan
Developer

Technically, yes, if Bulk Edit was enabled for the Slug column, it does what you want. I tried this locally by enabling bulk editing with the same logic as inline edit and when I clear the value and save it for all selected posts, it will generate the name like WordPress would do normally. Even when I give all the items the same name, it will suffix the slug (post name) with an auto-incremental number.

The next question though, do we want to enable bulk edit by default since it will probably do more harm if used incorrectly than do good. So I do still stand behind the choice that it should be disabled by default, but that it can be enabled by a hook.

Unfortunately, there is currently no hook in place to change that, but we will think of a way to make that possible in a future release. I’ve added it to the feature request list. As a dirty workaround, you could (temporarily) change the following file to make it possible until it will be overwritten by the next update.

admin-columns-pro/classes/Editing/Services/Post/Slug.php

Let get_view() return the same service for both inline and bulk:

public function get_view( $context ) {
	return ( new View\Text() )->set_placeholder( __( 'Enter slug', 'codepress-admin-columns' ) );
}

If you want a more sustainable way, you could extend the column and write your extended Editing service. But doing a quick fix and waiting for the fix in the next release is probably easier :)

Btw, I will report here if the feature to accommodate this with hooks is available.

3 months, 1 week ago

You must be logged in to reply to this topic.