How to deprecate a hook used in a plugin?

Firstly, you will need to lave the hook there. Deprecation just signals to developers that they should not use it, and that it will be removed in future. So you’re stuck with it for now. So really deprecation is a communications issue, not really a code issue. One helpful thing WordPress does provide in this … Read more

How to access custom post meta data from JavaScript

Your script should looks like this. function js_enqueue_scripts() { global $post; $text2 = get_post_meta( $post->ID, ‘_load_speed_field’, true ); $text3 = get_post_meta( $post->ID, ‘_tyre_brand_field’, true ); $text4 = get_post_meta( $post->ID, ‘_brand_model_field’, true ); $text5 = get_post_meta( $post->ID, ‘_run_flat_field’, true ); //Put your variables inside a array $arrayname = array( ‘text3’ => $text3, ‘text2’ => $text2 ); … Read more

Showing how many times is plugin activated or deactivated

Although you might have already managed to solve the problem you faced, here’s few thoughts. You could use register_activation_hook(), register_deactivation_hook() and register_uninstall_hook() functions to trigger a wp_remote_post() call to your (custom) API endpoint to count the times when your plugin is activated, deactivated or deleted. If the recieving site, where you keep track of the … Read more

Out of date plugins not showing ugrade link

Run this SQL query on your site’s WordPress database update wp_options set option_value=”” where option_name=”_site_transient_update_plugins”; This will force WordPress to check for plugin updates.