Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think this feature is very usefull.

    ??

    Hi, I SOLVED the problem !!!! :D:D:D:D:D:D

    I think is a problem with WP v3.0, I modify 2 lines in the file “custom-file-template.php”

    I don’t now if this modifications are the best solution for the problem but it works for me.

    1 – In function “load_custom_field( $id = 0 )”

    Original code (line 1997 aprox):

    if ( $options['custom_fields'][$id]['post_type'] ) :
    
    			if ( substr($wp_version, 0, 3) < '3.0' ) :
    
    				if ( $options['custom_fields'][$id]['post_type'] == 'post' && (strstr($_SERVER['REQUEST_URI'], 'wp-admin/page-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/edit-pages.php')) ) :
    
    					return;
    
    				endif;
    
    				if ( $options['custom_fields'][$id]['post_type'] == 'page' && (strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/edit.php')) ) :
    
    					return;
    
    				endif;
    
    			else :
    
    				if ( $_REQUEST['post_type']!=$options['custom_fields'][$id]['post_type'] && $post->post_type!=$options['custom_fields'][$id]['post_type'] ) :
    
    					return;
    
    				endif;
    
    			endif;
    
    		endif;

    Modified code:

    if ( $options['custom_fields'][$id]['post_type'] ) :
    
    			if ( substr($wp_version, 0, 3) < '3.0' ) :
    
    				if ( $options['custom_fields'][$id]['post_type'] == 'post' && (strstr($_SERVER['REQUEST_URI'], 'wp-admin/page-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/edit-pages.php')) ) :
    
    					return;
    
    				endif;
    
    				if ( $options['custom_fields'][$id]['post_type'] == 'page' && (strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/edit.php')) ) :
    
    					return;
    
    				endif;
    
    			else :
    
    /*---------------------------> MODIFICIO  AQUI*/
    				if ( $_REQUEST['post_type']!=$options['custom_fields'][$id]['post_type'] && $post->post_type!=$options['custom_fields'][$id]['post_type'] && !($options['custom_fields'][$id]['custom_post_type'])) :
    
    					return;
    
    				endif;
    
    			endif;
    
    		endif;

    2 – In funcion “custom_field_template_filter()”:

    Original code (line 2428 aprox):

    else :
    
    					if ( $post->post_type!=$options['custom_fields'][$i]['post_type'] ) :
    
    						continue;
    
    					endif;
    
    				endif;

    Modified code:

    else :
    
    /** ----------------------------------> MODIFICADO ESTO PARA QUE APAREZCA EL COMBO EN LOS TIPOS PERSONALIZADOS DE POSTS **/
    					if (( $post->post_type!=$options['custom_fields'][$i]['post_type'] )&&( !( $options['custom_fields'][$i]['custom_post_type'] ))) :
    						continue;
    
    					endif;
    
    				endif;

    I hope this help you too,

    – when I put gps-room in “Custom Post Type (comma-delimitated)”, I see the Custom Field Template meta box on the Add New Conference Room page but it’s empty except for two buttons “Initialize” and “Save.” Neither of which seem to do anything when clicked.

    Same problem!

    My custom type post definition is:

    add_action( 'init', 'create_my_post_types' );
    
    function create_my_post_types() {
    	register_post_type( 'evento',
    		array(
    			'labels' => array(
    				'name' => __( 'Eventos' ),
    				'singular_name' => __( 'Evento' ),
    				'add_new' => __( 'A?adir nuevo' ),
    				'add_new_item' => __( 'A?adir Nuevo Evento' ),
    				'edit' => __( 'Editar' ),
    				'edit_item' => __( 'Editar Evento' ),
    				'new_item' => __( 'Nuevo Evento' ),
    				'view' => __( 'Ver Evento' ),
    				'view_item' => __( 'Ver Evento' ),
    				'search_items' => __( 'Buscar Evento' ),
    				'not_found' => __( 'No se han encontrado Eventos' ),
    				'not_found_in_trash' => __( 'No se han encontrado Eventos en la papelera' ),
    				'parent' => __( 'Padre del Evento' )
    
    			),
    			'description' => __( 'Evento es un tipo de Post creado para mostrar los eventos de la agenda' ),
    			'public' => true,
    			'show_ui' => true,
    			'publicly_queryable' => true,
    			'exclude_from_search' => false,
    			'menu_position' => 5,
    			'hierarchical' => true,
    			'query_var' => true,
    			'supports' => array( 'title', 'editor','comments','trackbacks','revisions','author', 'excerpt', 'custom-fields', 'thumbnail','page-attributes'),
    			'taxonomies' => array( 'post_tag', 'category'),
    			'can_export' => true,
    			'permalink_epmask' => EP_PERMALINK,
    
    		)
    	);
    }

    [EDIT] I’m using version 1.8.2

Viewing 3 replies - 1 through 3 (of 3 total)