hide default post body field in backend

add_action(‘init’, ‘init_remove_support’,100); function init_remove_support() { $post_type=”your post type”; remove_post_type_support( $post_type, ‘editor’); } Add this to your themes functions.php and it should take care of it. cheers 🙂

Seems that admin_post_{action} does not executing

It’s simply the wrong endpoint. The admin_post_* hook and its admin_post_nopriv_* counterpart is not fired for any admin page with the appropriate action request variable set, it only triggers for requests hitting wp-admin/admin-post.php. Try https://test.local/wp-admin/admin-post.php?action=test instead. I should add that using admin-post.php for handling plugin actions might not be appropriate. If you wanted to return … Read more

Show excerpt if no title in admin view

You can try the following approach using the the_title filter in the edit.php screen: /** * Modify post titles in the edit.php screen. * If the post title is empty, then show max 10 words from the post content instead. */ add_action( ‘load-edit.php’, function() { add_filter( ‘the_title’, function( $title ) { $post = get_post(); if( … Read more

Remove Permalink From Admin Edit Post

I’m running the most up to date version of WordPress which has made changes to how permalinks are displayed and handled. There’s no longer a View Post button. I was able to remove the whole area using the get_sample_permalink_html hook. Just return an empty string: function hide_permalink() { return ”; } add_filter( ‘get_sample_permalink_html’, ‘hide_permalink’ );

Featured image on post edit page not loading over HTTPS

It turned out to be a problem with the uploads directory (not sure what caused it initially). I was able to resolve the issue with the following filter: function fix_ssl( $url ) { if ( is_ssl() ) { if (stripos($url, ‘http://’) === 0) { $url=”https” . substr($url, 4); } } return $url; } function uploadDir($uploads) … Read more

Problem with Settings API: changes are not saved after submit

You need to register the proper settings fields in your PPAdminOptions() and also point the form action to options.php: function PPAdminOptions() { if ( !current_user_can( ‘manage_options’ ) ) { wp_die( __( ‘You do not have sufficient permissions to access this page.’ ) ); } ?> <div class=”wrap”> <h1><?php echo get_admin_page_title(); ?></h1> <form method=”post” action=”options.php”> <?php … Read more

How can I merge two authors?

Delete one account. Upon deletion WP will prompt you with a question of whether to delete all posts by said author or attribute them to another user. Simple as that, wanted functionality is provided by the core.

Redirect from the dashboard to edit.php if wp_is_mobile() is true

The action you’re looking for is auth_redirect, which is before the headers but still recognizes $pagenow to tell which page you’re on: add_action(‘auth_redirect’, ‘the_mobile_boot’); function the_mobile_boot() { global $pagenow; if ( $pagenow == ‘index.php’ && wp_is_mobile() ) { header( ‘Location: ‘ . get_admin_url(null, ‘edit.php’) ); exit; } }