Title: tszdev's Replies | WordPress.org

---

# tszdev

  [  ](https://wordpress.org/support/users/tszdev/)

 *   [Profile](https://wordpress.org/support/users/tszdev/)
 *   [Topics Started](https://wordpress.org/support/users/tszdev/topics/)
 *   [Replies Created](https://wordpress.org/support/users/tszdev/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/tszdev/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/tszdev/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/tszdev/engagements/)
 *   [Favorites](https://wordpress.org/support/users/tszdev/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Creating option for my plugin](https://wordpress.org/support/topic/creating-option-for-my-plugin/)
 *  Thread Starter [tszdev](https://wordpress.org/support/users/tszdev/)
 * (@tszdev)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/creating-option-for-my-plugin/#post-9437399)
 * Yes it was.
 * The variable was assigned at the beginning
 *     ```
       public $default_phone_number;
       ```
   
 * Also the register_settings function is hooked from another class file under admin_init
   hook like this:
 *     ```
       $this->loader->add_action( 'admin_init', $plugin_admin, 'register_setting' );
       ```
   
 * You need to understand that my problem is not in the declaration of the Var but
   in getting the option from the db because if I declare the var as equal to 1234
   It outputs it.
 * for instance when I do this:
 *     ```
       $this->default_phone_number = 1234;
       ```
   
 * everything works good but when I do this(as I posted in the original code):
 *     ```
       $this->default_phone_number = get_option($this->plugin_name . '_phone');
       ```
   
 * nothing happens

Viewing 1 replies (of 1 total)