Title: howster's Replies | WordPress.org

---

# howster

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

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

 Search replies:

## Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Query Monitor] Logout Bug](https://wordpress.org/support/topic/logout-big/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/logout-big/#post-15024539)
 * I discovered the issue is having >1 Superadmin for Wp multi site
    [https://wordpress.org/support/topic/error-trying-to-update-wordpress/](https://wordpress.org/support/topic/error-trying-to-update-wordpress/)
   Known issue since 2019. Thanks
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Using OOP and admin_init in Settings>General](https://wordpress.org/support/topic/using-oop-and-admin_init-in-settingsgeneral/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/using-oop-and-admin_init-in-settingsgeneral/#post-12099542)
 * Example 2 here was also very useful: [https://codex.wordpress.org/Creating_Options_Pages](https://codex.wordpress.org/Creating_Options_Pages)
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Using OOP and admin_init in Settings>General](https://wordpress.org/support/topic/using-oop-and-admin_init-in-settingsgeneral/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/using-oop-and-admin_init-in-settingsgeneral/#post-12099531)
 * Outstanding. Thanks Mark. Exactly what I needed. I post the code that works for
   me.
 *     ```
       class myClass {
       	/**
       	 * Init function.
       	 *
       	 * @access public
       	 * @return void
       	 */
   
       	public function init()
           {
   
               add_action( 'admin_init', array( $this, 'page_init' ) );
           }
   
           public function page_init()
           {
   
       		register_setting( 'general', 'facebook_link' );
       		register_setting( 'general', 'twitter_link' );
       		register_setting( 'general', 'linkedin_link' );
       		register_setting( 'general', 'instagram_link' );
       		register_setting( 'general', 'youtube_link' );
   
               add_settings_section(
                   'setting_section_id', // ID
                   'Social Media Links', // Title
                   array( $this, 'print_section_info' ), // Callback
                   'general' // Page
               );
   
       		add_settings_field(
                   'facebook_link', // ID
                   'Facebook Link', // Title
                   array( $this, 'facebook_callback' ), // Callback
                   'general', // Page
                   'setting_section_id' // Section
       		);
       		   add_settings_field(
                   'twitter_link', // ID
                   'Twitter Link', // Title
                   array( $this, 'twitter_callback' ), // Callback
                   'general', // Page
                   'setting_section_id' // Section
       		);
   
       		add_settings_field(
                   'instagram_link', // ID
                   'Instagram Link', // Title
                   array( $this, 'instagram_callback' ), // Callback
                   'general', // Page
                   'setting_section_id' // Section
       		);
   
       		add_settings_field(
                   'linkedin_link', // ID
                   'LinkedIn Link', // Title
                   array( $this, 'linkedin_callback' ), // Callback
                   'general', // Page
                   'setting_section_id' // Section
       		);
   
       		add_settings_field(
                   'youtube_link', // ID
                   'YouTube Link', // Title
                   array( $this, 'youtube_callback' ), // Callback
                   'general', // Page
                   'setting_section_id' // Section
               );
   
           }
   
           /**
            * Print the Section text
            */
           public function print_section_info()
           {
               print 'Enter social media links below:';
           }
   
       		public function facebook_callback() {
       		$facebook_link = get_option( 'facebook_link', '' );
       		echo '<input id="facebook_link" style="width: 35%;" type="text" title="Facebook Link" name="facebook_link" value="' . sanitize_text_field($facebook_link) . '" />';
       		}
   
       		public function twitter_callback() {
       		$twitter_link = get_option( 'twitter_link', '' );
       		echo '<input id="twitter_link" style="width: 35%;" type="text" title="Twitter Link" name="twitter_link" value="' . sanitize_text_field($twitter_link) . '" />';
       		}
   
       		public function linkedin_callback() {
       		$linkedin_link = get_option( 'linkedin_link', '' );
       		echo '<input id="linkedin_link" style="width: 35%;" type="text" title="LinkedIn Link" name="linkedin_link" value="' . sanitize_text_field($linkedin_link) . '" />';
       		}
   
       		public function instagram_callback() {
       		$instagram_link = get_option( 'instagram_link', '' );
       		echo '<input id="instagram_link" style="width: 35%;" type="text" title="Instagram Link" name="instagram_link" value="' . sanitize_text_field($instagram_link) . '" />';
       		}
   
       		public function youtube_callback() {
       		$youtube_link = get_option( 'youtube_link', '' );
       		echo '<input id="youtube_link" style="width: 35%;" type="text" title="YouTube Link" name="youtube_link" value="' . sanitize_text_field($youtube_link) . '" />';
       		}
       }
       ```
   
    -  This reply was modified 6 years, 9 months ago by [howster](https://wordpress.org/support/users/howster/).
 *   Forum: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
   
   In reply to: [Using OOP and admin_init in Settings>General](https://wordpress.org/support/topic/using-oop-and-admin_init-in-settingsgeneral/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/using-oop-and-admin_init-in-settingsgeneral/#post-12098223)
 * Thanks very much. I added `add_action( 'admin_init', array ($this, 'link_settings_api_init'));`
   and that successfully allows the function `link_settings_api_init()` to execute.
   Now how do I get the other functions like `links_setting_section_callback_function()`
   and `facebook_function()...` to execute. Must I add more add_actions to `public
   function unit()` or add something to `link_settings_api_init()` because I’m getting
   errors like: `Warning: call_user_func() expects parameter 1 to be a valid callback,
   function ‘links_setting_section_callback_function’ not found or invalid function
   name in /home/xyz/code/wwwhsph/wp-admin/includes/template.php on line 1608`
 * …I seem to find lots of info on how to use procedural PHP to do this but OOP 
   not so much.
 * MUCH APPRECIATED.
    -  This reply was modified 6 years, 9 months ago by [howster](https://wordpress.org/support/users/howster/).
    -  This reply was modified 6 years, 9 months ago by [howster](https://wordpress.org/support/users/howster/).
    -  This reply was modified 6 years, 9 months ago by [howster](https://wordpress.org/support/users/howster/).
    -  This reply was modified 6 years, 9 months ago by [howster](https://wordpress.org/support/users/howster/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Get Use APIs - JSON Content Importer] Use with Sierra APi](https://wordpress.org/support/topic/use-with-sierra-api/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/use-with-sierra-api/#post-10171559)
 * …I also tried “entries” as the basenode and no joy
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Get Use APIs - JSON Content Importer] Use with Sierra APi](https://wordpress.org/support/topic/use-with-sierra-api/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/use-with-sierra-api/#post-10171464)
 * ‘This post has been held for moderation by our automated system. It will be reviewed
   within 72 hours.” …that sucks
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Child menu query](https://wordpress.org/support/topic/child-menu-query/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/child-menu-query/#post-10125175)
 * Ok this does it for me: [https://wordpress.org/plugins/advanced-menu-widget/](https://wordpress.org/plugins/advanced-menu-widget/)
   
   I was wondering if there was a simpler way though??
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [WP 3.3.2 Section of dashboard missing after migration](https://wordpress.org/support/topic/wp-332-section-of-dashboard-missing-after-migration/)
 *  Thread Starter [howster](https://wordpress.org/support/users/howster/)
 * (@howster)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/wp-332-section-of-dashboard-missing-after-migration/#post-6121739)
 * haha ya but I don’t want to mess with the plugins as some only work on this version.
   I’m happy to just move it from A to B for now.
 * I get the error `[12-May-2015 15:23:07 UTC] PHP Fatal error: Access to undeclared
   static property: WP_Screen::$this in /homemysit/public_html/wp-admin/includes/
   screen.php on line 706`
 * which is:
 * `<?php echo self::$this->_help_sidebar; ?>`
 * Any ideas of fix.

Viewing 8 replies - 1 through 8 (of 8 total)