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 | |
/** | |
* Hooked into `intermediate_image_sizes` filter hook. | |
* | |
* @param array $image_sizes | |
* | |
* @return array | |
*/ | |
function ss_unset_intermediate_image_sizes( $image_sizes ) { | |
$bad_sizes = array( |
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 | |
/** | |
* @author Filipe Seabra | |
* @link https://wp-cli.org/ | |
* @version 1.0.0 | |
* | |
* Put this file in the root directory of your WordPress installation. | |
* | |
* You make better usage of this file by using WP CLI (link above). Command line example: | |
* `wp eval-file wp-sweep-uploads.php`. |
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
(function ($) { | |
let stylesheet = '', | |
html = ''; | |
function get_colors(parent) { | |
let colors = {}; | |
colors.lighter = String($(".color-shade:nth-child(5)", parent).data("color")); |
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 | |
/** | |
* Rename file name while doing upload. | |
* | |
* @param string $filename The name of the file being uploaded | |
* | |
* @return string The sanitized string | |
*/ | |
function my_custom_file_name( $filename ) { | |
$info = pathinfo( $filename ); |
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 | |
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); |
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 | |
/** | |
* Sobrescrever assunto dos emails transacionais do WooCommerce. | |
* | |
* Tags possíveis para usar como parâmetro em add_filter(): | |
* | |
* woocommerce_email_subject_new_order = Novo pedido | |
* woocommerce_email_subject_customer_processing_order = Processando pedido | |
* woocommerce_email_subject_customer_completed_order = Pedido concluído | |
* woocommerce_email_subject_customer_invoice = Fatura do cliente |
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 | |
/** | |
* Disable action that sends e-mail to customer, warning that his/her order is processing, | |
* as this is not true, because when the status changes from pending to on-hold, | |
* the order is not processing yet. | |
* | |
* @return void | |
*/ | |
function manipulate_woocommerce_email_sending($email_class){ | |
remove_action('woocommerce_order_status_pending_to_on-hold_notification', array($email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger')); |
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 | |
/** | |
* Add custom value to custom column in admin on page that lists the shop_order post type. | |
* | |
* @param string $column This is the column id/key. | |
*/ | |
function add_custom_column_value_to_shop_order( $column ) { | |
global $post; | |
if ( $column == 'software_key' ) { |
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 | |
/** | |
* Add custom column to shop_order post type | |
* | |
* @param $columns array Array of all registered columns. | |
* | |
* @return array $new_columns | |
*/ | |
function add_custom_column_to_shop_order( $columns ) { | |
$new_columns = is_array( $columns ) ? $columns : array(); |
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 WooCommerce shortcode tag name. | |
* | |
* SEE EXISTING TAGS BELOW: | |
* | |
* product | |
* product_page | |
* product_category | |
* product_categories |
NewerOlder