Disable Login by Email
remove_filter( ‘authenticate’, ‘wp_authenticate_email_password’, 20 );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
remove_filter( ‘authenticate’, ‘wp_authenticate_email_password’, 20 );Continue reading
// Prevent search queries. add_action( ‘parse_query’, function ( $query, $error = true ) { if ( is_search() && ! is_admin() ) { $query->is_search = false; $query->query_vars[‘s’] = false; $query->query[‘s’] = false; if ( true === $error ) { $query->is_404 =…Continue reading
function wpcode_snippet_publish_later_on_feed( $where ) { global $wpdb; if ( is_feed() ) { // Timestamp in WP-format. $now = gmdate( ‘Y-m-d H:i:s’ ); // Number of unit to wait $wait = ’10’; // integer. // Choose time unit. $unit = ‘MINUTE’;…Continue reading
function wpcode_snippets_change_read_more( $read_more, $read_more_text ) { // Edit the line below to add your own “Read More” text. $custom_text = ‘Read the whole post’; $read_more = str_replace( $read_more_text, $custom_text, $read_more ); return $read_more; } add_filter( ‘the_content_more_link’, ‘wpcode_snippets_change_read_more’, 15, 2 );Continue reading
add_filter( ‘excerpt_length’, function ( $length ) { // Number of words to display in the excerpt. return 40; }, 500 );Continue reading
add_action( ‘admin_init’, function () { remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ ); } );Continue reading
/** * Exclude a category or multiple categories from the feeds. * If you want to exclude multiple categories, use a comma-separated list: “-15, -5, -6”. * Make sure to prefix the category id(s) with a minus “-“. * *…Continue reading
add_filter( ‘widget_text’, ‘do_shortcode’ );Continue reading
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
add_filter( ‘xmlrpc_enabled’, ‘__return_false’ );Continue reading