Skip to content

Instantly share code, notes, and snippets.

@jasonvarga
Last active August 29, 2015 13:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonvarga/10607597 to your computer and use it in GitHub Desktop.
Save jasonvarga/10607597 to your computer and use it in GitHub Desktop.
Small add-on to rename Statamic's date/time fields.
<?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