PHP code example of ayecode / wp-super-duper
1. Go to this page and download the library: Download ayecode/wp-super-duper library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ayecode / wp-super-duper example snippets
// SD V1 used to extend the widget class. V2 does not, so we cannot call register_widget() on it.
$widget = 'SD_Hello_World';
if ( is_subclass_of( $widget, 'WP_Widget' ) ) { // SD V1 is loaded.
register_widget( $widget );
} else {
new $widget(); // SD V2 is loaded.
}