Conditions for admin get_current_screen action parent_file edit.php?post_type=page

You can use get_current_screen() to get details about the current screen. We want to hook on or after load-edit.php because get_current_screen() is defined just prior to this hook. By hooking into load-edit.php, we guarantee that this code will only fire on the edit.php page. Then we check the current screen to see if the post … Read more

how can i add extra parameter to edit post link?

The get_edit_post_link filter lets you modify that value. This is applied any time get_edit_post_link function is called, which admin uses, as well as themes on the front end. function wpd_edit_post_link_filter( $link, $post_ID, $context ){ if( ‘room’ == get_post_type( $post_ID ) ){ $link = $link . ‘&fubar=baz’; } return $link; } add_filter( ‘get_edit_post_link’, ‘wpd_edit_post_link_filter’, 10, 3 … Read more

Post/Page editor loads twice

No, this is not a normal behavior. Try to set default editor, and that should fix it. If it does not fix the problem, you may have one of your plugins causing it. Deactivate all plugins, and then reactivate them, one by one, until you find one, which is responsible. Code below goes to functions.php: … Read more

How can I (for the long term) style the classic editor’s TEXTAREA?

I think I am following your question. You can enqueue a stylesheet only for the admin area and then add your styles to that. The following code will enqueue a stylesheet in a “css” folder in the root of your theme. function my_admin_styles(){ wp_enqueue_style( ‘admin_css’, get_stylesheet_directory_uri() . ‘/css/admin-styles.css’, array(), filemtime( get_stylesheet_directory() . ‘/css/admin-styles.css’) ); } … Read more

How to hide the Text Color icon from Visual Editor of WordPress Post Editor from Users other than Admins?

This should work if you add it to your functions.php file. It targets the buttons on the second row in your text editor. To target the first row, use the mce_buttons hook instead of mce_buttons_2. /** * Removes text color button from tiny mce editor */ add_filter( ‘mce_buttons_2’, ‘remove_tiny_mce_buttons’); function remove_tiny_mce_buttons( $buttons ) { if … Read more

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