Created
April 30, 2015 19:01
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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