HTML Snippets Powered By : XYZScripts.com'; echo $content; } add_action('admin_init', 'xyz_ihs_check_and_upgrade_plugin_version'); function xyz_ihs_check_and_upgrade_plugin_version() { $current_version = xyz_ihs_plugin_get_version(); $saved_version = get_option('xyz_ihs_free_version'); if ($saved_version === false) { xyz_ihs_run_upgrade_routines(); add_option('xyz_ihs_free_version', $current_version); } elseif (version_compare($current_version, $saved_version, '>')) { xyz_ihs_run_upgrade_routines(); update_option('xyz_ihs_free_version', $current_version); } } add_filter('plugin_action_links_' . plugin_basename(XYZ_INSERT_HTML_PLUGIN_FILE), 'xyz_ihs_plugin_action_links'); function xyz_ihs_plugin_action_links($links) { if (isset($links['deactivate'])) { if (preg_match('/href=[\'"]([^\'"]+)[\'"]/', $links['deactivate'], $matches)) { $ihs_deactivation_url = esc_url($matches[1]); $links['deactivate'] = 'Deactivate'; } } return $links; } add_action('admin_enqueue_scripts', 'xyz_ihs_enqueue_modal_assets'); function xyz_ihs_enqueue_modal_assets($hook) { if ($hook !== 'plugins.php') return; add_action('admin_footer', 'xyz_ihs_modal_html'); } function xyz_ihs_modal_html() { ?> post_status !== 'publish') { global $wpdb; $wpdb->delete($wpdb->prefix . 'xyz_ihs_usage', ['post_id' => $post_id]); return; } xyz_ihs_update_usage_for_post( $post_id, $post->post_content, $post->post_type ); }, 10, 2); add_action('before_delete_post', function($post_id) { global $wpdb; $wpdb->delete($wpdb->prefix . 'xyz_ihs_usage', ['post_id' => $post_id]); }); } ?>