wp_get_attachment_url filter won’t accept two arguments

I think you’re missing the number of callback input arguments, so try this one instead: add_filter( ‘wp_get_attachment_url’,’mfeu_filter_attachment_url’, 10, 2 ); | | Priority _____| | Number of arguments ________| The default is 10, 1, so you’re currently only passing on the $url and not the second $post_id argument.

How to check if comments are paginated?

Just some additional info for the main comment query: Since you mentioned the global $wp_query object, we can see that it stores: $wp_query->max_num_comment_pages = $comment_query->max_num_pages; in the main comment query in the comments template. There exists a wrapper for this, namely: get_comment_pages_count(); that’s available after the main comment query. If we need it before the … Read more

How do I get URL from WP_HTTP object?

I’m not sure what you’re after here, but you can try to get the HTTP response object from the WP_HTTP_Requests_Response::get_response_object() method. Here’s an example to retrieve the url: if( ! is_wp_error( $test ) && isset( $test[‘http_response’] ) && $test[‘http_response’] instanceof \WP_HTTP_Requests_Response && method_exists( $test[‘http_response’], ‘get_response_object’ ) ) echo $test[‘http_response’]->get_response_object()->url;

Need to get specific data from array

You should be able to rewrite what you have about and also use get_permalink as @Benoti stated while omitting the $split array. get_permalink accepts either the Post ID or a post object. global $rental; $images = get_children( array( ‘post_parent’ => $rental_id, ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘order’ => ‘ASC’, ‘orderby’ => … Read more