Skip to content

Commit

Permalink
update core assets and make theme options easy to code
Browse files Browse the repository at this point in the history
  • Loading branch information
robojuicedev committed Jul 20, 2017
1 parent 4b22b0c commit 103c0e7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,20 @@ Documentation and examples can be found at [http://typerocket.com](http://typero

## License

TypeRocket is open-sourced software licenced under the [GNU General Public License 3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)
TypeRocket is open-sourced software licenced under the [GNU General Public License 3.0](https://www.gnu.org/licenses/gpl-3.0.en.html)

## Quick Example

```php
$team = tr_post_type('Person');
$team->setIcon('users')->setArgument('supports', ['title'] );
$team->setTitlePlaceholder( 'Enter full name here' );
$team->setTitleForm( function() {
$form = tr_form();
echo $form->image('Photo');
$editor = $form->editor('post_content'); // Override post_content in DB
echo $editor->setLabel('About Person');
} );

tr_taxonomy('Department')->apply($team);
```
23 changes: 13 additions & 10 deletions plugins/theme-options/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
echo $form->open();

// about
$contact = [
$form->text('Company Name'),
$form->text('Company Email'),
$form->text('Company Phone'),
$form->search('Terms Page')->setPostType('page'),
$form->checkbox('Company Open')->setText('Company open for business')->setLabel(false)
];
$about = $form->getFromFieldsString( $contact );
$about = function() use ($form) {
echo $form->text('Company Name');
echo $form->text('Company Email');
echo $form->text('Company Phone');
echo $form->search('Terms Page')->setPostType('page');
echo $form->checkbox('Company Open')->setText('Company open for business')->setLabel(false);
};

// api
$help = '<a target="blank" href="https://developers.google.com/maps/documentation/embed/guide#api_key">Get Your Google Maps API</a> to activate maps in the theme.';
$api = $form->password( 'Google Maps API Key')->setHelp($help)->setAttribute('autocomplete', 'new-password');
$api = function() use ($form) {
$help = '<a target="blank" href="https://developers.googl..com/maps/documentation/embed/guide#api_key">Get Your Google Maps API</a>.';
echo $form->password( 'Google Maps API Key')
->setHelp($help)
->setAttribute('autocomplete', 'new-password');
};

// save
$save = $form->submit( 'Save' );
Expand Down
2 changes: 1 addition & 1 deletion wordpress/assets/typerocket/css/core.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wordpress/assets/typerocket/js/core.js

Large diffs are not rendered by default.

0 comments on commit 103c0e7

Please sign in to comment.