Make Categories and Tags required in admin

The JavaScript function is a bit wrong, its catching the form submit instead of the button click change it to this: function my_publish_admin_hook(){ if(is_admin()) { echo” <script language=\”javascript\” type=\”text/javascript\”> jQuery(document).ready(function() { jQuery(‘#publish’).click(function() { var form_data = jQuery(‘#post’).serializeArray(); form_data = jQuery.param(form_data); var data = { action: ‘my_pre_submit_validation’, security: ‘”;echo wp_create_nonce( ‘pre_publish_validation’ ); echo”‘, form_data: form_data }; … Read more

Get specific color from admin color scheme

Color schemes are registered globally within $_wp_admin_css_colors (see wp-includes/general-template.php for reference). You can return the colors for the current user depending on get_user_meta() for a specific settings page like this: global $pagenow; if ( $pagenow == ‘options-permalink.php’ ) : add_action( ‘admin_notices’, ‘get_current_user_admin_color’ ); function get_current_user_admin_color() { global $_wp_admin_css_colors; $user_admin_color = get_user_meta(get_current_user_id(), ‘admin_color’, true); echo ‘<pre>’; … Read more

Customizing subject in comment notification e-mails

If I understand you correctly you want to change the subject line of the email. The hook of your code only changes the content of the e-mail. There’s a different hook for the subject: add_filter(‘comment_notification_subject’, ‘wpse_228315_comment_notification_subject’); function wpse_228315_comment_notification_subject($subject, $comment_id){ return “New comment”; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)