{"id":102,"date":"2014-04-02T11:38:21","date_gmt":"2014-04-02T11:38:21","guid":{"rendered":"http:\/\/buddydev.com\/docs\/?p=102"},"modified":"2014-04-04T19:05:47","modified_gmt":"2014-04-04T19:05:47","slug":"extending-buddypress-testimonials","status":"publish","type":"post","link":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/","title":{"rendered":"Extending BuddyPress User Testimonials"},"content":{"rendered":"<p><a href=\"https:\/\/buddydev.com\/plugins\/bp-user-testimonials\/\">BuddyPress User Testimonials<\/a> plugin provides the following hook to control the permissions for various actions:-<\/p>\n<ul>\n<li><strong>testimonial_can_delete<\/strong> \u00a0: Whether current user can delete the testimonial or not?<\/li>\n<li><strong>testimonial_can_approve<\/strong>\u00a0: Can current user approve testimonial<\/li>\n<li><strong>bp_testimonials_can_user_write : <\/strong>Can the current user write testimonial<\/li>\n<\/ul>\n<p>All these filters provide a boolean value( true|false) to contol the action.<\/p>\n<p>To find the current user, you can use the function <strong>get_current_user_id<\/strong>()<\/p>\n<p>To find the user whom the testimonial was being written, you can use <strong>bp_displayed_user_id<\/strong>()<\/p>\n<h3>Example 1:- Only super admins can approve testimonial<\/h3>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\nadd_filter('testimonial_can_approve', 'bpt_only_super_admins_can_approve');&lt;strong&gt;\r\n\r\nfunction\u00a0bpt_only_super_admins_can_approve( $can ){\r\n\r\nif( is_super_admin() )\r\n\r\nreturn true;\r\n\r\nreturn false;\r\n\r\n}\r\n\r\n<\/pre>\n<p>You can put the code in bp-custom.php and it will allow only super admins to approve the testimonials.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BuddyPress User Testimonials plugin provides the following hook to control the permissions for various actions:- testimonial_can_delete \u00a0: Whether current user can delete the testimonial or not? testimonial_can_approve\u00a0: Can current user approve testimonial bp_testimonials_can_user_write : Can the current user write testimonial All these filters provide a boolean value( true|false) to contol the action. To find the &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5476],"tags":[],"class_list":["clearfix","post-102","post","type-post","status-publish","format-standard","hentry","category-bp-user-testimonials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Extending BuddyPress User Testimonials &#8226; BuddyDev Help Center<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Extending BuddyPress User Testimonials &#8226; BuddyDev Help Center\" \/>\n<meta property=\"og:description\" content=\"BuddyPress User Testimonials plugin provides the following hook to control the permissions for various actions:- testimonial_can_delete \u00a0: Whether current user can delete the testimonial or not? testimonial_can_approve\u00a0: Can current user approve testimonial bp_testimonials_can_user_write : Can the current user write testimonial All these filters provide a boolean value( true|false) to contol the action. To find the ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/\" \/>\n<meta property=\"og:site_name\" content=\"BuddyDev Help Center\" \/>\n<meta property=\"article:published_time\" content=\"2014-04-02T11:38:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-04-04T19:05:47+00:00\" \/>\n<meta name=\"author\" content=\"Brajesh Singh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brajesh Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/\",\"url\":\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/\",\"name\":\"Extending BuddyPress User Testimonials &#8226; BuddyDev Help Center\",\"isPartOf\":{\"@id\":\"https:\/\/buddydev.com\/docs\/#website\"},\"datePublished\":\"2014-04-02T11:38:21+00:00\",\"dateModified\":\"2014-04-04T19:05:47+00:00\",\"author\":{\"@id\":\"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb\"},\"breadcrumb\":{\"@id\":\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/buddydev.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extending BuddyPress User Testimonials\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/buddydev.com\/docs\/#website\",\"url\":\"https:\/\/buddydev.com\/docs\/\",\"name\":\"BuddyDev Help Center\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/buddydev.com\/docs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb\",\"name\":\"Brajesh Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/buddydev.com\/docs\/#\/schema\/person\/image\/\",\"url\":\"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon\",\"contentUrl\":\"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon\",\"caption\":\"Brajesh Singh\"},\"sameAs\":[\"http:\/\/buddydev.com\/members\/sbrajesh\/\",\"https:\/\/x.com\/sbrajesh\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Extending BuddyPress User Testimonials &#8226; BuddyDev Help Center","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/","og_locale":"en_US","og_type":"article","og_title":"Extending BuddyPress User Testimonials &#8226; BuddyDev Help Center","og_description":"BuddyPress User Testimonials plugin provides the following hook to control the permissions for various actions:- testimonial_can_delete \u00a0: Whether current user can delete the testimonial or not? testimonial_can_approve\u00a0: Can current user approve testimonial bp_testimonials_can_user_write : Can the current user write testimonial All these filters provide a boolean value( true|false) to contol the action. To find the ...","og_url":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/","og_site_name":"BuddyDev Help Center","article_published_time":"2014-04-02T11:38:21+00:00","article_modified_time":"2014-04-04T19:05:47+00:00","author":"Brajesh Singh","twitter_misc":{"Written by":"Brajesh Singh","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/","url":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/","name":"Extending BuddyPress User Testimonials &#8226; BuddyDev Help Center","isPartOf":{"@id":"https:\/\/buddydev.com\/docs\/#website"},"datePublished":"2014-04-02T11:38:21+00:00","dateModified":"2014-04-04T19:05:47+00:00","author":{"@id":"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb"},"breadcrumb":{"@id":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/buddydev.com\/docs\/bp-user-testimonials\/extending-buddypress-testimonials\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/buddydev.com\/docs\/"},{"@type":"ListItem","position":2,"name":"Extending BuddyPress User Testimonials"}]},{"@type":"WebSite","@id":"https:\/\/buddydev.com\/docs\/#website","url":"https:\/\/buddydev.com\/docs\/","name":"BuddyDev Help Center","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buddydev.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/buddydev.com\/docs\/#\/schema\/person\/4ebf5f3e519f8cbddc6583e182dbe4fb","name":"Brajesh Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buddydev.com\/docs\/#\/schema\/person\/image\/","url":"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon","contentUrl":"\/\/www.gravatar.com\/avatar\/2106622ee90d53d15ac1402806616aca?s=96&#038;r=g&#038;d=identicon","caption":"Brajesh Singh"},"sameAs":["http:\/\/buddydev.com\/members\/sbrajesh\/","https:\/\/x.com\/sbrajesh"]}]}},"_links":{"self":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":6,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/posts\/102\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buddydev.com\/docs\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}