<?php echo '<pre>'; echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL; // Download file file_put_contents('wp.zip', file_get_contents('https://wordpress.org/latest.zip')); $zip = new ZipArchive();…
Inline JS and CSS in WordPress for Backend and Gutenberg
Disable „stick to the top of the blog“ and „pending review“ in Gutenberg sidebar
//hide stick to the top of the blog checkbox
function inline_custom_admin_style() {
echo '<style>
.editor-post-author__panel {
margin-top:-50px !important;
}
.post-author-selector{background: white;}
</style>';
}
add_action('admin_head', 'inline_custom_admin_style');
Set the „top toolbar“ option in gutenberg by default
function jba_enable_editor_fixedToolbar_by_default() {
$script = "window.onload = function() { const isfixedToolbar = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fixedToolbar' ); if ( !isfixedToolbar ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fixedToolbar' ); } }";
wp_add_inline_script( 'wp-blocks', $script );
}
add_action( 'enqueue_block_editor_assets', 'jba_enable_editor_fixedToolbar_by_default' );
