Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Wordpress: admin-hooks.php on line 160

Estas en el tema de Wordpress: admin-hooks.php on line 160 en el foro de WordPress en Foros del Web. Hola amigos y amigas: Me gustaría contar con vuestra ayuda. Verán, me sale una advertencia de error en la parte superior de la plantilla de ...
  #1 (permalink)  
Antiguo 19/11/2012, 16:44
 
Fecha de Ingreso: abril-2009
Mensajes: 92
Antigüedad: 15 años
Puntos: 2
Pregunta Wordpress: admin-hooks.php on line 160

Hola amigos y amigas:

Me gustaría contar con vuestra ayuda. Verán, me sale una advertencia de error en la parte superior de la plantilla de wordpress. Este aviso aparece con la activación de la plantilla.

Cita:
Warning: Creating default object from empty value in C:\xampp\htdocs\wordpress\wp-content\themes\Cript\functions\admin-hooks.php on line 160
Me encantaría saber qué indica esa línea de código y cómo puedo reparar el código fuente. He intentado buscar algo en google pero no encuentro información al respecto.

P.S. He editado el archivo functions/admin-hooks.php pero no se encuentra la línea 106. ¿Puedo copiar aquí el archivo fuente admin-hooks.php? no sé si concierne seguridad.

Aquí una captura:
http://i49.tinypic.com/i3tcso.jpg

Con mi agradecimiento anticipado....

Mil gracias y un abrazo.

Última edición por Simeone1; 19/11/2012 a las 16:52
  #2 (permalink)  
Antiguo 19/11/2012, 16:58
Avatar de hasdpk  
Fecha de Ingreso: agosto-2011
Ubicación: $spain->city( 'Arucas' );
Mensajes: 1.800
Antigüedad: 12 años, 8 meses
Puntos: 297
Respuesta: Wordpress: admin-hooks.php on line 160

Sería interesante ver el código fuente, así sabremos por donde tirar.

De todos modos tienes la opción de desactivar las alertas de PHP, aunque la mayoría no te lo aconsejarían.
__________________
Freelance Developer — www.rubenmartin.me PHP, SQL, Wordpress, Prestashop, Codeigniter, Laravel
RegaloConsolas — www.regaloconsolas.com Sorteo juegos, consolas y accesorios
  #3 (permalink)  
Antiguo 19/11/2012, 17:28
 
Fecha de Ingreso: abril-2009
Mensajes: 92
Antigüedad: 15 años
Puntos: 2
Respuesta: Wordpress: admin-hooks.php on line 160

Cita:
Iniciado por hasdpk Ver Mensaje
Sería interesante ver el código fuente, así sabremos por donde tirar.

De todos modos tienes la opción de desactivar las alertas de PHP, aunque la mayoría no te lo aconsejarían.
Gracias mil, amigo hasdpk. No lo puse antes porque creía que podía afectar al tema de seguridad. A continuación cito el código admin-hooks.php en la siguiente ventana.

Un abrazo.
  #4 (permalink)  
Antiguo 19/11/2012, 17:31
 
Fecha de Ingreso: abril-2009
Mensajes: 92
Antigüedad: 15 años
Puntos: 2
Respuesta: Wordpress: admin-hooks.php on line 160

Cita:
<?php

/*-------------------------------------------------------------------------------------

TABLE OF CONTENTS

- Hook Definitions

- Contextual Hook and Filter Functions
-- woo_do_atomic()
-- woo_apply_atomic()
-- woo_get_query_context()

-------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* Hook Definitions */
/*-----------------------------------------------------------------------------------*/

// header.php
function woo_head() { woo_do_atomic( 'woo_head' ); }
function woo_top() { woo_do_atomic( 'woo_top' ); }
function woo_header_before() { woo_do_atomic( 'woo_header_before' ); }
function woo_header_inside() { woo_do_atomic( 'woo_header_inside' ); }
function woo_header_after() { woo_do_atomic( 'woo_header_after' ); }
function woo_nav_before() { woo_do_atomic( 'woo_nav_before' ); }
function woo_nav_inside() { woo_do_atomic( 'woo_nav_inside' ); }
function woo_nav_after() { woo_do_atomic( 'woo_nav_after' ); }

// Template files: 404, archive, single, page, sidebar, index, search
function woo_content_before() { woo_do_atomic( 'woo_content_before' ); }
function woo_content_after() { woo_do_atomic( 'woo_content_after' ); }
function woo_main_before() { woo_do_atomic( 'woo_main_before' ); }
function woo_main_after() { woo_do_atomic( 'woo_main_after' ); }
function woo_post_before() { woo_do_atomic( 'woo_post_before' ); }
function woo_post_after() { woo_do_atomic( 'woo_post_after' ); }
function woo_post_inside_before() { woo_do_atomic( 'woo_post_inside_before' ); }
function woo_post_inside_after() { woo_do_atomic( 'woo_post_inside_after' ); }
function woo_loop_before() { woo_do_atomic( 'woo_loop_before' ); }
function woo_loop_after() { woo_do_atomic( 'woo_loop_after' ); }

// Tumblog Functionality
function woo_tumblog_content_before() { woo_do_atomic( 'woo_tumblog_content_before', 'Before' ); }
function woo_tumblog_content_after() { woo_do_atomic( 'woo_tumblog_content_after', 'After' ); }

// Sidebar
function woo_sidebar_before() { woo_do_atomic( 'woo_sidebar_before' ); }
function woo_sidebar_inside_before() { woo_do_atomic( 'woo_sidebar_inside_before' ); }
function woo_sidebar_inside_after() { woo_do_atomic( 'woo_sidebar_inside_after' ); }
function woo_sidebar_after() { woo_do_atomic( 'woo_sidebar_after' ); }

// footer.php
function woo_footer_top() { woo_do_atomic( 'woo_footer_top' ); }
function woo_footer_before() { woo_do_atomic( 'woo_footer_before' ); }
function woo_footer_inside() { woo_do_atomic( 'woo_footer_inside' ); }
function woo_footer_after() { woo_do_atomic( 'woo_footer_after' ); }
function woo_foot() { woo_do_atomic( 'woo_foot' ); }

/*-----------------------------------------------------------------------------------*/
/* Contextual Hook and Filter Functions */
/*-----------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------*/
/* woo_do_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual action hooks to the theme. This allows users to easily add context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_head'. The woo_do_atomic() function extends that to
* give extra hooks such as 'woo_head_home', 'woo_head_singular', and 'woo_head_singular-page'.
*
* Major props to Ptah Dunbar for the do_atomic() function.
* @link http://ptahdunbar.com/wordpress/smarter-hooks-context-sensitive-hooks
*
* @since 3.9.0
* @uses woo_get_query_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
*/

if ( ! function_exists( 'woo_do_atomic' ) ) {
function woo_do_atomic( $tag = '', $args = '' ) {

if ( !$tag ) { return false; } // End IF Statement

/* Do actions on the basic hook. */
do_action( $tag, $args );

/* Loop through context array and fire actions on a contextual scale. */
foreach ( (array) woo_get_query_context() as $context ) {

do_action( "{$tag}_{$context}", $args );

} // End FOREACH Loop

} // End woo_do_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_apply_atomic() */
/*-----------------------------------------------------------------------------------*/
/**
* Adds contextual filter hooks to the theme. This allows users to easily filter context-based content
* without having to know how to use WordPress conditional tags. The theme handles the logic.
*
* An example of a basic hook would be 'woo_entry_meta'. The woo_apply_atomic() function extends
* that to give extra hooks such as 'woo_entry_meta_home', 'woo_entry_meta_singular' and 'woo_entry_meta_singular-page'.
*
* @since 3.9.0
* @uses woo_get_query_context() Gets the context of the current page.
* @param string $tag Usually the location of the hook but defines what the base hook is.
* @param mixed $value The value to be filtered.
* @return mixed $value The value after it has been filtered.
*/

if ( ! function_exists( 'woo_apply_atomic' ) ) {
function woo_apply_atomic( $tag = '', $value = '' ) {

if ( !$tag )
return false;

/* Get theme prefix. */
// $pre = woo_get_prefix();
$pre = 'woo';

/* Apply filters on the basic hook. */
$value = apply_filters( "{$pre}_{$tag}", $value );

/* Loop through context array and apply filters on a contextual scale. */
foreach ( (array)woo_get_query_context() as $context )
$value = apply_filters( "{$pre}_{$context}_{$tag}", $value );

/* Return the final value once all filters have been applied. */
return $value;

} // End woo_apply_atomic()
} // End IF Statement

/*-----------------------------------------------------------------------------------*/
/* woo_get_query_context() */
/*-----------------------------------------------------------------------------------*/
/**
* Retrieve the context of the queried template.
*
* @since 3.9.0
* @return array $query_context
*/

if ( ! function_exists( 'woo_get_query_context' ) ) {
function woo_get_query_context() {
global $wp_query, $query_context;

/* If $query_context->context has been set, don't run through the conditionals again. Just return the variable. */
if ( isset( $query_context->context ) && is_array( $query_context->context ) ) {

return $query_context->context;

} // End IF Statement

$query_context->context = array();

/* Front page of the site. */
if ( is_front_page() ) {

$query_context->context[] = 'home';

} // End IF Statement

/* Blog page. */
if ( is_home() && ! is_front_page() ) {

$query_context->context[] = 'blog';

/* Singular views. */
} elseif ( is_singular() ) {

$query_context->context[] = 'singular';
$query_context->context[] = "singular-{$wp_query->post->post_type}";

/* Page Templates. */
if ( is_page_template() ) {

$to_skip = array( 'page', 'post' );

$page_template = basename( get_page_template() );
$page_template = str_replace( '.php', '', $page_template );
$page_template = str_replace( '.', '-', $page_template );

if ( $page_template && ! in_array( $page_template, $to_skip ) ) {

$query_context->context[] = $page_template;

} // End IF Statement

} // End IF Statement

$query_context->context[] = "singular-{$wp_query->post->post_type}-{$wp_query->post->ID}";
}

/* Archive views. */
elseif ( is_archive() ) {
$query_context->context[] = 'archive';

/* Taxonomy archives. */
if ( is_tax() || is_category() || is_tag() ) {
$term = $wp_query->get_queried_object();
$query_context->context[] = 'taxonomy';
$query_context->context[] = $term->taxonomy;
$query_context->context[] = "{$term->taxonomy}-" . sanitize_html_class( $term->slug, $term->term_id );
}

/* User/author archives. */
elseif ( is_author() ) {
$query_context->context[] = 'user';
$query_context->context[] = 'user-' . sanitize_html_class( get_the_author_meta( 'user_nicename', get_query_var( 'author' ) ), $wp_query->get_queried_object_id() );
}

/* Time/Date archives. */
else {
if ( is_date() ) {
$query_context->context[] = 'date';
if ( is_year() )
$query_context->context[] = 'year';
if ( is_month() )
$query_context->context[] = 'month';
if ( get_query_var( 'w' ) )
$query_context->context[] = 'week';
if ( is_day() )
$query_context->context[] = 'day';
}
if ( is_time() ) {
$query_context->context[] = 'time';
if ( get_query_var( 'hour' ) )
$query_context->context[] = 'hour';
if ( get_query_var( 'minute' ) )
$query_context->context[] = 'minute';
}
}
}

/* Search results. */
elseif ( is_search() ) {
$query_context->context[] = 'search';

/* Error 404 pages. */
} elseif ( is_404() ) {
$query_context->context[] = 'error-404';

} // End IF Statement

return $query_context->context;

} // End woo_get_query_context()
} // End IF Statement
?>
  #5 (permalink)  
Antiguo 19/11/2012, 17:40
 
Fecha de Ingreso: abril-2009
Mensajes: 92
Antigüedad: 15 años
Puntos: 2
Respuesta: Wordpress: admin-hooks.php on line 160

Cabe decir, que estoy trabajando con el Xampp en su última versión.

Mis mejores saludos.
  #6 (permalink)  
Antiguo 19/11/2012, 23:17
 
Fecha de Ingreso: abril-2009
Mensajes: 92
Antigüedad: 15 años
Puntos: 2
Respuesta: Wordpress: admin-hooks.php on line 160

Estimados amigos,

Encontre esta info en la red que en principio parece que se trata del mismo problema que el mío. No domino el inglés para nada, y de PHP sé muy poco. Si no os resulta demasiado pesado, me gustaría que vieran los comentarios y a ver si pueden decirme algo. Espero poder encontrar la solución pronto.

Sitio web: http://wordpress.org/support/topic/woocommerce-wootique-theme-error?replies=12

Este comentario llama la atención:

Cita:
So! After a little digging, I found that if my server uses php 5.4, I get the error. If I change the settings, and use php 5.2, I don't get the error.

Thanks to odorex for pointing me in a direction!
Creo que dice algo de actualizar el servidor de PHP. No entiendo bien a qué se refiere ni cómo se hace eso de bajar de nivel la versión del PHP.

Un abrazo.
  #7 (permalink)  
Antiguo 20/11/2012, 02:38
Avatar de hasdpk  
Fecha de Ingreso: agosto-2011
Ubicación: $spain->city( 'Arucas' );
Mensajes: 1.800
Antigüedad: 12 años, 8 meses
Puntos: 297
Respuesta: Wordpress: admin-hooks.php on line 160

Creo que ya sé cual es el problema, principalmente que estás en localhost y las directivas de PHP en xampp por defecto son de desarollo, no de produccción, esto quiere decir que PHP es muy estricto y se enfada con "niñeces". Seguramente cuando lo publiques online, no saldrá.

El theme es de Woothemes (http://demo.woothemes.com/?name=crisp), y en foros del web no se da soporte a themes de pago.

De todos modos si tienes alguna otra duda ya sabes que aquí estamos.
__________________
Freelance Developer — www.rubenmartin.me PHP, SQL, Wordpress, Prestashop, Codeigniter, Laravel
RegaloConsolas — www.regaloconsolas.com Sorteo juegos, consolas y accesorios
  #8 (permalink)  
Antiguo 20/11/2012, 02:58
 
Fecha de Ingreso: abril-2009
Mensajes: 92
Antigüedad: 15 años
Puntos: 2
Respuesta: Wordpress: admin-hooks.php on line 160

Cita:
Iniciado por hasdpk Ver Mensaje
Creo que ya sé cual es el problema, principalmente que estás en localhost y las directivas de PHP en xampp por defecto son de desarollo, no de produccción, esto quiere decir que PHP es muy estricto y se enfada con "niñeces". Seguramente cuando lo publiques online, no saldrá.

El theme es de Woothemes ([url]http://demo.woothemes.com/?name=crisp[/url]), y en foros del web no se da soporte a themes de pago.

De todos modos si tienes alguna otra duda ya sabes que aquí estamos.
¡Muchísimas gracias amigo hasdpk!

Es cierto, utilizo la plataforma Xampp. De momento no tengo espacio de alojamiento y ojalá sea como dices.

P.S. Gracias por ponerme en conocimiento la norma sobre themes de pago. Queda anotado.

Un abrazo.

Etiquetas: line, themes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:08.