Getting timestamp of activation plugin time

You’ll have to use get- and add_option inside a register_activation_hook. <?php register_activation_hook(__FILE__,’save_activation_timestamp’); function save_activation_timestamp() { add_option(“myplugin_activation_timestamp”,mktime()); } ?> You can find an entire tutorial on that at CodeYoghurt. It even mentions your case as an example.

WP_Editor – Saving Value into Plugin Option – Stripping HTML

The Problem This turned out to be a common case of needing to use stripslashes();. How did I figure this out? I logged into phpMyAdmin, navigated to the options table, found my option name, and edited it. Here’s what I discovered… s:11:”description”;s:90:”<span style=\”text-decoration: underline;\”>This is supposed to be underlined text.</span>”; So obviously my plugin is … Read more

Any hook for pre-plugin-update -either bulk or single plugin update

Here are two untested ideas: Idea #1: If you want to hook before an instance of the Plugin_Upgrader class is created with: $upgrader = new Plugin_Upgrader( … ) where the upgrades are activated with: $upgrader->upgrade($plugin); // for a single plugin upgrade $upgrader->bulk_upgrade( $plugins ); // for bulk plugins upgrades then you could try: /** * … Read more

Checkbox Undefined index error in Plugin

You shouldn’t put quotes around the index for HTML names – otherwise you end up with ‘single_images’ (including single quotes) as the PHP name (so you’d have to address it $iwmp_options[“‘single_images'”], which some might consider confusing) … eg: add_action( ‘admin_init’, function () { register_setting( ‘iwmp_settings’, ‘iwmp_settings’ ); add_settings_section( ‘single_images’, __( ‘Single Images’, ‘iwmp_domain’ ) , … Read more