custom-post-type-permalinks icon indicating copy to clipboard operation
custom-post-type-permalinks copied to clipboard

Will this work with programmatically-added content?

Open robertandrews opened this issue 8 years ago • 1 comments

Hi,

When does this plugin work?

I have a custom post type, "Quotes", registered using register_post_type( 'quote', $args ); and code options.

I have a script running on cron which finds quotes in public news content and inserts them as a "quote" post, using wp_insert_post and wp_publish_post, and maybe wp_update_post. post_name may be used in some cases.

By default, created "quote" post slugs are versions of the title (although the Permalinks setting for standard Posts is different). As it happens, it is currently problematic, because I find duplicate slugs are getting saved for posts with the same legitimate headline.

Could your plugin help me?

ie. If I run your plugin on my custom post type "Quotes", will all "Quotes" posts adopt the specified permalink structure even if they are created programmatically by a script? In other words, will your plugin take control? Or will everything still be run by the script?

What about if I don't manually set post_name in the script? Would the plugin then take over?

Thanks.

robertandrews avatar Mar 21 '18 16:03 robertandrews

@robertandrews sorry for the late reply.

This plugin set permalink all posts of the post type.

Can not change permalinks for each post with this plugin.

I think that it is possible using add_rewrite_rule.

torounit avatar Jul 20 '18 05:07 torounit