Redirection of users away from wp-admin (but not administrators)

Here’s how I do this: // if admin send them to the dashboard, otherwise leave them on the frontend add_action(‘wp_login’, ‘rt_login_redirect’, 10, 2); //use this action if you want them to be redirected only after login but leave the ability to to to the dashboard later (ie changing profile or pw). add_action( ‘admin_init’, ‘rt_login_redirect’ ); … Read more

How to hide some section in WordPress under Post

On this page in the top right, click the three dots stacked up on each other. At the bottom of the drop down menu, choose “preferences”. In the preferences window on the left column look for “Panels”. Click it and de-select any times you don’t want to show. After you’re done choosing, click the “x” … Read more

Save / Show multi line text in metabox

Why ? You are using sanitize_text_field() in the metabox save function. According to the code referensece it, Checks for invalid UTF-8, Converts single < characters to entities Strips all tags Removes line breaks, tabs, and extra whitespace Strips octets When saving textarea you want to use sanitize_textarea_field() instead. The function is like sanitize_text_field(), but preserves … Read more