Module: WpWrapper::Modules::Options

Included in:
Client
Defined in:
lib/wp_wrapper/modules/options.rb

Instance Method Summary collapse

Instance Method Details

#disable_comments_and_trackbacksObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/wp_wrapper/modules/options.rb', line 9

def disable_comments_and_trackbacks
  options   =   {
    :default_pingback_flag      =>  {:checked => false, :type => :checkbox}, 
    :default_ping_status        =>  {:checked => false, :type => :checkbox},
    :default_comment_status     =>  {:checked => false, :type => :checkbox},
    :comments_notify            =>  {:checked => false, :type => :checkbox},
    :moderation_notify          =>  {:checked => false, :type => :checkbox}
  }

  return set_options(:discussion, options)
end

#set_blog_description(description) ⇒ Object



5
6
7
# File 'lib/wp_wrapper/modules/options.rb', line 5

def set_blog_description(description)
  return set_options(:general, {:blogdescription => {:value => description, :type => :input}})
end

#set_options(type, options = {}) ⇒ Object



21
22
23
24
# File 'lib/wp_wrapper/modules/options.rb', line 21

def set_options(type, options = {})
  url = get_url("#{type}_options".to_sym, absolute: false, admin_prefix: '')
  return set_options_and_submit(url, {action: /options\.php/i}, options)
end