“Hello, I’m currently developing a WordPress plugin. In this plugin, I’m using the wp_update_post() function to update a post. When I use this function, it runs normally, but I receive the following warning message on my site: Warning: Use of undefined constant WP_POST_REVISIONS – assumed ‘WP_POST_REVISIONS’.
To address this, I used “define(‘WP_POST_REVISIONS’, 3);” which solves the problem. However, when I submit my plugin to WordPress to publish it in their library, they tell me, “Don’t Force Set Limits Globally.”
Here is the code when I update my post:
$updated_page = array (
'ID' => $page_id,
'post_content' => $new_content,
);
wp_update_post ( $updated_page );Here is the code when I define the maximum number of post revisions :
if (!defined('WP_POST_REVISIONS')) {
define ('WP_POST_REVISIONS', 3);
} else {
$revisions = WP_POST_REVISIONS;
}I really need help to resolve this issue and publish my plugin in the library. Thank you :)”
- This topic was modified 1 hour, 27 minutes ago by .
