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 | |
| // Add this to your functions.php for example... | |
| add_action( 'init', 'rkn_clean_slate__init' ); | |
| /** | |
| * WP has a lot of initial...err...stuff even with a completely blank theme. Let's remove quite a bit | |
| * of that. | |
| * |
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
| // Reduced Example. You'll need to do your imports. | |
| // Add a custom control which contains a Slot | |
| export const exampleAdditionalControl = createHigherOrderComponent( ( BlockEdit ) => { | |
| return ( props ) => { | |
| return ( | |
| <Fragment> | |
| <BlockEdit { ...props } /> |
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
| # Be *very* careful with this. | |
| # In your wp-config.php file | |
| $db_name = getenv( 'WP_CLI_DB_NAME' ); | |
| define( 'DB_NAME', ( !empty( $db_name ) ? $db_name : 'default_global' ) ); # Default often 'wpmu_global' | |
| # Then, when calling wp-cli, if the tables you want are in a shard called prefix_3f | |
| # And you want to grab the comments table for a site with an ID of 10175 | |
| WP_CLI_DB_NAME=prefix_3f; export WP_CLI_DB_NAME; wp db export --tables=wp_10175_comments |
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
| # Scenario: You have a lot (say, 200+) plugins/themes/whatevers that you need to add to a composer setup | |
| # and none of them have composer.json files. Also, none of them are on a git repo anywhere | |
| # Here's how I solved this problem which would have taken days to do manually | |
| # To get git repo in each directory and then push existing code to appropriate repo | |
| for d in ./*/ ; do (cd "$d" && git init); done | |
| for d in ./*/ ; do (cd "$d" && git add .); done | |
| # To allow an empty commit message, don't judge me | |
| git config --global alias.nccommit 'commit -a --allow-empty-message -m ""' |
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: MU plugins subdirectory loader | |
| * Plugin URI: http://code.ctlt.ubc.ca | |
| * Description: Enables the loading of plugins sitting in mu-plugins (as folders) | |
| * Version: 0.1 | |
| * Author: iamfriendly, CTLT | |
| * Author URI: http://ubc.ca/ | |
| * |
NewerOlder