fpw_helper_functions: minor bug
-
As always, great plugin, thanks for your time in creating and maintaining it.
I’ve come across an edge case “bug”. It relies on carelessness of others, so may not justify fixing…to trigger it:
- Add a custom post type
- Add the post type to FPW via
fpw_post_types
- Create a FPW Widget that points to a post of that type
- Remove the custom post type (deactivate plugin, say)
- Don’t remove the post type from
fpw_post_types
This can cause FPW to trigger a PHP warning via this code in
fpw_helper_functions.php
:`
85 $post_type_object = get_post_type_object( $type );
86 $name = $post_type_object->labels->name;
`
Line 85 will return null; line 86 will generate a “trying to get properties of a non-object” warning.
Fix should be fairly simple, something like:
`
85 $post_type_object = get_post_type_object( $type );
86
87 if ( $post_type_object === null ) continue;
88
89 $name = $post_type_object->labels->name;
`
- The topic ‘fpw_helper_functions: minor bug’ is closed to new replies.