Last active
February 5, 2024 15:16
-
-
Save webzunft/9b364906d21a5ce1d3eefcf3f8878f45 to your computer and use it in GitHub Desktop.
ISC Options Printer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: ISC Options Printer | |
* Plugin URI: https://yourwebsite.com/ | |
* Description: A helper plugin to print the Image Source Control plugin options in raw, serialized format at the top of the ISC plugin options page. | |
* Version: 1.0 | |
* Author: Your Name | |
* Author URI: https://yourwebsite.com/ | |
* License: GPL2 | |
*/ | |
class ISC_Options_Printer { | |
public function __construct() { | |
add_action('admin_notices', array($this, 'print_isc_options')); | |
} | |
public function print_isc_options() { | |
// Get the options | |
$options = get_option('isc_options'); | |
// Serialize the options | |
$serialized_options = serialize($options); | |
// Print the serialized options | |
echo '<div class="notice notice-info is-dismissible">'; | |
echo '<p><strong>ISC Options:</strong></p>'; | |
echo '<textarea readonly onclick="this.focus();this.select()" style="width:100%;min-height:50px;">' . esc_html($serialized_options) . '</textarea>'; | |
echo '</div>'; | |
} | |
} | |
new ISC_Options_Printer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment