How to Change the Entire WordPress Admin panel Look and Feel?

Here’s a great codex article on the topic of creating administration theme: http://codex.wordpress.org/Creating_Admin_Themes And back to your question, you will want to load different stylesheets for different user roles, so you have to check who the current user is. Pay attention, the check is done using current_user_can() function and checking for administrator is not being … Read more

How to prevent newline from appearing in shortcode?

The <br> tag is coming from wpautop(), which is one of a number of display filters added to the content via wp-includes/default-filters.php: // Display filters add_filter( ‘the_content’, ‘wptexturize’ ); add_filter( ‘the_content’, ‘convert_smilies’, 20 ); add_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘shortcode_unautop’ ); add_filter( ‘the_content’, ‘prepend_attachment’ ); add_filter( ‘the_content’, ‘wp_make_content_images_responsive’ ); … // Shortcodes add_filter( ‘the_content’, … Read more

How do I “replace a function via plugins” in WordPress?

You’re on the right track with creating the plugin. All your assumptions are correct. To avoid errors on activation you’ll want to wrap the functions that you are redefining in function_exists blocks, as on activation those functions will already be defined: if ( ! function_exists( ‘wp_hash_password’ ) ) : function wp_hash_password( $password ) { return … Read more

How to control output of custom post type without modifying theme?

There’re two very often forgotten action ref arrays: loop_start/_end(). Just turn on output buffering and you’re ready to go. add_action( ‘loop_start’, ‘wpse75307_plugin_loop’ ); add_action( ‘loop_end’, ‘wpse75307_plugin_loop’ ); /** * Callback function triggered during: * + ‘loop_start’/`have_posts()` after the last post gets rendered * + ‘loop_end’/`the_post()` before the 1st post gets rendered * @param object \WP_Query … Read more

What is the difference between using global $current_screen and get_current_screen()?

In your example, there is currently no difference. You get the same object, if there is one. Try it: global $current_screen; $current_screen->foo = 1; $screen = get_current_screen(); $screen->foo = 2; echo ‘$current_screen->foo: ‘ . $current_screen->foo; // 2! The simple reason: objects are not passed as a copy in PHP. But: global variables are really bad, … Read more

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