mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 01:01:18 +03:00
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:
parent
aef07828a6
commit
4ce08c3f87
|
@ -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,
|
||||
)
|
||||
);
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue