/** * FORM display the widget in the management of * sidebar in the administration panel of wordpress */ function form($instance) { // Creating arrays for list fields that must be // present in the form before calling wp_parse_args() $array = array('title' => '', 'mode' => '', 'link' => '', 'cover' => '', 'photo' => '', 'biography' => '', 'width' => '', 'width_auto' => ''); // Creating arrays for list of fields to be retrieved FORM // and loading the file with the HTML template to display $OBJC = new SZGoogleActionPlusAuthorBadge(); extract((array) $OBJC->checkOptions(wp_parse_args($instance, $array), EXTR_OVERWRITE)); // Calling the template for displaying the part // that concerns the administration panel (admin) @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
<?php /** * Script to implement the HTML code shared with widgets * in the function pop-up insert shortcodes via GUI * * @package SZGoogle * @subpackage Admin * @author Massimo Della Rovere * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ if (!defined('SZ_PLUGIN_GOOGLE') or !SZ_PLUGIN_GOOGLE) { die; } // Creating array to list the fields that must be // present in the form before calling wp_parse_args () $array = array('mode' => '', 'link' => '', 'cover' => '', 'photo' => '', 'biography' => '', 'width' => '', 'width_auto' => '', 'action' => 'A'); // Creating arrays to list of fields to be retrieved FORM // and loading the file with the HTML template to display $OBJC = new SZGoogleActionPlusAuthorBadge(); extract((array) $OBJC->checkOptions(wp_parse_args($instance, $array), EXTR_OVERWRITE)); // Loading ADMIN template for composition using // shortcodes in many cases the same code Widget @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/mce/shortcodes/SZGoogleBaseHeader.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidgetPlusAuthorBadge.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/mce/shortcodes/SZGoogleBaseFooter.php');
function szgoogle_gplus_get_badge_author($options = array()) { if (!($object = new SZGoogleActionPlusAuthorBadge())) { return false; } else { return $object->getHTMLCode($options); } }