wp search-replace 'http://example.com' 'http://example.test' --export=piranesi.sql --skip-columns=guid --skip-tables=wp_users
This file contains 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
//get post or page slug | |
get_post_field( 'post_name' ) // second parameter of post ID could be added | |
//set automatic updates: https://wordpress.org/support/article/configuring-automatic-background-updates/ |
This file contains 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
//Windows! | |
mysqldump --user=root --all-databases --result-file=name | |
//without result-file (using > filename) output goes to UTF16LE, which mysql cannot load!!! |
This file contains 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
1. Create new column in table wp_terms | |
2. add filter get_terms_orderby which returns 't.<created column>', where created column is created column in wp_terms |
This file contains 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
// get current post categories | |
wp.data.select('core/editor').getEditedPostAttribute('categories') | |
wp.data.select('core/editor').getCurrentPostAttribute('categories') | |
// Get the data of a block | |
wp.data.select( 'core/editor' ).getBlocks()[0] | |
// Update attributes of another block | |
// wp.data.dispatch( 'core/editor' ).updateBlockAttributes( clientID, attributes ) | |
wp.data.dispatch( 'core/editor' ).updateBlockAttributes( '10d88a6d-95d6-4e07-8293-5f59c83a26c0', { heading: 'New Heading' } ) |
New-Item -ItemType SymbolicLink -Path "C:\Wamp.NET\bin\.php" -Target "C:\Wamp.NET\bin\12-php_7.4.18_x64"
-ItemType Junction for junction -ItemType HardLink for hardlink
This file contains 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
// https://stackoverflow.com/questions/54203925/remove-embedded-stylesheet-for-gutenberg-editor-on-the-back-end | |
add_filter( 'block_editor_settings' , 'remove_guten_wrapper_styles' ); | |
public function remove_guten_wrapper_styles( $settings ) { | |
unset($settings['styles'][0]); | |
return $settings; | |
} |