author_link filter not work correctly

The problem is that while you can change the URL, you also need to make sure WordPress knows what to do with it. This is called the Rewrite API. There’s a filter specifically for author URLs. If we print that, it looks like this: Array ( [author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2] [author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2] [author/([^/]+)/embed/?$] => index.php?author_name=$matches[1]&embed=true … Read more

Remove Comment Author Link only for subscribers

This doesn’t feel very nice since it calls get_comment() and get_userdata(), but I’m not sure there’s an obvious better way since the code that calls this doesn’t pass in the records we need: function remove_comment_author_link( $return, $author, $comment_ID ) { $comment = get_comment( $comment_ID ); if ( $comment && $comment->user_id ) { $user = get_userdata( … Read more

Adding author option to [products] woocommerce shortcode

Try this: function htdat_shortcode_atts_products( $out, $pairs, $atts, $shortcode ) { if ( isset ( $atts[‘author’] ) ) $out[‘author’] = $atts[‘author’]; return $out; } add_filter(‘shortcode_atts_products’, ‘htdat_shortcode_atts_products’, 10, 4); function htdat_woocommerce_shortcode_products_query( $query_args, $attributes ) { if ( isset( $attributes[‘author’] ) ) $query_args[‘author’] = $attributes[‘author’]; return $query_args; } add_filter( ‘woocommerce_shortcode_products_query’, ‘htdat_woocommerce_shortcode_products_query’, 10, 2 );

how to get page views of author page?

WordPress doesn’t track page views, so this isn’t possible. You would need to use a plugin or (preferably) an external analytics service to track views. The method of checking views for an author page would then depend on that plugin or service.

Use of comment_reply_link_args filter

You mean, something like this? add_filter( ‘comment_reply_link_args’, ‘change_author_title’, 10, 2 ); function change_author_title( $args, $comment ) { $args[‘reply_to_text’] = ‘Reply to ‘ . get_comment_author( $comment ); return $args; } Explanation: I changed the function declaration so that it accepts the second parameter ($comment) which is the comment object (a WP_Comment instance), then I simply call … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)