This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* When you have many orders, searching in the WooCommerce admin section will be very slow. | |
* The reason is that WooCommerce looks for the search term in many fields of the order | |
* (such as billing address and shipping address). | |
* With the following code, you can search only the metas you need. | |
* For me, only the first name and last name were important. | |
* Of course, the search will still be done based on the phone number, email and order number, | |
* and there will be no problem in the main function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change views on the edit product screen. | |
* | |
* @param array $views Array of views. | |
* @return array | |
*/ | |
function ywp_product_views( $views ) { | |
global $wp_query; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ywp_reading_time() { | |
global $post; | |
if ( empty( $post ) ) { | |
$post = get_the_ID(); | |
} | |
if ( empty( $post ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create a list of all available payment methods, even inactive ones | |
* | |
* @return void | |
*/ | |
function ywp_filter_orders_by_payment_method() { | |
global $typenow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* prerequisites: | |
* You must define products as variables. One variation for single purchase and one variation for box purchase. | |
* | |
* You can change the name of the box purchase attribute in the code below. (the 'box-capacity' variable). | |
* For each variation, you set one equal to the number 1 for the other variation equal to the number in each box. | |
* | |
* Copy the following code into the functions.php file of the theme/child theme. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param $query | |
* @param $product_id | |
* @param $exclude_order_id | |
* | |
* @return mixed|string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change Default Comment Login link to UM Login Page | |
*/ | |
if ( ! function_exists( 'ywp_um_change_login_link' ) ) { | |
function ywp_um_change_login_link( $defaults ) { | |
if ( class_exists( 'UM' ) ) { | |
$defaults['must_log_in'] = '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), um_get_core_page( 'login' ) ) . '</p>'; | |
return $defaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined( 'ABSPATH' ) || exit; | |
/** | |
* | |
*/ | |
class YWP_Walker_CategoryDropdown extends Walker { | |
/** | |
* What the class handles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param $columns | |
* | |
* @return mixed | |
*/ | |
function ywp_add_billing_phone_column_in_review_list( $columns ): mixed { | |
$columns['billing_phone'] = __( 'Billing Phone' ); |
NewerOlder