Get the user type of an author

One way would be to use the get_the_author_meta function and pass it user_level More info on the function: http://codex.wordpress.org/Function_Reference/get_the_author_meta Then, see this chart to convert user levels to roles (unless you have created custom roles): http://codex.wordpress.org/Roles_and_Capabilities#User_Level_to_Role_Conversion Example code $level = get_the_author_meta(‘user_level’); if($level >= 8) { // Is admin // do something } else if ($level … Read more

Add javascript when post is published

To enqueue scripts on the admin side, you should use the admin_enqueue_scripts hook. In this callback I check that are on the appropriate page (i.e. the page where you edit posts / post types), using the passed $hook argument. Optionally you can check if the post is of a specific type (in case this is … Read more

how to enable different number of revisions for different blogs when using WPMU?

No, wp-config.php can have granular constants. Like this: if ( ‘example.com’ == $_SERVER[‘HTTP_HOST’] ) { define( ‘WP_POST_REVISIONS’, 1 ); } elseif ( ‘blog1.example.com’ == $_SERVER[‘HTTP_HOST’] ) { define( ‘WP_POST_REVISIONS’, 5 ); } elseif ( ‘blog2.example.com’ == $_SERVER[‘HTTP_HOST’] ) { define( ‘WP_POST_REVISIONS’, 10 ); }

Why is our post editor stuck at cols=40?

You can use the following (mu-)plugin to change the height. You just need to adjust the height as you need it. <?php defined( ‘ABSPATH’ ) OR exit; /** * Plugin Name: (#83974) WCM TinyMCE height */ add_filter( ‘the_editor’, ‘wpse83974_tinymce_height’ ); function wpse83974_tinymce_height( $html ) { return str_replace( array( ‘cols=”40″‘, ‘ style=”height: 360’ ) ,array( ‘cols=”400″‘, … Read more

Search posts by post author name

This line is likely the issue – $where = ” AND ( atl_posts.post_author = {$authorID} ) “; You are replacing the contents of $where, not changing it. You have to use . before = – $where.= ” AND ( atl_posts.post_author = {$authorID} ) “;

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