Plugin Directory

Changeset 2566290


Ignore:
Timestamp:
07/17/2021 11:49:25 AM (5 years ago)
Author:
trasweb
Message:

bump 0.3 version

Location:
display-metadata
Files:
29 added
7 edited

Legend:

Unmodified
Added
Removed
  • display-metadata/trunk/Metabox/class-metabox.php

    r2469780 r2566290  
    44
    55use Trasweb\Plugins\DisplayMetadata\Plugin;
    6 
    76use const Trasweb\Plugins\DisplayMetadata\PLUGIN_NAME;
    87
     
    8180
    8281    /**
     82     * Shift metadata in order to avoid remove metas with equal key
     83     *
     84     * @param mixed $meta
     85     *
     86     * @return mixed
     87     */
     88    protected function shift_metadata( $meta ) {
     89        return $meta[1] ? $meta : $meta[0];
     90    }
     91
     92    /**
    8393     * Display metadata metabox.
    8494     *
  • display-metadata/trunk/Metabox/class-post.php

    r2469780 r2566290  
    7575    protected function get_item_metadata(): array
    7676    {
    77         return array_map( 'array_shift', get_post_meta( $this->item_id ) ?: [] );
     77        return array_map( [ $this, 'shift_metadata' ], get_post_meta( $this->item_id ) ?: [] );
    7878    }
    7979}
  • display-metadata/trunk/Metabox/class-term.php

    r2469780 r2566290  
    6363    protected function get_item_metadata(): array
    6464    {
    65         return array_map( 'array_shift', get_term_meta( $this->item_id ) ?: [] );
     65        return array_map( [ $this, 'shift_metadata' ], get_term_meta( $this->item_id ) ?: [] );
    6666    }
    6767}
  • display-metadata/trunk/Metabox/class-user.php

    r2443918 r2566290  
    5252     */
    5353    protected function get_item_metadata(): array {
    54         return array_map('array_shift', get_user_meta( $this->item_id )?: [] );
     54        return array_map( [ $this, 'shift_metadata' ],get_user_meta( $this->item_id )?: [] );
    5555    }
    5656}
  • display-metadata/trunk/assets/display_metadata.css

    r2469780 r2566290  
    3131#trasweb-metadata-metabox .meta_empty_array table {
    3232    border: 1px solid #7e8993;
     33    border-right: 0;
    3334    box-sizing: border-box;
    34     margin: 13px 6px;
     35    margin: 13px 0 13px 0;
     36    padding: 15px 0 15px 15px;
    3537}
    3638
    37 #trasweb-metadata-metabox td.meta_value table {
    38     box-sizing: border-box;
    39     padding: 13px 6px;
    40 }
    4139
    4240#trasweb-metadata-metabox td, #trasweb-metadata-metabox th {
    4341    border: 1px solid #7e8993;
    44     font-size: 1em;
     42    border-right: 0;
     43    font-size: 0.99em;
    4544    vertical-align: baseline;
    46     padding: 4px 5px;
     45    padding: 4px 0 4px 5px;
    4746}
    4847
    49 #trasweb-metadata-metabox .depth_2:hover td.meta_key, #trasweb-metadata-metabox .depth_2:hover td.meta_value {
     48#trasweb-metadata-metabox .meta_item:not(.depth_1):hover > td.meta_key, #trasweb-metadata-metabox .meta_item.meta_scalar:not(.depth_1):hover > td.meta_value {
    5049    background: #dbdbdb;
     50    background-clip: padding-box; /* fix bug with borders in position relative */
    5151}
    5252
    5353#trasweb-metadata-metabox .depth_1 > td.meta_key {
    5454    font-weight: bold;
    55     font-size: 1.2em;
     55    font-size: 1em;
     56}
     57
     58#trasweb-metadata-metabox .depth_1 > td.meta_value > table {
     59    border-right: 1px solid #7e8993;
     60}
     61
     62#trasweb-metadata-metabox .depth_1 table {
     63    padding: 13px 0 13px 5px;
    5664}
    5765
     
    6169    color: #000;
    6270    letter-spacing: 1px;
     71    padding-right: 3px;
    6372}
    6473
     
    8897#trasweb-metadata-metabox td.meta_value {
    8998    background-color: #fff;
    90     overflow-x: auto;
    9199    word-wrap: break-word;
    92100    width: 100%;
     
    94102}
    95103
    96 #trasweb-metadata-metabox .meta_scalar > td.meta_value:hover{
     104#trasweb-metadata-metabox .meta_item > td.meta_value:hover{
    97105    position: relative;
    98106    background-clip: padding-box; /* fix bug with borders in position relative */
  • display-metadata/trunk/display-metadata.php

    r2469780 r2566290  
    77 * Plugin URI: https://github.com/trasweb/DisplayMetadata
    88 * Description: Shows metas in a metabox for posts( any CPT ), terms( any taxonomy ), comments and users. Metadata are displayed for humans( organized and unserialized ). This metabox only will be displayed per either administrator users or users with `display_metadata_metabox` capability.
    9  * Version: 0.2
     9 * Version: 0.3
    1010 * Author: Manuel Canga
    1111 * Author URI: https://manuelcanga.dev
  • display-metadata/trunk/readme.txt

    r2469780 r2566290  
    1 === Display Metadata ===
     1=== Display post meta, term meta, comment meta, and user meta ===
    22Contributors: trasweb
    33Tags: development, metabox, debug, metadata
    44Requires at least: 4.9.0
    5 Tested up to: 5.6
     5Tested up to: 5.7.2
    66Requires PHP: 7.2
    7 Stable tag: 0.2
     7Stable tag: 0.3
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1212
    1313== Description ==
     14
     15Shows metas( fields, custom fields and protected metas ) in a metabox for posts( any CPT ), terms( any taxonomy ), comments and users. Metas are displayed for humans( organized and unserialized ). This metabox only will be displayed per either administrator users or users with `display_metadata_metabox` capability.
    1416
    1517As a developer you normally need know about a value of some meta( or properties ) of a post, term o user.
     
    5456More detailed changes in [Display Metadata GitHub Repository](https://github.com/trasweb/DisplayMetadata/).
    5557
     58= 0.3 / 2021-07-17
     59
     60* Better hover
     61* Better design
     62* Fix bug with metas with the same key.
     63
     64
    5665= 0.2 / 2021-02-05
    5766
Note: See TracChangeset for help on using the changeset viewer.