May 4, 2011

Custom Field by Php Code | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Related Related Topics sp_TopicIcon
Custom Field by Php Code
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
July 25, 2017
3:15 am
Avatar
magneto664
Member
Members
Forum Posts: 12
Member Since:
July 1, 2017
sp_UserOfflineSmall Offline

Hi, i need a simply solution how to write a customfield by php code, i need format data from custom field by low and upper case

So i think the best way will be a use custom php code line for example in custom field

we have

display_name->displayname

so in custom php code will be

$post['custom_fields']['displayname'] = ucfirst($post['custom_fields']['NEW_CUSTOM_FIELD']);

I don't know if i use a correct code i don't know php much tnx.

July 25, 2017
10:10 am
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

In your case the correct PHP code will be:

Login to see the code

July 25, 2017
12:16 pm
Avatar
magneto664
Member
Members
Forum Posts: 12
Member Since:
July 1, 2017
sp_UserOfflineSmall Offline

Not exactly.

I would like to keep two value normal and with ucfirst

$post['custom_fields']['display_name'] = ucfirst($post['custom_fields']['display_name']);

and by this code (I add new custom field)

 

$post['custom_fields']['display_name'] = ucfirst($post['custom_fields']['NEW_DISPLAY_NAME']);

 

but this no working

btw how add a raw code on forum tnx

tnx

July 25, 2017
12:53 pm
Avatar
magneto664
Member
Members
Forum Posts: 12
Member Since:
July 1, 2017
sp_UserOfflineSmall Offline

When I do by this.

 

$post[‘custom_fields’][‘display_name’] = ucfirst($post[‘custom_fields’][‘NEW_DISPLAY_NAME’]);

I don't get nothing i main field display_name and also in NEW_DISPLAY_NAME

So maybe will be a reason to remove a

display_name->display_name

from custom field form in settins

but how to add this main directive by php tnx/.

July 31, 2017
4:52 am
Avatar
CyberSEO
Admin
Forum Posts: 3913
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I've replied to that on your email. The problem is that you are trying to uppercase the string before to separate it on words by means of replacing "_" symbols with spaces.

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 68

Freedom: 61

Pandermos: 54

MediFormatica: 49

B8europe: 48

Member Stats:

Guest Posters: 337

Members: 2817

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1627

Posts: 8280

Newest Members:

igor.buzaev, jeremyboucher, lthompson2709, MAC, duty3canada, backlinkmorocco

Administrators: CyberSEO: 3913