My plugin showing “Are you sure you want to do this” on screen with a “Argument #2 is not an array in load.php’

It appears that the issue is related to my uses of this code: $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING) ; $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING) ; I had placed this at the top of the plugin (outside of the plugin’s class); I used it to sanitize any GET and POST values. When you do any action (like a … Read more

Update database record in plugin

It’s really hard to understand what are you actually doing ( a refactor will help also). but for updating you can try: You will need the $id, show you tell which row to update. $wpdb->update( $wpdb->prefix . ‘tropix_dmin’, array( ‘post_name1’ => $arr), array( ‘id’ => $id ), array( ‘%s’ ), array( ‘%d’ ) );

Custom recurrence not working / Wp Cron event

Maybe someone will make use of it, I had a similar problem and the solution was to call time() instead of current_time( ‘timestamp’ ) as the first argument of wp_schedule_event(). So it should look like this: wp_schedule_event( time(), ‘custom_interval’, ‘custom_hook’ ); I tried to find a difference between time and current_time(‘timestamp’), but they appear to … Read more

login_message filter not working

Man you really need to read the hooks docs https://codex.wordpress.org/Plugin_API/Action_Reference/wp_authenticate https://codex.wordpress.org/Plugin_API/Filter_Reference/login_message Wp_authenticate receives a parameter, also login_message, but instead of apply_filter you need to use add_filter to show the message something like this: add_action( ‘wp_authenticate’, array($this, ‘verify_token’), 30, 1); // even if you aren’t using the $username you need to declare it in the function … Read more