Skip to content

Commit

Permalink
Fixing an issue that prevented post upload when no post_title is set
Browse files Browse the repository at this point in the history
  • Loading branch information
rinatkhaziev committed Apr 27, 2015
1 parent ed6ec5c commit c14600c
Show file tree
Hide file tree
Showing 15 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend-uploader.php
Expand Up @@ -330,10 +330,12 @@ function _upload_post() {
}
}

$post_title = isset( $_POST['caption'] ) ? sanitize_text_field( $_POST['caption'] ) : sanitize_text_field( $_POST['post_title'] );

// Construct post array;
$post_array = array(
'post_type' => isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], $this->settings['enabled_post_types'] ) ? $_POST['post_type'] : 'post',
'post_title' => isset( $_POST['caption'] ) ? sanitize_text_field( $_POST['caption'] ) : sanitize_text_field( $_POST['post_title'] ),
'post_title' => $post_title ? $post_title : __( 'Untitled post submission', 'frontend-uploader' ),
'post_content' => wp_filter_post_kses( $_POST['post_content'] ),
'post_status' => $this->_is_public() ? 'publish' : 'private',
'post_category' => $category,
Expand Down
Empty file modified languages/frontend-uploader-de_DE.mo 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-de_DE.po 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-es_ES.mo 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-es_ES.po 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-fa_IR.mo 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-fa_IR.po 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-nb_NO.mo 100755 → 100644
Empty file.
Empty file modified languages/frontend-uploader-nb_NO.po 100755 → 100644
Empty file.
Empty file modified lib/js/validate/localization/messages_hr.js 100755 → 100644
Empty file.
Empty file modified lib/php/settings-api/.gitignore 100755 → 100644
Empty file.
Empty file modified lib/php/settings-api/class.settings-api.php 100755 → 100644
Empty file.
Empty file modified lib/php/settings-api/readme.md 100755 → 100644
Empty file.
Empty file modified lib/php/settings-api/readme.txt 100755 → 100644
Empty file.
Empty file modified lib/php/settings-api/screenshot-1.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c14600c

Please sign in to comment.