WordPress.org

Make WordPress Core

Ticket #12754: example-plugin.php

File example-plugin.php, 457 bytes (added by scribu, 4 years ago)
Line 
1<?php
2// Plugin Name: Example
3
4function example_install() {
5        add_option('example_option_a', 'foo');
6        add_option('example_option_b', 'bar');
7}
8register_activation_hook(__FILE__, 'example_install');
9
10function example_uninstall_a() {
11        delete_option('example_option_a');
12}
13register_uninstall_hook(__FILE__, 'example_uninstall_a');
14
15function example_uninstall_b() {
16        delete_option('example_option_b');
17}
18register_uninstall_hook(__FILE__, 'example_uninstall_b');