Closed deniro83 closed 3 hours ago
adding Single Page to CCT
in the CCT field there would be an additional (could be hidden) or editable field (link) like Name/ID
you can add a script that would generate a link from meta, e.g. name (you could use a script)
function generate_slug($title) { // Convert to lowercase $title = mb_strtolower($title, 'UTF-8'); // Converting Polish characters to Latin $title = str_replace( ['ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ź','Ż'], ['a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z'], $title ); // Removing special characters $title = preg_replace('/[^a-z0-9\s-]/', '', $title); // Replacing spaces with dashes $title = preg_replace('/[\s-]+/', '-', $title); // Removing double dashes $title = trim($title, '-'); return $title; }
Based on this field, a link would be generated (like in CPT), but it would be saved in the database as one of the rows, e.g.
this_is_my_product
and together it would look like this
http://mypage.com/products/this_is_my_product
this would open the way to other benefits.
adding Single Page to CCT
in the CCT field there would be an additional (could be hidden) or editable field (link) like Name/ID
you can add a script that would generate a link from meta, e.g. name (you could use a script)
Based on this field, a link would be generated (like in CPT), but it would be saved in the database as one of the rows, e.g.
this_is_my_product
and together it would look like this
http://mypage.com/products/this_is_my_product
this would open the way to other benefits.