Title: Errors when saving other post types
Last modified: September 1, 2016

---

# Errors when saving other post types

 *  [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * (@garrett-eclipse)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/errors-when-saving-other-post-types/)
 * Hello,
 * I noticed the following in debug.log when I saved any other custom post type 
   or post/page other than the forum/topic cpts;
    [14-Jun-2016 20:19:05 UTC] PHP
   Notice: Undefined index: str-bbpress-topic-sort-replies in /home/ljlee/public_html/
   wp-content/plugins/bbpress-sort-topic-replies/bbPress_sort_topic_replies.php 
   on line 190 [14-Jun-2016 20:19:05 UTC] PHP Notice: Undefined index: str-bbpress-
   topic-sort-replies in /home/ljlee/public_html/wp-content/plugins/bbpress-sort-
   topic-replies/bbPress_sort_topic_replies.php on line 192 [14-Jun-2016 20:19:05
   UTC] PHP Notice: Undefined index: str-bbpress-sort-replies in /home/ljlee/public_html/
   wp-content/plugins/bbpress-sort-topic-replies/bbPress_sort_topic_replies.php 
   on line 199 [14-Jun-2016 20:19:05 UTC] PHP Notice: Undefined index: str-bbpress-
   sort-replies in /home/ljlee/public_html/wp-content/plugins/bbpress-sort-topic-
   replies/bbPress_sort_topic_replies.php on line 201 [14-Jun-2016 20:19:05 UTC]
   PHP Notice: Undefined index: str-bbpress-sort-replies-show-lead-topic in /home/
   ljlee/public_html/wp-content/plugins/bbpress-sort-topic-replies/bbPress_sort_topic_replies.
   php on line 208 [14-Jun-2016 20:19:05 UTC] PHP Notice: Undefined index: str-bbpress-
   sort-replies-show-lead-topic in /home/ljlee/public_html/wp-content/plugins/bbpress-
   sort-topic-replies/bbPress_sort_topic_replies.php on line 210 [14-Jun-2016 20:
   19:05 UTC] PHP Notice: Undefined index: str-bbpress-sort-replies-show-lead-topic-
   forum in /home/ljlee/public_html/wp-content/plugins/bbpress-sort-topic-replies/
   bbPress_sort_topic_replies.php on line 217 [14-Jun-2016 20:19:05 UTC] PHP Notice:
   Undefined index: str-bbpress-sort-replies-show-lead-topic-forum in /home/ljlee/
   public_html/wp-content/plugins/bbpress-sort-topic-replies/bbPress_sort_topic_replies.
   php on line 219
 * This is due to the code being executed via save_post which runs on any CPT during
   save.
    To resolve replace the add_action on line 186 with two add_actions one
   for each CPT that uses this functionality (ie. forum and topic); add_action( ‘
   save_post_forum’, ‘bbPress_meta_box_save’ ); add_action( ‘save_post_topic’, ‘
   bbPress_meta_box_save’ );
 * By specifying the post_type in the save_post action we don’t need to do a check
   before working with $_POST attributes that the plugin expects.
 * Thank you
 * [https://wordpress.org/plugins/bbpress-sort-topic-replies/](https://wordpress.org/plugins/bbpress-sort-topic-replies/)

The topic ‘Errors when saving other post types’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bbpress-sort-topic-replies_fafafa.
   svg)
 * [bbPress - Sort topic replies](https://wordpress.org/plugins/bbpress-sort-topic-replies/)
 * [Support Threads](https://wordpress.org/support/plugin/bbpress-sort-topic-replies/)
 * [Active Topics](https://wordpress.org/support/plugin/bbpress-sort-topic-replies/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bbpress-sort-topic-replies/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bbpress-sort-topic-replies/reviews/)

## Tags

 * [cpt](https://wordpress.org/support/topic-tag/cpt/)
 * [save_post](https://wordpress.org/support/topic-tag/save_post/)

 * 0 replies
 * 1 participant
 * Last reply from: [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/errors-when-saving-other-post-types/)
 * Status: not resolved