Exemplo n.º 1
0
<?php

/**
 * This file belongs to the YIT Plugin Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$sidebars = YIT_Plugin_Sidebar()->custom_sidebars;
?>

<div class="wrap" id="layout-panel-option">
    <h2><?php 
echo __('Sidebar Settings', 'yit');
?>
</h2>
    <div id="layout-panel">
        <div id="poststuff">
            <p id="message"></p>
            <form id="sidebar-form">
                <?php 
wp_nonce_field('yit-add-sidebar', 'wpnonce-sidebar');
?>
                <div id="add-sidebar" class="postbox">
                    <h3><?php 
    <?php 
    }
    public function register_sidebars()
    {
        if (!empty($this->custom_sidebars)) {
            foreach ($this->custom_sidebars as $sidebar) {
                register_sidebar(array('name' => $sidebar, 'id' => strtolower(str_replace(' ', '-', $sidebar)), 'description' => '', 'class' => apply_filters('yit_sidebar_class', ''), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
            }
        }
    }
}
/**
 * Main instance of plugin
 *
 * @return object
 * @since  1.0
 * @author Emanuela Castorina <*****@*****.**>
 */
function YIT_Plugin_Sidebar()
{
    return YIT_Plugin_Sidebar::instance();
}
/**
 * Instantiate Sidebar class
 *
 * @since  1.0
 * @author Emanuela Castorina <*****@*****.**>
 */
YIT_Plugin_Sidebar();