/**
  * Runs on the page load. Checks if we're viewing the theme post type and adds
  * the appropriate actions/filters for the page.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public function load()
 {
     $screen = get_current_screen();
     $theme_type = thds_get_theme_post_type();
     // Bail if not on the themes screen.
     if (empty($screen->post_type) || $theme_type !== $screen->post_type) {
         return;
     }
     // Custom action for loading the edit theme screen.
     do_action('thds_load_theme_edit');
     // Load the fields manager.
     require_once thds_plugin()->dir_path . 'admin/fields-manager/class-manager.php';
     // Create a new theme details manager.
     $this->manager = new THDS_Fields_Manager('theme_details');
     // Enqueue scripts and styles.
     add_action('admin_enqueue_scripts', array($this, 'enqueue'));
     // Output the theme details box.
     add_action('edit_form_after_editor', array($this, 'theme_details_box'));
     // Add/Remove meta boxes.
     add_action('add_meta_boxes', array($this, 'add_meta_boxes'));
     // Add custom option to the publish/submit meta box.
     add_action('post_submitbox_misc_actions', array($this, 'submitbox_misc_actions'));
     // Save metadata on post save.
     add_action('save_post', array($this, 'update'));
     // Filter the post author drop-down.
     add_filter('wp_dropdown_users_args', array($this, 'dropdown_users_args'), 10, 2);
 }
            $role->add_cap('manage_theme_features');
            // Post type caps.
            $role->add_cap('create_theme_projects');
            $role->add_cap('edit_theme_projects');
            $role->add_cap('edit_others_theme_projects');
            $role->add_cap('publish_theme_projects');
            $role->add_cap('read_private_theme_projects');
            $role->add_cap('delete_theme_projects');
            $role->add_cap('delete_private_theme_projects');
            $role->add_cap('delete_published_theme_projects');
            $role->add_cap('delete_others_theme_projects');
            $role->add_cap('edit_private_theme_projects');
            $role->add_cap('edit_published_theme_projects');
        }
    }
}
/**
 * Gets the instance of the `THDS_Plugin` class.  This function is useful for quickly grabbing data
 * used throughout the plugin.
 *
 * @since  1.0.0
 * @access public
 * @return object
 */
function thds_plugin()
{
    return THDS_Plugin::get_instance();
}
// Let's do this thang!
thds_plugin();
/**
 * Registers admin styles.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function thds_admin_register_styles()
{
    $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    wp_register_style('thds-admin', thds_plugin()->css_uri . "admin{$min}.css");
}