backend_customers

Adds custom content to backend’s “Customers” section.

Shop-Script

Input (passed by reference)

No specific parameters.
… your plugin code …

Output

{$backend_customers.sidebar_top_li}
Custom items under the “All customers” link. E.g., a custom link pointing to a customer list powered by your plugin.
{$backend_customers.sidebar_section}
Custom blocks in the middle of the sidebar above the “Categories” block.
Shop-Script

Plugin code example

PHP

{
    $link_text = _wp('My plugin’s link');

    return [
        'sidebar_top_li' => <<<HTML
<script>
$.customers.{$this->id}Action = function () {
    this.load('?plugin={$this->id}&module=customers');
}
</script>

<li><a href="#/{$this->id}">{$link_text}</li>
HTML,
        'sidebar_section' => '<div class="box">' . _wp('My plugin’s section') . '</div>',
    ];
}