From 25b7d2aab61ae6421398d3abae5da6ffe590333d Mon Sep 17 00:00:00 2001 From: s1n Date: Sat, 28 Mar 2020 10:36:41 -0700 Subject: 3/28/2020, 10:36 --- user/plugins/sample-page/plugin.php | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 user/plugins/sample-page/plugin.php (limited to 'user/plugins/sample-page/plugin.php') diff --git a/user/plugins/sample-page/plugin.php b/user/plugins/sample-page/plugin.php new file mode 100644 index 0000000..717961d --- /dev/null +++ b/user/plugins/sample-page/plugin.php @@ -0,0 +1,63 @@ +Sample Plugin Administration Page +

This plugin stores an integer in the option database

+
+ +

+

+
+ +HTML; +} + +// Update option in database +function ozh_yourls_samplepage_update_option() { + $in = $_POST['test_option']; + + if( $in ) { + // Validate test_option. ALWAYS validate and sanitize user input. + // Here, we want an integer + $in = intval( $in); + + // Update value in database + yourls_update_option( 'test_option', $in ); + } +} \ No newline at end of file -- cgit v1.2.3