Limit length of headline in Editor

You could add this function : add_action(‘publish_post’, ‘wpse_105297_max_char’); function wpse_105297_max_char() { global $post; $title = $post->post_title; if (strlen($title) >= 100 ) wp_die( “The max lenght is 100 for title” ); } This will prevent users from using too much longer titles.

WordPress editor, change code wrap (bbpress?)

put this code in functions.php add_action(‘wp_footer’,’ravs_codeTag_fix’); function ravs_codeTag_fix(){ if ( bbp_use_wp_editor() ) : ?> <script> jQuery(document).ready( function() { /* Use <code> instead of backticks for the Code button in the editor */ if ( typeof( edButtons ) !== ‘undefined’ ) { edButtons[110] = new QTags.TagButton( ‘code’, ‘code’, ‘<code>’, ‘</code>’, ‘c’ ); QTags._buttonsInit(); } }); </script> … Read more

Contributor post to be reviewed and published by only one editor

You don’t say how you save the editor -> contributor associations, I assume you store it in a user meta field with key ‘assigned_contrib’ where you save an array of contributors user id. First off all, hide posts to other editors using pre_get_posts hook: add_action(‘pre_get_posts’, ‘hide_posts_to_editors’); function hide_posts_to_editors( $query ) { if ( is_admin() && … Read more

Show editor widgets only on pages that use a specific template?

Solution used: // decide to show or hide the widgets function check_for_using_template(selected){ if (selected == “page-templates/core-front-page.php”){ jQuery(“#page-core-home-1”).show(); jQuery(“#page-core-home-2”).show(); jQuery(“#page-core-home-3”).show(); jQuery(“label[for=”page-core-home-1-hide”]”).show(); jQuery(“label[for=”page-core-home-2-hide”]”).show(); jQuery(“label[for=”page-core-home-3-hide”]”).show(); }else{ jQuery(“#page-core-home-1”).hide(); jQuery(“#page-core-home-2”).hide(); jQuery(“#page-core-home-3”).hide(); jQuery(“label[for=”page-core-home-1-hide”]”).hide(); jQuery(“label[for=”page-core-home-2-hide”]”).hide(); jQuery(“label[for=”page-core-home-3-hide”]”).hide(); } } jQuery(document).ready(function(){ check_for_using_template(jQuery(“#page_template”).val()); jQuery(“#page_template”).change(function(){ check_for_using_template(jQuery(“#page_template”).val()); }) }); Unfortunately, I was unable to successfully utilized the is_page_template, so I used jQuery. Works, though it may not … Read more

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