@@ -9,24 +9,24 @@ discard block |
||
| 9 | 9 | */ |
| 10 | 10 | function wordlift_mce_css( $mce_css ) { |
| 11 | 11 | |
| 12 | - /* |
|
| 12 | + /* |
|
| 13 | 13 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 14 | 14 | * |
| 15 | 15 | * @since 3.20.3 |
| 16 | 16 | * |
| 17 | 17 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 18 | 18 | */ |
| 19 | - if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 20 | - return $mce_css; |
|
| 21 | - } |
|
| 19 | + if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 20 | + return $mce_css; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - if ( ! empty( $mce_css ) ) { |
|
| 24 | - $mce_css .= ','; |
|
| 25 | - } |
|
| 23 | + if ( ! empty( $mce_css ) ) { |
|
| 24 | + $mce_css .= ','; |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - $mce_css .= plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css'; |
|
| 27 | + $mce_css .= plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css'; |
|
| 28 | 28 | |
| 29 | - return $mce_css; |
|
| 29 | + return $mce_css; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // hook the TinyMCE custom styles function. |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | function wordlift_filter_tiny_mce_before_init( $options ) { |
| 43 | 43 | |
| 44 | - if ( ! isset( $options['extended_valid_elements'] ) ) { |
|
| 45 | - $options['extended_valid_elements'] = ''; |
|
| 46 | - } |
|
| 44 | + if ( ! isset( $options['extended_valid_elements'] ) ) { |
|
| 45 | + $options['extended_valid_elements'] = ''; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - $options['extended_valid_elements'] .= ",span[*]"; |
|
| 48 | + $options['extended_valid_elements'] .= ",span[*]"; |
|
| 49 | 49 | |
| 50 | - return $options; |
|
| 50 | + return $options; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | add_filter( 'tiny_mce_before_init', 'wordlift_filter_tiny_mce_before_init' ); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * |
| 8 | 8 | * @return string The updated list of styles, including the custom style provided by WordLift. |
| 9 | 9 | */ |
| 10 | -function wordlift_mce_css( $mce_css ) { |
|
| 10 | +function wordlift_mce_css($mce_css) { |
|
| 11 | 11 | |
| 12 | 12 | /* |
| 13 | 13 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
@@ -16,21 +16,21 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 18 | 18 | */ |
| 19 | - if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 19 | + if ( ! apply_filters('wl_can_see_classification_box', true)) { |
|
| 20 | 20 | return $mce_css; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if ( ! empty( $mce_css ) ) { |
|
| 23 | + if ( ! empty($mce_css)) { |
|
| 24 | 24 | $mce_css .= ','; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - $mce_css .= plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css'; |
|
| 27 | + $mce_css .= plugin_dir_url(__FILE__).'css/wordlift-reloaded.min.css'; |
|
| 28 | 28 | |
| 29 | 29 | return $mce_css; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // hook the TinyMCE custom styles function. |
| 33 | -add_filter( 'mce_css', 'wordlift_mce_css' ); |
|
| 33 | +add_filter('mce_css', 'wordlift_mce_css'); |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Set TinyMCE options, in particular enable microdata tagging. |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @return mixed |
| 41 | 41 | */ |
| 42 | -function wordlift_filter_tiny_mce_before_init( $options ) { |
|
| 42 | +function wordlift_filter_tiny_mce_before_init($options) { |
|
| 43 | 43 | |
| 44 | - if ( ! isset( $options['extended_valid_elements'] ) ) { |
|
| 44 | + if ( ! isset($options['extended_valid_elements'])) { |
|
| 45 | 45 | $options['extended_valid_elements'] = ''; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -50,4 +50,4 @@ discard block |
||
| 50 | 50 | return $options; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -add_filter( 'tiny_mce_before_init', 'wordlift_filter_tiny_mce_before_init' ); |
|
| 53 | +add_filter('tiny_mce_before_init', 'wordlift_filter_tiny_mce_before_init'); |
|
@@ -14,65 +14,65 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Wordlift_Tinymce_Adapter { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * The {@link Wordlift} plugin instance. |
|
| 19 | - * |
|
| 20 | - * @since 3.12.0 |
|
| 21 | - * @access private |
|
| 22 | - * @var \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 23 | - */ |
|
| 24 | - private $plugin; |
|
| 17 | + /** |
|
| 18 | + * The {@link Wordlift} plugin instance. |
|
| 19 | + * |
|
| 20 | + * @since 3.12.0 |
|
| 21 | + * @access private |
|
| 22 | + * @var \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 23 | + */ |
|
| 24 | + private $plugin; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Wordlift_Tinymce_Adapter constructor. |
|
| 28 | - * |
|
| 29 | - * @param \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 30 | - */ |
|
| 31 | - public function __construct( $plugin ) { |
|
| 26 | + /** |
|
| 27 | + * Wordlift_Tinymce_Adapter constructor. |
|
| 28 | + * |
|
| 29 | + * @param \Wordlift $plugin The {@link Wordlift} plugin instance. |
|
| 30 | + */ |
|
| 31 | + public function __construct( $plugin ) { |
|
| 32 | 32 | |
| 33 | - $this->plugin = $plugin; |
|
| 33 | + $this->plugin = $plugin; |
|
| 34 | 34 | |
| 35 | - } |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Load the TinyMCE plugin. This method is called by the WP mce_external_plugins hook. |
|
| 39 | - * |
|
| 40 | - * @param array $plugins The existing plugins array. |
|
| 41 | - * |
|
| 42 | - * @return array The modified plugins array. |
|
| 43 | - * @since 3.12.0 |
|
| 44 | - */ |
|
| 45 | - function mce_external_plugins( $plugins ) { |
|
| 37 | + /** |
|
| 38 | + * Load the TinyMCE plugin. This method is called by the WP mce_external_plugins hook. |
|
| 39 | + * |
|
| 40 | + * @param array $plugins The existing plugins array. |
|
| 41 | + * |
|
| 42 | + * @return array The modified plugins array. |
|
| 43 | + * @since 3.12.0 |
|
| 44 | + */ |
|
| 45 | + function mce_external_plugins( $plugins ) { |
|
| 46 | 46 | |
| 47 | - /* |
|
| 47 | + /* |
|
| 48 | 48 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 49 | 49 | * |
| 50 | 50 | * @since 3.20.3 |
| 51 | 51 | * |
| 52 | 52 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 53 | 53 | */ |
| 54 | - if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 55 | - return $plugins; |
|
| 56 | - } |
|
| 54 | + if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 55 | + return $plugins; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - // Get WordLift's version as a cache killer. |
|
| 59 | - $version = $this->plugin->get_version(); |
|
| 58 | + // Get WordLift's version as a cache killer. |
|
| 59 | + $version = $this->plugin->get_version(); |
|
| 60 | 60 | |
| 61 | - // User can edit? |
|
| 62 | - $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
|
| 61 | + // User can edit? |
|
| 62 | + $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
|
| 63 | 63 | |
| 64 | - // If user can't edit or rich editing isn't enabled, bail out. |
|
| 65 | - if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) { |
|
| 66 | - return $plugins; |
|
| 67 | - } |
|
| 64 | + // If user can't edit or rich editing isn't enabled, bail out. |
|
| 65 | + if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) { |
|
| 66 | + return $plugins; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - // Add our own JavaScript file to TinyMCE's extensions. |
|
| 70 | - // DO NOT use the minified version, it'll yield errors with AngularJS. |
|
| 71 | - $plugins['wordlift'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version; |
|
| 72 | - $plugins['wl_shortcodes'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift_shortcode_tinymce_plugin.js?ver=' . $version; |
|
| 73 | - $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/1/tinymce.js?ver=' . $version; |
|
| 69 | + // Add our own JavaScript file to TinyMCE's extensions. |
|
| 70 | + // DO NOT use the minified version, it'll yield errors with AngularJS. |
|
| 71 | + $plugins['wordlift'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version; |
|
| 72 | + $plugins['wl_shortcodes'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift_shortcode_tinymce_plugin.js?ver=' . $version; |
|
| 73 | + $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/1/tinymce.js?ver=' . $version; |
|
| 74 | 74 | |
| 75 | - return $plugins; |
|
| 76 | - } |
|
| 75 | + return $plugins; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | 78 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @param \Wordlift $plugin The {@link Wordlift} plugin instance. |
| 30 | 30 | */ |
| 31 | - public function __construct( $plugin ) { |
|
| 31 | + public function __construct($plugin) { |
|
| 32 | 32 | |
| 33 | 33 | $this->plugin = $plugin; |
| 34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @return array The modified plugins array. |
| 43 | 43 | * @since 3.12.0 |
| 44 | 44 | */ |
| 45 | - function mce_external_plugins( $plugins ) { |
|
| 45 | + function mce_external_plugins($plugins) { |
|
| 46 | 46 | |
| 47 | 47 | /* |
| 48 | 48 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 53 | 53 | */ |
| 54 | - if ( ! apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 54 | + if ( ! apply_filters('wl_can_see_classification_box', true)) { |
|
| 55 | 55 | return $plugins; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -59,18 +59,18 @@ discard block |
||
| 59 | 59 | $version = $this->plugin->get_version(); |
| 60 | 60 | |
| 61 | 61 | // User can edit? |
| 62 | - $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
|
| 62 | + $can_edit = current_user_can('edit_posts') || current_user_can('edit_pages'); |
|
| 63 | 63 | |
| 64 | 64 | // If user can't edit or rich editing isn't enabled, bail out. |
| 65 | - if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) { |
|
| 65 | + if ( ! $can_edit || ! get_user_option('rich_editing')) { |
|
| 66 | 66 | return $plugins; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Add our own JavaScript file to TinyMCE's extensions. |
| 70 | 70 | // DO NOT use the minified version, it'll yield errors with AngularJS. |
| 71 | - $plugins['wordlift'] = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version; |
|
| 72 | - $plugins['wl_shortcodes'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift_shortcode_tinymce_plugin.js?ver=' . $version; |
|
| 73 | - $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/1/tinymce.js?ver=' . $version; |
|
| 71 | + $plugins['wordlift'] = plugin_dir_url(dirname(__FILE__)).'js/wordlift-reloaded.js?ver='.$version; |
|
| 72 | + $plugins['wl_shortcodes'] = plugin_dir_url(dirname(__FILE__)).'admin/js/wordlift_shortcode_tinymce_plugin.js?ver='.$version; |
|
| 73 | + $plugins['wl_tinymce'] = plugin_dir_url(dirname(__FILE__)).'admin/js/1/tinymce.js?ver='.$version; |
|
| 74 | 74 | |
| 75 | 75 | return $plugins; |
| 76 | 76 | } |