开发者 | GregRoss |
---|---|
更新时间 | 2024年6月10日 07:27 |
PHP版本: | 5.0 及以上 |
WordPress版本: | 6.5.3 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
<?php echo do_shortcode('[just_like_and_dislike id=post_id]');?>
Please replace post_id with the id of the post or remove id parameter for considering the post id as the id of global $post object
This plugin provides the ability to add the like and dislike buttons for WordPress native posts, pages and comments.
The plugin uses the_content filter to append like and dislike icons . So if your active theme's posts template doesn't use the_content filter to display posts content then the plugin won't be able to display like and dislike icons. You can still use the plugin, but you'll have to add some custom code to your theme (see custom function above) to support it.
There are a few available to add new default icon template options, see the code for details.
We do have a shortcode [just_likes_and_dislikes] which can also be used as custom function through <?php echo do_shortcode('[just_likes_and_dislikes]');?>
There is no built in migration tool at this time, however if you have access to your SQL server (probably phpMyAdmin), you can run some simply queries to migrate the data. To do so, do the following steps: *** WARNING: The following steps are destructive and a one time process. ***
``
DELETE FROM
wp_commentmetaWHERE
meta_keyLIKE 'jlad_%';
UPDATE
wp_commentmetaSET
meta_key= REPLACE(
meta_key`, 'cld_', 'jlad_');wp_postmeta
WHERE meta_key
LIKE 'jlad_%';
UPDATE wp_postmeta
SET meta_key
= REPLACE(meta_key
, 'pld_', 'jlad_');
```
4. Enable Just Likes and Dislikes.
This above will do two things:
``
DELETE FROM
wp_commentmetaWHERE
meta_keyLIKE 'cld_%';
UPDATE
wp_commentmetaSET
meta_key= REPLACE(
meta_key`, 'jlad_', 'cld_');wp_postmeta
WHERE meta_key
LIKE 'pld_%';
UPDATE wp_postmeta
SET meta_key
= REPLACE(meta_key
, 'jlad_', 'pld_');
```
4. Enable Posts Like Dislikes and Comments Like Dislike.
If there are enough requests I can add this feature to the plugin.