In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| #!/bin/bash | |
| for uid in $(wp user list --field=ID) | |
| do | |
| pass=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32}` | |
| wp user update $uid --user_pass="$pass" | |
| done |
| # For SCSS-Lint v0.31.0 | |
| linters: | |
| BangFormat: | |
| enabled: true | |
| space_before_bang: true | |
| space_after_bang: false | |
| BorderZero: |
| <?php | |
| /* | |
| Plugin Name: JP Mini REST API GET Client | |
| Plugin URI: http://torquemag.io/?p=72403 | |
| Description: A min client for making GET requests via the WordPress REST API. | |
| Version: 0.1.1 | |
| Author: Josh Pollock | |
| Author URI: http://JoshPress.net | |
| License: GPL v2 or later | |
| */ |
| // optical-center | |
| // | |
| // Provide this mixin a padding value that you might normally apply equally to | |
| // top and bottom padding on an element (e.g. so its contents are centered). | |
| // | |
| // It will, instead, give a bit more padding to the bottom and a bit less to the top so | |
| // the element appears optically centered and takes up the same amount of room. | |
| // | |
| // The amount of padding that goes to the bottom vs the top is controlled by a second | |
| // $ratio parameter that defaults to 1.3 |
| <?php | |
| /** | |
| * Dont Update the Theme | |
| * | |
| * If there is a theme in the repo with the same name, this prevents WP from prompting an update. | |
| * | |
| * @since 1.0.0 | |
| * @param array $r Existing request arguments | |
| * @param string $url Request URL | |
| * @return array Amended request arguments |
| // awesome semantic comment | |
| function better_comment($comment, $args, $depth) { | |
| $GLOBALS['comment'] = $comment; | |
| extract($args, EXTR_SKIP); | |
| if ( 'article' == $args['style'] ) { | |
| $tag = 'article'; | |
| $add_below = 'comment'; | |
| } else { |
| <?php | |
| /** | |
| * Plugin Name: Static Templates | |
| * | |
| * If most of your site content is in .php template files, and you're tired of | |
| * creating new pages, assigning them page templates, creating page templates | |
| * then doing it all over again on production, this plugin is for you. | |
| * | |
| * Examples: | |
| * |
| <?php | |
| /** | |
| * Plugin Name: Cpt In Main Query By Meta | |
| * Plugin URI: http://wordpress.stackexchange.com/questions/129236/ | |
| * Description: Allow mixing a post type with another on main query, only if the second match some meta query args | |
| * Author: Giuseppe Mazzapica | |
| * Author URI: http://wordpress.stackexchange.com/users/35541/g-m | |
| */ | |