Simple Membership Plugin › Forums › Simple Membership Plugin › Searchable Member Fields
- This topic has 5 replies, 3 voices, and was last updated 10 years, 11 months ago by
peter.
-
AuthorPosts
-
December 10, 2015 at 3:58 pm #4432
peter
ParticipantHi I hope you can help.
I have edited the following file:class.swpm-members.php
And added the follwoing code:
function get_columns() {
return array(
‘cb’ => ‘<input type=”checkbox” />’
, ‘member_id’ => SwpmUtils::_(‘ID’)
, ‘user_name’ => SwpmUtils::_(‘Username’)
, ‘first_name’ => SwpmUtils::_(‘First Name’)
, ‘last_name’ => SwpmUtils::_(‘Last Name’)
, ’email’ => SwpmUtils::_(‘Email’)
, ‘company_name’ => SwpmUtils::_(‘Company’)
, ‘address_city’ => SwpmUtils::_(‘City’)
, ‘alias’ => SwpmUtils::_(‘Membership Level’)
, ‘subscription_starts’ => SwpmUtils::_(‘Access Starts’)
, ‘account_state’ => SwpmUtils::_(‘Account State’)
);
}function get_sortable_columns() {
return array(
‘member_id’ => array(‘member_id’, true),//True means already sorted
‘user_name’ => array(‘user_name’, false),
’email’ => array(’email’, false),
‘alias’ => array(‘alias’, false),
‘company_name’ => array(‘alias’, false),
‘address_city’ => array(‘alias’, false),
‘account_state’ => array(‘account_state’, false),
);
}As you can see I have added company name and also address city.
Can you advise how I make these fields show up in search results. I am happy to edit the correct section of code. Currently when I search for say ‘ACME’ then I get the feedback that no results have been found, but I have clearly added ACME as the company name for a member.
Many thanks in advance.
December 10, 2015 at 10:21 pm #4436mbrsolution
ModeratorHi, are you trying to set up the search for custom fields added using the Form Builder Add-on under the Members tab?
December 11, 2015 at 9:46 am #4461peter
ParticipantNo these are regular fields when adding a member.
It seems that WordPress only comes with the ability to search the name and username. I have exapnded this slightly using a function, but I would really like to include the company name and also the city/town fields in my search.
I have been able to add the fields to the mmeber view using the code above, but really would be ideal if these could also be searchable.
I don’t have the Form Builder installed.
December 11, 2015 at 11:43 pm #4468mbrsolution
ModeratorHi, thank you for your request. The plugin developers will further into your request.
December 13, 2015 at 12:57 am #4496admin
KeymasterWe have made a change so the the search feature in the members menu will search the company name, city, state, country fields also. This feature will be available in the next version.
December 14, 2015 at 9:15 am #4516peter
ParticipantThanks for this.
Do you have a date when this update will be released?
Thanks
Peter
-
AuthorPosts
- You must be logged in to reply to this topic.