Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mehrshaddarzi/79a763deeccd0d841c5018878df0368a to your computer and use it in GitHub Desktop.
Save mehrshaddarzi/79a763deeccd0d841c5018878df0368a to your computer and use it in GitHub Desktop.
Fix AuthrDiv MetaBox for WordPress
<?php
// Replace Authirdiv MetaBox for Increase Edit Page Speed
add_action('do_meta_boxes', 'action_change_author_meta_box');
function action_change_author_meta_box($screen)
{
remove_meta_box('authordiv', $screen, 'core');
add_meta_box('authordiv', 'شناسه نویسنده', 'action_post_author_meta_box', $screen, 'advanced', 'high');
}
function action_post_author_meta_box($post)
{
global $user_ID;
$post_type_object = get_post_type_object($post->post_type);
?>
<label class="screen-reader-text" for="post_author_override">
<?php
/* translators: Hidden accessibility text. */
_e('Author');
?>
</label>
<input name="post_author_override" id="post_author_override"
value="<?php echo empty($post->ID) ? $user_ID : $post->post_author ?>">
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment