https://github.com/horttcore/wp-meta-box-address
https://github.com/horttcore/wp-meta-box-address
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/horttcore/wp-meta-box-address
- Owner: Horttcore
- Created: 2019-11-20T09:55:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T20:09:52.000Z (over 4 years ago)
- Last Synced: 2025-03-05T09:45:38.169Z (about 2 months ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WordPress Meta Box Address data
Adding address data fields as a meta box
- Street / Streetnumber
- ZIP code / City
- Address Additionall
- Country
- Map## Installation
`composer require ralfhortt/wp-meta-box-address`
## Usage
```php
/*
new MetaBoxAddress(
array $screen = ['post'],
string $context = 'advanced',
string $priority = 'default'
)
*/
```### Serviceloader
```php
use RalfHortt\MetaBoxAddress\MetaBoxAddress;PluginFactory::create()
->addService(MetaBoxAddress::class, ['page'], 'advanced', 'default')
->boot();
```### Standalone
```php
use RalfHortt\MetaBoxAddress\MetaBoxAddress;(new MetaBoxAddress(['page'], 'advanced', 'default' ))->register();
```## Hooks
### Filter
- `wp-meta-box-address/meta-box-identifier` - Change meta box id
- `wp-meta-box-address/meta-box-label` - Change meta box label
- `wp-meta-box-address/street-{$postType}` - Hide street field for \$postType
- `wp-meta-box-address/streetnumber-{$postType}` - Hide streetnumber field for \$postType
- `wp-meta-box-address/address-additional-{$postType}` - Hide address additional field for \$postType
- `wp-meta-box-address/zip-{$postType}` - Hide zip field for \$postType
- `wp-meta-box-address/city-{$postType}` - Hide city field for \$postType
- `wp-meta-box-address/country-{$postType}` - Hide country field for \$postType
- `wp-meta-box-address/latitude-{$postType}` - Hide latitude field for \$postType
- `wp-meta-box-address/longitude-{$postType}` - Hide longitude field for \$postType#### Example
```php