frozzare/papi-property-table

Table property for Papi

Installs: 16

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Type:wordpress-plugin

v1.0.0 2016-08-21 10:39 UTC

This package is auto-updated.

Last update: 2024-12-26 02:40:02 UTC


README

Table property for Papi.

Installation

This property requires Papi plugin.

If you're using Composer to manage WordPress, add Papi to your project's dependencies. Run:

composer require frozzare/papi-property-table

Usage

<?php

$fields = [
    ['Name', 'facility_name'],
    ['ID', 'facility_id'],
    ['Location', 'facility_location_name'],
    ['E-email', 'facility_email'],
    ['Address', 'facility_street_address'],
    ['Zip code', 'facility_zip_code']
];

foreach ( $fields as $k => $v ) {
    $fields[$k][1] = get_post_meta( $_GET['post'], $v[1], true );
}

$this->box( [
    'title'   => 'Facility information',
    'context' => 'side'
], [
    papi_property( [
        'sidebar'  => false,
        'title'    => 'Facility information',
        'type'     => 'table',
        'settings' => [
            'items' => $fields
        ]
    ] )
] );

License

MIT © Fredrik Forsmo