Title: Suggested Custom Post Type Support
Last modified: August 21, 2016

---

# Suggested Custom Post Type Support

 *  [maiorano84](https://wordpress.org/support/users/maiorano84/)
 * (@maiorano84)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/suggested-custom-post-type-support/)
 * I would highly recommend you add Custom Post Type support under your “Show on”
   options. This can be achieved fairly easily by adding the following lines of 
   code to the appropriate files:
 *     ```
       //admin/admin.php - function show_on_setting() - line 709
       <?php foreach(get_post_types(array('public'=>true, '_builtin' => false)) as $type){ ?>
       <li>
               <span><input id='social_on_<?php echo $type ?>' name='wp_social_ring_options[social_on_<?php echo $type ?>]' type='checkbox' value="1" <?php checked($this->options["social_on_$type"], 1); ?> /></span>
               <span><?php _e(get_post_type_object($type)->label,WP_SOCIAL_RING) ?></span>
           </li>
       <?php } ?>
   
       //admin/admin.php - function validate_options() - line 742
       foreach(get_post_types(array('public'=>true, '_builtin' => false)) as $type){
           $valid["social_on_$type"] = (isset( $input["social_on_$type"])) ? 1 : 0;
       }
   
       //includes/library.php - function set_default_options() - line 78
       foreach(get_post_types(array('public'=>true, '_builtin' => false)) as $type){
           if(!isset($this->options["social_on_$type"])) {
               $this->options["social_on_$type"] = 0;
           }
       }
   
       //includes/library.php - function print_check() - line 575
       function print_check() {
           $current_type = get_post_type();
           if(is_single() && $current_type == "post") {
               return $this->options['social_on_posts'];
           }
           if(is_page() && $current_type == "page") {
               return $this->options['social_on_pages'];
           }
           if(is_home()) {
               return $this->options['social_on_home'];
           }
           if(is_category()) {
               return $this->options['social_on_category'];
           }
           if(is_archive()) {
               return $this->options['social_on_archive'];
           }
           if(is_single() && isset($this->options["social_on_$current_type"])) {
               return $this->options["social_on_$current_type"];
           }
           return 0;
       }
       ```
   
 * Testing on my end yielded satisfactory results. All in all, keep up the great
   work.

Viewing 1 replies (of 1 total)

 *  [carlos](https://wordpress.org/support/users/amkal/)
 * (@amkal)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/suggested-custom-post-type-support/#post-4962307)
 * Hey nice improvement!!
 * One question…is there any way to avoid social button in certain page? I mean…
   do it independently, or per-page…
 * thanks!!

Viewing 1 replies (of 1 total)

The topic ‘Suggested Custom Post Type Support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-social-ring_ffffff.svg)
 * [Social Ring (Facebook Like, Google +1, ReTweet, LinkedIn and Pin It)](https://wordpress.org/plugins/wordpress-social-ring/)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-social-ring/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-social-ring/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-social-ring/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-social-ring/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [carlos](https://wordpress.org/support/users/amkal/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/suggested-custom-post-type-support/#post-4962307)
 * Status: not resolved