you’ll have to act on 2 parameters for the lyte_filter_ytapi_pre_store_results filter and the 2nd one should contain the full YT-response including the channelID? Do take into account that as soon as data is fetched for a video, it is stored and the lyte_filter_ytapi_pre_store_results will not kick in any more.
I think I might be calling to late then. Here is what I was doing:
function lyte_filter_ytapi_pre_store_results_override( $content, $ytResponse ) {
do_action( 'qm/info', $content );
do_action( 'qm/info', $ytResponse );
}
add_filter( 'lyte_filter_ytapi_pre_store_results', 'lyte_filter_ytapi_pre_store_results_override', 10, 2 );
Is there any way to pull the stored ‘$yt_resp_array’?
-
This reply was modified 3 years, 9 months ago by
kbowson.
Is there any way to pull the stored ‘$yt_resp_array’?
no, LYTE does not store that anywhere, it only stores the specific values that it needs.
can you instead of using query monitor logging dump $content and $response to the PHP errorlog (using error_log())?
Ah that’s too bad (for this use case — otherwise GREAT!)
Give me a few months lol. Going to take a coding bootcamp or similar to learn to properly develop. query monitor logging was all I knew how to do. Logging via error_log wasn’t working (the log file wasn’t being generated after editing wp-confi.php. For reference, the other 2 filters were returning data in the query monitor. Anyway, I will circle back to this once I know more what I am doing so as to not waste your time. Thanks for your help!
maybe simply try something like this and see if that populates the errorlog file?
function lyte_filter_ytapi_pre_store_results_override( $content, $ytResponse ) {
error_log( 'results to be stored: ' . json_encode( $content ) );
error_log( 'yt response: ' . json_encode( $ytResponse ) );
}
add_filter( 'lyte_filter_ytapi_pre_store_results', 'lyte_filter_ytapi_pre_store_results_override', 10, 2 );
🙁 nothing in the /wp-content/
This is what is in my config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
To note, this is on a staging server. Not sure if that would interrupt proper error_logging
php_error() logs to the PHP error logfile, which is rarely in the WP directories (mine is in /var/log/apache/error.log for example). Maybe ask your host where the PHP errorlog is located?
Oh, that’s embarrassing. Found it… hiding in the ‘logs’ folder.
Sadly the filter added to functions.php was not added. Honestly, I think the issue is on my end. I can’t get anything to log to any of the logs there or anywhere. The only logging I can get done is to query monitor