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

Commit

Permalink
With the introduction of the hook edit_form_before_permalink we can n…
Browse files Browse the repository at this point in the history
…ow put the subtitle directly underneath post titles, making for a better overall plugin UI. This fixes #30. [skip ci]
  • Loading branch information
Philip Arthur Moore committed Nov 5, 2014
1 parent d249bcd commit a4d4e8e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ All versions of _Subtitles_ can be found on the [Releases](https://github.com/ph
- Bug Fix: Do not show subtitles in RSS feeds (see [issue](https://github.com/philiparthurmoore/Subtitles/issues/32)).
- Extra: Russian (ru_RU) language packs added
- Extra: Better WordPress Coding Standards
- Extra: WordPress 4.1 introduced a new hook called `edit_form_before_permalink` that allows us to move Subtitles into a more natural position, just underneath the post title. Let's use that and preserve backwards compatibility for older versions of WordPress.

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

Expand Down
4 changes: 4 additions & 0 deletions admin/assets/css/subtitles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
margin-bottom: 10px;
margin-top: -5px;
}
.version-4-1 #subtitlediv {
margin-bottom: 0;
margin-top: 0;
}

#subtitlediv label {
cursor: text;
Expand Down
6 changes: 5 additions & 1 deletion admin/subtitles-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ protected function __construct() {
*
* @since 1.0.0
*/
add_action( 'edit_form_after_title', array( &$this, 'build_subtitle_input' ) );
if ( version_compare( $GLOBALS[ 'wp_version' ], '4.1-alpha', '<' ) ) {
add_action( 'edit_form_after_title', array( &$this, 'build_subtitle_input' ) );
} else {
add_action( 'edit_form_before_permalink', array( &$this, 'build_subtitle_input' ) );
}

/**
* Validate and update the subtitle input field.
Expand Down

0 comments on commit a4d4e8e

Please sign in to comment.