Change page title in admin area

add_filter(‘admin_title’, ‘my_admin_title’, 10, 2); function my_admin_title($admin_title, $title) { return get_bloginfo(‘name’).’ • ‘.$title; } You could also do a str_replace on $admin_title to remove “— WordPress” and change “‹”. Look at the top of the wp-admin/admin-header.php file to see what is going on by default.

Unwanted media library URLs in posts?

This thing you are saying is unwanted is just normal functionality under WordPress and it cannot be removed. However there are things you can do to point the unwanted URL to something more usefull. Here is a forum post on this issue with some interesting fixes and a description on what is happening: Attachments …

Read more

Custom columns for taxonomy list table

The manage_{TAXONOMY}_custom_column filter hook passes 3 arguments: $content $column_name $term_id So try this: function add_book_place_column_content($content,$column_name,$term_id){ $term= get_term($term_id, ‘book_place’); switch ($column_name) { case ‘foo’: //do your stuff here with $term or $term_id $content=”test”; break; default: break; } return $content; } add_filter(‘manage_book_place_custom_column’, ‘add_book_place_column_content’,10,3);

How to correctly add Javascript in functions.php

Your $scr in your wp_register_script() function is wrong. Given that your functions.php is inside your plugin, and your removeArrows.js is in the root of your plugin, your $scr should look like this plugins_url( ‘/removeArrows.js’ , __FILE__ ) Another point of note, it is always good practice to load your scripts and styles last. This will …

Read more

How to remove entire admin menu?

The correct hook to use is admin_menu and then create a function to remove the menus you want to remove. The following 2 functions remove all the menus. add_action( ‘admin_menu’, ‘remove_admin_menus’ ); add_action( ‘admin_menu’, ‘remove_admin_submenus’ ); //Remove top level admin menus function remove_admin_menus() { remove_menu_page( ‘edit-comments.php’ ); remove_menu_page( ‘link-manager.php’ ); remove_menu_page( ‘tools.php’ ); remove_menu_page( ‘plugins.php’ …

Read more

Why use wp_send_json() over echo json_encode()?

wp_send_json() handles all parts of returning content in an AJAX call. First off, it sets the content type of the returned content to application/json with the proper charset. Secondly, it automatically calls wp_die() after sending the JSON result, which is necessary in an AJAX call in WordPress. You could consider using wp_send_json_success() for successful requests …

Read more

WordPress localhost site redirect to live site

Try following If there are caching plugins installed like W3 total cache. Then purge cache first. Or may be disable them for time being Perform Search and Replace in the database for Old Site URL. You can Use this Plugin Reset Permalinks ( Dashboard >> Settings >> Permalinks ) Last but not the least. Clear …

Read more