Disable Full Site Editing (FSE)

add_action( ‘admin_menu’, function() { remove_submenu_page(‘themes.php’, ‘site-editor.php’); }); add_action(‘admin_bar_menu’, function($wp_admin_bar) { $wp_admin_bar->remove_node(‘site-editor’); }, 250); add_action(‘admin_init’, function() { global $pagenow; if (‘site-editor.php’ === $pagenow) { wp_safe_redirect(admin_url()); exit; } });Continue reading

Disable Posts in Admin

add_action( ‘admin_bar_menu’, function ( $wp_admin_bar ) { $wp_admin_bar->remove_node( ‘new-post’ ); }, 100 ); add_action( ‘admin_menu’, function () { remove_menu_page( ‘edit.php’ ); } );Continue reading

Disable the Excerpt in RSS Feeds

// Make sure we display the excerpt in the feed. add_filter( ‘pre_option_rss_use_excerpt’, ‘__return_true’ ); // Remove the excerpt content for feeds. add_filter( ‘the_excerpt_rss’, ‘__return_empty_string’ );Continue reading

Untitled Snippet

i want a on off button that when press each other send logical true if press on and false when press off …i want this for local web page that control IoT thing with microcontroller that writted with c++ and…Continue reading

featured-images-rss-feed

function featuredtoRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '<div>' . get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'featuredtoRSS'); add_filter('the_content_feed', 'featuredtoRSS');Continue reading