/** * Registers post types needed by the plugin. * * @since 1.0.0 * @access public * @return void */ function thds_register_post_types() { // Set up the arguments for the theme post type. $theme_args = array('description' => thds_get_archive_description(), 'public' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'show_in_admin_bar' => true, 'exclude_from_search' => false, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => null, 'menu_icon' => 'dashicons-art', 'can_export' => true, 'delete_with_user' => false, 'hierarchical' => false, 'has_archive' => thds_get_rewrite_base(), 'query_var' => 'theme_project', 'capability_type' => 'theme_project', 'map_meta_cap' => true, 'capabilities' => thds_get_theme_capabilities(), 'labels' => thds_get_theme_labels(), 'rewrite' => array('slug' => thds_get_theme_rewrite_slug(), 'with_front' => false, 'pages' => true, 'feeds' => true, 'ep_mask' => EP_PERMALINK), 'supports' => array('title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-background', 'custom-header')); // Register the post types. register_post_type(thds_get_theme_post_type(), apply_filters('thds_theme_post_type_args', $theme_args)); }
/** * Archive description field callback. * * @since 1.0.0 * @access public * @return void */ public function field_archive_description() { wp_editor(thds_get_archive_description(), 'thds_archive_description', array('textarea_name' => 'thds_settings[archive_description]', 'drag_drop_upload' => true, 'editor_height' => 150)); ?> <p> <span class="description"><?php esc_html_e('Your theme archive description. This may or may not be shown by your theme.', 'theme-designer'); ?> </span> </p> <?php }
/** * Filters the archive description. * * @since 1.0.0 * @access public * @param string $desc * @return string */ function thds_get_the_archive_description($desc) { if (thds_is_author()) { $desc = get_the_author_meta('description', get_query_var('author')); } else { if (thds_is_theme_archive() && !$desc) { $desc = thds_get_archive_description(); } } return $desc; }