Learn icon indicating copy to clipboard operation
Learn copied to clipboard

Public ideas board for Learn WordPress content

Open hlashbrooke opened this issue 3 years ago • 7 comments
trafficstars

It would be great if we could have a public ideas board hosted directly on Learn WordPress where logged-in users can propose content ideas and there can be public voting. It doesn't need to be feature heavy and, in my estimation, would need the following to be included:

  • A new "Ideas" post type that includes title, description and comments
  • A front-end form for logged-in users to submit ideas, with a custom field for content type (tutorial, course, lesson plan or online workshop) - would only need title, description (ideally limited to a certain number of words), and the custom field.
  • A searchable archive of ideas on the frontend that can be filtered by idea status and ordered by number of votes
  • Comments enabled for logged-in users
  • A frontend UI element for upvoting an idea by logged-in users - this can be stored in a single custom field as an integer that is incremented with each vote
  • An array of usernames stored in a meta field on each idea to indicate who has voted to prevent them from voting a second time
  • A custom field for indicating the status of the idea - submitted, accepted, in progress, complete
  • A visual indicator in the dashboard list table and the edit screen showing number of votes
  • A way to change the idea status in the dashboard

That's about all I can think of - I don't feel like it's too intense in terms of development needs, but there could very well be something I'm not seeing.

hlashbrooke avatar Aug 11 '22 02:08 hlashbrooke

I started working on this, but then quickly realised I am woefully out of date with how to build with blocks in mind, so I only got as far as registering the post type. If anyone wants to work on this and have a very slight head start, here's that code:

// Register Custom Post Type
function wporg_ideas_register_post_type() {

	$labels = array(
		'name'                  => _x( 'Ideas', 'Post Type General Name', 'wporg_learn' ),
		'singular_name'         => _x( 'Idea', 'Post Type Singular Name', 'wporg_learn' ),
		'menu_name'             => __( 'Ideas', 'wporg_learn' ),
		'name_admin_bar'        => __( 'Idea', 'wporg_learn' ),
		'archives'              => __( 'Idea Archives', 'wporg_learn' ),
		'attributes'            => __( 'Idea Attributes', 'wporg_learn' ),
		'parent_item_colon'     => __( 'Parent Idea:', 'wporg_learn' ),
		'all_items'             => __( 'All Ideas', 'wporg_learn' ),
		'add_new_item'          => __( 'Add New Idea', 'wporg_learn' ),
		'add_new'               => __( 'Add New', 'wporg_learn' ),
		'new_item'              => __( 'New Idea', 'wporg_learn' ),
		'edit_item'             => __( 'Edit Idea', 'wporg_learn' ),
		'update_item'           => __( 'Update Idea', 'wporg_learn' ),
		'view_item'             => __( 'View Idea', 'wporg_learn' ),
		'view_items'            => __( 'View Ideas', 'wporg_learn' ),
		'search_items'          => __( 'Search Idea', 'wporg_learn' ),
		'not_found'             => __( 'Not found', 'wporg_learn' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'wporg_learn' ),
		'featured_image'        => __( 'Featured Image', 'wporg_learn' ),
		'set_featured_image'    => __( 'Set featured image', 'wporg_learn' ),
		'remove_featured_image' => __( 'Remove featured image', 'wporg_learn' ),
		'use_featured_image'    => __( 'Use as featured image', 'wporg_learn' ),
		'insert_into_item'      => __( 'Insert into idea', 'wporg_learn' ),
		'uploaded_to_this_item' => __( 'Uploaded to this idea', 'wporg_learn' ),
		'items_list'            => __( 'Ideas list', 'wporg_learn' ),
		'items_list_navigation' => __( 'Ideas list navigation', 'wporg_learn' ),
		'filter_items_list'     => __( 'Filter ideas list', 'wporg_learn' ),
	);

	$args   = array(
		'label'                 => __( 'Idea', 'wporg_learn' ),
		'description'           => __( 'Ideas submitted by site users', 'wporg_learn' ),
		'labels'              	=> $labels,
		'supports'            	=> array( 'title', 'editor', 'comments', 'revisions', 'custom-fields' ),
		'taxonomies'          	=> array( 'category', 'post_tag' ),
		'hierarchical'        	=> true,
		'public'              	=> true,
		'show_ui'             	=> true,
		'show_in_menu'        	=> true,
		'menu_position'       	=> 8,
		'menu_icon'           	=> 'dashicons-lightbulb',
		'show_in_admin_bar'   	=> true,
		'show_in_nav_menus'   	=> true,
		'can_export'          	=> true,
		'has_archive'         	=> 'ideas',
		'exclude_from_search' 	=> false,
		'publicly_queryable'  	=> true,
		'capability_type'     	=> 'post',
		'map_meta_cap'        	=> true,
		'show_in_rest'        	=> true,
	);
	register_post_type( 'wporg_idea', $args );

}
add_action( 'init', 'wporg_ideas_register_post_type', 0 );

hlashbrooke avatar Aug 11 '22 02:08 hlashbrooke

A suggested existing plugin that we could use: https://wordpress.org/plugins/simple-feature-requests/ - I will test this soon.

hlashbrooke avatar Aug 12 '22 04:08 hlashbrooke

Hi @hlashbrooke, Just checked the above plugin, it seems interesting. so do you suggest customizing it and merge it? or we can utilize free version and check for the same?

amitpatel0702 avatar Aug 16 '22 07:08 amitpatel0702

HI, @hlashbrooke is the plan that these ideas will then be automatically added to our Content Projects board on GitHub? I can see the post being more accessible and easy to use than GitHub but how do we avoid duplication?

azhiya avatar Aug 16 '22 07:08 azhiya

@azhiya GitHub is only really something that contributors see - my thinking is that this ideas board would be on Learn itself (not on Make) and we could move ideas to GitHub when we approve them. This would mean the ideas board is more readily open to learners and they don't need to navigate GitHub (which can be confusing for many people) in order to suggest content ideas.

hlashbrooke avatar Aug 17 '22 00:08 hlashbrooke

@amitpatel0702 We could use the free version if it suits our needs. I tested it out, and it's OK, but I'm not fully sold on it as an option. I would much prefer if we could build our own solution as it would be lean and tailored to what we need without any extra fluff or needing a pro version.

hlashbrooke avatar Aug 17 '22 00:08 hlashbrooke

Yes, Developing a custom solution will be the best way to deal with that. Because you never know when any feature might be pulled off from the free version and making us dependent on the same.

amitpatel0702 avatar Aug 22 '22 14:08 amitpatel0702