Hot answers tagged

3

Currently it is not available in WP CLI. See https://github.com/wp-cli/wp-cli/blob/master/php/commands/comment.php#L136 If you want, you can have your own customized comment generation command. See command cookbook. http://wp-cli.org/docs/commands-cookbook/


2

There is no use for converting an integer to a string when you just need to display the result or for simple checking against a hardcoded known datatype value. Converting datatypes is only useful when you need to validate values strickly against a certain specific datatype. Your issue is that you do not exactly know how to test your values. 0, either an an ...


2

Please try: $args = array( 'posts_per_page' => -1, 'post_type' => 'thread' ); $thread_posts = get_posts( $args ); // Get all posts of thread. foreach($thread_posts as $thread_post_object) { /*not sure really need to be working IDs only, but is simpler, plus made checking was getting right ones easier */ $thread_post_IDs[] = $...


2

I was wrong when I said we had gone back and disabled all comments and trackbacks for previous posts. As it turns out, we did not. The comment from Dan above made me realize our error as when I began to scan our logs, I noticed these were all previously published pages. Whomp, whomp. Our solution was to run the following two SQL statements on our database ...


1

I found an exact solution I'm looking for. function my_comment_link_filter( $link ) { $link = str_replace( get_permalink() , $custom_permalink , $link ); return $link; }; add_filter( 'get_comment_link', 'my_comment_link_filter' ); It does exactly what I am looking for: It replaces the Page Permalink with the dynamic permalinks when I call the ...


1

I'm not completely sure what you are trying to accomplish, but here's what I think. Normally you would generate a link to a comment like this: echo '<a href="' . get_permalink($comment->comment_post_ID) . '#comment-' . (strval($comment->comment_ID)) . '">'; The problem with filtering get_permalink() is that the filter must know that it is ...



Only top voted, non community-wiki answers of a minimum length are eligible