How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met

You can add the following code in your plugin. I have used this in my ARB booking plugin and it worked perfectly. The full details of the code with explanation can be found here: class FT_AdminNotice { protected $min_wc=”5.0.0″; //replace ‘5.0.0’ with your dependent plugin version number /** * Register the activation hook */ public … Read more

Add custom ID to CPT posts only create not update

Yes, it’s simple – check for existence of id_valoraciones meta value when saving post. If post does not have id_valoraciones set, do your job with getting last value and incerementing it. If the post has id_valoraciones meta, then – do nothing. Like this: <?php function auto_assign_ids( $post_id, $post, $update ) { // Only assign ID … Read more