parent
4299a71df5
commit
1728e0fcd5
9 changed files with 523 additions and 502 deletions
|
@ -25,17 +25,6 @@ use footnotes\includes as Includes;
|
|||
*/
|
||||
class WYSIWYG {
|
||||
|
||||
/**
|
||||
* Initialize the class and set its properties.
|
||||
*
|
||||
* @param string $plugin_name The name of this plugin.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a new Button to the WYSIWYG editor of Posts and Pages.
|
||||
*
|
||||
|
@ -46,7 +35,7 @@ class WYSIWYG {
|
|||
* @todo Should this be `static`?
|
||||
*/
|
||||
public static function new_visual_editor_button( $p_arr_buttons ) {
|
||||
array_push( $p_arr_buttons, 'footnotes' );
|
||||
$p_arr_buttons[] = 'footnotes';
|
||||
return $p_arr_buttons;
|
||||
}
|
||||
|
||||
|
@ -56,7 +45,7 @@ class WYSIWYG {
|
|||
* @since 1.5.0
|
||||
*/
|
||||
public static function new_plain_text_editor_button() {
|
||||
$l_obj_template = new Includes\Template( Includes\Template::C_STR_DASHBOARD, 'editor-button' );
|
||||
$l_obj_template = new Includes\Template( \footnotes\includes\Template::C_STR_DASHBOARD, 'editor-button' );
|
||||
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $l_obj_template->get_content();
|
||||
// phpcs:enable
|
||||
|
@ -84,11 +73,11 @@ class WYSIWYG {
|
|||
*/
|
||||
public static function ajax_callback() {
|
||||
// Get start and end tag for the footnotes short code.
|
||||
$l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
|
||||
$l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
|
||||
$l_str_starting_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
|
||||
$l_str_ending_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
|
||||
if ( 'userdefined' === $l_str_starting_tag || 'userdefined' === $l_str_ending_tag ) {
|
||||
$l_str_starting_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
|
||||
$l_str_ending_tag = Includes\Settings::instance()->get( Includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
|
||||
$l_str_starting_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
|
||||
$l_str_ending_tag = Includes\Settings::instance()->get( \footnotes\includes\Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
|
||||
}
|
||||
echo wp_json_encode(
|
||||
array(
|
||||
|
|
Reference in a new issue