[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

bw_virtual_field_parm_values() – Obtain the parm values for the callback function

Description

Obtain the parm values for the callback function

The parameters we pass to the callback function must be obtained from post_meta for the current post. For example for the callback function used to display the value of the virtual field _oik_sc_the_title_cb we need to obtain the value of the _oik_sc_code field to pass as the first parameter.

Usage

$array = bw_virtual_field_parm_values( $field );

Parameters

$field
( string ) required – the virtual field being displayed

Returns

array parm values

TO DO

Extend to support 'fieldref' fields as well, by using bw_query_fieldref_value() Note: The parms must be unique values… not multiple

Source

File name: oik-fields/includes/oik-fields.inc
Lines:
1 to 15 of 15
function bw_virtual_field_parm_values( $field ) { 
  $args = $field['#args'];
  $parms = bw_assoc( bw_as_array( bw_array_get( $args, "#parms", null ) ) );
  $post_id = bw_current_post_id();
  $parm_values = array();
  if ( count( $parms ) ) {
    foreach ( $parms as $parm ) {
      $parm_values[] = get_post_meta( $post_id, $parm, true );
    }
  }
  $parm_values[] = $post_id;
  //bw_trace2( $post_id, "post id" );
  //bw_trace2( $parm_values, "parm_values" );
  return( $parm_values );
}
 
 View on GitHub

Called by

1 to 1 of 1
  • bw_theme_field_virtual() – Theme a field of type ‘virtual’

Invoked by

    Calls

    1 to 3 of 3
    • bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
    • bw_assoc() – Convert a simple array into an associative array keyed on the value
    • bw_as_array() – Split a string into an array if necessary

    Call hooks

    Function name: bw_virtual_field_parm_values
    Plugin ref: oik-fields – custom post type field APIs
    Version: 1.54.3
    Sourcefile: includes/oik-fields.inc
    File ref: includes/oik-fields.inc
    Deprecated?: No
    API Letters: B,F,P,V

    Published: March 14, 2017 | Last updated: March 14, 2017

    Information

    Function name: bw_virtual_field_parm_values
    Plugin ref: oik-fields – custom post type field APIs
    Version: 1.54.3
    Sourcefile: includes/oik-fields.inc
    File ref: includes/oik-fields.inc
    Deprecated?: No
    API Letters: B,F,P,V

    Recent plugin updates

    oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
    SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
    oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
    oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
    oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

    Plugins

    • All Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins

    Themes

    • FREE themes
    • Bespoke themes
    • Premium themes

    Blocks

    • All Blocks
    • Block examples
    • About Blocks

    Shortcodes

    • All Shortcodes
    • Shortcode examples
    • About Shortcodes

    Reference

    • About APIs
    • All APIs
    • All Classes
    • All Files
    • All Hooks

    Support

    • Contact
    • Cookies policy
    • Get API key
    • Privacy
    • Request support
    • Sitemap
    • Stay informed
    • Terms and Conditions
    oik-plugins
    Email: herb@bobbingwide.com

    Weight shipping plugins

    Find out which cart weight shipping plugin you need for your WooCommerce site.
    Which cart weight based plugin do I need?

    Site:  www.oik-plugins.com
    © Copyright oik-plugins 2011-2025. All rights reserved.


    Website designed and developed by Herb Miller of Bobbing Wide
    Proudly powered by WordPress and oik-plugins

    WordPress version: 6.8.3

    Gutenberg version: 21.7.0

    PHP version: 8.2.29