Search custom properties in objects on the scene (Python) Is it possible to somehow search all objects on the scene which have a custom property enabled using prop_search?

I know how to do this with dynamic EnumProperty but it seems to be not an option as it has some bugs.
Since Blender 2.79 this possible by using bpy.props.PointerProperty and its poll parameter.

For example:

# define the filter method
def filter_on_custom_prop(self, object):
    return "MyCustomPropName" in object

# define the property by using the bpy.props.PointerProperty and its poll function
bpy.types.Object.my_object = bpy.props.PointerProperty(
    type=bpy.types.Object,
    poll=filter_on_custom_prop
)

# add to your draw code a `prop_search`
layout.prop_search(obj, "my_object", context.scene, "objects")
# or just simple
layout.prop(obj, "my_object")