Shamim

How to Use zsh Alias

It’s very convenient to use an alias instead of full command. So, let’s see how we can make some aliases for git command – To make an alias, open the terminal and write the command below – Write some aliases – alias gs=”git status”alias ga=”git add”alias gm=”git commit -m”alias bci=”brew cask install” Colse and save …

How to Use zsh Alias Read More »

WPCS with Visual Studio Code

Installation The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands: # Download using curl curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar # Or download using wget wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar # Then test the downloaded PHARs php phpcs.phar -h php phpcbf.phar -h Composer

Git Command

Go to the directory you want to initiate Git and then follow the commands: Initiate the git: git init Remove Git if you have initiated in a wrong place ( Be aware if there is another git in the subdirectory): rm -rf .git To add all the files(including subdirectory) to staging step: git add -A

After Installation of Visual Studio Code

Go to Preferences  → Settings and then paste code within {} brackets – “editor.minimap.enabled”: true, “files.autoSave”: “afterDelay”, “editor.autoIndent”: true, “editor.detectIndentation”: true, “editor.fontSize”: 14, “editor.wordWrap”: “on”,   Thanks!    

Change Custom Post Type Name Safely.

Just replace the second line’s post type names: global $wpdb; $old_post_types = array(‘old_type’ => ‘new_type’); foreach ($old_post_types as $old_type=>$type) { $wpdb->query( $wpdb->prepare( “UPDATE {$wpdb->posts} SET post_type = REPLACE(post_type, %s, %s) WHERE post_type LIKE %s”, $old_type, $type, $old_type ) ); $wpdb->query( $wpdb->prepare( “UPDATE {$wpdb->posts} SET guid = REPLACE(guid, %s, %s) WHERE guid LIKE %s”, “post_type={$old_type}”, “post_type={$type}”, …

Change Custom Post Type Name Safely. Read More »