get_body_params() is always empty in POST request
The value you’re trying to send in the body is not valid JSON: { “userID” = 3 } JSON looks like this: { “userID”: 3 }
The value you’re trying to send in the body is not valid JSON: { “userID” = 3 } JSON looks like this: { “userID”: 3 }
You’re getting the Fatal Error because array_diff() is comparing the WP_Term objects in your array to a string, and it can’t do that. Here’s one way to fix that: Replace $topic = array_diff($topic, [“expired”]); with: $my_topic = array(); foreach ( $topic as $term ) { if ( ‘expired’ !== $term->slug ) { // Adds $term … Read more
If you mean, how to change the link’s text, then you can change it when you register your taxonomy, by setting the back_to_items label to whatever text you like. Excerpt from the documentation: ‘back_to_items’ – the text displayed after a term has been updated for a link back to main index. Default is __( ‘← … Read more
I think you’re more interested in the last time the user reset their password than the last time they logged in. I’ve written this to check on the last password reset. add_action( ‘wp_login’, ‘wpse410045_check_last_login’, 10, 2 ); /** * Checks and updates the user’s last login time. * * @param string $user_login The username. * … Read more
The use of curly braces ({}) in accessing an array index or string offset was deprecated in PHP 7.4 and later versions. You need to use square brackets ([]) instead. Update the code on line 82 (or there about) in call.php to fix the offending use of {}.
I don’t want Ajax request to be sent every 2 seconds. Is there a way to send me a notification only if the database changes in a certain meta? You can’t watch the database for changes like this. The most you could do is add filters on post meta changes on the PHP side to … Read more
This answer is completely based on the code and help from -KIKO Software. I did have to add in the global ‘$current_user’ for it to work correctly. Also, per @kikosoftware foresight, I added a means to track by year, just in case a user did not visit the site until the same quarter the following … Read more
Take 2 on my answer: get_the_title uses the the_title filter, which turns your apostrophe into a right single quotation mark. When you then plug the resulting string into get_page_by_title, you don’t get a match – because ’ is not the same as ‘. So, bypass the_title filter completely: $post = get_post( $extraPostID ); $extraContent = … Read more
Do not, under any circumstances, edit core WordPress files. The bug is not in WordPress. If it were the proper way to handle such a bug is not to edit WordPress. The right way is to downgrade PHP to a compatible version that doesn’t cause the error and file a bug report at https://core.trac.wordpress.org, if … Read more
Here’s the code from formatting.php if ( get_option( ‘use_smilies’ ) && ! empty( $wp_smiliessearch ) ) { // HTML loop taken from texturize function, could possible be consolidated. $textarr = preg_split( ‘/(<.*>)/U’, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // Capture the tags as well as in between. $stop = count( $textarr ); // Loop stuff. The problem … Read more