Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
wpmark committed Jun 19, 2018
2 parents 48bcae9 + 7860e8f commit a89d380
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
15 changes: 9 additions & 6 deletions functions/application-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,14 @@ function wpbb_application_processing() {

/* insert the application post */
$wpbb_application_id = wp_insert_post(
array(
'post_type' => 'wpbb_application',
'post_title' => esc_html( $applicant_name ),
'post_status' => 'publish',
'post_content' => $applicant_message
apply_filters(
'wpbb_insert_application_args',
array(
'post_type' => 'wpbb_application',
'post_title' => esc_html( $applicant_name ),
'post_status' => 'draft',
'post_content' => $applicant_message
)
)
);

Expand Down Expand Up @@ -379,7 +382,7 @@ function wpbb_application_processing() {
if( true === wpbb_maybe_remove_application_attachments() ) {

// lets remove the file that was just uploaded
wp_delete_attachment( $wpbb_attach_id, true );
$attachment_deleted = wp_delete_attachment( $wpbb_attach_id, true );

}

Expand Down
2 changes: 1 addition & 1 deletion functions/post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function wpbb_register_post_types() {
'slug' => 'applications',
'with_front' => false
),
'has_archive' => true,
'has_archive' => false,
'show_in_menu' => 'wp_broadbean_home' // shows the post type below wp broadbean home
)
);
Expand Down
4 changes: 2 additions & 2 deletions functions/wpbb-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ function wpbb_text_html_email_type() {
}

/**
*
* Default to removing application attachments once the application is processed.
*/
function wpbb_maybe_remove_application_attachments() {
return apply_filters( 'wpbb_remove_application_attachments_after_send', true );
}
}
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Broadbean can build you a completely bespoke feed to your site, with practically

== Changelog ==

= 2.2.2 =
* Set applications post type to not have an archive. Even though the post type is set to not public (`'public' => false`) it would appear that in some setups the applications had a front-end page.
* Set the applications to draft post status by default
* Create a new filter named `wpbb_insert_application_args` to allow devs to change the args used when creating the application post.

= 2.2.1 =
* Allow jobs to be edited once they are sent through from Broadbean. If a job is sent with the same reference as an existing job in WordPress, the job will be updated rather than a new job being created. If you don't not want this functionality you can add the `add_filter( 'wpbb_allow_job_updates', '__return_false' );` to either your themes `functions.php` file or a plugin / mu-plugin.
* More strings are now translatable, particularly in the applications form and associated messages.
Expand Down

0 comments on commit a89d380

Please sign in to comment.