Last active
August 29, 2015 13:59
-
-
Save jasonvarga/10607597 to your computer and use it in GitHub Desktop.
Small add-on to rename Statamic's date/time fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Hooks_rename_date_fields extends Hooks | |
{ | |
public function control_panel__add_to_foot() | |
{ | |
if (URL::getCurrent() == '/publish') { | |
return $this->js->inline(' | |
var form = $(".primary-form"); | |
form.find("label:contains(\'Publish Date\')").text("New date field name"); | |
form.find("label:contains(\'Publish Time\')").text("New time field name"); | |
'); | |
} | |
} | |
} | |
/** | |
* Instructions: | |
* | |
* 1. Place this code in /_add-ons/rename_date_fields/hooks.rename_date_fields.php | |
* 2. Enjoy your new field names. | |
* | |
**/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment