-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add settings page, and show placeholder if no credit #9
Conversation
Also adds a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's working great! Crazy to see all my images being replaced for a placeholder 😅
I've left some comments for small adjustments and there's also a tiny but very annoying UX detail: when I write the credit name to the image, I then press tab
to start writing the next field. This action fires a save action and after it succeeds the field I'm writing loses focus and I start triggering keyboard shortcuts 😆 . I don't know why this happens only to the image credits fields.
[ | ||
'description' => __( 'A label to prefix all image credits. Leave blank to display no prefix.', 'newspack-image-credits' ), | ||
'key' => 'newspack_image_credits_prefix_label', | ||
'label' => __( 'Image Credit Label', 'newpack-listings' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change the domain from newspack-listing
to newspack-image-credits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! Updated in fcc3699
[ | ||
'description' => __( 'A placeholder image to be displayed in place of images without credits. If none is chosen, the image will be displayed normally whether or not it has a credit.', 'newspack-image-credits' ), | ||
'key' => 'newspack_image_credits_placeholder', | ||
'label' => __( 'Placeholder Image', 'newpack-listings' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change the domain from newspack-listing
to newspack-image-credits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! Updated in fcc3699
*/ | ||
public static function add_media_credit( $fields, $post ) { | ||
$credit_info = self::get_media_credit( $post->ID ); | ||
$fields['media_credit'] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update indentation from space to tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in fcc3699
package.json
Outdated
"prettier": "https://github.com/Automattic/wp-prettier/releases/download/wp-1.16.4/wp-prettier-1.16.4.tgz", | ||
"stylelint": "^13.12.0", | ||
"stylelint-config-prettier": "^8.0.1", | ||
"stylelint-config-wordpress": "^17.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: stylelint-config-wordpress
has been deprecated in favor of @wordpress/stylelint-config. Should we start using the maintained package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 1fcfcbe
@miguelpeixe I'm also not sure why this is, but the fields are added using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably a core issue. Thank you for the updates! 💯
Adds a new settings page for Image Credits options under the WP Admin > Settings > Media menu (placed there because this plugin has no dependencies on other Newspack products). New options available:
span
that wraps image credit strings. This defaults toimage-credit
, which was previously hard-coded, so it shouldn't change behavior for sites that are already using the plugin.Credit:
, which was previously hard-coded, so it shouldn't change behavior for sites that are already using the plugin.Note: The options have been moved to the Media settings page instead of living in their own standalone page.
To test: