awesomemotive / one-click-demo-import

One Click Demo Import plugin
https://www.awesomemotive.com/
195 stars 83 forks source link

Make successful import buttons filterable #280

Closed donmhico closed 10 months ago

donmhico commented 10 months ago

Description

This PR introduces a new filter named ocdi/import_successful_buttons, which allows developers to add/edit the buttons displayed after the import process is successful.

Screenshot 2023-10-31 at 18 29 22

Motivation

This PR fixes #239.

Filter usage

add_filter( 'ocdi/import_successful_buttons', 'test_ocdi_import_buttons' );
function test_ocdi_import_buttons( $buttons ) {

    return [
        [
            'label'  => 'Visit Theme Options',
            'href'   => add_query_arg( 'page', 'my-theme', admin_url( 'themes.php' ) ),
            'target' => '_blank',
            'class'  => 'button button-primary button-hero',
        ],
        [
            'label'  => 'Request Support',
            'href'   => 'https://my-awesome-theme.com/support/',
            'target' => '_blank',
            'class'  => 'button button-primary button-hero'
        ]
    ];
}

Screenshot 2023-10-31 at 18 39 00