开始新搜索?
如果未找到相关内容,请试试再次搜索!
-
作者搜索结果
-
WooCommerce v3.3之后 对订单列表做了大幅度的更动,其中有一项是把客户留的订单备注栏位取消了,这会对订单量大的商店在管理上增加困扰,但我们还可利用短代码快速的把它加回来。
将下列代码加入主题的
functions.php
存档即可。add_filter( 'manage_edit-shop_order_columns', 'custom_shop_order_column', 90 ); function custom_shop_order_column( $columns ) { $ordered_columns = array(); foreach( $columns as $key => $column ){ $ordered_columns[$key] = $column; if( 'order_date' == $key ){ $ordered_columns['order_notes'] = __( 'Notes', 'woocommerce'); } } return $ordered_columns; } add_action( 'manage_shop_order_posts_custom_column' , 'custom_shop_order_list_column_content', 10, 1 ); function custom_shop_order_list_column_content( $column ) { global $post, $the_order; $customer_note = $post->post_excerpt; if ( $column == 'order_notes' ) { if ( $the_order->get_customer_note() ) { echo '<span class="note-on customer tips" data-tip="' . wc_sanitize_tooltip( $the_order->get_customer_note() ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>'; } if ( $post->comment_count ) { $latest_notes = wc_get_order_notes( array( 'order_id' => $post->ID, 'limit' => 1, 'orderby' => 'date_created_gmt', ) ); $latest_note = current( $latest_notes ); if ( isset( $latest_note->content ) && 1 == $post->comment_count ) { echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $latest_note->content ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>'; } elseif ( isset( $latest_note->content ) ) { // translators: %d: notes count echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $latest_note->content . '<br/><small style="display:block">' . sprintf( _n( 'Plus %d other note', 'Plus %d other notes', ( $post->comment_count - 1 ), 'woocommerce' ), $post->comment_count - 1 ) . '</small>' ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>'; } else { // translators: %d: notes count echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( sprintf( _n( '%d note', '%d notes', $post->comment_count, 'woocommerce' ), $post->comment_count ) ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>'; } } } } // Set Here the WooCommerce icon for your action button add_action( 'admin_head', 'add_custom_order_status_actions_button_css' ); function add_custom_order_status_actions_button_css() { echo '<style> td.order_notes > .note-on { display: inline-block !important;} span.note-on.customer { margin-right: 4px !important;} span.note-on.customer::after { font-family: woocommerce !important; content: "\e026" !important;} </style>'; }
最后更新 3 年, 11 月 前 #24288人们称之为WP All Import 神奇的原因 - 它适用于任何XML或CSV文件,导入图像,并可以轻松地将数据导入到插件和主题字段或其他任何你需要的地方。找到主题的 /wp-content/themes/knowall/inc/support-helpers.php 文件,大约在 20 行
原版的代码如下:
function ht_knowall_activation_reminder(){ $screen = get_current_screen(); $theme_license_status = get_option( 'knowall_license_key_status', false ); $hide_knowall_activation_reminder = apply_filters( 'hide_knowall_activation_reminder', false ); if( is_a($screen, 'WP_Screen') && 'appearance_page_knowall-license' != $screen->id && 'appearance_page_knowall-welcome' != $screen->id && 'valid' != $theme_license_status && !$hide_knowall_activation_reminder ): ?> <div class="notice notice-info is-dismissible"> <p> <?php _e( 'Your KnowAll key is not activated, you could be missing important updates and support.', 'knowall' ); ?> <a href="<?php echo admin_url( 'themes.php?page=knowall-license' ); ?>"><?php _e( 'Activate Now', 'knowall' ); ?></a> </p> </div> <?php endif; }
要去掉后台的提示信息,修改为:
function ht_knowall_activation_reminder(){ $screen = get_current_screen(); $theme_license_status = get_option( 'knowall_license_key_status', true ); $hide_knowall_activation_reminder = apply_filters( 'hide_knowall_activation_reminder', true ); if( is_a($screen, 'WP_Screen') && 'appearance_page_knowall-license' != $screen->id && 'appearance_page_knowall-welcome' != $screen->id && 'valid' != $theme_license_status && !$hide_knowall_activation_reminder ): ?> <div class="notice notice-info is-dismissible"> <p> <?php _e( 'Your KnowAll key is not activated, you could be missing important updates and support.', 'knowall' ); ?> <a href="<?php echo admin_url( 'themes.php?page=knowall-license' ); ?>"><?php _e( 'Activate Now', 'knowall' ); ?></a> </p> </div> <?php endif; }
这样就不会再有了。
此回复已被标记为私有,🔒 仅楼主及管理员可见。#43话题: 39. 安装 WordPress 后,需要做的十件最重要的事情 论坛内 疑难杂症 |WordPress 初学者指南教程,是由 WPBeginner 录制出品的,适合对 WordPress 还不太熟悉的朋友,本教程语言为英语,不懂的可以跟帖告知。
39.安装WordPress后,需要做的十件最重要的事情 Top 10 Most Important Things To Do After Installing WordPress整套教程合集下载地址:
-
作者搜索结果