Contributors: Add Contributors CPT and related admin UI

This commit is contained in:
Corey McKrill 2019-10-21 15:00:50 -07:00
parent aaf8b1a712
commit 75428a3c95
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38
4 changed files with 158 additions and 36 deletions

View file

@ -8,6 +8,7 @@ namespace WordPressDotOrg\FiveForTheFuture\PledgeMeta;
use WordPressDotOrg\FiveForTheFuture;
use WordPressDotOrg\FiveForTheFuture\Pledge;
use WordPressDotOrg\FiveForTheFuture\PledgeForm;
use WordPressDotOrg\FiveForTheFuture\Contributor;
use WP_Post, WP_Error;
defined( 'WPINC' ) || die();
@ -153,12 +154,14 @@ function add_meta_boxes() {
*/
function render_meta_boxes( $pledge, $box ) {
$readonly = ! current_user_can( 'edit_page', $pledge->ID );
$data = array();
$data = array();
foreach ( get_pledge_meta_config() as $key => $config ) {
$data[ $key ] = get_post_meta( $pledge->ID, META_PREFIX . $key, $config['single'] );
}
$contributors = Contributor\get_pledge_contributors( $pledge->ID, 'all' );
echo '<div class="pledge-form">';
switch ( $box['id'] ) {