Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
Change version to 2.0.0, as the CSS and performance change is incompa…
Browse files Browse the repository at this point in the history
…tible with version 1.0.7 of Subtitles and will cause sites that have disabled styling from the plugin to now show that styling. README has been updated to reflect this change.
  • Loading branch information
Philip Arthur Moore committed Aug 31, 2014
1 parent 671768f commit 6e3a46d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,20 @@ If you're worried about SEO and the markup of _Subtitles_, then [roll your own m

### Front-End Performance ###

_Subtitles_ makes one additional server request on the front-end of your website. This is to load sensible CSS that will ensure your subtitle is always scaled properly alongside your website title.
As of version 2.0.0, _Subtitles_ outputs its CSS via `wp_head`. This is to load sensible CSS that will ensure your subtitle is always scaled properly alongside your website title and never shown in comment areas.

```css
/**
* Plugin Name: Subtitles
* Plugin URI: http://wordpress.org/plugins/subtitles/
* Description: Easily add subtitles into your WordPress posts, pages, custom post types, and themes.
* Author: Philip Arthur Moore
* Author URI: https://philiparthurmoore.com/
* Version: 2.0.0
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/**
* Be explicit about this styling only applying to spans,
* since that's the default markup that's returned by
Expand All @@ -135,18 +146,15 @@ span.entry-subtitle {
}
```

I can certainly see a case for potentially inlining these styles, but I need to first make sure that it makes sense to do so at the expense of documentation and extensibility for potential future enhancements to the plugin.

For now, if you'd like to remove this additional CSS call, then simply add a similar function to the following in your plugin or theme's primary file:
If you'd like to remove this additional CSS, then simply add a similar function to the following in your plugin or theme's primary setup file:

```php
function ditch_subtitle_styling() {
wp_dequeue_style( 'subtitles-style' );
if ( class_exists( 'Subtitles' ) && method_exists( 'Subtitles', 'subtitle_styling' ) ) {
remove_action( 'wp_head', array( Subtitles::getInstance(), 'subtitle_styling' ) );
}
add_action( 'wp_enqueue_scripts', 'ditch_subtitle_styling' );
```

After doing this, nothing should be loaded on the front end of your site and you'll need to style subtitles using your own CSS.
After doing this, no styling should be loaded on the front end of your site and you'll need to style subtitles using your own CSS.

---

Expand Down Expand Up @@ -271,9 +279,9 @@ An ID isn't necessary for `get_the_subtitle`, but will work for retrieving subti

All versions of _Subtitles_ can be found on the [Releases](https://github.com/philiparthurmoore/Subtitles/releases) page.

### [v1.0.8](https://github.com/philiparthurmoore/Subtitles/releases/tag/v1.0.8) (August 31st, 2014)
### [v2.0.0](https://github.com/philiparthurmoore/Subtitles/releases/tag/v2.0.0) (August 31st, 2014)

- Bug Fix: Better CSS Handling for better overall plugin performance (see [issue](https://github.com/philiparthurmoore/Subtitles/issues/28)).
- Performance Fix: Better CSS Handling for better overall plugin performance (see [issue](https://github.com/philiparthurmoore/Subtitles/issues/28)).

### [v1.0.7](https://github.com/philiparthurmoore/Subtitles/releases/tag/v1.0.7) (August 17th, 2014)

Expand Down
2 changes: 1 addition & 1 deletion admin/assets/css/subtitles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Easily add subtitles into your WordPress posts, pages, custom post types, and themes.
* Author: Philip Arthur Moore
* Author URI: https://philiparthurmoore.com/
* Version: 1.0.8
* Version: 2.0.0
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
Expand Down
8 changes: 4 additions & 4 deletions public/class-subtitles.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Subtitles {
*
* @since 1.0.0
*/
const VERSION = '1.0.8';
const VERSION = '2.0.0';

/**
* Constant used when referencing the plugin in load text domain calls and other
Expand Down Expand Up @@ -198,7 +198,7 @@ protected function __construct() {
* Output front-end styles for Subtitles via wp_head
*
* @see add_action()
* @since 1.0.8
* @since 2.0.0
*/
add_action( 'wp_head', array( &$this, 'subtitle_styling' ) );

Expand Down Expand Up @@ -490,7 +490,7 @@ public function load_subtitles_textdomain() {
* Output front-end styles for Subtitles via wp_head
*
* @access public
* @since 1.0.8
* @since 2.0.0
*/
public function subtitle_styling() { ?>
<style type="text/css" media="screen">
Expand All @@ -500,7 +500,7 @@ public function subtitle_styling() { ?>
* Description: Easily add subtitles into your WordPress posts, pages, custom post types, and themes.
* Author: Philip Arthur Moore
* Author URI: https://philiparthurmoore.com/
* Version: 1.0.8
* Version: 2.0.0
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
Expand Down
2 changes: 1 addition & 1 deletion subtitles.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Easily add subtitles into your WordPress posts, pages, custom post types, and themes.
* Author: Philip Arthur Moore
* Author URI: https://philiparthurmoore.com/
* Version: 1.0.8
* Version: 2.0.0
* Text Domain: subtitles
* Domain Path: /languages/
* License: GNU General Public License v2 or later
Expand Down

0 comments on commit 6e3a46d

Please sign in to comment.