Function: swp_get_user_options()

  1. Home
  2. Knowledge Base
  3. Developers
  4. Function: swp_get_user_options()

Not the solution you were looking for?

Click the link below to submit a support ticket. If you are a Social Warfare - Pro license holder, you can log into your Account page to submit a ticket.
Submit Ticket


This function allows you to fetch all of the options that the user has set in on the options pages. It will be returned as an array of keys and values.

Example Usage

// Fetch the user assigned options
$swp_user_options = swp_get_user_options();

if($swp_user_options['some_checkbox_option'] == true):
    // Do something cool since the checkbox was checked



This function accepts no parameters.


The function returns an array of options in a format much like this example. However, to see the real values, you’ll want to run a var_dump() prior to utilizing the data.

array(5) {
    string(17) "User's Text Input"
    string(11) "choicethree"
    string(7) "#ffffff"
    array(4) {
        string(9) "True Love"
        string(17) "Rhyming I mean it"
        string(8) "To Blave"
        string(7) "Revenge"

Was this article helpful?

Related Articles