Used for shorter namespace access when creating a field.
Exemplo n.º 1
0
if (!function_exists('carbon_get_user_meta')) {
    function carbon_get_user_meta($id, $name, $type = null)
    {
        return false;
    }
}
if (!function_exists('carbon_get_comment_meta')) {
    function carbon_get_comment_meta($id, $name, $type = null)
    {
        return false;
    }
}
/* Custom Fields */
use Carbon_Fields\Container;
use Carbon_Fields\Field;
Container::make('post_meta', 'Homepage & Sidebar Selector')->show_on_post_type('page')->add_fields(array(Field::make("radio", "wise_page_feat", 'Featured Image')->add_options(array('disable' => 'Disabled', 'enable' => 'Enabled'))->set_default_value('disable'), Field::make("radio", "wise_page_share", 'Share Buttons')->add_options(array('disable' => 'Disabled', 'enable' => 'Enabled'))->set_default_value('disable'), Field::make("radio", "wise_endis_homepage", 'Custom Homepage')->add_options(array('disable' => 'Disabled', 'enable' => 'Enabled'))->set_default_value('disable'), Field::make('sidebar', 'wise_custom_homepage', 'Select Homepage'), Field::make('sidebar', 'wise_custom_sidebar', 'Select Sidebar')));
function wise_dynamic_sidebar($index = 1, $options = array())
{
    global $wp_registered_sidebars;
    // Get the sidebar index the same way as the dynamic_sidebar() function
    if (is_int($index)) {
        $index = "sidebar-{$index}";
    } else {
        $index = sanitize_title($index);
        foreach ((array) $wp_registered_sidebars as $key => $value) {
            if (sanitize_title($value['name']) == $index) {
                $index = $key;
                break;
            }
        }
    }
Exemplo n.º 2
0
function crb_sponsor_link()
{
    Container::make('post_meta', 'Link')->show_on_post_type('sponsorowane')->set_context('side')->set_priority('high')->add_fields(array(Field::make('text', 'crb_sponsor_link', 'Podaj link')));
}
Exemplo n.º 3
0
 function __construct()
 {
     global $wp_cats;
     $this->setup('#Home - Complex 4 Block', 'Displays complex 4 posts block.', array(Field::make('text', 'wise_c4post_title', 'Posts Title')->set_default_value('Complex 4 Title'), Field::make("select", "wise_c4title_type", "Title Design")->add_options(array('back' => 'Background', 'light' => 'Light')), Field::make("select", "wise_c4post_categ", "Post Categories")->add_options($wp_cats), Field::make('number', 'wise_c4post_number', 'No. of Posts')->set_default_value('6')));
     $this->print_wrappers = false;
     // disable wrapper
 }
Exemplo n.º 4
0
 function __construct()
 {
     $this->setup('#Wise Ads', 'Displays advertisement dynamically.', array(Field::make('textarea', 'wise_ads_code', 'Enter Ads code here.'), Field::make("checkbox", "adis_home", "Disable on Homepage")->set_option_value('yes'), Field::make("checkbox", "adis_arch", "Disable on Archive")->set_option_value('yes'), Field::make("checkbox", "adis_post", "Disable on Posts")->set_option_value('yes'), Field::make("checkbox", "adis_page", "Disable on Pages")->set_option_value('yes'), Field::make("checkbox", "adis_paginate", "Disable if Paginated")->set_option_value('yes'), Field::make("checkbox", "sidebar_fix", "Check if Used in Sidebar")->set_option_value('yes')));
     $this->print_wrappers = false;
     // disable wrapper
 }
Exemplo n.º 5
0
function crb_register_management_board()
{
    Container::make('user_meta', 'Obierz zarząd lub prezesa')->add_fields(array(Field::make('set', 'crb_managment_board', 'Mianuj na członka zarządu lub prezesa')->help_text('With great power comes great responsibility')->add_options(array('member_of_managment_board' => 'Członek zarządu', 'president' => 'Prezes'))));
}