Пример #1
0
$menu_post_status = isset($this->params['admin_menu_post_status']) ? $this->params['admin_menu_post_status'] : array();
if ($menu_post_types) {
    foreach ($menu_post_types as $pt) {
        $cpt_list[$pt] = ucwords($pt);
    }
    foreach ($menu_post_status as $ps) {
        $cps_list[$ps] = ucwords($ps);
    }
    $options_panel->addParagraph(sprintf('<hr /><h4 class="h3-mtt">%s</h4>', __('POST STATUS BUBBLES', 'mtt')));
    $bubbles[] = $options_panel->addCheckboxList('cpt', $cpt_list, array('name' => __('Select types:', 'mtt'), 'desc' => '', 'class' => 'no-toggle', 'std' => false), true);
    $bubbles[] = $options_panel->addSelect('status', $cps_list, array('name' => __('Select status:', 'mtt'), 'desc' => '', 'std' => false), true);
    $options_panel->addCondition('admin_menus_bubbles', array('name' => __('Enable', 'mtt'), 'desc' => sprintf(__('Tip via: %s.%s', 'mtt'), B5F_MTT_Utils::make_tip_credit('WordPress Answers', 'http://wordpress.stackexchange.com/a/95058/12615'), "<div class='img-help'><img src='{$plugin_url}images/adminmenus-bubbles.jpg' /></div>"), 'fields' => $bubbles, 'std' => false));
}
if (function_exists('get_fields')) {
    $options_panel->addParagraph(sprintf('<hr /><h4 class="h3-mtt">%s</h4>', __('ADVANCED CUSTOM FIELDS', 'mtt')));
    $users_arr = B5F_MTT_Utils::get_users_array();
    // ACF CPT PAGE
    if ($users_arr) {
        $ACF_hide_from_users[] = $options_panel->addSelect('for_user', $users_arr, array('name' => __('Select authorized user.', 'mtt'), 'desc' => '', 'std' => array('none')), true);
        $options_panel->addCondition('plugins_acf_show_only', array('name' => __('Advanced Custom Fields: show ACF menu only for one user.', 'mtt'), 'desc' => '', 'fields' => $ACF_hide_from_users, 'std' => false));
    }
    // ACF OPTIONS ADDON PAGE
    if (class_exists('acf_options_page_plugin')) {
        if ($users_arr) {
            $ACF_hide_options_from_users[] = $options_panel->addSelect('for_user', $users_arr, array('name' => __('If you want to show only for one user, select bellow.', 'mtt'), 'desc' => __('If none is selected, the Options are only hidden from non-administrators.', 'mtt'), 'std' => array('none')), true);
            $options_panel->addCondition('plugins_acf_hide_options', array('name' => __('Advanced Custom Fields: hide "Options" from non-administrators', 'mtt'), 'desc' => '', 'fields' => $ACF_hide_options_from_users, 'std' => false));
        }
    }
}
$options_panel->addParagraph(sprintf('<hr /><h4 class="h3-mtt">%s</h4><p>%s</p>', __('RENAME POSTS', 'mtt'), __('to whatever you want (i.e. news, articles)', 'mtt')));
$Post_rename_fields[] = $options_panel->addText('name', array('name' => __('Name', 'mtt'), 'std' => ''), true);