Remove unnecessary meta config and prefixes

The meta config introduced in 2927532 are unnecessary because the
contributors associated with a pledge are not stored as post meta data,
but rather as posts of a separate post type. The added `org-` prefixes
are also unnecessary because there is already a `5ftf` prefix for all
the fields. The `org-` is used for some fields where the data is a
property of the organization making the pledge (org-name, org-email).
Contributors are not really a property of the organization.
This commit is contained in:
Corey McKrill 2019-10-21 15:31:06 -07:00
parent aef07828a6
commit 4ce08c3f87
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38
3 changed files with 4 additions and 10 deletions

View file

@ -82,7 +82,7 @@ function process_form_new() {
);
}
$contributors = parse_contributors( $submission['org-pledge-contributors'] );
$contributors = parse_contributors( $submission['pledge-contributors'] );
if ( is_wp_error( $contributors ) ) {
return $contributors;
@ -189,7 +189,7 @@ function get_form_submission() {
wp_list_pluck( PledgeMeta\get_pledge_meta_config( 'user_input' ), 'php_filter' ),
// Inputs with no corresponding meta value.
array(
'org-pledge-contributors' => FILTER_SANITIZE_STRING,
'pledge-contributors' => FILTER_SANITIZE_STRING,
'pledge-agreement' => FILTER_VALIDATE_BOOLEAN,
)
);

View file

@ -61,12 +61,6 @@ function get_pledge_meta_config( $context = '' ) {
'show_in_rest' => false,
'php_filter' => FILTER_VALIDATE_INT,
),
'org-pledge-contributors' => array(
'single' => true,
'sanitize_callback' => 'sanitize_text_field',
'show_in_rest' => false,
'php_filter' => FILTER_SANITIZE_STRING,
),
);
$generated = array(

View file

@ -15,8 +15,8 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
<input
type="text"
id="5ftf-pledge-contributors"
name="org-pledge-contributors"
value="<?php echo esc_attr( $data['org-pledge-contributors'] ); ?>"
name="pledge-contributors"
value="<?php echo esc_attr( $data['pledge-contributors'] ); ?>"
required
aria-describedby="5ftf-pledge-contributors-help"
/>