Pink-Crab / Perique-Registerables

The Registerables module for the PinkCrab framework.
MIT License
3 stars 0 forks source link

Now has an optional filter which allows for the passing of variable p… #31

Closed gin0115 closed 2 years ago

gin0115 commented 2 years ago

Now has an optional filter which allows for the passing of variable populated at load to view.

calling

$meta_box->view_data_filter(
  function( WP_Post $post, array $args ): array {
    $args['meta'] = esc_html( get_post_meta($post->ID, 'some_key', true) );
    return $args;
  }
)

Then in your template

<p><?php echo $meta; ?></p>
codecov[bot] commented 2 years ago

Codecov Report

Merging #31 (9043f32) into develop (61b9783) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##             develop       #31   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       138       144    +6     
===========================================
  Files             13        13           
  Lines            400       418   +18     
===========================================
+ Hits             400       418   +18     
Impacted Files Coverage Δ
src/Meta_Box.php 100.00% <100.00%> (ø)
src/Registrar/Meta_Box_Registrar.php 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 61b9783...9043f32. Read the comment docs.