/**
  * Save theme details settings on post save.
  *
  * @since  1.0.0
  * @access public
  * @param  int     $post_id
  * @return void
  */
 public function update($post_id)
 {
     $this->manager->update($post_id);
     // Verify the nonce.
     if (!isset($_POST['thds_theme_publish_box']) || !wp_verify_nonce($_POST['thds_theme_publish_box'], 'thds_theme_publish_box_nonce')) {
         return;
     }
     // Is the sticky checkbox checked?
     $should_stick = !empty($_POST['thds_theme_sticky']);
     // If checked, add the theme if it is not sticky.
     if ($should_stick && !thds_is_theme_sticky($post_id)) {
         thds_add_sticky_theme($post_id);
     } elseif (!$should_stick && thds_is_theme_sticky($post_id)) {
         thds_remove_sticky_theme($post_id);
     }
 }
 /**
  * Callback function for handling post status changes.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public function handler()
 {
     // Checks if the sticky toggle link was clicked.
     if (isset($_GET['action']) && 'thds_toggle_sticky' === $_GET['action'] && isset($_GET['theme_id'])) {
         $theme_id = absint(thds_get_theme_id($_GET['theme_id']));
         // Verify the nonce.
         check_admin_referer("thds_toggle_sticky_{$theme_id}");
         if (thds_is_theme_sticky($theme_id)) {
             thds_remove_sticky_theme($theme_id);
         } else {
             thds_add_sticky_theme($theme_id);
         }
         // Redirect to correct admin page.
         $redirect = add_query_arg(array('updated' => 1), remove_query_arg(array('action', 'theme_id', '_wpnonce')));
         wp_safe_redirect(esc_url_raw($redirect));
         // Always exit for good measure.
         exit;
     }
     return;
 }