Pregunta sobre Yoast SEO de Wordpress:

Advertencia de PHP: call_user_func_array () espera que el parámetro 1 sea una recuperación válida

Un usuario preguntó 👇

¡Hola!

Después de actualizar Yoast SEO a v10.0, veo muchas de estas advertencias en los registros:

PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /site_path/wp-includes/class-wp-hook.php on line 286

Código:

// Avoid the array_slice if possible.
if ( $the_['accepted_args'] == 0 ) {
    $value = call_user_func_array( $the_['function'], array() );
} elseif ( $the_['accepted_args'] >= $num_args ) {
    $value = call_user_func_array( $the_['function'], $args );
} else {
    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
}

Yoast SEO v10.0 WordPress 5.1.0 y 5.1.1 PHP 7.2.16-1 + ubuntu16.04.1 + deb.sury.org + 1

(@stodorovic)

Hace 1 año, 8 meses

Sí, si no aplica (que es un retiro para add_filter o https://developer.wordpress.org/reference/functions/add_action/).

Debe intentar vaciar OPcache y es útil habilitar Xdebug (u otra solución) para obtener una pista de depuración (verá qué filtro está involucrado).

(@airathalitov)

Hace 1 año, 8 meses

No uso OPcache

Aquí están mis configuraciones de modo WP_DEBUG:

/** Enable WP_DEBUG mode */
define( 'WP_DEBUG', true );

if ( WP_DEBUG ) {
    @error_reporting( E_ALL );
    @ini_set( 'log_errors', true );
    @ini_set( 'log_errors_max_len', '0' );

    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );
    define( 'CONCATENATE_SCRIPTS', false );
    define( 'SAVEQUERIES', true );
    define( 'SCRIPT_DEBUG', false );
}

Pero no veo ningún rastro de apilamiento allí. Solo esta línea:

PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /site_path/wp-includes/class-wp-hook.php on line 286

(@stodorovic)

Hace 1 año, 8 meses

Esta esencia le explicará cómo habilitar el fondo en su sitio web: https://gist.github.com/jrfnl/5925642

(@airathalitov)

Hace 1 año, 8 meses

Como dije aqui si wordpress-seo Plugin (Yoast SEO) en Backtrace:

[13-Mar-2019 14:06:25 UTC] PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /site_path/wp-includes/class-wp-hook.php on line 286
[13-Mar-2019 14:06:26 UTC] Backtrace from warning 'call_user_func_array() expects parameter 1 to be a valid callback, no array or string given' at /site_path/wp-includes/class-wp-hook.php 286: /site_path/wp-includes/plugin.php 208 calling apply_filters() | /site_path/wp-content/plugins/wordpress-seo/frontend/class-remove-reply-to-com.php 81 calling apply_filters() | /site_path/wp-content/plugins/wordpress-seo/frontend/class-remove-reply-to-com.php 23 calling clean_reply_to_com() | /site_path/wp-content/plugins/wordpress-seo/frontend/class-frontend.php 151 calling register_hooks() | /site_path/wp-content/plugins/wordpress-seo/frontend/class-frontend.php 198 calling __construct() | /site_path/wp-content/plugins/wordpress-seo/inc/wpseo-functions.php 19 calling get_instance() | /site_path/wp-includes/class-wp-hook.php 286 calling initialize_wpseo_front() | /site_path/wp-includes/class-wp-hook.php 310 calling apply_filters() | /site_path/wp-includes/plugin.php 465 calling do_action() | /site_path/wp-settings.php 505 calling do_action() | /site_path/wp-config.php 210 calling require_once() | /site_path/wp-load.php 37 calling require_once() | /site_path/wp-blog-header.php 13 calling require_once() | /site_path/index.php 17 calling require()

(@airathalitov)

Hace 1 año, 8 meses

https://github.com/Yoast/wordpress-seo/issues/12425

(@airathalitov)

Hace 1 año, 8 meses

Solución:
Agregar al tema functions.php archivo:

add_filter( 'wpseo_remove_reply_to_com', '__return_false' );

en vez de
add_filter( 'wpseo_remove_reply_to_com', false );

Relacionado: https://wordpress.org/support/topic/readers-cant-answer-comments/ https://wordpress.org/support/topic/replytocom-removal-breaks-wp-touch-pro-nested-comments/ # iar-10072157

Esta respuesta fue modificada hace 1 año, 8 meses por.

(@jrf)

Hace 1 año, 8 meses

@airathalitov ¿Podría marcar este tema como una solución?

(@airathalitov)

Hace 1 año, 8 meses

¡Hecho, gracias!

¿Solucionó tu problema??

0 / 0

Deja una respuesta 0

Tu dirección de correo electrónico no será publicada.