• Resolved Fabricio10

    (@fabriciobarros10)


    I need to make this code open the extra menu link in a new tab

    add_filter( ‘dokan_get_dashboard_nav’, ‘dokan_add_help_menu’ );
    function dokan_add_help_menu( $urls ) {
    $urls[‘pos’] = array(
    ‘title’ => __( ‘Pos’, ‘dokan’),
    ‘icon’ => ”,
    ‘url’ => get_bloginfo(‘url’) . ‘/pos/” target=”_blank”‘,
    ‘pos’ => 51
    );
    return $urls;
    }

    i followed this tutorial to create the new menu

    https://wedevs.com/blog/98671/adding-extra-menu-dokan-vendor-dashboard/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @fabriciobarros10,

    The code snippet that you have shared has some syntax-related issues. I can see your code is using this instead of '. Try replacing those and this should resolve the issue.

    Thanks!

    Thread Starter Fabricio10

    (@fabriciobarros10)

    ChatGPT, sulutions;

    // Função para adicionar o link para a página “pos” no menu do painel do Dokan function dokan_add_help_menu( $urls ) { $urls[‘pos’] = array( ‘title’ => __( ‘Pos’, ‘dokan’), ‘icon’ => ‘<i class=”fa fa-user”></i>’, ‘url’ => esc_url( add_query_arg( array( ‘target’ => ‘_blank’ ), get_bloginfo(‘url’) . ‘/pos/’ ) ), ‘pos’ => 51 ); return $urls; } add_filter( ‘dokan_get_dashboard_nav’, ‘dokan_add_help_menu’ ); // Função para adicionar o atributo target=”_blank” aos links do painel do Dokan function dokan_add_help_menu_target_blank( $args, $menu_id ) { if ( $menu_id === ‘pos’ ) { $args[‘link_before’] = str_replace( ‘<a’, ‘<a target=”_blank”‘, $args[‘link_before’] ); } return $args; } add_filter( ‘dokan_dashboard_nav_menu_item_args’, ‘dokan_add_help_menu_target_blank’, 10, 2 ); // Função para adicionar o atributo target=”_blank” aos links que contêm “/pos/” em seu URL function dokan_add_target_blank_to_pos_links() { ?> <script type=”text/javascript”> jQuery(document).ready(function($) { $(‘a[href*=”/pos/”]’).attr(‘target’, ‘_blank’); }); </script> <?php } add_action(‘wp_head’, ‘dokan_add_target_blank_to_pos_links’);

    Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @fabriciobarros10,

    There is no need to use ChatGPT as a code reference as the code is already mentioned on the blog that you have shared. On top of that, ChatGPT’s code also has the same syntax error that I mentioned earlier on. Please resolve the syntax error as I mentioned and I believe you will be able to get your desired result.

    Thanks!

    Thread Starter Fabricio10

    (@fabriciobarros10)

    @jahidulhassan

    the GPT chat solved my problem, your help did not, because even making your recommendation the problem was not solved.

    Dokan needs more capable people to solve their plugin problems.

    GPT chat saved my work!

    Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @fabriciobarros10,

    Great to know that your issue has been resolved.

    We have reviewed your request and determined that it is a custom requirement that falls outside the existing functionality of our product. As a result, we are not able to provide a custom solution to address your specific needs.

    We would like to clarify that our primary focus is to provide support for the default functionalities of our product, which are designed to meet the needs of a wide range of users.

    While we strive to provide the best possible support to all of our users, we do have a responsibility to ensure that our resources are allocated effectively to assist as many users as possible.

    Please understand that if we spend too much time on individual customization requests and code reviews, it may prevent us from providing timely assistance to other users who also require support. We hope you can appreciate the importance of balancing the needs of all of our users.

    Anyways, great to know that your problem was resolved. This is our prime focus to hear that the problem has been resolved.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘MEnu’ is closed to new replies.