Error Uncaught ArgumentCountError i cant find it

Your problem is how you’re using the wp_new_user_notification_email filter. As you’ll see from its documentation, the callback function receives 3 arguments: $wp_new_user_notification_email $user $blogname However, the function you’re using as the callback accepts 4 arguments. function custom_wp_new_user_notification_email( $wp_new_user_notification_email, $user, $blogname, $post ) { Plus you’ve set the number of arguments to be passed to the … Read more

Buddypress update user avatar image via REST

I finally found a SOLUTION and i want to post it because can be useful for someone! public function update_user_avatar() { global $json_api; if (!$json_api->query->user_id) { $json_api->error(“Missing ‘user_id’ parameter.”); } if (!$json_api->query->image) { $json_api->error(“Missing ‘image’ parameter.”); } $user_id = $json_api->query->user_id; $base64 = $json_api->query->image; $imgdata = base64_decode($base64); $f = finfo_open(); $mime_type = finfo_buffer($f, $imgdata, FILEINFO_MIME_TYPE); $type_file … Read more

How to create pagination for users list using custom array?

<?php global $wp_query; $topuser = array(); $avatar_size = 100; $args = array( ‘role__in’ => array(‘contributor’, ‘author’), ‘hide_empty’ => ‘1’ ); $users = get_users( $args ); foreach ( $users as $user ) { $query = get_posts( array(‘author’ => $user->ID, ‘cat’ => ‘3’, ‘numberposts’ => -1, ‘post_type’ => ‘post’ )); $counter = 0; $post_count = count_user_posts( $user->ID … Read more

Include Parent Term in wp_list_categories

Try this, which worked well for me: $term = get_queried_object(); $children = get_term_children( $term->term_id, $term->taxonomy ); $has_children = ( ! is_wp_error( $children ) && ! empty( $children ) ); // Has children, or no parent. if ( $has_children || ! $term->parent ) { $parent =& $term; // reference to $term // No children, but has … Read more

Path for php file for inserting data through html form

You need to integrate your form and php form processor with WordPress. One method to do this in your theme as follows. Create a page template in your theme folder, as described here. And put your form markup in it. Don’t specify an action on your form, and add a hidden field to your form … Read more

Exclude posts with specific metadata from search?

You need an additional parameter meta_query in the WP_Query arguments. $query_args = [ ‘posts_per_page’ => -1, ‘s’ => esc_attr( $_POST[‘keyword’] ), ‘post_type’ => ‘visitor’, ‘meta_query’ => [ ‘key’ => ‘visitor-hide’, ‘value’ => ‘yes’, ‘compare’ => ‘!=’, ] ] or in cases like yours (query by single custom field): $query_args = [ ‘posts_per_page’ => -1, ‘s’ … Read more

Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?

The name you see is the text domain of the theme. __(‘some text’, ‘text-domain’) is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n P.s. if … Read more