Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- **
- ** Author: Gabriel Tadeu
- ** URL: htp://gabrieltadeu.com/
- **
- */
- // Set the content width based on the theme's design and stylesheet.
- if ( ! isset( $content_width ) )
- $content_width = 730; /* pixels */
- // Firing all out initial functions at the start
- add_action( 'after_setup_theme','ahoy', 15 );
- function ahoy() {
- // launching operation cleanup
- add_action( 'init', 'head_cleanup' );
- // remove WP version from RSS
- add_filter( 'the_generator', 'rss_version' );
- // remove pesky injected css for recent comments widget
- add_filter( 'wp_head', 'remove_wp_widget_recent_comments_style', 1 );
- // clean up comment styles in the head
- add_action( 'wp_head', 'remove_recent_comments_style', 1 );
- // clean up gallery output in wp
- add_filter( 'the_content', 'remove_br_gallery', 11, 2);
- // enqueue cdn jquery scripts
- add_action( 'wp_enqueue_scripts', 'cdn_jquery' );
- // launching this stuff after theme setup
- add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars' );
- //add_filter( 'mce_buttons', 'ilc_mce_buttons' );
- add_action( 'after_setup_theme','theme_support' );
- // adding the search form
- add_filter( 'get_search_form', 'wpsearch' );
- // cleaning up random code around images
- add_filter( 'the_content', 'filter_ptags_on_images' );
- // cleaning up excerpt
- add_filter( 'excerpt_more', 'excerpt_more' );
- //Page w/ excerpt
- add_action( 'init', 'my_add_excerpts_to_pages' );
- // removing the dashboard widgets
- add_action( 'admin_menu', 'disable_default_dashboard_widgets' );
- // Better title
- add_filter( 'wp_title', 'gt_wp_title', 10, 2 );
- // adding the function to the Wordpress init
- add_action( 'init', 'gt_custom_post');
- //Taxonomies Post class
- add_filter( 'post_class', 'custom_taxonomy_post_class', 10, 3 );
- //Performace counter
- add_action( 'wp_footer', 'footer_db_queries' );
- // Disable wp admin bar
- add_filter( 'show_admin_bar', '__return_false' );
- //Shortcode
- add_shortcode('vid','vid_sc');
- }
- function head_cleanup() {
- // category feeds
- remove_action( 'wp_head', 'feed_links_extra', 3 );
- // post and comment feeds
- remove_action( 'wp_head', 'feed_links', 2 );
- // EditURI link
- remove_action( 'wp_head', 'rsd_link' );
- // windows live writer
- remove_action( 'wp_head', 'wlwmanifest_link' );
- // index link
- remove_action( 'wp_head', 'index_rel_link' );
- // previous link
- remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
- // start link
- remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
- // links for adjacent posts
- remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
- // WP version
- remove_action( 'wp_head', 'wp_generator' );
- // remove WP version from css
- add_filter( 'style_loader_src', 'remove_wp_ver_css_js', 9999 );
- // remove Wp version from scripts
- add_filter( 'script_loader_src', 'remove_wp_ver_css_js', 9999 );
- }
- function remove_wp_ver_css_js( $src ) {
- // remove WP version from scripts
- if ( strpos( $src, 'ver=' ) )
- $src = remove_query_arg( 'ver', $src );
- return $src;
- }
- function rss_version() {
- // remove WP version from RSS
- return '';
- }
- function remove_wp_widget_recent_comments_style() {
- // remove injected CSS for recent comments widget
- if ( has_filter( 'wp_head', 'wp_widget_recent_comments_style' ) ) {
- remove_filter( 'wp_head', 'wp_widget_recent_comments_style' );
- }
- }
- function remove_recent_comments_style() {
- // remove injected CSS from recent comments widget
- global $wp_widget_factory;
- if ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {
- remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
- }
- }
- function remove_br_gallery($output) {
- // add_filter( 'use_default_gallery_style', '__return_false' );
- return preg_replace('/\<br[^\>]*\>/', '', $output);
- }
- function cdn_jquery() {
- // Deregister core-bundled jQuery
- // This is dangerous! Understand the
- // potential consequences before doing this!
- wp_deregister_script( 'jquery' );
- // Register custom jQuery version
- wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js' );
- // Enqueue cusotm jQuery
- wp_enqueue_script( 'jquery' );
- }
- function ilc_mce_buttons($buttons) {
- //array_push($buttons, "backcolor", "anchor", "hr", "fontselect", "sub", "sup");
- array_push($buttons, "sub", "sup");
- return $buttons;
- }
- function my_toolbars( $toolbars ) {
- // Uncomment to view format of $toolbars
- /*
- echo '< pre >';
- print_r($toolbars);
- echo '< /pre >';
- //die;
- // Add a new toolbar called "Very Simple"
- // - this toolbar has only 1 row of buttons
- $toolbars['Enough'] = array();
- $toolbars['Enough'][1] = array(
- 'bold',
- 'italic',
- 'strikethrough',
- 'underline',
- 'bullist',
- 'numlist',
- 'blockquote',
- 'justifyleft',
- 'justifycenter',
- 'justifyright',
- 'justifyfull',
- 'link',
- 'unlink',
- 'wp_more',
- 'spellchecker',
- 'fullscreen',
- 'formatselect',
- 'forecolor',
- 'pastetext',
- 'pasteword',
- 'removeformat',
- 'charmap',
- 'outdent',
- 'indent',
- 'undo',
- 'redo',
- 'wp_help',
- 'code',
- 'backcolor',
- 'anchor',
- 'hr',
- 'fontselect',
- 'sub',
- 'sup'
- );
- */
- $toolbars['List'] = array();
- $toolbars['List'][1] = array(
- 'bullist',
- 'outdent',
- 'indent',
- 'bold',
- 'italic',
- 'strikethrough',
- 'link',
- 'unlink',
- 'sub',
- 'sup',
- 'pastetext',
- 'pasteword',
- 'removeformat',
- 'charmap',
- 'fullscreen',
- );
- /*
- // Edit the "Full" toolbar and remove 'code'
- // - delet from array code from http://stackoverflow.com/questions/7225070/php-array-delete-by-value-not-key
- if( ($key = array_search('code' , $toolbars['Full' ][2])) !== false )
- {
- unset( $toolbars['Full' ][2][$key] );
- }
- // remove the 'Basic' toolbar completely
- unset( $toolbars['Basic' ] );
- */
- // return $toolbars - IMPORTANT!
- return $toolbars;
- }
- function theme_support() {
- // wp thumbnails ( sizes handled in functions.php )
- add_theme_support( 'post-thumbnails' );
- add_image_size( 'mini', 120, 120, true );
- add_image_size( 'module', 280, 210, true );
- add_image_size( 'project', 1440, 475, true );
- add_image_size( 'background', 1440, 900, true );
- // Supports all available post formats.
- // add_theme_support( 'structured-post-formats', array( 'video', 'gallery' ) );
- // add_theme_support( 'post-formats', array( 'video', 'gallery' ) );
- // rss thingy
- // add_theme_support('automatic-feed-links');
- add_action('wp_head', 'addBackPostFeed');
- // wp menus
- add_theme_support( 'menus' );
- // registering wp3+ menus
- register_nav_menus(
- array(
- 'main-nav' => 'Menu',
- 'user-nav' => 'User',
- )
- );
- }
- function addBackPostFeed() {
- echo '<link rel="alternate" type="application/rss+xml" title="RSS 2.0 Feed" href="'.get_bloginfo('rss2_url').'" />';
- }
- function wpsearch( $form ) {
- // Search Form ' . get_search_query() . '
- $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
- <fieldset>
- <input type="text" value="' . get_search_query() . '" name="s" id="s" autocomplete="off" />
- <button type="submit" id="searchsubmit"><span class="ir">Search</span></button>
- </fieldset>
- </form>';
- return $form;
- }
- function filter_ptags_on_images( $content ){
- // remove the p from around imgs ( http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/ )
- return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
- }
- function excerpt_more( $more ) {
- // This removes the annoying […] to a Read More link
- global $post;
- // edit here if you like
- return '...';
- }
- function my_add_excerpts_to_pages() {
- add_post_type_support( 'page', 'excerpt' );
- }
- function disable_default_dashboard_widgets() {
- // disable default dashboard widgets
- //remove_meta_box( 'dashboard_right_now', 'dashboard', 'core' ); // Right Now Widget
- //remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'core' ); // Comments Widget
- remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'core' ); // Incoming Links Widget
- remove_meta_box( 'dashboard_plugins', 'dashboard', 'core' ); // Plugins Widget
- remove_meta_box( 'dashboard_quick_press', 'dashboard', 'core' ); // Quick Press Widget
- //remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'core' ); // Recent Drafts Widget
- remove_meta_box( 'dashboard_primary', 'dashboard', 'core' ); //
- remove_meta_box( 'dashboard_secondary', 'dashboard', 'core' ); //
- //removing plugin dashboard boxes
- remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal' ); // Yoast's SEO Plugin Widget
- }
- function gt_wp_title( $title, $sep ) {
- global $paged, $page;
- if ( is_feed() )
- return $title;
- // Add the site name.
- $title .= get_bloginfo( 'name' );
- // Add the site description for the home/front page.
- $site_description = get_bloginfo( 'description', 'display' );
- if ( $site_description && ( is_home() || is_front_page() ) )
- $title = "$title $sep $site_description";
- // Add a page number if necessary.
- if ( $paged >= 2 || $page >= 2 )
- $title = "$title $sep " . sprintf( 'Página', max( $paged, $page ) );
- return $title;
- }
- function gt_custom_post() {
- // creating ( registering ) the custom type
- $labels = array(
- 'name' => 'Projetos',
- 'singular_name' => 'Projeto',
- 'all_items' => 'Todos os Projetos',
- 'add_new' => 'Adicione um novo',
- 'add_new_item' => 'Adicione um novo Projeto',
- 'edit' => 'Editar',
- 'edit_item' => 'Editar Projeto',
- 'new_item' => 'Novo Projeto',
- 'view_item' => 'Ver Projeto',
- 'search_items' => 'Procurar Projetos',
- 'not_found' => 'Nenhum Projeto encontrado',
- 'not_found_in_trash' => 'Nenhum Projeto na lixeira',
- 'parent_item_colon' => ''
- );
- $projetos = array(
- //'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
- 'label' => 'projetos',
- 'description' => '',
- 'labels' => $labels,
- 'supports' => array('author', 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes', 'excerpt'), //, 'author'
- 'menu_icon' => 'dashicons-portfolio',
- 'capability_type' => 'page',
- 'exclude_from_search' => false,
- 'hierarchical' => true,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => 20,
- 'can_export' => true,
- 'has_archive' => true,
- 'publicly_queryable' => true,
- 'query_var' => true,
- 'rewrite' => false, //array('slug' => false, 'with_front' => false, 'paged' => false, 'feed' => false),
- ); // ( http://codex.wordpress.org/Function_Reference/register_post_type )
- register_post_type('projetos', $projetos);
- register_taxonomy_for_object_type('category', 'projetos');
- register_taxonomy_for_object_type('post_tag', 'projetos');
- // creating ( registering ) the custom type
- $labels = array(
- 'name' => 'Backgrounds',
- 'singular_name' => 'Background',
- 'all_items' => 'Todos os Backgrounds',
- 'add_new' => 'Adicione um novo',
- 'add_new_item' => 'Adicione um novo Background',
- 'edit' => 'Editar',
- 'edit_item' => 'Editar Background',
- 'new_item' => 'Novo Background',
- 'view_item' => 'Ver Background',
- 'search_items' => 'Procurar Backgrounds',
- 'not_found' => 'Nenhum Background encontrado',
- 'not_found_in_trash' => 'Nenhum Background na lixeira',
- 'parent_item_colon' => ''
- );
- $backgrounds = array(
- //'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
- 'label' => 'backgrounds',
- 'description' => '',
- 'labels' => $labels,
- 'supports' => array('title', 'thumbnail'), //, 'author'
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-format-gallery',
- 'exclude_from_search' => true,
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => 10,
- 'can_export' => true,
- 'has_archive' => true,
- 'publicly_queryable' => true,
- 'query_var' => true,
- 'rewrite' => false, //array('slug' => false, 'with_front' => false, 'paged' => false, 'feed' => false),
- ); // ( http://codex.wordpress.org/Function_Reference/register_post_type )
- register_post_type('backgrounds', $backgrounds);
- // creating ( registering ) the custom type
- $labels = array(
- 'name' => 'Mailings',
- 'singular_name' => 'Mailing',
- 'all_items' => 'Todos os Mailings',
- 'add_new' => 'Adicione um novo',
- 'add_new_item' => 'Adicione um novo Mailing',
- 'edit' => 'Editar',
- 'edit_item' => 'Editar Mailing',
- 'new_item' => 'Novo Mailing',
- 'view_item' => 'Ver Mailing',
- 'search_items' => 'Procurar Mailings',
- 'not_found' => 'Nenhum Mailing encontrado',
- 'not_found_in_trash' => 'Nenhum Mailing na lixeira',
- 'parent_item_colon' => ''
- );
- $mailings = array(
- //'menu_icon' => get_stylesheet_directory_uri() . '/library/images/custom-post-icon.png', /* the icon for the custom post type menu */
- 'label' => 'maling',
- 'description' => '',
- 'labels' => $labels,
- 'supports' => array('title', 'custom-fields', 'editor'), //, 'author'
- 'capability_type' => 'page',
- 'menu_icon' => 'dashicons-email-alt',
- 'exclude_from_search' => true,
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => true,
- 'show_in_admin_bar' => true,
- 'menu_position' => 20,
- 'can_export' => true,
- 'has_archive' => true,
- 'publicly_queryable' => true,
- 'query_var' => true,
- 'rewrite' => true,
- ); // ( http://codex.wordpress.org/Function_Reference/register_post_type )
- register_post_type('mailing', $mailings);
- }
- function views_base_pid_cpt_rewrite() {
- $post_types = array('projetos');
- foreach($post_types as $post_type) {
- // Prevent WordPress from sending a 404
- add_rewrite_rule('([0-9]{4})/projeto/(\d+)/[^/]+/?$', 'index.php?year=$matches[1]&post_type='.$post_type.'&p=$matches[2]', 'top');
- add_rewrite_rule('([0-9]{4})/projeto/(\d+)/[^/]+/[^/]+/?$', 'index.php?year=$matches[1]&post_type='.$post_type.'&p=$matches[2]', 'top');
- }
- }
- function views_base_pid_cpt_rewrite_permalink( $post_link, $id = 0 ) {
- $post_types = array('projetos');
- // check if post exits and if we hit the cpt slug
- $post = get_post($id);
- if(is_wp_error($post) || !in_array($post->post_type, $post_types))
- return $post_link;
- // sanitize slug
- empty($post->slug) and $post->slug = sanitize_title($post->post_title);
- if($post->post_parent > 0) {
- $parent = get_post($post->post_parent);
- empty($parent->slug) and $parent->slug = sanitize_title($parent->post_title);
- //empty($post->slug) and $post->slug = sanitize_title($post->post_title);
- return home_url(user_trailingslashit("%year%/projeto/$post->ID/$parent->slug/$post->slug"));
- } else {
- return home_url(user_trailingslashit("%year%/projeto/$post->ID/$post->slug"));
- }
- // return the modified url
- //return home_url(user_trailingslashit("$post->post_type/%year%/$post->ID/$post->slug"));
- //return home_url(user_trailingslashit("%year%/$post->post_type/$post->ID/$post->slug"));
- }
- function gt_permalink($permalink, $post_id, $leavename) {
- $post = get_post($post_id);
- $rewritecode = array(
- '%year%',
- '%monthnum%',
- '%day%',
- '%hour%',
- '%minute%',
- '%second%',
- $leavename? '' : '%postname%',
- '%post_id%',
- '%category%',
- '%author%',
- $leavename? '' : '%pagename%',
- );
- if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')) ) {
- $unixtime = strtotime($post->post_date);
- $category = '';
- if ( strpos($permalink, '%category%') !== false ) {
- $cats = get_the_category($post->ID);
- if ( $cats ) {
- usort($cats, '_usort_terms_by_ID'); // order by ID
- $category = $cats[0]->slug;
- if ( $parent = $cats[0]->parent )
- $category = get_category_parents($parent, false, '/', true) . $category;
- }
- // show default category in permalinks, without
- // having to assign it explicitly
- if ( empty($category) ) {
- $default_category = get_category( get_option( 'default_category' ) );
- $category = is_wp_error( $default_category ) ? '' : $default_category->slug;
- }
- }
- $author = '';
- if ( strpos($permalink, '%author%') !== false ) {
- $authordata = get_userdata($post->post_author);
- $author = $authordata->user_nicename;
- }
- $date = explode(" ",date('Y m d H i s', $unixtime));
- $rewritereplace =
- array(
- $date[0],
- $date[1],
- $date[2],
- $date[3],
- $date[4],
- $date[5],
- $post->post_name,
- $post->ID,
- $category,
- $author,
- $post->post_name,
- );
- $permalink = str_replace($rewritecode, $rewritereplace, $permalink);
- } else { // if they're not using the fancy permalink option
- }
- return $permalink;
- }
- function my_remove_menu_pages() {
- remove_menu_page('edit.php');
- }
- add_action('wp_before_admin_bar_render', 'remove_admin_bar_links');
- function remove_admin_bar_links() {
- global $wp_admin_bar;
- $wp_admin_bar->remove_menu('new-content'); // Remove the content link
- }
- // Add filter to plugin init function
- add_filter('post_type_link', 'gt_permalink', 10, 3);
- add_filter('post_type_link', 'views_base_pid_cpt_rewrite_permalink', 1, 3);
- add_action('init', 'views_base_pid_cpt_rewrite');
- add_action( 'admin_menu', 'my_remove_menu_pages' );
- function custom_taxonomy_post_class( $classes, $class, $ID ) {
- $taxonomy = array('classificacao');
- $terms = get_the_terms( (int) $ID, $taxonomy );
- if( !empty( $terms ) ) {
- foreach( (array) $terms as $order => $term ) {
- if( !in_array( $term->slug, $classes ) ) {
- $classes[] = $term->slug;
- }
- }
- }
- return $classes;
- }
- function footer_db_queries() {
- echo '<!-- '.get_num_queries().' queries in '.timer_stop(0).' seconds. -->'.PHP_EOL;
- }
- function vid_sc($atts, $content=null) {
- extract(
- shortcode_atts(array(
- 'site' => 'youtube',
- 'id' => '',
- 'w' => '600',
- 'h' => '370'
- ), $atts)
- );
- if ( $site == "youtube" ) { $src = 'http://www.youtube.com/embed/' . $id . '?enablejsapi=1&version=3&color=white&modestbranding=1&rel=0&showinfo=0&theme=dark&wmode=transparent&fs=1&controls=2&autohide=1&origin=*&playerapiid=v_' . $id; }
- else if ( $site == "vimeo" ) { $src = 'http://player.vimeo.com/video/'.$id; }
- else if ( $site == "dailymotion" ) { $src = 'http://www.dailymotion.com/embed/video/'.$id; }
- else if ( $site == "yahoo" ) { $src = 'http://d.yimg.com/nl/vyc/site/player.html#vid='.$id; }
- else if ( $site == "bliptv" ) { $src = 'http://a.blip.tv/scripts/shoggplayer.html#file=http://blip.tv/rss/flash/'.$id; }
- else if ( $site == "veoh" ) { $src = 'http://www.veoh.com/static/swf/veoh/SPL.swf?videoAutoPlay=0&permalinkId='.$id; }
- else if ( $site == "viddler" ) { $src = 'http://www.viddler.com/simple/'.$id; }
- if ( $id != '' ) {
- return '<div id="v_' . $id . '" class="embed"><iframe id="i_' . $id . '" src="'.$src.'" class="vid iframe-'.$site.'"></iframe></div>';
- }
- }
- function filter_media_comment_status( $open, $post_id ) {
- $post = get_post( $post_id );
- if( $post->post_type == 'attachment' ) {
- return false;
- }
- return $open;
- }
- add_filter( 'comments_open', 'filter_media_comment_status', 10 , 2 );
- add_filter( 'page_attributes_dropdown_pages_args', 'so_3538267_enable_drafts_parents' );
- add_filter( 'quick_edit_dropdown_pages_args', 'so_3538267_enable_drafts_parents' );
- function so_3538267_enable_drafts_parents( $args ) {
- $args['post_status'] = 'draft,publish,pending';
- return $args;
- }
- if(function_exists("register_field_group")) {
- //define( 'ACF_LITE', true );
- register_field_group(array (
- 'id' => 'acf_linha-do-tempo',
- 'title' => 'Linha do Tempo',
- 'fields' => array (
- array (
- 'key' => 'field_52e3dd03acc06',
- 'label' => 'Status',
- 'name' => 'status',
- 'type' => 'select',
- 'choices' => array (
- 1 => 'Em andamento',
- 2 => 'Pausado',
- 3 => 'Concluído',
- ),
- 'default_value' => '',
- 'allow_null' => 0,
- 'multiple' => 0,
- ),
- array (
- 'key' => 'field_52e3dd0324c06',
- 'label' => 'Ordenação',
- 'name' => 'ordenacao',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Habilitar ordem manual dos itens',
- 'default_value' => 0,
- ),
- array (
- 'key' => 'field_52e3dd03aa405',
- 'label' => 'Acontecimentos',
- 'name' => 'acontecimentos',
- 'type' => 'flexible_content',
- 'layouts' => array (
- array (
- 'label' => 'Galeria',
- 'name' => 'galeria',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fd9c809fe',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe29f92b7bf',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fd78809fd',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e3003d73f21',
- 'label' => 'Imagens',
- 'name' => 'imagens',
- 'type' => 'gallery',
- 'column_width' => '',
- 'preview_size' => 'mini',
- 'library' => 'all',
- ),
- array (
- 'key' => 'field_52e2fdaf809ff',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Imagem',
- 'name' => 'imagem',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe0f0cc3f',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2a68c2164',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe0f0cc40',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e3006b73f22',
- 'label' => 'Imagem',
- 'name' => 'imagem',
- 'type' => 'image',
- 'column_width' => '',
- 'save_format' => 'object',
- 'preview_size' => 'mini',
- 'library' => 'all',
- ),
- array (
- 'key' => 'field_52e2fe0f0cc41',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Video',
- 'name' => 'video',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe480cc43',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2a7bc2165',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe480cc44',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e3008473f23',
- 'label' => 'Código',
- 'name' => 'codigo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52e2fe480cc45',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Áudio',
- 'name' => 'audio',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe520cc47',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2a91c2166',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe520cc48',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe520cc49',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- array (
- 'key' => 'field_52e3009c73f24',
- 'label' => 'Arquivo',
- 'name' => 'arquivo',
- 'type' => 'file',
- 'column_width' => '',
- 'save_format' => 'object',
- 'library' => 'all',
- ),
- ),
- ),
- array (
- 'label' => 'Artigo',
- 'name' => 'artigo',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe5c0244b',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2aa2c2247',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe5c24c4c',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe5c0cc4d',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'full',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'E-mail',
- 'name' => 'email',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe5c0cc4b',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2aa2c2167',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe5c0cc4c',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe524cc4d',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'full',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Press Release',
- 'name' => 'press_release',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe6a0cc4f',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2abbdb664',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe6a0cc50',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe6a0cc51',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'full',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Link',
- 'name' => 'link',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe750cc53',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2ae1db665',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe750cc54',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe750cc55',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Arquivo',
- 'name' => 'arquivo',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe7e0cc57',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2aefdb666',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe7e0cc58',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe7e0cc59',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Contrato',
- 'name' => 'contrato',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_530278dc10ea3',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_530278dc10ea4',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_530278dc10ea5',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_530278dc10ea6',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Citação',
- 'name' => 'citacao',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe880cc5b',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2afcdb667',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe880cc5c',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52e2fe880cc5d',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'full',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- array (
- 'label' => 'Localização',
- 'name' => 'localizacao',
- 'display' => 'row',
- 'min' => '',
- 'max' => '',
- 'sub_fields' => array (
- array (
- 'key' => 'field_52e2fe910cc5f',
- 'label' => 'Título',
- 'name' => 'titulo',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52fe2b0adb668',
- 'label' => 'Privado',
- 'name' => 'privado',
- 'type' => 'true_false',
- 'column_width' => '',
- 'message' => 'Ocultar conteúdo para usuários não logados',
- 'default_value' => 1,
- ),
- array (
- 'key' => 'field_52e2fe910cc60',
- 'label' => 'Data',
- 'name' => 'data',
- 'type' => 'date_picker',
- 'required' => 1,
- 'column_width' => '',
- 'date_format' => 'yymmdd',
- 'display_format' => 'dd/mm/yy',
- 'first_day' => 1,
- ),
- array (
- 'key' => 'field_52eaa7b901cd0',
- 'label' => 'Link',
- 'name' => 'link',
- 'type' => 'text',
- 'column_width' => '',
- 'default_value' => '',
- 'placeholder' => '',
- 'prepend' => '',
- 'append' => '',
- 'formatting' => 'html',
- 'maxlength' => '',
- ),
- array (
- 'key' => 'field_52e3ed02672f8',
- 'label' => 'Mapa',
- 'name' => 'mapa',
- 'type' => 'google_map',
- 'column_width' => '',
- 'center_lat' => '-17.9335027',
- 'center_lng' => '-53.0159668',
- 'zoom' => 6,
- 'height' => '',
- ),
- array (
- 'key' => 'field_52e2fe910cc61',
- 'label' => 'Texto',
- 'name' => 'texto',
- 'type' => 'wysiwyg',
- 'column_width' => '',
- 'default_value' => '',
- 'toolbar' => 'basic',
- 'media_upload' => 'yes',
- ),
- ),
- ),
- ),
- 'min' => '',
- 'max' => '',
- 'button_label' => 'Add Row',
- ),
- ),
- 'location' => array (
- array (
- array (
- 'param' => 'post_type',
- 'operator' => '==',
- 'value' => 'projetos',
- 'order_no' => 0,
- 'group_no' => 0,
- ),
- ),
- ),
- 'options' => array (
- 'position' => 'normal',
- 'layout' => 'default',
- 'hide_on_screen' => array (
- 0 => 'excerpt',
- 1 => 'custom_fields',
- ),
- ),
- 'menu_order' => 2,
- ));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement