20/01/2016, 14:15
|
| | Fecha de Ingreso: diciembre-2012 Ubicación: Viña del mar
Mensajes: 12
Antigüedad: 12 años, 1 mes Puntos: 0 | |
Respuesta: ERROR strict Standards Walker Menu Hola Siddharta muchas gracias por tu respuesta. la verdad no me manejo a fondo con PHP pero aca esta la linea de codigo del menu walker:
/*---------------------------------
Redefine menu structure with a walker class
------------------------------------*/
class menu_default_walker extends Walker_Nav_Menu
{
function start_lvl(&$output, $depth){
$output .= '<ul class="clearfix">';
}
function display_element($element, &$children_elements, $max_depth, $depth=0, $args, &$output){
$id_field = $this->db_fields['id'];
if ( is_object( $args[0] ) ) {
$args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
}
return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}
function start_el(&$output, $item, $depth, $args, $id =0) {
global $wp_query;
global $rb_submenus;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$new_output = '';
$depth_class = ($args->has_children ? 'parent ' : '');
$class_names = $value = '';
$classes = empty($item->classes) ? array() : (array) $item->classes;
$current_indicators = array('current-menu-item','current-menu-parent','current_page_item','current_page_parent', 'current-menu-ancestor');
$newClasses = array();
foreach($classes as $el)
if(in_array($el,$current_indicators))
array_push($newClasses,$el);
$class_names = join(' ',apply_filters('nav_menu_css_class',array_filter( $newClasses),$item));
if($class_names != '') {
$class_names = ' class="' . $depth_class . 'selected"';
} else if($class_names == '') {
$class_names = ' class="' . $depth_class . 'menu-item"';
}
if ( !get_post_meta( $item->object_id , '_members_only' , true ) || is_user_logged_in() ) {
$output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $class_names . '>';
}
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '</a>';
$item_output .= $args->after;
if ( !get_post_meta( $item->object_id, '_members_only' , true ) || is_user_logged_in() ) {
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args, $id );
}
$output .= $new_output;
}
function end_el(&$output, $item, $depth) {
if ( !get_post_meta( $item->object_id, '_members_only' , true ) || is_user_logged_in() ) {
$output .= "</li>\n";
}
}
function end_lvl(&$output, $depth) {
$output .= "</ul>\n";
}
}
espero me puedas ayudar...
gracias! |