Skip to content

Commit

Permalink
Fixed PHP fatal error when quick editing an award
Browse files Browse the repository at this point in the history
  • Loading branch information
eri-trabiccolo committed Aug 17, 2022
1 parent 506a957 commit 4fc66d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changelogs/issue_2231.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: fixed
links:
- "#2231"
entry: Fixed PHP fatal error when quick editing an award.
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@ public function date_col_status( $text, $post, $column_name ) {
*
* @since 6.0.0
* @since 6.4.0 Stop using deprecated `FILTER_SANITIZE_STRING`.
* @since [version] When no INPUT_GET `post_type` variable set, retrieve the post_type from the `$id` (WP_Post ID) parameter.
*
* @param int $id WP_Post id.
* @param int $id WP_Post ID.
* @param boolean $template Whether or not a template is being requested.
* @return LLMS_User_Achievement|LLMS_User_Certificate|boolean Returns the object or `false` for invalid post types.
*/
private function get_object( $id, $template = false ) {

$post_type = llms_filter_input( INPUT_GET, 'post_type' );
$post_type = $post_type ? $post_type : get_post_type( $id );

if ( 'llms_my_achievement' === $post_type ) {
return new LLMS_User_Achievement( $id );
Expand Down

0 comments on commit 4fc66d8

Please sign in to comment.