Skip to content

Instantly share code, notes, and snippets.

Musilek Vladislav Musilda

Block or report user

Report or block Musilda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View custom-order-status-for-woocommerce.php
<?php
add_filter( 'woocommerce_register_shop_order_post_statuses', 'musilda_register_custom_order_status' );
function musilda_register_custom_order_status( $order_statuses ){
$order_statuses['wc-custom-status'] = array(
'label' => _x( 'Custom Status', 'Order status', 'woocommerce' ),
'public' => false,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
View default-wordpress-htaccess.txt
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
View htaccess-for-multisite.txt
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
View online-podani-link.php
View media-file-rename.php
<?php
$chars = array (
/** Cyrillics **/
'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G',
'Д' => 'D', 'Е' => 'E', 'Ё' => 'E', 'Ж' => 'Zh',
'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K',
'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O',
'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T',
'У' => 'U', 'Ф' => 'F', 'Х' => 'Kh', 'Ц' => 'Ts',
View add-copy-to-customer-email-woocommerce.php
<?php
add_filter( 'woocommerce_email_recipient_customer_completed_order', 'your_email_recipient_filter_function', 10, 2);
function your_email_recipient_filter_function($recipient, $object) {
$recipient = $recipient . ', me@myemail.com';
return $recipient;
}
add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2);
View hide-subcategory-count.php
<?php
/**
* Hide category product count in product archives
*/
add_filter( 'woocommerce_subcategory_count_html', '__return_false' );
View use-script-debug.php
<?php
// Use minified libraries if SCRIPT_DEBUG is turned off
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'my-script-handle', plugin_dir_url( __FILE__ ) . 'assets/my-file' . $suffix . '.js', array( 'jquery' ) );
View publish-hidden-post-after-one-month.php
<?php
add_action( 'publish_post_after_month', 'musilda_publish_post_after_month' );
function musilda_publish_post_after_month() {
$post_id = 123;
wp_publish_post( $post_id );
}
add_action( 'init', 'musilda_single_event' );
function musilda_single_event(){
wp_schedule_single_event( 30 * DAY_IN_SECONDS, 'publish_post_after_month' );
View delete-all-failed-orders-wp-cron.php
<?php
// Delete all failed orders custom action
add_action( 'musilda_delete_failed_orders', 'musilda_delete_all_failed_orders' );
// This function will run once the 'musilda_delete_failed_orders' is called
function musilda_delete_all_failed_orders() {
$args = array(
'status' => 'failed',
);
You can’t perform that action at this time.