Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

display only user contributor comments wordpress

// Add to functions.php
function authorize_comments_for_current_user($clauses) {
    if (is_admin()) {
        global $user_ID, $wpdb;
        $clauses['join'] = ", wp_posts";
        $clauses['where'] .= " AND wp_posts.post_author = ".$user_ID." AND wp_comments.comment_post_ID = wp_posts.ID";
    };
    return $clauses;
};
if(!current_user_can('edit_others_posts')) {
  add_filter('comments_clauses', 'authorize_comments_for_current_user');
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: ts Command pattern 
Typescript :: how to loop through a specific number of elements in a list python 
Typescript :: which network device reads the source and destination MAC addresses, looks up the destination to determine where to send the frame, and forwards it out to the correct port 
Typescript :: which view should a user query to display the columns associated with the constraints on a table owned by a user? 
Typescript :: how do i add limitations in inputs in python 
Typescript :: e.target.value submit form typescript 
Typescript :: edit lights in a room alexa 
Typescript :: what is .align mips 
Typescript :: The marking menu shortcuts to context-sensitive commands and tools. Marking menu accessed for objects: 
Typescript :: see all github issue comments i made site:stackoverflow.com 
Typescript :: rapists near me 
Typescript :: subscripts list c# 
Typescript :: print in a tsv file all names of files in a directory linux 
Typescript :: count custom posts type basis of author 
Typescript :: nest js config from yaml 
Typescript :: Define a function sum_two_gr with three arguments returning the sum of the greatest two python 
Typescript :: how to capitalize the first word of a sentence in ionic 
Typescript :: How to check that tuple A contains all elements of tuple B python? 
Typescript :: how to get array elements in same line in python 
Typescript :: typescript initialize stripe api, connect stripe with OAuth and creating Direct Charges in Stripe. 
Typescript :: pass generic type to arow function typescript 
Typescript :: custom function with condition in google sheet 
Typescript :: aws lambda cache gets to next response 
Typescript :: multi inputs in one line c++ 
Typescript :: sourcetree winmerge arguments three way merge 
Typescript :: formControl Server Side rendering 
Typescript :: The command "composer require barryvdh/laravel-dompdf" always gets an error 
Typescript :: typescript list 
Typescript :: ionic google map 
Typescript :: python write a program that asks the user for a weight in kilograms and converts it to pounds 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =