Disable Widgets blocks
//Disable Widgets blocks add_filter( ‘use_widgets_block_editor’, ‘__return_false’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
//Disable Widgets blocks add_filter( ‘use_widgets_block_editor’, ‘__return_false’ );Continue reading
// Disable Gutemberg add_filter( ‘use_block_editor_for_post’, ‘__return_false’, 10 );Continue reading
// Remove tags add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
// Add column: Product type add_filter( ‘manage_edit-product_columns’, ‘huk_admin_products_visibility_column’); function huk_admin_products_visibility_column( $columns ){ $columns[‘product_type’] = ‘Type’; return $columns; } add_action( ‘manage_product_posts_custom_column’, ‘huk_admin_products_visibility_column_content’, 20, 2 ); function huk_admin_products_visibility_column_content( $column, $product_id ){ if ( $column == ‘product_type’ ) { $product = wc_get_product( $product_id…Continue reading
function customizeLoginUrl($login_url, $redirect, $force_reauth) { $login_url = site_url(‘store-login’); if(!empty($redirect)) { $login_url = add_query_arg(‘redirect_to’, urlencode($redirect), $login_url); } if($force_reauth) { $login_url = add_query_arg(‘reauth’, ‘1’, $login_url); } return $login_url; } add_filter(‘login_url’, ‘customizeLoginUrl’, 10, 3);Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
// Go to Settings > Media after activating this snippet to set the default featured image. add_action( ‘admin_init’, function() { register_setting( ‘media’, ‘default_featured_image’, ‘absint’ ); add_settings_field( ‘default_featured_image’, __( ‘Default Featured Image’, ‘wpcode-snippet’ ), function() { wp_enqueue_media(); $image_id = get_option( ‘default_featured_image’,…Continue reading
// Hide text using the shortcode like this: [spoiler]hidden text here[/spoiler]. add_shortcode(‘spoiler’, ‘inline_spoiler_shortcode’); function inline_spoiler_shortcode($atts, $content = null) { // Start output buffering ob_start(); // Output the spoiler content with the necessary styles ?>Continue reading