Type: php
Relocate Uploads / Media Library to mirachem.com/m folder
define( ‘UPLOADS’, ”.’m’ );Continue reading
Changes the default recipe author name in Tasty Recipes
add_filter( ‘tasty_recipes_default_author_name’, function() { return ‘Your New Default Author Name’; } );Continue reading
Add a “Rate this recipe” Tasty Recipes quick link
add_filter( ‘tasty_recipes_quick_links’, function( $links ) { $links[] = ‘Rate this Recipe‘; return $links; } );Continue reading
Prevent Tasty Links inside Tasty Recipes
add_action( ‘init’, function() { // Remove Tasty Links from Tasty Recipes description, notes, ingredients, and instructions. remove_filter( ‘tasty_recipes_the_content’, array( ‘Tasty_LinksIntegrationsTasty_Recipes’, ‘filter_tasty_recipes_content’ ) ); });Continue reading
Hide nutrition facts for Tasty Recipes printing
add_filter( ‘tasty_recipes_print_view_buttons’, ‘wpt_hide_nutrition_button’ ); function wpt_hide_nutrition_button( $buttons ) { unset( $buttons[‘nutrition’] ); return $buttons; }Continue reading
pdf page count
Require 2FA for all users
add_filter( ‘two_factor_enabled_providers_for_user’, function( $providers ) { if ( empty( $providers ) && class_exists( ‘Two_Factor_Email’ ) ) { $providers[] = ‘Two_Factor_Email’; } return $providers; } );Continue reading
Student Post Existence Check
// Check if the current user already has a “student” post $args = array( ‘author’ => get_current_user_id(), ‘post_type’ => ‘student’, ‘posts_per_page’ => -1, // Retrieve all posts ‘order’ => ‘DESC’, // Order by most recent post first ); $student_posts =…Continue reading
Allow ICO files upload
add_filter( ‘upload_mimes’, function ( $mimes ) { // By default, only administrator users are allowed to add ICO files. // To enable more user types edit or comment the lines below but beware of // the security risks if you…Continue reading