humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
66 stars 7 forks source link

80 filter defualt guest author #91

Closed mattheu closed 1 year ago

mattheu commented 2 years ago

I'm having an issue that saving a post as a draft is setting the post author to the WP User who created the post, and this trips up our editors. I'd like a way to prevent this happening.

I found this issue: #80 that suggests adding a filter.

How does this look?

mattheu commented 2 years ago

PHP Standards are flagging a false positive here:

 ------ --------------------------------------------------------------- 
  Line   inc/namespace.php                                              
 ------ --------------------------------------------------------------- 
  370    Function apply_filters invoked with 3 parameters, 2 required.  
 ------ --------------------------------------------------------------- 

What would you prefer to be done about this?

johnbillion commented 2 years ago

The apply_filters() issue should be ignored in the PHPStan config. Example: https://github.com/johnbillion/user-switching/blob/8cf1bcaabcafa987b4eb0943f991e013b9e5f6de/phpstan.neon.dist#L27-L28

mattheu commented 2 years ago

Took me ages to get back to this one! But I've finally circled back and ignored apply_filters in the PHPStan config

roborourke commented 2 years ago

Any reason not to merge yet? Thinking it’s time for a new major release along with bumping asset loader once the stable for that is ready