Esempio n. 1
0
    protected function is_active()
    {
        $items = get_option(self::OPTION);
        if ($items && is_front_page()) {
            return true;
        }
        return false;
    }
    /**
     * Sets up admin page.
     * @return void
     */
    public function settings()
    {
        $fm = new \Fieldmanager_Group(array('name' => self::OPTION, 'limit' => 10, 'add_more_label' => __('Add another item', 'mindseyesociety'), 'sortable' => true, 'label' => __('Carousel Item', 'mindseyesociety'), 'children' => array('image' => new \Fieldmanager_Media(array('label' => __('Image', 'mindseyesociety'), 'preview_size' => 'thumbnail')), 'link' => new \Fieldmanager_Link(array('label' => __('URL', 'mindseyesociety'), 'inline_label' => true)), 'external' => new \Fieldmanager_Checkbox(array('label' => __('Open in new window', 'mindseyesociety'), 'inline_label' => true)))));
        $fm->activate_submenu_page();
    }
    /**
     * Singleton method.
     * @return Carousel Self.
     */
    public static function instance()
    {
        if (!self::$instance) {
            self::$instance = new self();
        }
        return self::$instance;
    }
}
Carousel::instance();