Add custom endpoints and content
-
I want to add an endpoint to the dashboard menu.
I want to use this section as advertising tools such as placing banners.
I added the following line to the class-yith-wcaf-endpoints.php file.'banners' => _x( 'Banners', '[GLOBAL] Endpoint title', 'yith-woocommerce-affiliates' ),
I also saved the Permalink Settings again to fix the 404 error.
With this, the banners item was added to the dashboard menu. Then I created a file called dashboard-banners.php in the templates/shortcodes path and put the following code in it.<?php /** * Affiliate Banners * * @author YITH * @package YITH\Affiliates\Templates * @version 2.0.0 */ /** * Template variables: * * @var $affiliate YITH_WCAF_Affiliate * @var $generated_url string * @var $original_url string * @var $share_enabled bool * @var $atts array * @var $share_atts array */ if ( ! defined( 'YITH_WCAF' ) ) { exit; } // Exit if accessed directly ?> <?php do_action( 'yith_wcaf_before_dashboard_section', 'banners', $atts ); ?> <div> <h1>Welcome to the Banners endpoint!</h1> </div> <?php do_action( 'yith_wcaf_after_dashboard_section', 'banners', $atts );
Now I want the custom content that I put in the dashboard-banners.php file to be displayed at the endpoint of the banners.
Please advise what other file should I add or edit.
Of course, adding the banner section can be a good suggestion for the developers of this plugin.
I appreciate any help and guidance.
Thank You
- The topic ‘Add custom endpoints and content’ is closed to new replies.