How to insert custom linked icon to the template

Thanks for the help again, Andrii :slight_smile:

I managed to rewrite the code to get the listing id. Can you please have a look at it?

Is it the right way to do this? Or am I missing something/doing something wrong?

add_filter(
    'hivepress/v1/templates/listing_edit_block',
    function ( $template ) {
        $listing_id = get_the_ID();
        
        if ( ! $listing_id || 'hp_listing' !== get_post_type( $listing_id ) ) {
            return $template;
        }

        $feature_url = add_query_arg(
            'listingid',
            absint( $listing_id ),
            home_url( '/checkout/' )
        );

        return hivepress()->helper->merge_trees(
            $template,
            [
                'blocks' => [
                    'listing_actions_primary' => [
                        'blocks' => [
                            'listing_feature_link' => [
                                'type'    => 'content',
                                'content' => sprintf(
                                    '<a href="%s" title="%s" class="hp-listing__action hp-link"><i class="hp-icon fas fa-star"></i></a>',
                                    esc_url( $feature_url ),
                                    esc_attr__( 'Feature' )
                                ),
                                '_order'  => 10,
                            ],
                        ],
                    ],
                ],
            ]
        );
    },
    1000
);

Thanks again :slight_smile: