shopp_orderui_orderdata_{data-name}

filters one orderdata list item on the Shopp Order Manager order-data meta box.

add_filter( 'shopp_orderui_orderdata_{data-name}', [callback] )

@param string $listing one orderdata list item on the Shopp Order Manager order-data meta box.

Description

filters one orderdata list item on the Shopp Order Manager order-data meta box.

This filter could be useful if you wanted to handle a particular piece of order-data from an order in a special way. The filter is passed the entire <li> markup line. The name of this filter is dynamic, and will be called based on the sanitized name of the data collected on the checkout form.

Each list item content is created by the shopp(‘checkout’,’order-data’) on the checkout form, and displayed on the Shopp Order Manager in the WordPress Admin in the order-data metabox.

Example

// register filter callback
// add_filter('shopp_orderui_orderdata_{data-name}', 'my_filter');

// if the data is collected on the checkout form using a field you have called
// "Hello World" like so:
// shopp('checkout', 'order-data', 'name=Hello World');
// the filter name for this would be sanitized to lower-case with dashes as
// shopp_orderui_orderdata_hello-world
add_filter('shopp_orderui_orderdata_hello-world', 'hello_world_data_filter');

// create filter function
function hello_world_data_filter( $li ) {
    // only display for admins
    if ( ! current_user_can('manage_options') )
        $li = '';

    return $li;
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar