Changeset 2566290
- Timestamp:
- 07/17/2021 11:49:25 AM (5 years ago)
- Location:
- display-metadata
- Files:
-
- 29 added
- 7 edited
-
tags/0.3 (added)
-
tags/0.3/LICENSE (added)
-
tags/0.3/Metabox (added)
-
tags/0.3/Metabox/class-comment.php (added)
-
tags/0.3/Metabox/class-metabox-factory.php (added)
-
tags/0.3/Metabox/class-metabox.php (added)
-
tags/0.3/Metabox/class-metadata-iterator.php (added)
-
tags/0.3/Metabox/class-none.php (added)
-
tags/0.3/Metabox/class-post.php (added)
-
tags/0.3/Metabox/class-term.php (added)
-
tags/0.3/Metabox/class-user.php (added)
-
tags/0.3/Metabox/index.php (added)
-
tags/0.3/assets (added)
-
tags/0.3/assets/display_metadata.css (added)
-
tags/0.3/assets/display_metadata.js (added)
-
tags/0.3/assets/index.php (added)
-
tags/0.3/class-plugin.php (added)
-
tags/0.3/display-metadata.php (added)
-
tags/0.3/index.php (added)
-
tags/0.3/readme.txt (added)
-
tags/0.3/views (added)
-
tags/0.3/views/assets.php (added)
-
tags/0.3/views/footer.php (added)
-
tags/0.3/views/header.php (added)
-
tags/0.3/views/index.php (added)
-
tags/0.3/views/meta_list.php (added)
-
tags/0.3/views/metabox.php (added)
-
tags/0.3/views/nothing.php (added)
-
trunk/Metabox/class-comment.php (added)
-
trunk/Metabox/class-metabox.php (modified) (2 diffs)
-
trunk/Metabox/class-post.php (modified) (1 diff)
-
trunk/Metabox/class-term.php (modified) (1 diff)
-
trunk/Metabox/class-user.php (modified) (1 diff)
-
trunk/assets/display_metadata.css (modified) (4 diffs)
-
trunk/display-metadata.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
display-metadata/trunk/Metabox/class-metabox.php
r2469780 r2566290 4 4 5 5 use Trasweb\Plugins\DisplayMetadata\Plugin; 6 7 6 use const Trasweb\Plugins\DisplayMetadata\PLUGIN_NAME; 8 7 … … 81 80 82 81 /** 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 /** 83 93 * Display metadata metabox. 84 94 * -
display-metadata/trunk/Metabox/class-post.php
r2469780 r2566290 75 75 protected function get_item_metadata(): array 76 76 { 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 ) ?: [] ); 78 78 } 79 79 } -
display-metadata/trunk/Metabox/class-term.php
r2469780 r2566290 63 63 protected function get_item_metadata(): array 64 64 { 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 ) ?: [] ); 66 66 } 67 67 } -
display-metadata/trunk/Metabox/class-user.php
r2443918 r2566290 52 52 */ 53 53 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 )?: [] ); 55 55 } 56 56 } -
display-metadata/trunk/assets/display_metadata.css
r2469780 r2566290 31 31 #trasweb-metadata-metabox .meta_empty_array table { 32 32 border: 1px solid #7e8993; 33 border-right: 0; 33 34 box-sizing: border-box; 34 margin: 13px 6px; 35 margin: 13px 0 13px 0; 36 padding: 15px 0 15px 15px; 35 37 } 36 38 37 #trasweb-metadata-metabox td.meta_value table {38 box-sizing: border-box;39 padding: 13px 6px;40 }41 39 42 40 #trasweb-metadata-metabox td, #trasweb-metadata-metabox th { 43 41 border: 1px solid #7e8993; 44 font-size: 1em; 42 border-right: 0; 43 font-size: 0.99em; 45 44 vertical-align: baseline; 46 padding: 4px 5px;45 padding: 4px 0 4px 5px; 47 46 } 48 47 49 #trasweb-metadata-metabox . depth_2:hover td.meta_key, #trasweb-metadata-metabox .depth_2:hovertd.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 { 50 49 background: #dbdbdb; 50 background-clip: padding-box; /* fix bug with borders in position relative */ 51 51 } 52 52 53 53 #trasweb-metadata-metabox .depth_1 > td.meta_key { 54 54 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; 56 64 } 57 65 … … 61 69 color: #000; 62 70 letter-spacing: 1px; 71 padding-right: 3px; 63 72 } 64 73 … … 88 97 #trasweb-metadata-metabox td.meta_value { 89 98 background-color: #fff; 90 overflow-x: auto;91 99 word-wrap: break-word; 92 100 width: 100%; … … 94 102 } 95 103 96 #trasweb-metadata-metabox .meta_ scalar> td.meta_value:hover{104 #trasweb-metadata-metabox .meta_item > td.meta_value:hover{ 97 105 position: relative; 98 106 background-clip: padding-box; /* fix bug with borders in position relative */ -
display-metadata/trunk/display-metadata.php
r2469780 r2566290 7 7 * Plugin URI: https://github.com/trasweb/DisplayMetadata 8 8 * 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. 29 * Version: 0.3 10 10 * Author: Manuel Canga 11 11 * 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 === 2 2 Contributors: trasweb 3 3 Tags: development, metabox, debug, metadata 4 4 Requires at least: 4.9.0 5 Tested up to: 5. 65 Tested up to: 5.7.2 6 6 Requires PHP: 7.2 7 Stable tag: 0. 27 Stable tag: 0.3 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 12 12 13 13 == Description == 14 15 Shows 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. 14 16 15 17 As a developer you normally need know about a value of some meta( or properties ) of a post, term o user. … … 54 56 More detailed changes in [Display Metadata GitHub Repository](https://github.com/trasweb/DisplayMetadata/). 55 57 58 = 0.3 / 2021-07-17 59 60 * Better hover 61 * Better design 62 * Fix bug with metas with the same key. 63 64 56 65 = 0.2 / 2021-02-05 57 66
Note: See TracChangeset
for help on using the changeset viewer.