mirror of
https://github.com/ulaulaman/book-template.git
synced 2025-02-07 15:58:46 +01:00
Ritorno alla versione 2020.0813
This commit is contained in:
parent
9e5b4ac8f0
commit
2c5d4601db
@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
Plugin Name: Book Template
|
Plugin Name: Book Template
|
||||||
Description: Plugin che aggiunge uno shortcode per la creazione di un box con i dati editoriali di un libro o di un fumetto.
|
Description: Plugin che aggiunge uno shortcode per la creazione di un box con i dati editoriali di un libro o di un fumetto.
|
||||||
Version: 2020.0814.dev
|
Version: 2020.0813
|
||||||
Author: Gianluigi Filippelli
|
Author: Gianluigi Filippelli
|
||||||
Author URI: http://dropseaofulaula.blogspot.it/
|
Author URI: http://dropseaofulaula.blogspot.it/
|
||||||
Plugin URI: https://ulaulaman.github.io/book-template/
|
Plugin URI: https://ulaulaman.github.io/book-template/
|
||||||
@ -116,37 +116,5 @@ add_shortcode( 'bookdata', 'bookdata' );
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add TinyMCE buttons for shortcode
|
|
||||||
*/
|
|
||||||
|
|
||||||
add_action( 'init', 'bookdata_tinymce_shortcode_buttons' );
|
|
||||||
|
|
||||||
add_filter( 'tiny_mce_version', 'bookdata_refresh_tinymce' );
|
|
||||||
function pilau_tinymce_shortcode_buttons() {
|
|
||||||
// Don't bother doing this stuff if the current user lacks permissions
|
|
||||||
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) )
|
|
||||||
return;
|
|
||||||
// Add only in Rich Editor mode
|
|
||||||
//if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
|
||||||
// add_filter( 'mce_external_plugins', 'pilau_tinymce_plugins' );
|
|
||||||
// add_filter( 'mce_buttons', 'pilau_register_tinymce_shortcode_buttons' );
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
function bookdata_register_tinymce_shortcode_buttons( $buttons ) {
|
|
||||||
array_push( $buttons, "|", "bookdata" );
|
|
||||||
return $buttons;
|
|
||||||
}
|
|
||||||
function bookdata_tinymce_plugins( $plugin_array ) {
|
|
||||||
$plugin_array['bookdata'] = get_template_directory_uri() . '/assets/js/tinymce-buttons.js';
|
|
||||||
return $plugin_array;
|
|
||||||
}
|
|
||||||
|
|
||||||
function bookdata_refresh_tinymce( $ver ) {
|
|
||||||
$ver += 3;
|
|
||||||
return $ver;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user