Support

Search results for ""

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

Using "New column type" template

I’d be grateful for some assistance in getting this feature to work.

I’m trying to create a new column type that will allow me to create a column for editable permalinks. I believe I’ve followed directions to a T. I tried at first with column name of Permalinks to distinguish it from WP’s system name of permalink. Then tried just Permalink (without the s). I have succeeded in creating an editable column, but it’s not picking up and presenting the value of the permalink field. Instead, it is literally displaying the text word “something.” See here: https://gyazo.com/41975b14244c17eba17a7ae90d490878

Any assistance you can offer would be helpful. I saw that in another post you mentioned ” you could use our slug column as a good example.” ( https://www.admincolumns.com/forums/topic/inline-permalink-or-path/ ) but I haven’t any idea where to look for that.

6 years, 7 months ago
randal.oulton

p.s. I don’t suppose there’s any chance of you just offering this as a downloadable add-on with the already customized code, since I see several others have crashed into the Permalink editing hurdle?

6 years, 7 months ago
Stefan van den Dungen Gronovius
Developer

Hi Randal,

Please notice that creating a custom column requires some developer skills. The repository you downloaded is an example and you really need to adjust the code to make it work. This example indeed just shows ‘something’ for every column since that is the example we put in there.

You’ll have to put in your custom logic in the get_value() and get_raw_value() methods to make it work. To display the permalink you can easily use the get_the_permalink( $id ) function in the get_raw_value() method. Addin inline editing is really an advanced step to make it work. And besides that, there is no default way to change the permalink in WordPress.

A permalink in WordPress is based on multiple settings and stored automatically. The following parameters can affect a permalink for a specific post:

– Permalink structure (Settings)
– Any parent posts (for hierarchical posts)
– The Slug of a post (the most important param for a specific post)

Please notice that there is a slug column available that also allows you to inline edit the slug. I believe this already solves most of your issue.

We indeed cannot help you with a downloadable add-on for this as there is no good standardized way to alter the permalink per post. Even in WordPress, there is no UI to do this, except for the slug part and that is already available in our Slug column.

6 years, 7 months ago
randal.oulton

“Please notice that there is a slug column available that also allows you to inline edit the slug. I believe this already solves most of your issue.”

You believe incorrectly. The slug does diddly squat to fix the permalink.

“You’ll have to put in your custom logic in the get_value() and get_raw_value() methods to make it work. To display the permalink you can easily use the get_the_permalink( $id ) function in the get_raw_value() method. Addin inline editing is really an advanced step to make it work. And besides that, there is no default way to change the permalink in WordPress.”

You should add that to your directions for using the example. Your directions explicitly say “search and replace and rename” and bob’s your uncle. You need to add to your directions what you have just told me. Would be easy to do since you’ve already typed it out, you can just copy and paste.

I wish your advertising had not said that NOT ALL fields would be editable in columns. As your support forum shows, many purchasers are buying and thinking that that includes permalinks.

I’m happy with the product otherwise and will stick with it, but this experience has sadly started me off with a sour taste in my mouth, which could have been averted by adding to your marketing “permalinks are an exception.”

Thanks for your time.

Cheers.

6 years, 7 months ago
Stefan van den Dungen Gronovius
Developer

Hi Randal,

1) I’m sorry, but we can’t give much support on creating your own column. We provided a toolkit to get you started, but of course you must have some knowlegde on how to develop custom code. Just search and replace is of course not enough to make a new column work. The ‘Custom Code’ part is the most important part to make the column ‘Custom’.

2) I can give you an example for the column class that contains all the logic to display the permalink. You can find the code below, but I can’t help you to make it editable. It is just not possible in WordPress to edit something in the DB that alters the complete permalink (including structure) unless you alter the way how permalinks work in WordPress. That’s also the reason that we don’t have a permalink column that is inline editable. Our plugin works with the default functionality of WordPress.

class AC_Column_Permalink extends AC_Column {

	public function __construct() {
		$this->set_type( 'column-custom_permalink' );
		$this->set_label( 'Permalink' );
	}

	public function get_raw_value( $post_id ) {
		return get_the_permalink( $post_id );
	}

}

3) I believe we have enough information on our website that tells that most columns are inline editable, filterable and sortable. We even provide lists per column that shows which features are supported. It’s not possible to add all features to all columns, so permalink is not the only exception.

4) I understand that the lack of this particular feature that you need may be a disappointment for you, so I can offer you a refund if you want. Please let me know at support@admincolumns.com how I can help you any further with this issue.

6 years, 6 months ago

You must be logged in to reply to this topic.