PHP code example of wptrt / customize-section-button
1. Go to this page and download the library: Download wptrt/customize-section-button library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wptrt / customize-section-button example snippets
// Use statements must come after the `namespace` statement at the top of the
// file but before any other code.
use WPTRT\Customize\Section\Button;
// Register the "button" section.
add_action( 'customize_register', function( $manager ) {
$manager->register_section_type( Button::class );
$manager->add_section(
new Button( $manager, 'themeslug_pro', [
'title' => __( 'ThemeName Pro', 'themeslug' ),
'button_text' => __( 'Go Pro', 'themeslug' ),
'button_url' => 'http://example.com'
] )
);
} );