Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeah8000/acf-autosize
Autoresize wysiwyg and textarea fields in ACF
https://github.com/yeah8000/acf-autosize
Last synced: 3 months ago
JSON representation
Autoresize wysiwyg and textarea fields in ACF
- Host: GitHub
- URL: https://github.com/yeah8000/acf-autosize
- Owner: yeah8000
- License: lgpl-3.0
- Created: 2018-06-19T09:01:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-14T20:07:19.000Z (over 1 year ago)
- Last Synced: 2024-07-31T02:34:05.333Z (3 months ago)
- Language: PHP
- Size: 1.62 MB
- Stars: 20
- Watchers: 9
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# acf-autosize
A wordpress plugin to automatically resize and improve upon wysiwyg and textarea fields in Advanced Custom Fields## Features
- Automatically resize wysiwyg and textarea fields in ACF groups
- Add `data-wysiwyg-slug='my-wysiwyg-field'` to the body in tinymce iframes, so you can style those iframe's contents using editor-styles:```php
// functions.phpfunction yeah9346_dashboard_tinymce_editor_styles() {
add_editor_style(get_stylesheet_directory_uri().'/path/to/css/editor-styles.css?v=123');
}
add_action('admin_init', 'yeah9346_dashboard_tinymce_editor_styles');```
```css
/* editor-styles.css */body[data-wysiwyg-slug="my-wysiwyg-field"] {
...
}
```- Set `min-height` of WYSIWYG-fields via `acf-autosize/wysiwyg/min-height`-filter.
```php
// functions.phpadd_filter('acf-autosize/wysiwyg/min-height', function() {
return 200;
});```
- Disable autosizing by default width `acf-autosize/enabledByDefault`-filter (is enabled by default).
```php
// functions.phpadd_filter('acf-autosize/enabledByDefault', function() {
return false;
});```
## Usage
- Install and activate like any other wordpress plugin
- `[data-wysiwyg-slug]` is added to *every* wysiwyg field!
- The plugin is enabled by default on all textareas and wysiwyg fields. You can disable it by adding the class `no-autosize` to a field.
- You can set the the default behaviour to false via the `acf-autosize/enabledByDefault`-filter. After that you can reenable single fields by adding the class `autosize`.
- Set `min-height` of WYSIWYG-fields via `acf-autosize/wysiwyg/min-height`-filter.## mu-plugin
`acf-autosize-mu.php` is a single-file drop-in version of acf-autosize for usage in your theme or mu-plugins. It contains the javascript and is AUTOGENERATED!## Development
- Install build tools: `npm install`
- Run dev watcher: `npm run dev`
- Distribution: `npm run dist`
- Compile mu-plugin: `npm run mu`
- deploy to wordpress.org: `npm run deploy your-username`### Versions need a bump in:
- 2 × `acf-autosize.php`
- 1 × `package.json`
- 1 × `readme.txt` + Changelog!… and don't forget to `npm run dist`