久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在woocommerce的管理訂單列表頂部添加一個(gè)按鈕

Add a button on top of admin orders list in woocommerce(在woocommerce的管理訂單列表頂部添加一個(gè)按鈕)
本文介紹了在woocommerce的管理訂單列表頂部添加一個(gè)按鈕的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

限時(shí)送ChatGPT賬號(hào)..

我一直在努力尋找一個(gè)鉤子,讓我可以在 woocommerce 管理訂單頁(yè)面"的頂部添加一個(gè)按鈕,但到目前為止沒(méi)有成功.我找到了將操作按鈕添加到操作列以及每個(gè)訂單頁(yè)面內(nèi)的掛鉤……但不是我現(xiàn)在需要的位置.

如果沒(méi)有鉤子,那么另一種方法.

更具體地說(shuō),我附上了一張我所指的地方的圖片

有什么建議嗎?

解決方案

因?yàn)檫@與 Wordpress 相關(guān),而不是特定于 Woocommerce,因?yàn)橛唵沃皇且环N自定義帖子類型.因此以下代碼將在現(xiàn)有字段和按鈕之后的頂部區(qū)域顯示一個(gè)自定義按鈕:

add_action( 'manage_posts_extra_tablenav', 'admin_order_list_top_bar_button', 20, 1 );功能 admin_order_list_top_bar_button( $which ) {全球 $typenow;if ( 'shop_order' === $typenow && 'top' === $which ) {?><div class="alignleft 動(dòng)作自定義"><button type="submit" name="custom_" style="height:32px;"class="button" value=""><?php回聲 __( '自定義', 'woocommerce');?></按鈕>

<?php}}

代碼位于活動(dòng)子主題(或主題)的 function.php 文件中.經(jīng)過(guò)測(cè)試并有效.

<小時(shí)>

繼續(xù):在woocommerce管理訂單頁(yè)面中的自定義按鈕點(diǎn)擊上運(yùn)行一個(gè)功能

I have been struggling to find a hook that allows me to add a button to the top of the woocommerce admin "orders page", but so far unsuccessfully. I have found hooks to add action buttons to the action column, as well as inside each orders page ... but not where I need now.

If there is no hook, then an alternative approach.

More specifically, I attach an image with the place I am referring to

Any suggestions?

解決方案

Because this is related to Wordpress and not specific to Woocommerce as Orders are just a custom post type. so the following code will display a custom button on the top zone just after existing fields and buttons:

add_action( 'manage_posts_extra_tablenav', 'admin_order_list_top_bar_button', 20, 1 );
function admin_order_list_top_bar_button( $which ) {
    global $typenow;

    if ( 'shop_order' === $typenow && 'top' === $which ) {
        ?>
        <div class="alignleft actions custom">
            <button type="submit" name="custom_" style="height:32px;" class="button" value=""><?php
                echo __( 'Custom', 'woocommerce' ); ?></button>
        </div>
        <?php
    }
}

Code goes in function.php file of your active child theme (or theme). Tested and works.


Continuation: Run a function on custom button click in woocommerce admin order page

這篇關(guān)于在woocommerce的管理訂單列表頂部添加一個(gè)按鈕的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產(chǎn)品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產(chǎn)品的總訂單數(shù))
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗(yàn)證問(wèn)題中添加自定義注冊(cè)字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡(jiǎn)單產(chǎn)品中添加一個(gè)將更改價(jià)格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產(chǎn)品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結(jié)帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 亚洲精品1 | 五月婷婷丁香 | 国产精品久久毛片av大全日韩 | 亚洲福利一区二区 | 亚洲精品3| 精品毛片在线观看 | 中文字幕成人av | 91精品国产91久久久久青草 | 国产极品91 | 欧美一区二区三区视频 | 国产欧美在线视频 | 亚洲一区二区三区在线播放 | 9191在线观看 | 亚洲人久久| 亚洲免费一区二区 | 亚洲国产精品久久久久 | 天天爽网站 | 一区二区三区免费观看 | 国产99久久| 最新国产精品 | 欧美中国少妇xxx性高请视频 | 亚洲www | 日日干夜夜草 | av免费成人 | 亚洲成av人片在线观看 | 日韩中文字幕 | 好好的日在线视频 | 亚洲 欧美 综合 | 在线看片国产 | 久久久国产一区二区三区 | 欧美一区二区在线观看 | 久久精品影视 | 国产综合精品 | 天天爽一爽 | 色综合久久天天综合网 | 国产高清一区二区三区 | 日韩三级一区 | 亚洲一区二区精品视频在线观看 | 久久久精品一区 | 精品国产高清一区二区三区 | 伊人在线 |