Hi @kirgizmustafa17,
unfortunately it is not available in the vanilla version of plugin, but you can try to use the following code snippet to make it possible to set custom permalinks with CLI:
/**
* Examples:
* 1. wp set_custom_permalink --id=123 --uri="sample/custom/permalink"
* 2. wp set_custom_permalink --id=123 --uri="default"
*/
function pm_set_custom_uri($args = array(), $assoc_args = array()) {
global $permalink_manager_uris;
$arguments = wp_parse_args(
$assoc_args,
array(
'id' => 0,
'uri' => '',
)
);
// Check if arguments are alright.
if(!empty($arguments['id']) && ! empty($arguments['uri']) && !empty($permalink_manager_uris)) {
$post_id = $arguments['id'];
$post_uri = ($arguments['uri'] == 'default') ? Permalink_Manager_URI_Functions_Post::get_default_post_uri($post_id) : $arguments['uri'];
$permalink_manager_uris[$post_id] = $post_uri;
update_option('permalink-manager-uris', $permalink_manager_uris);
// Show success message.
WP_CLI::success('The custom permalink was set correctly!');
} else {
// Show error message
WP_CLI::error('The custom permalink was not set!' );
}
}
if(defined( 'WP_CLI' ) && WP_CLI) {
WP_CLI::add_command('set_custom_permalink', 'pm_set_custom_permalink');
}
Best regards,
Maciej
Thank you for you answer. I am trying now,