- Create
.octoprint/plugins/filetaband.octoprint/plugins/filetab/templates - Copy
__init__.pyto.octoprint/plugins/filetab - Copy
filetab_tab.jinja2to.octoprint/plugins/filetab/templates - Modify
.octoprint/plugins/config.yamlto includefilesin thedisabledvalues forsidebar(see example) - Optional: Adjust the
orderfortabif you want the "Files" tab to be placed somewhere else than after the regular tab components (see example) - Restart OctoPrint, verify in the log that it discovered the plugin
This file contains hidden or 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 | |
| /** | |
| * Plugin Name: Replace WordPress Dashboard | |
| * Description: Replaces the default WordPress dashboard with a custom one. | |
| * Author: Micah Wood | |
| * Author URI: http://micahwood.me | |
| * Version: 0.1 | |
| * License: GPL3 | |
| */ |
This file contains hidden or 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
| //* Redirect WordPress Logout to Home Page - Anonymous Function | |
| add_action('wp_logout',create_function('','wp_redirect(home_url());exit();')); | |
| // Redirect WordPress Logout to Home Page - Full Function | |
| function logout_redirect_home(){ | |
| wp_safe_redirect(home_url()); | |
| exit; | |
| } | |
| add_action('wp_logout', 'logout_redirect_home'); |
This file contains hidden or 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
| if( !function_exists( "is_subscriber" ) ){ | |
| function is_subscriber() { | |
| // Test if role is subscriber | |
| $cu = wp_get_current_user(); | |
| if (!empty($cu->roles) && is_array($cu->roles)) { | |
| if(in_array('subscriber', $cu->roles)) { | |
| return true; | |
| } | |
| } | |
| return false; |
This file contains hidden or 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(){ | |
| /** | |
| * Create a new MediaLibraryTaxonomyFilter we later will instantiate | |
| */ | |
| var MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({ | |
| id: 'media-attachment-taxonomy-filter', | |
| createFilters: function() { | |
| var filters = {}; | |
| // Formats the 'terms' we've included via wp_localize_script() |
This file contains hidden or 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 Distraction Free Writing Mode and the "Auto Expanding" | |
| * height of the editor based on a list of post types. | |
| * | |
| * @return void | |
| */ | |
| function my_deregister_editor_expand($val, $post_type) | |
| { |
This file contains hidden or 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
| #local prevents openvpn from starting automagically | |
| #local 192.168.2.0 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS | |
| dev tun | |
| proto udp #Some people prefer to use tcp. Don't change it if you don't know. | |
| port 1194 | |
| ca /etc/openvpn/easy-rsa/keys/ca.crt | |
| cert /etc/openvpn/easy-rsa/keys/Server.crt # SWAP WITH YOUR CRT NAME | |
| key /etc/openvpn/easy-rsa/keys/Server.key # SWAP WITH YOUR KEY NAME | |
| dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here! | |
| server 10.8.0.0 255.255.255.0 |
This file contains hidden or 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
| #!/bin/bash | |
| # Default Variable Declarations | |
| DEFAULT="Default.txt" | |
| FILEEXT=".ovpn" | |
| CRT=".crt" | |
| KEY=".3des.key" | |
| CA="ca.crt" | |
| TA="ta.key" | |
These commands will install multiple dummy sites in a WordPress Multisite environment.
I wrote this to easily create an environment to work on https://core.trac.wordpress.org/ticket/15317.
In the terminal, inside your WordPress directory: simply copy, paste, and run the one-line command.
You can also add it to a location available in your $PATH and invoke the script from the shell.
