@@ 163-172 (lines=10) @@ | ||
160 | */ |
|
161 | public function set_label( $label ) { |
|
162 | // Try to guess field label from it's name |
|
163 | if ( is_null( $label ) ) { |
|
164 | // remove the leading underscore(if it's there) |
|
165 | $label = preg_replace( '~^_~', '', $this->name ); |
|
166 | ||
167 | // remove the leading "crb_"(if it's there) |
|
168 | $label = preg_replace( '~^crb_~', '', $label ); |
|
169 | ||
170 | // split the name into words and make them capitalized |
|
171 | $label = ucwords( str_replace( '_', ' ', $label ) ); |
|
172 | } |
|
173 | ||
174 | $this->label = $label; |
|
175 | } |
@@ 452-461 (lines=10) @@ | ||
449 | **/ |
|
450 | public function set_label( $label ) { |
|
451 | // Try to guess field label from it's name |
|
452 | if ( is_null( $label ) ) { |
|
453 | // remove the leading underscore(if it's there) |
|
454 | $label = preg_replace( '~^_~', '', $this->name ); |
|
455 | ||
456 | // remove the leading "crb_"(if it's there) |
|
457 | $label = preg_replace( '~^crb_~', '', $label ); |
|
458 | ||
459 | // split the name into words and make them capitalized |
|
460 | $label = mb_convert_case( str_replace( '_', ' ', $label ), MB_CASE_TITLE ); |
|
461 | } |
|
462 | ||
463 | $this->label = $label; |
|
464 | } |