init_shortcodes(); } /** * Init shortcodes * * @return void */ public function init_shortcodes() { add_shortcode( self::$USERFEEDBACK_SURVEY_SHORTCODE, array( $this, 'handle_survey_shortcode' ) ); } /** * Register [userfeedback id=X] shortcode * * @param $attrs * @return string */ public function handle_survey_shortcode( $attrs ) { if ( ! isset( $attrs['id'] ) ) { return ''; } $survey_id = esc_attr($attrs['id']); return "
"; } } new UserFeedback_Shortcodes();