get_content(); // phpcs:enable } /** * Includes the Plugins WYSIWYG editor script. * * @since 1.5.0 * @param array $plugins Scripts to be included to the editor. * @return array */ public static function include_scripts( $plugins ) { $plugins[ Footnotes_Config::PLUGIN_NAME ] = plugins_url( '/../js/wysiwyg-editor.js', __FILE__ ); return $plugins; } /** * AJAX Callback function when the Footnotes Button is clicked. Either in the Plain text or Visual editor. * Returns an JSON encoded array with the Footnotes start and end short code. * * @since 1.5.0 */ public static function ajax_callback() { // Get start and end tag for the footnotes short code. $starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::FOOTNOTES_SHORT_CODE_START ); $ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::FOOTNOTES_SHORT_CODE_END ); if ( 'userdefined' === $starting_tag || 'userdefined' === $ending_tag ) { $starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::FOOTNOTES_SHORT_CODE_START_USER_DEFINED ); $ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::FOOTNOTES_SHORT_CODE_END_USER_DEFINED ); } echo json_encode( array( 'start' => htmlspecialchars( $starting_tag ), 'end' => htmlspecialchars( $ending_tag ), ) ); exit; } }