Module: WpWrapper::Modules::Profiles
- Included in:
- Client
- Defined in:
- lib/wp_wrapper/modules/profiles.rb
Instance Method Summary collapse
- #add_user(login, email, password, role = :editor, send_password = false) ⇒ Object
- #change_display_name(display_name) ⇒ Object
-
#change_profile_password(new_password) ⇒ Object
Deprec?.
- #update_profile(options = {}) ⇒ Object
Instance Method Details
#add_user(login, email, password, role = :editor, send_password = false) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/wp_wrapper/modules/profiles.rb', line 5 def add_user(login, email, password, role = :editor, send_password = false) = { :user_login => {:value => login, :type => :input}, :email => {:value => email, :type => :input}, :pass1 => {:value => password, :type => :input}, :pass2 => {:value => password, :type => :input}, :role => {:value => role, :type => :select}, :send_password => {:checked => send_password, :type => :checkbox}, } url = get_url(:new_user, absolute: false, admin_prefix: '') return (url, {name: "createuser"}, ) end |
#change_display_name(display_name) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/wp_wrapper/modules/profiles.rb', line 20 def change_display_name(display_name) = { :nickname => {:value => display_name, :type => :input} } update_profile() = { :display_name => {:value => display_name, :type => :select} } update_profile() end |
#change_profile_password(new_password) ⇒ Object
Deprec?
50 51 52 53 54 55 56 57 |
# File 'lib/wp_wrapper/modules/profiles.rb', line 50 def change_profile_password = { :pass1 => {:value => new_password, :type => :input}, :pass2 => {:value => new_password, :type => :input} } return update_profile() end |
#update_profile(options = {}) ⇒ Object
43 44 45 46 47 |
# File 'lib/wp_wrapper/modules/profiles.rb', line 43 def update_profile( = {}) url = get_url(:profile, absolute: false, admin_prefix: '') return (url, {action: /profile\.php/i}, ) end |