The plugin will show real comment previews to the users
| Name | Github Username |
|---|---|
| Kishan Jasani | @kishanjasani |
- PHP Requires: 7.0
- WordPress Requires at least: 4.7
- Jetpack Plugin to Render proper markupp
You can use comment_preview_allowed_post_types filter to add ustom post type support.
Ex:
add_filter( 'comment_preview_allowed_post_types', function( $post_type ) {
return $post_type[] = 'new_post_type';
} );
NOTE: This plugin works with WordPress's default comment form only.
Convert Markdown comment to readable format ( POST request )
http://example.com/wp-json/comment_preview/v1/preview- Params:
comment- Comment text.format- Whether to preview markdown or plain text - Two values it will takeplainORmarkdown.author- For non-logged in user you can send author's name here, logged-in users will automatically get their name in that comment.
- Params:
During development
Clone the repo and run
cd comment-preview
composer install
composer dump-autoloadOr
If you have WordPress boilerplate with Composer, just add this to repository object and inside the require dependency.
"repositories": [
{
"type": "vcs",
"url": "git@github.com:kishanjasani/comment-preview.git"
}
]
"require": {
"kishanjasani/comment-preview": "dev-main"
}And run this composer command in terminal
composer updateNow, you should see plugin on the plugin page in WordPress dashboard.
To run unit test you need to manually clone the repo inside the plugin directory and run these commands.
composer install
./vendor/bin/phpunitHappy Coding!😊


