hi. sometime ago norman gave me workaround:https://toolset.com/forums/topic/custom-post-title-from-5-different-custom-fields/
to auto rename the post title. its working well.
now i need simple php codes to detect the value.
to cut short i have this..
....
$field_1 = $postarr['wpcf'][project-name']; //select field
if(!isset($field_1) and $field_1 == 'Major') //value 1
$title .= 'Major Project';
if(!isset($field_1) and $field_1 == 'Minor') //value 2
$title .= 'Minor Project';
if(!isset($field_1) and $field_1 == ' ') //value 3
$title .= 'No Project';
am i doing something wrong here ?
if(isset($field_1) and $field_1 == 'Major')
{$title .= ' ***[Major Project] ';}
if(isset($field_1) and $field_1 == 'Minor')
{$title .= ' [Minor Project] ';}
if(isset($field_1) and $field_1 != 'Major' and $field_1 != 'Minor')
{$title .= ' No Project ';}
i manage to solve this halfway. wonder if this is acceptable or better way of doing it ? thanks
Hi Dee,
Your updated code looks good and you can further shorten it up as:
if(isset($field_1) and $field_1 == 'Major')
{$title .= '***[Major Project]';}
elseif(isset($field_1) and $field_1 == 'Minor')
{$title .= '[Minor Project]';}
else
{$title .= 'No Project';}
regards,
Waqar
yes, thats good thanks waqar.