Disable Gutenberg Code Editing for Non-Admin Users
add_filter( ‘block_editor_settings_all’, function ( $settings ) { $settings[‘codeEditingEnabled’] = current_user_can( ‘manage_options’ ); return $settings; } );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘block_editor_settings_all’, function ( $settings ) { $settings[‘codeEditingEnabled’] = current_user_can( ‘manage_options’ ); return $settings; } );Continue reading
// Hide admin ‘Screen Options’ tab add_filter(‘screen_options_show_screen’, ‘__return_false’);Continue reading
add_filter( ‘admin_footer_text’, function ( $footer_text ) { // Edit the line below to customize the footer text. $footer_text = ‘Powered by WordPress | WordPress Tutorials: WPBeginner‘; return $footer_text; } );Continue reading
add_action( ‘admin_init’, function () { remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); } );Continue reading
function wpcode_snippet_oembed_defaults( $sizes ) { return array( ‘width’ => 400, ‘height’ => 280, ); } add_filter( ’embed_defaults’, ‘wpcode_snippet_oembed_defaults’ );Continue reading
/** * Prevent publishing posts under a minimum number of words. * * @param int $post_id The id of the post. * @param WP_Post $post The post object. * * @return void */ function wpcode_snippet_publish_min_words( $post_id, $post ) { //…Continue reading
function wpcode_snippet_replace_howdy( $wp_admin_bar ) { // Edit the line below to set what you want the admin bar to display intead of “Howdy,”. $new_howdy = ‘Welcome,’; $my_account = $wp_admin_bar->get_node( ‘my-account’ ); if ( ! isset( $my_account->title ) ) { return;…Continue reading