How to Delete Hidden Files on Mac
Go to the directory –
1 2 3 4 5 6 7 8 9 |
find . -name '*.DS_Store' -type f -delete or, sudo find / -name .DS_Store -delete; |
To remove .git file –
1 2 3 4 5 |
rm -rf .git |
Go to the directory –
1 2 3 4 5 6 7 8 9 |
find . -name '*.DS_Store' -type f -delete or, sudo find / -name .DS_Store -delete; |
To remove .git file –
1 2 3 4 5 |
rm -rf .git |
1. Add the code in the Notice Class like Below –
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
/** * Set transient only when the plugin is activated. * * @since 3.0.2 * @return void */ public static function add_the_transient() { /* Create transient data */ set_transient( 'prefix-activation-notice', true, 5 ); } /** * Admin Notice on Activation. * * @since 3.0.2 * @return void */ public function add_activation_notice() { $itesm = get_posts( array( 'post_type' => 'my_post_type' ) ); if ( count( $items ) > 0 ) { /* Check transient, if available display notice */ if ( get_transient( 'prefix-activation-notice' ) ) { ?> <div class="updated notice is-dismissible"> <p>Thank you for using this plugin! <strong>You are awesome</strong>.</p> </div> <?php /* Delete transient, only display this notice once. */ delete_transient( 'prefix-activation-notice' ); } } } |
2. Include the Notice class file in the Main class of the plugin and register the admin hook in the define_admin_hooks method –
1 2 3 4 5 6 7 |
// Admin Notice. $admin_notice = new My_Plugin_Name_Notice( $this->get_plugin_name(), $this->get_version() ); $this->loader->add_action( 'admin_notices', $admin_notice, 'add_activation_notice' ); |
3. Add the code in the Main plugin […]
Goto to Project directory through the command:
1 2 3 4 5 |
cd drag&drop/your/project/folder/here |
Initialize git:
1 2 3 4 5 |
git init |
Make staging:
1 2 3 4 5 |
git add . |
Commit :
1 2 3 4 5 |
git commit -m "your message" |
Create a repository on Bitbucket and then connect the repository with your local project –
1 2 3 4 5 |
git remote add origin https://shamimmia@bitbucket.org/shamimmia/myprojcet.git |
1 2 3 4 5 |
git push -u origin master |
Check your repository source code on Bitbucket, your project code should […]
Installation The easiest way to get started with PHP_CodeSniffer is to download the Phar files for each of the commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[crayon-5c71108fe0a56459230369 ]# 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 |
[/crayon] Composer If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
1 2 3 4 5 |
[crayon-5c71108fe0a5e245621293 ]composer global require "squizlabs/php_codesniffer=*" |
[/crayon] Make sure you have the composer bin dir in […]
Go to the directory you want to initiate Git and then follow the commands: Initiate the git:
1 2 3 4 5 |
git init |
Remove Git if you have initiated in a wrong place ( Be aware if there is another git in the subdirectory):
1 2 3 4 5 |
rm -rf .git |
To add all the files(including subdirectory) […]
Go to Preferences → Settings and then paste code within {} brackets –
1 2 3 4 5 6 7 8 9 10 |
"editor.minimap.enabled": true, "files.autoSave": "afterDelay", "editor.autoIndent": true, "editor.detectIndentation": true, "editor.fontSize": 14, "editor.wordWrap": "on", |
Thanks!
Just replace the second line’s post type names:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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}", "%post_type={$type}%" ) ); $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET guid = REPLACE(guid, %s, %s) WHERE guid LIKE %s", "/{$old_type}/", "/{$type}/", "%/{$old_type}/%" ) ); } |
Source: https://wordpress.stackexchange.com/questions/97026/how-do-i-safely-change-the-name-of-a-custom-post-type
The following plugins are very useful to WordPress developers. These may help you to make a standard and error-free theme and plugin. Developer. Debug Bar Query Monitor. Theme Check. User Switching. Regenerate Thumbnails. Log Deprecated Notice. RTL Tester, RTL Tester Mirror. Monster Widget. PHP Compatibility. SG Optimizer. […]
In the functions.php file or in your plugin file write the code below –
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
/** * Check if it should load frontend scripts * * @return mixed|void */ private function should_load_scripts() { global $post; $load_scripts = is_active_widget( false, false, 'wpl_logo_carousel_pro_widget_content', true ) || ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'logo-carousel-pro' ) ); return apply_filters( 'logo_carousel_pro_load_scripts', $load_scripts ); } /** * Plugin Scripts and Styles * */ function public_scripts() { if ( $this->should_load_scripts() ) { wp_enqueue_script( 'jquery-isotope-min-js', MY_URL . 'assets/js/jquery.isotope.min.js', array( 'jquery' ), $this->version, false ); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
.selectable{ -webkit-touch-callout: all; /* iOS Safari */ -webkit-user-select: all; /* Safari */ -khtml-user-select: all; /* Konqueror HTML */ -moz-user-select: all; /* Firefox */ -ms-user-select: all; /* Internet Explorer/Edge */ user-select: all; /* Chrome and Opera */ } |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function wpl_lc_add_custom_title( $data, $postarr ) { if($data['post_type'] == 'wpl_lcp_shortcodes') { if(empty($data['post_title'])) { $data['post_title'] = 'Untitled Carousel'; } } return $data; } add_filter('wp_insert_post_data', 'wpl_lc_add_custom_title', 10, 2 ); |
Now use the function
1 2 3 4 5 |
the_title(); |