コード例 #1
1
 /**
  * Register settings page
  */
 function plugin_admin_add_page()
 {
     acf_add_options_page(array('page_title' => 'Brand', 'menu_title' => get_bloginfo('name'), 'menu_slug' => 'theme-general-settings', 'redirect' => false, 'position' => -1));
     acf_add_options_sub_page(array('page_title' => 'SEO (Search Engine Optimization)', 'menu_title' => 'SEO', 'parent_slug' => 'theme-general-settings'));
     acf_add_options_sub_page(array('page_title' => 'SDO (Social Discovery Optimization)', 'menu_title' => 'SDO', 'parent_slug' => 'theme-general-settings'));
     acf_add_options_sub_page(array('page_title' => 'Third Party API\'S', 'menu_title' => 'API\'s', 'parent_slug' => 'theme-general-settings'));
 }
コード例 #2
1
 public static function setup_settings_page()
 {
     if (function_exists('acf_add_options_page')) {
         acf_add_options_sub_page(array('page_title' => 'Fruit Pack Settings', 'menu_title' => 'Fruit Pack Settings', 'parent_slug' => 'plugins.php'));
     }
     if (function_exists('acf_add_local_field_group')) {
         acf_add_local_field_group(array('key' => 'group_563931a6e6559', 'title' => 'Github Settings', 'fields' => array(array('key' => 'field_563931bfe4a0b', 'label' => 'Github Username', 'name' => 'github_username', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_563931f1e4a0c', 'label' => 'Repository Slug', 'name' => 'repository_slug', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_563931ffe4a0d', 'label' => 'Authorization Key', 'name' => 'authorization_key', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0)), 'location' => array(array(array('param' => 'options_page', 'operator' => '==', 'value' => 'acf-options-fruit-pack-settings'))), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => ''));
     }
 }
コード例 #3
0
ファイル: functions.php プロジェクト: jabrankhalil/testsite
 function businesstheme()
 {
     // Enable support for Post Thumbnails, and declare two sizes.
     add_theme_support('title-tag');
     add_theme_support('post-thumbnails');
     //set_post_thumbnail_size( 255, 255, true );
     add_image_size('twentyfourteen-full-width', 1038, 576, true);
     add_image_size('service-image', 255, 255, true);
     add_image_size('portfolio-image', 400, 289, true);
     add_image_size('team-image', 235, 235, true);
     add_image_size('about-image', 170, 170, true);
     add_image_size('single', 300, 500);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('primary' => __('Primary menu'), 'footer' => __('Footer menu')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     add_editor_style(array('css/editor-style.css'));
     if (function_exists('acf_add_options_page')) {
         acf_add_options_sub_page('Header');
         acf_add_options_sub_page('Footer');
         acf_add_options_sub_page('Service');
         acf_add_options_sub_page('Portfolio');
         acf_add_options_sub_page('Team');
         acf_add_options_sub_page('about');
     }
     // This theme uses its own gallery styles.
     add_filter('use_default_gallery_style', '__return_false');
 }
コード例 #4
0
function yb_add_options_page()
{
    /* create main yb options page */
    acf_add_options_page(array('page_title' => 'yb Site Options', 'menu_title' => 'Site Options', 'menu_slug' => 'yb-options', 'capability' => 'edit_posts', 'redirect' => false));
    /* create settings sub page */
    acf_add_options_sub_page(array('page_title' => 'Miscellaneous', 'menu_title' => 'Miscellaneous', 'parent_slug' => 'yb-options'));
}
コード例 #5
0
ファイル: Setup.php プロジェクト: fuelingtheweb/wp-base-theme
 function optionsPage()
 {
     if (function_exists('acf_add_options_page')) {
         acf_add_options_page();
         acf_add_options_sub_page(array('page_title' => 'General Settings', 'menu_title' => 'General'));
         acf_add_options_sub_page(array('page_title' => 'Contact Settings', 'menu_title' => 'Contact'));
     }
 }
コード例 #6
0
function add_theme_acf_options_page()
{
    if (function_exists('acf_add_options_page')) {
        acf_add_options_page(array('page_title' => 'Site Settings', 'menu_title' => 'Site Settings', 'menu_slug' => 'site-settings', 'capability' => 'edit_posts', 'redirect' => true));
        acf_add_options_sub_page(array('page_title' => 'Above Average Theme Settings', 'menu_title' => 'AA Settings', 'menu_slug' => 'aa-features', 'parent_slug' => 'site-settings'));
        acf_add_options_sub_page(array('page_title' => 'The Kicker Theme Settings', 'menu_title' => 'TK Settings', 'menu_slug' => 'tk-features', 'parent_slug' => 'site-settings'));
    }
}
コード例 #7
0
 public function init()
 {
     if (!function_exists('acf_add_options_page')) {
         return;
     }
     $options_page = array('page_title' => 'Blunt Gated Content Options', 'menu_title' => 'Options', 'menu_slug' => 'blunt-gated-content-options', 'capability' => 'edit_posts', 'parent_slug' => 'edit.php?post_type=blunt-gated-content', 'autoload' => 'true');
     acf_add_options_sub_page($options_page);
 }
コード例 #8
0
ファイル: backend.php プロジェクト: dungtd91/bones
 function acf_add_options_page()
 {
     if (function_exists('acf_add_options_page')) {
         acf_add_options_page(array('menu_title' => 'Theme Options', 'menu_slug' => 'theme-general-settings', 'capability' => 'edit_posts', 'icon_url' => 'dashicons-welcome-write-blog', 'redirect' => true));
         acf_add_options_sub_page(array('page_title' => 'General Settings', 'menu_title' => 'General Settings', 'parent_slug' => 'theme-general-settings'));
         acf_add_options_sub_page(array('page_title' => 'Home Settings', 'menu_title' => 'Home Settings', 'parent_slug' => 'theme-general-settings'));
     }
 }
コード例 #9
0
 /**
  * Add options pages
  *
  */
 function add_options_pages()
 {
     if (function_exists('acf_add_options_page')) {
         //SITE OPTIONS
         acf_add_options_page(array('page_title' => 'About site', 'menu_title' => 'About site', 'menu_slug' => 'theme-options', 'capability' => 'edit_posts', 'redirect' => true));
         acf_add_options_sub_page(array('page_title' => 'Contact info', 'menu_title' => 'Contact info', 'parent_slug' => 'theme-options'));
         acf_add_options_sub_page(array('page_title' => 'Words', 'menu_title' => 'Words', 'parent_slug' => 'theme-options'));
     }
 }
コード例 #10
0
function mtm_options_page()
{
    if (false !== mtm_acf_check()) {
        acf_add_options_page(array('page_title' => 'Theme General Settings', 'menu_title' => 'Theme Settings', 'menu_slug' => 'theme-general-settings', 'capability' => 'edit_posts', 'redirect' => true));
        acf_add_options_sub_page(array('page_title' => 'Theme Header Settings', 'menu_title' => 'Header', 'parent_slug' => 'theme-general-settings'));
        acf_add_options_sub_page(array('page_title' => 'Theme Default Settings', 'menu_title' => 'Defaults', 'parent_slug' => 'theme-general-settings'));
        acf_add_options_sub_page(array('page_title' => 'Theme Footer Settings', 'menu_title' => 'Footer', 'parent_slug' => 'theme-general-settings'));
    }
}
コード例 #11
0
 /**
  * Add menu options page
  * @since 0.1.0
  */
 public function add_options_page()
 {
     if (!function_exists('acf_add_options_sub_page')) {
         return;
     }
     $options_page = 'edit.php?post_type=' . $this->post_type;
     if ($this->post_type == 'post') {
         $options_page = 'edit.php';
     }
     $this->options_page = acf_add_options_sub_page(array('page_title' => 'Options', 'menu_title' => 'Options ' . $this->post_type, 'parent_slug' => $options_page, 'menu_slug' => 'acf-seo-' . $this->post_type, 'post_id' => $this->post_type));
 }
コード例 #12
0
function theme_acf_options_pages()
{
    if (function_exists('acf_add_options_page')) {
        $parent = acf_add_options_page(array('page_title' => 'Site Settings', 'menu_title' => 'Site Settings', 'redirect' => false));
        acf_add_options_sub_page(array('page_title' => 'Social Settings', 'menu_title' => 'Social', 'parent_slug' => $parent['menu_slug']));
        acf_add_options_sub_page(array('page_title' => 'Signup Settings', 'menu_title' => 'Signup', 'parent_slug' => $parent['menu_slug']));
        acf_add_options_sub_page(array('page_title' => 'Category Card Content', 'menu_title' => 'Category Info Cards', 'parent_slug' => $parent['menu_slug']));
        acf_add_options_sub_page(array('page_title' => 'Sign up Incentive Widget', 'menu_title' => 'Sign up Widget', 'parent_slug' => $parent['menu_slug']));
        acf_add_options_sub_page(array('page_title' => 'MailChimp Settings', 'menu_title' => 'MailChimp', 'parent_slug' => $parent['menu_slug']));
    }
}
コード例 #13
0
 public function add_pages()
 {
     if (function_exists('acf_add_options_page')) {
         foreach ($this->pages as $page) {
             if (isset($page['parent_slug'])) {
                 acf_add_options_sub_page($page);
             } else {
                 acf_add_options_page($page);
             }
         }
     }
 }
コード例 #14
0
ファイル: theme.php プロジェクト: jabrankhalil/websolution
 function businesstheme()
 {
     // Enable support for Post Thumbnails, and declare two sizes.
     add_theme_support('title-tag');
     add_theme_support('post-thumbnails');
     //set_post_thumbnail_size( 255, 255, true );
     add_image_size('twentyfourteen-full-width', 1038, 576, true);
     add_image_size('service-image', 255, 255, true);
     add_image_size('portfolio-image', 400, 289, true);
     add_image_size('team-image', 235, 235, false);
     add_image_size('about-image', 170, 170, true);
     add_image_size('single', 300, 500);
     add_image_size('header', 1300, 800, true);
     // This theme uses wp_nav_menu() in two locations.
     register_nav_menus(array('footer' => __('Footer menu'), 'one page site' => __('One page site')));
     /*
      * Switch default core markup for search form, comment form, and comments
      * to output valid HTML5.
      */
     add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
     add_editor_style(array('css/editor-style.css'));
     if (function_exists('acf_add_options_page')) {
         acf_add_options_sub_page('Header');
         acf_add_options_sub_page('Footer');
         acf_add_options_sub_page('Service');
         acf_add_options_sub_page('e-commerce');
         acf_add_options_sub_page('Team');
         acf_add_options_sub_page('webapplication');
         acf_add_options_sub_page('wordpress');
     }
     function remove_menus()
     {
         //remove_menu_page( 'index.php' );                  //Dashboard
         remove_menu_page('edit.php');
         //Posts
         remove_menu_page('upload.php');
         //Media
         remove_menu_page('edit.php?post_type=page');
         //Pages
         remove_menu_page('edit-comments.php');
         //Comments
         //remove_menu_page( 'themes.php' );                 //Appearance
         //remove_menu_page( 'plugins.php' );                //Plugins
         //remove_menu_page( 'users.php' );                  //Users
         //remove_menu_page( 'tools.php' );                  //Tools
         //remove_menu_page( 'options-general.php' );        //Settings
     }
     add_action('admin_menu', 'remove_menus');
     // This theme uses its own gallery styles.
     add_filter('use_default_gallery_style', '__return_false');
 }
コード例 #15
0
ファイル: functions.php プロジェクト: jabrankhalil/testsite
function pc_setup()
{
    add_theme_support('title-tag');
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(100, 75, true);
    add_image_size('client-logos', 208, 98, true);
    register_nav_menus(array('primary' => __('Primary Menu')));
    add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
    add_editor_style(array('css/editor-style.css'));
    if (function_exists('acf_add_options_page')) {
        acf_add_options_sub_page('Header');
        acf_add_options_sub_page('Footer');
        acf_add_options_sub_page('404');
        acf_add_options_sub_page('Homepage Options');
    }
}
コード例 #16
0
function my_setup()
{
    add_theme_support('title-tag');
    add_theme_support('post-thumbnails', array('post'));
    set_post_thumbnail_size(300, 300, true);
    add_image_size('avatar', 224, 224, true);
    add_image_size('brand', 200, 200, false);
    add_image_size('gallery', 600, 600, false);
    register_nav_menus(array('primary' => __('Menu', 'rbrasil')));
    add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
    // add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', my_fonts_url() ) );
    if (function_exists('acf_add_options_page')) {
        acf_add_options_page(array('page_title' => 'Opções', 'position' => 21, 'menu_slug' => 'acf-options', 'redirect' => true));
        acf_add_options_sub_page(array('page_title' => 'Redes Sociais', 'menu_title' => 'Redes Sociais', 'parent_slug' => 'acf-options'));
        acf_add_options_sub_page(array('page_title' => 'Localização', 'menu_title' => 'Localização', 'parent_slug' => 'acf-options'));
    }
}
コード例 #17
0
function tool_acf_optionpage_build($p = array())
{
    // DEFAULTS {
    $defaults = array('setup' => false);
    $p = array_replace_recursive($defaults, $p);
    // }
    if ($p['setup']) {
        // REGISTER OPTIONSPAGE {
        if (function_exists('register_options_page')) {
            acf_add_options_sub_page($p['setup']['optionpage_name']);
        }
        // }
        // FIELDS {
        $lang_array = unserialize(THEME_LANG_ARRAY);
        if (isset($p['setup']['fieldgroups']) && count($p['setup']['fieldgroups']) > 0) {
            foreach ($p['setup']['fieldgroups'] as $key1 => $fg) {
                $fields = array();
                foreach ($lang_array as $key => $item) {
                    // LANGUAGE TAB
                    if (count($lang_array) > 1) {
                        $fields[] = array('key' => 'field_opt_' . $p['setup']['optionpage_key'] . '_' . $fg['key'] . '_tab_' . $item['language_code'], 'label' => $item['translated_name'], 'name' => '', 'type' => 'tab');
                    }
                    // FIELDS {
                    foreach ($fg['fields'] as $key => $item2) {
                        $defaults = array('required' => true, 'formatting' => 'none', 'column_width' => '', 'toolbar' => 'full', 'media_upload' => 'no');
                        $item2 = array_replace_recursive($defaults, $item2);
                        if ($item2['type'] == 'text') {
                            $fields[] = array('type' => 'text', 'key' => 'field_opt_' . $p['setup']['optionpage_key'] . '_' . $fg['key'] . '_' . $item2['key'] . '_' . $item['language_code'], 'name' => 'opt_' . $p['setup']['optionpage_key'] . '_' . $fg['key'] . '_' . $item2['key'] . '_' . $item['language_code'], 'label' => $item2['label'], 'required' => $item2['required'], 'default_value' => $item2['default_value'], 'formatting' => $item2['formatting']);
                        }
                        if ($item2['type'] == 'wysiwyg') {
                            $fields[] = array('type' => 'wysiwyg', 'key' => 'field_opt_' . $p['setup']['optionpage_key'] . '_' . $fg['key'] . '_' . $item2['key'] . '_' . $item['language_code'], 'name' => 'opt_' . $p['setup']['optionpage_key'] . '_' . $fg['key'] . '_' . $item2['key'] . '_' . $item['language_code'], 'label' => $item2['label'], 'default_value' => $item2['default_value'], 'column_width' => $item2['column_width'], 'toolbar' => $item2['toolbar'], 'media_upload' => $item2['media_upload']);
                        }
                    }
                    // FIELDS }
                }
                // }
                //print_o( $fields );
                // INIT FIELDS {
                register_field_group(array('id' => 'acf_' . $p['setup']['optionpage_key'] . '_' . $fg['key'], 'title' => $fg['label'], 'fields' => $fields, 'location' => array('rules' => array(array('param' => 'options_page', 'operator' => '==', 'value' => 'acf-options-' . strtolower($p['setup']['optionpage_name']), 'order_no' => 0)), 'allorany' => 'all'), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 999));
                // }
            }
        }
        // }
    }
}
コード例 #18
0
function setup_touch_easy_seo_settings_page()
{
    if (function_exists('acf_add_options_sub_page')) {
        acf_add_options_sub_page(array('title' => 'Settings', 'parent' => 'touch_easy_seo', 'slug' => "touch-easy-seo-settings", 'capability' => 'read_touch-easy-seo-settings', 'menu' => 'Touch Easy SEO Settings'));
    }
    if (function_exists("register_field_group")) {
        $roles = get_editable_roles();
        // Do not allow rights modification of administrator and current role
        if (isset($roles["administrator"])) {
            unset($roles["administrator"]);
        }
        $field_value = array();
        foreach ($roles as $role_name => $role_info) {
            $field_value[$role_name] = ucfirst($role_name);
        }
        register_field_group(array('id' => 'acf_touch-easy-seo-settings', 'title' => 'Touch Easy SEO Settings', 'fields' => array(array('key' => 'field_5409423015b00', 'label' => 'Select who is able to edit the meta tags', 'name' => 'allowed_roles_for_touch_seo', 'type' => 'checkbox', 'instructions' => 'Admins are always allowed, you can not remove their rights.', 'choices' => $field_value, 'default_value' => '', 'layout' => 'horizontal')), 'location' => array(array(array('param' => 'options_page', 'operator' => '==', 'value' => 'touch-easy-seo-settings', 'order_no' => 0, 'group_no' => 0))), 'options' => array('position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array()), 'menu_order' => 0));
    }
}
コード例 #19
0
ファイル: Theme.php プロジェクト: helsingborg-stad/Municipio
 public function __construct()
 {
     if (function_exists('acf_add_options_page')) {
         $themeOptionsCapability = 'administrator';
         acf_add_options_page(array('page_title' => __('Theme Options', 'municipio'), 'menu_title' => __('Theme Options', 'municipio'), 'menu_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'redirect' => false, 'icon_url' => 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiB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LDAuMy0xLDAuM2MwLDAsMCwwLDAsMGMtMC41LDAtMC44LTAuMS0wLjktMC4yYy0wLjIsMC4xLTAuNSwwLjItMSwwLjINCgkJYy0wLjUsMC0wLjgtMC4yLTEtMC4yYy0wLjIsMC4xLTAuNSwwLjItMS4yLDAuMmMtMC43LDAtMS0wLjEtMS4yLTAuMmMtMC4yLDAuMS0wLjUsMC4yLTEsMC4yYy0wLjUsMC0wLjgtMC4xLTEtMC4yDQoJCWMtMC4xLDAuMS0wLjUsMC4yLTAuOSwwLjJjLTAuNSwwLTAuOC0wLjItMS0wLjNjLTAuMiwwLjEtMC41LDAuMi0wLjgsMC4yVjIxSDE3Ljl6IE0xNS43LDE4LjdjMC4yLTAuNSwwLjktMC41LDEuMSwwdjEuNWgtMS4xDQoJCVYxOC43eiBNMTMuNSwxOC41YzAuMi0wLjcsMS4xLTAuNywxLjMsMHYxLjdoLTEuM1YxOC41eiBNMTEuMywxOC41YzAuMi0wLjcsMS4xLTAuNywxLjMsMHYxLjdoLTEuM1YxOC41eiBNOS4xLDE4LjUNCgkJYzAuMi0wLjcsMS4xLTAuNywxLjMsMHYxLjdIOS4xVjE4LjV6IE03LjIsMTguN2MwLjItMC41LDAuOS0wLjUsMS4xLDB2MS41SDcuMlYxOC43eiIvPg0KCTxwYXRoIGQ9Ik0yMy40LDIxdi0zLjloLTQuNWMtMC4xLDAuMS0wLjMsMC4xLTAuNiwwLjJWMjFIMjMuNHogTTIxLjksMTguNGMwLjEtMC40LDAuNi0wLjQsMC44LDB2MC45aC0wLjhWMTguNHogTTIwLjQsMTguNA0KCQljMC4xLTAuNCwwLjYtMC40LDAuOCwwdjAuOWgtMC44VjE4LjR6IE0xOC45LDE4LjRjMC4xLTAuNCwwLjYtMC40LDAuOCwwdjAuOWgtMC44VjE4LjR6Ii8+DQo8L2c+DQo8L3N2Zz4NCg=='));
         acf_add_options_sub_page(array('page_title' => __('Navigation', 'municipio'), 'menu_title' => __('Navigation', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-navigation'));
         acf_add_options_sub_page(array('page_title' => __('Header', 'municipio'), 'menu_title' => __('Header', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-header'));
         acf_add_options_sub_page(array('page_title' => __('Content', 'municipio'), 'menu_title' => __('Content', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-content'));
         acf_add_options_sub_page(array('page_title' => __('Footer', 'municipio'), 'menu_title' => __('Footer', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-footer'));
         acf_add_options_sub_page(array('page_title' => __('Search', 'municipio'), 'menu_title' => __('Search', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-search'));
         acf_add_options_sub_page(array('page_title' => __('Blog & Archives', 'municipio'), 'menu_title' => __('Blog & Archives', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-archives'));
         acf_add_options_sub_page(array('page_title' => '404', 'menu_title' => '404', 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-404'));
         acf_add_options_sub_page(array('page_title' => 'Google Analytics', 'menu_title' => 'Google Analytics', 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-google-analytics'));
         acf_add_options_sub_page(array('page_title' => 'Google Translate', 'menu_title' => 'Google Translate', 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-google-translate'));
         acf_add_options_sub_page(array('page_title' => __('Custom Post Types', 'municipio'), 'menu_title' => __('Post Types', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-post-types'));
         acf_add_options_sub_page(array('page_title' => __('Custom Taxonomies', 'municipio'), 'menu_title' => __('Taxonomies', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-taxonomies'));
         acf_add_options_sub_page(array('page_title' => __('Custom CSS/JS Editor', 'municipio'), 'menu_title' => __('Custom CSS/JS', 'municipio'), 'parent_slug' => 'theme-settings', 'capability' => $themeOptionsCapability, 'menu_slug' => 'acf-options-css'));
     }
 }
コード例 #20
0
ファイル: functions.php プロジェクト: giorgiosaud/bej
add_filter('login_errors', 'login_errors_message');
// Elimina basura del head
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
// elimina el codigo HTML de los comentarios
add_filter('pre_comment_content', 'wp_specialchars');
if (function_exists('acf_add_options_page')) {
    acf_add_options_page(array('page_title' => 'Theme Options', 'menu_title' => 'Theme Options', 'menu_slug' => 'theme-options', 'capability' => 'edit_posts', 'parent_slug' => '', 'position' => false, 'icon_url' => false, 'redirect' => true));
    acf_add_options_sub_page(array('page_title' => 'Main Options', 'menu_title' => 'Main Options', 'menu_slug' => 'main-options', 'capability' => 'edit_posts', 'parent_slug' => 'theme-options', 'position' => false, 'icon_url' => false));
    acf_add_options_sub_page(array('page_title' => 'Social Network', 'menu_title' => 'Social Network', 'menu_slug' => 'social-network', 'capability' => 'edit_posts', 'parent_slug' => 'theme-options', 'position' => false, 'icon_url' => false));
    acf_add_options_sub_page(array('page_title' => 'Footer', 'menu_title' => 'Footer', 'menu_slug' => 'footer', 'capability' => 'edit_posts', 'parent_slug' => 'theme-options', 'position' => false, 'icon_url' => false));
}
include_once "vendor/autoload.php";
$tema = new \WordpressBase\Initializer();
add_filter('wp_nav_menu_items', 'add_todaysdate_in_menu', 10, 2);
function add_todaysdate_in_menu($items, $args)
{
    // var_dump($args);
    if ($args->fallback_cb == 'menu-principal') {
        if (get_header_image()) {
            $CustomHeader = '<li class="Menu__customTitle"><a href="/" title="Home"><img src="' . get_header_image() . '" alt="' . get_bloginfo('title') . '" /></a></li>';
        } else {
            $CustomHeader = '<li class="Menu__customTitle"><a href="/" title="Home">' . get_bloginfo('title') . '</a></li>';
        }
        $SocialNetwork = '';
        if (have_rows('social_networks', 'option')) {
コード例 #21
0
ファイル: api-options-page.php プロジェクト: Garth619/Femi9
 function register_options_page($title = false)
 {
     acf_add_options_sub_page($title);
 }
コード例 #22
0
ファイル: functions.php プロジェクト: Hipermedia/icobelli
    // 	'title' 	=> 'Portada',
    // 	'parent_slug'	=> 'theme-general-settings',
    // ));
    // acf_add_options_sub_page(array(
    // 	'title' 	=> 'Bloques',
    // 	'parent_slug'	=> 'theme-general-settings',
    // ));
    // acf_add_options_sub_page(array(
    // 	'title'	=> 'Texto',
    // 	'parent_slug'	=> 'theme-general-settings',
    // ));
    // acf_add_options_sub_page(array(
    // 	'title' 	=> 'Testimonios',
    // 	'parent_slug'	=> 'theme-general-settings',
    // ));
    acf_add_options_sub_page(array('title' => 'Contacto', 'parent_slug' => 'theme-general-settings'));
}
/** Imprime el url del home  */
function inicio_url()
{
    print get_home_url();
}
/** Envía el valor del url del home  */
function get_inicio_url()
{
    return get_home_url();
}
/** Envía el valor del url del tema en uso  */
function plantilla_url()
{
    echo get_bloginfo('template_url');
コード例 #23
0
ファイル: options.php プロジェクト: ndimatteo/tgdco-theme
<?php

//ACF Site Settings
if (function_exists('acf_add_options_page')) {
    acf_add_options_page(array('page_title' => 'Site Settings', 'position' => '54.5', 'menu_slug' => 'site-settings', 'redirect' => false));
}
if (function_exists('acf_add_options_sub_page')) {
    //ACF Admin Settings Page
    acf_add_options_sub_page(array('title' => 'Admin', 'parent' => 'site-settings', 'capability' => 'edit_themes'));
}
//register ACF fields
if (function_exists('register_field_group')) {
    register_field_group(array('id' => 'acf_seo', 'title' => 'SEO', 'fields' => array(array('key' => 'field_535765da57f3c', 'label' => 'Description', 'name' => 'seo_desc', 'type' => 'textarea', 'instructions' => 'Enter the description here that you\'d like to show up in Search Results for this page/post.', 'default_value' => '', 'placeholder' => '', 'maxlength' => 155, 'formatting' => 'none'), array('key' => 'field_5357662557f3d', 'label' => 'Keywords', 'name' => 'seo_keywords', 'type' => 'text', 'instructions' => 'Enter up to 15 words or phrases separated by a comma.', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'none', 'maxlength' => '')), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'page', 'order_no' => 0, 'group_no' => 0)), array(array('param' => 'post_type', 'operator' => '==', 'value' => 'project', 'order_no' => 0, 'group_no' => 0)), array(array('param' => 'post_type', 'operator' => '==', 'value' => 'post', 'order_no' => 0, 'group_no' => 1))), 'options' => array('position' => 'side', 'layout' => 'default', 'hide_on_screen' => array(0 => 'custom_fields', 1 => 'discussion', 2 => 'comments', 3 => 'author', 4 => 'format', 5 => 'tags', 6 => 'send-trackbacks')), 'menu_order' => 2));
    acf_add_local_field_group(array('key' => 'group_5619ca28ed7c3', 'title' => 'Share Settings', 'fields' => array(array('key' => 'field_5633ea2521cf2', 'label' => 'Display Image', 'name' => 'share_image', 'type' => 'image', 'instructions' => 'Use images that are at least 1200 x 630 pixels', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'return_format' => 'array', 'preview_size' => 'medium', 'library' => 'uploadedTo', 'min_width' => '', 'min_height' => '', 'min_size' => '', 'max_width' => '', 'max_height' => '', 'max_size' => '', 'mime_types' => 'jpg'), array('key' => 'field_5619ca376e071', 'label' => 'Description', 'name' => 'share_desc', 'type' => 'textarea', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'wrapper' => array('width' => '', 'class' => '', 'id' => ''), 'default_value' => '', 'placeholder' => '', 'maxlength' => '', 'rows' => '', 'new_lines' => '', 'readonly' => 0, 'disabled' => 0)), 'location' => array(array(array('param' => 'post_type', 'operator' => '==', 'value' => 'post')), array(array('param' => 'post_type', 'operator' => '==', 'value' => 'page')), array(array('param' => 'post_type', 'operator' => '==', 'value' => 'project'))), 'menu_order' => 3, 'position' => 'side', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => '', 'active' => 1, 'description' => ''));
    register_field_group(array('key' => 'group_542213662fb71', 'title' => 'Admin Settings', 'fields' => array(array('key' => 'field_5422644c5b5d1', 'label' => 'Footer', 'name' => '', 'prefix' => '', 'type' => 'tab', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0), array('key' => 'field_542264265b5d0', 'label' => 'Custom Text', 'name' => 'admin_footer_text', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'default_value' => 'Design + Development by <a href="http://nickdimatteo.com">Nick DiMatteo</a>', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_542264655b5d2', 'label' => 'Widgets', 'name' => '', 'prefix' => '', 'type' => 'tab', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0), array('key' => 'field_542384189ce37', 'label' => 'Title', 'name' => 'widget_title', 'prefix' => '', 'type' => 'text', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'maxlength' => '', 'readonly' => 0, 'disabled' => 0), array('key' => 'field_54238429a2d13', 'label' => 'Content', 'name' => 'widget_text', 'prefix' => '', 'type' => 'wysiwyg', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '', 'tabs' => 'all', 'toolbar' => 'full', 'media_upload' => 0), array('key' => 'field_542264a8362e7', 'label' => 'Login', 'name' => '', 'prefix' => '', 'type' => 'tab', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0), array('key' => 'field_542228572b6f1', 'label' => 'CSS', 'name' => 'login_css', 'prefix' => '', 'type' => 'textarea', 'instructions' => '', 'required' => 0, 'conditional_logic' => 0, 'default_value' => '/*---------- BACKGROUND ----------*/
	
body.login {
		background: #fff;
}
	
	
/*---------- LOGO ----------*/
	
.login h1 a {
		width: 100px;
		height: 45px;
		background-size: 100px 45px !important; /* <----- make sure this matches image size! */
		background-image:url(\'/assets/img/logo.png\') !important;
		margin: 0 auto 20px;
	}
コード例 #24
0
ファイル: functions.php プロジェクト: evgensorokin/euroPomelo
 */
require get_template_directory() . '/inc/template-tags.php';
/**
 * Customizer additions.
 */
require get_template_directory() . '/inc/customizer.php';
add_action('init', 'create_post_type_products');
function create_post_type_products()
{
    $labels = array('name' => _x('Products', 'post type general name'), 'singular_name' => _x('Product', 'post type singular name'), 'add_new' => _x('Add New', 'post'), 'add_new_item' => __('Add New Product'), 'edit_item' => __('Edit Product'), 'new_item' => __('New Product'), 'view_item' => __('View Product'), 'search_items' => __('Search Product'), 'not_found' => __('Nothing found'), 'not_found_in_trash' => __('Nothing found in Trash'), 'parent_item_colon' => '');
    $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 5, 'supports' => array('title', 'thumbnail', 'editor', 'comments', 'excerpt'), 'taxonomies' => array('post_tag'));
    register_post_type('product', $args);
}
add_action('init', 'create_post_type_recipes');
function create_post_type_recipes()
{
    $labels = array('name' => _x('Recipes', 'post type general name'), 'singular_name' => _x('Recipe', 'post type singular name'), 'add_new' => _x('Add New', 'post'), 'add_new_item' => __('Add New Recipe'), 'edit_item' => __('Edit Recipe'), 'new_item' => __('New Recipe'), 'view_item' => __('View Recipe'), 'search_items' => __('Search Recipe'), 'not_found' => __('Nothing found'), 'not_found_in_trash' => __('Nothing found in Trash'), 'parent_item_colon' => '');
    $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 5, 'supports' => array('title', 'thumbnail', 'editor', 'comments', 'excerpt'), 'taxonomies' => array('post_tag'));
    register_post_type('recipe', $args);
}
add_action('init', 'create_brand');
function create_brand()
{
    $labels = array('name' => 'Brands', 'singular_name' => 'Brand', 'search_items' => 'Search Brands', 'all_items' => 'All Brands', 'parent_item' => 'Parent Brand', 'parent_item_colon' => 'Parent Brand:', 'edit_item' => 'Edit Brand', 'update_item' => 'Update Brand', 'add_new_item' => 'Add New Brand', 'new_item_name' => 'New Brand Name', 'menu_name' => 'Brand');
    $args = array('label' => '', 'labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'hierarchical' => true, 'update_count_callback' => '', 'query_var' => true, 'capabilities' => array(), 'meta_box_cb' => null, 'show_admin_column' => false, '_builtin' => false, 'show_in_quick_edit' => null);
    register_taxonomy('brand', 'product', $args);
}
if (function_exists('acf_add_options_page')) {
    acf_add_options_page();
    acf_add_options_sub_page('Footer');
}
コード例 #25
0
<?php

//Add ACF options page
if (function_exists('acf_add_options_page')) {
    acf_add_options_page(array('page_title' => 'Theme General Settings', 'menu_title' => 'Theme Settings', 'menu_slug' => 'theme-general-settings', 'capability' => 'edit_posts', 'redirect' => true));
    acf_add_options_sub_page(array('page_title' => 'General Settings', 'menu_title' => 'General Settings', 'parent_slug' => 'theme-general-settings'));
    acf_add_options_sub_page(array('page_title' => 'Banner Settings', 'menu_title' => 'Banner Settings', 'parent_slug' => 'theme-general-settings'));
    //    acf_add_options_sub_page(array(
    //        'page_title' 	=> 'Theme Footer Settings',
    //        'menu_title'	=> 'Footer',
    //        'parent_slug'	=> 'theme-general-settings',
    //    ));
}
require_once get_template_directory() . '/lib/acf/acf-options--branding.php';
require_once get_template_directory() . '/lib/acf/acf-options--contact.php';
require_once get_template_directory() . '/lib/acf/acf-options--banner-image.php';
require_once get_template_directory() . '/lib/acf/acf-options--banner-content.php';
require_once get_template_directory() . '/lib/acf/acf-options--footer-info.php';
コード例 #26
0
 public static function add_options_page()
 {
     if (function_exists('acf_add_options_page')) {
         acf_add_options_sub_page(array('page_title' => 'Post Archive Settings', 'menu_title' => 'Archive Settings', 'parent_slug' => 'theme-general-settings'));
     }
 }
コード例 #27
0
ファイル: options-pages.php プロジェクト: TMBR/johnjohn
<?php

/*
// ACF PRO Options pages
-----------------------------
> http://www.advancedcustomfields.com/resources/register-multiple-options-pages/
> http://www.advancedcustomfields.com/resources/acf_add_options_sub_page/
*/
if (function_exists('acf_add_options_page')) {
    acf_add_options_page(array('page_title' => 'Global Settings', 'menu_title' => 'Global Settings', 'menu_slug' => 'global-settings', 'capability' => 'edit_posts', 'icon_url' => 'dashicons-admin-site', 'redirect' => false));
    acf_add_options_sub_page(array('page_title' => 'Header Settings', 'menu_title' => 'Header', 'parent_slug' => 'global-settings', 'capability' => 'manage_options'));
    acf_add_options_sub_page(array('page_title' => 'Footer Settings', 'menu_title' => 'Footer', 'parent_slug' => 'global-settings', 'capability' => 'manage_options'));
}
/*
// ACF PRO Options Page Settings: 
This Hook Allows you to Modify Settings for the Options Page Add-on
-----------------------------------------------------------------------
> http://www.advancedcustomfields.com/resources/filters/acfoptions_pagesettings/


// this example will change the menu item title to 'Global Settings' and add 3 sub pages!

function my_acf_options_page_settings( $settings ) {
	 $settings['title'] = 'Global Settings';
	 $settings['pages'] = array('Header', 'Sidebar', 'Footer');

	 return $settings;
}

add_filter('acf/options_page/settings', 'my_acf_options_page_settings');
*/
コード例 #28
0
ファイル: acf.php プロジェクト: jakecleary/ultrapress
 * @var string
 */
$acfPath = FULL_PATH . 'acf';
/**
 * Set the path of where we load the fields.
 */
function acfLoad($paths)
{
    global $acfPath;
    unset($paths[0]);
    $paths[] = $acfPath;
    return $paths;
}
/**
 * Set the path of where we save the fields.
 */
function acfSave($path)
{
    global $acfPath;
    $path = $acfPath;
    return $path;
}
add_filter('acf/settings/load_json', 'acfLoad');
add_filter('acf/settings/save_json', 'acfSave');
/**
 * Set up the options pages.
 */
if (function_exists('acf_add_options_page')) {
    acf_add_options_page(['page_title' => 'A&F Settings', 'menu_title' => 'Settings', 'menu_slug' => 'site-settings', 'capability' => 'edit_posts', 'redirect' => false]);
    acf_add_options_sub_page(['page_title' => 'Products', 'menu_title' => 'Products', 'parent_slug' => 'site-settings']);
}
コード例 #29
0
ファイル: acf-options.php プロジェクト: superphly/cervantes
<?php

if (function_exists('acf_add_options_sub_page')) {
    acf_add_options_sub_page(array('title' => 'CPT Options', 'menu' => 'CPT Options', 'parent' => 'edit.php?post_type=cpt', 'slug' => 'cpt_options', 'capability' => 'manage_options'));
}
コード例 #30
0
ファイル: functions.php プロジェクト: plandd/pbagora
    return $dir;
}
/**
 * Framework para personalização de campos
 * (custom meta post)
 */
include_once get_stylesheet_directory() . '/includes/acf-pro/acf.php';
define('ACF_LITE', true);
//include_once( get_stylesheet_directory() . '/includes/acf/preconfig.php' );
if (function_exists('acf_add_options_page')) {
    acf_add_options_page(array('page_title' => 'Opções gerais', 'menu_title' => 'PB Agora', 'menu_slug' => 'opcoes-gerais', 'capability' => 'edit_posts', 'redirect' => false));
    acf_add_options_sub_page(array('page_title' => 'Defina categorias para seções da página principal', 'menu_title' => 'Seções', 'parent_slug' => 'opcoes-gerais'));
    acf_add_options_sub_page(array('page_title' => 'Código de rastramento do analytics', 'menu_title' => 'Analytics', 'parent_slug' => 'opcoes-gerais'));
    acf_add_options_sub_page(array('page_title' => 'Otimizar indexação da página', 'menu_title' => 'SEO', 'parent_slug' => 'opcoes-gerais'));
    acf_add_options_sub_page(array('page_title' => 'Adicione código extra no site', 'menu_title' => 'Extra', 'parent_slug' => 'opcoes-gerais'));
    acf_add_options_sub_page(array('page_title' => 'Gerencie as publicidades do portal', 'menu_title' => 'Publicidades', 'parent_slug' => 'opcoes-gerais'));
}
/**
 * Função genérica para exibir publicidades
 */
function pba_show_ads($ads_imgs, $img_key, $ads_html)
{
    $ads = get_field($ads_imgs, 'option');
    if (is_array($ads)) {
        shuffle($ads);
    }
    $html = get_field($ads_html, 'option');
    $i = 0;
    if ($html == "") {
        if ($ads) {
            foreach ($ads as $img) {