Skip to content

Instantly share code, notes, and snippets.

@codeasashu
Created April 30, 2015 19:01
Show Gist options
  • Save codeasashu/f60a1e32196dbe7db0cf to your computer and use it in GitHub Desktop.
Save codeasashu/f60a1e32196dbe7db0cf to your computer and use it in GitHub Desktop.
Use this code to enable shortcode to use usernoiceshow feedback button on partcilaur page
<?php
// Replace this file in wp-content/plugins/usernoice/inc/shortcodes.php
class UN_Shortcodes{
function __construct(){
add_shortcode('usernoise', array($this, '_usernoise_form'));
add_shortcode( 'usernoiceshow', array($this, '_usernoise_show') );
}
function _usernoise_form($attrs){
ob_start();
do_action('un_feedback_form', '?un_action=feedback_submit');
return ob_get_clean();
}
function _usernoise_show(){
wp_enqueue_script('usernoise-button', usernoise_url('/js/button.js'), array('jquery', 'usernoise'),
UN_VERSION);
}
}
new UN_Shortcodes;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment