Limit Revisions
/** * Limit WordPress revisions to 5 for all post types. */ add_filter(‘wp_revisions_to_keep’, function ($num, $post) { return 5; }, 10, 2);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * Limit WordPress revisions to 5 for all post types. */ add_filter(‘wp_revisions_to_keep’, function ($num, $post) { return 5; }, 10, 2);Continue reading
Totally fair, Warren — this part trips up a lot of people. Let’s break it down clean and clear: 🧠 The Two Parts of GTM Code 1. The Short Code This is your GTM Container ID — it looks like:…Continue reading
/** * Hindra åtkomst till /wp-admin för prenumeranter */ add_action( ‘admin_init’, function() { if ( is_user_logged_in() ) { $user = wp_get_current_user(); if ( in_array( ‘subscriber’, (array) $user->roles, true ) ) { if ( ! ( defined( ‘DOING_AJAX’ ) && DOING_AJAX…Continue reading
/** * 2) Dölj admin-baren för prenumeranter */ add_filter( ‘show_admin_bar’, function( $show ) { if ( is_user_logged_in() ) { $user = wp_get_current_user(); if ( in_array( ‘subscriber’, (array) $user->roles, true ) ) { return false; } } return $show; });Continue reading
/** * 1) Omdirigera prenumeranter till startsidan efter inloggning */ add_filter( ‘login_redirect’, function( $redirect_to, $requested_redirect_to, $user ) { if ( $user instanceof WP_User && in_array( ‘subscriber’, (array) $user->roles, true ) ) { return home_url(‘/’); } return $redirect_to; }, 10, 3…Continue reading
#== Custom Separator for Data Manipulation || PFE ==# function data_manipulation_separator() { return ‘ — ‘; } add_filter( ‘adt_field_manipulation_separator’, ‘data_manipulation_separator’ );Continue reading