get_content(); // phpcs:enable } /** * Includes the Plugins WYSIWYG editor script. * * @since 1.5.0 * @param array $p_arr_plugins Scripts to be included to the editor. * @return array */ public static function include_scripts( $p_arr_plugins ) { $p_arr_plugins[ Footnotes_Config::C_STR_PLUGIN_NAME ] = plugins_url( 'js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', dirname( __FILE__ ) ); return $p_arr_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. $l_str_starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START ); $l_str_ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END ); if ( 'userdefined' === $l_str_starting_tag || 'userdefined' === $l_str_ending_tag ) { $l_str_starting_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED ); $l_str_ending_tag = Footnotes_Settings::instance()->get( Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED ); } echo wp_json_encode( array( 'start' => htmlspecialchars( $l_str_starting_tag ), 'end' => htmlspecialchars( $l_str_ending_tag ), ) ); exit; } }