How to modify admin headers

Not a direct answer, but: for simple data exports on the admin side, I generally just use the AJAX API. Set up an AJAX handler for your export: /** * export from admin */ function wpse_126508_export() { header(‘Content-Type: text/xml; charset=utf-8’); header(‘Content-Description: File Transfer’); header(‘Content-Disposition: attachment; filename=wpse_126508_export.xml’); $xml = new XMLWriter(); $xml->openURI(‘php://output’); $xml->startDocument(‘1.0’, ‘UTF-8’); $xml->startElement(‘wpse_126508_export’); // … Read more

Add menu item to edit specific page

You’ve almost answered your own question. Just pass the URL as the $menu_slug to add_menu_page: add_menu_page( null, // not an actual page, so title is irrelevant ‘Menu Item Name’, ‘edit_posts’, // or whatever capability required for this object ‘/post.php?post=42&action=edit’, null, ”, 6 ); The caveat is that when you visit this menu item, the actual … Read more

How to change all “Post” texts in dahboard into “Article”?

You can update the override the post labels: function wpse163462_rename_menu_post_to_article() { global $menu; global $submenu; $menu[5][0] = ‘Articles’; $submenu[‘edit.php’][5][0] = ‘Articles’; $submenu[‘edit.php’][10][0] = ‘Add Articles’; echo ”; } function wpse163462_rename_post_to_article() { global $wp_post_types; $labels = &$wp_post_types[‘post’]->labels; $labels->name=”Articles”; $labels->singular_name=”Article”; $labels->add_new = ‘Add Article’; $labels->add_new_item = ‘Add Article’; $labels->edit_item = ‘Edit Article’; $labels->new_item = ‘Article’; $labels->view_item = … Read more

Bind custom role to admin page

So for your information (based on add_menu_page) i am suggesting you to check the codex of add_menu_page in wordpress http://codex.wordpress.org/Function_Reference/add_menu_page if you look into the parameter of add_menu_page third one is for $capability just change it below code manage_options to manage_wpse_173073 (or any name you want) and just assign that capability to your custom role. … Read more

WordPress Brute Force Prevention

Rather than blacklist logins, why not whitelist your own IP (example 12.345.67.891 below; or a range) for wp-login.php and in wp-admin for logins and administration? (No plugin needed). A whitelist will block everyone else except you from login. See http://httpd.apache.org/docs/2.4/howto/access.html in the .htaccess in the wp-admin folder: Options All -Indexes order deny,allow deny from all … Read more

How to activate the dashboard

Go to your domain and type /wp-admin and log on with your username and password. http//www.yourdomain.com/wp-admin Then go to appearance, themes and then activate your theme. If it’s not already installed you can either drag your theme to the wp-content/themes folder or install it from within the themes area.

How do I diagnose a plugin resource 404?

I have the feeling that either those files don’t exist or the location of the file has changed. Go into /plugins/wp-greet-box/js/ and see if you can locate the functions.js and the jquery.js. If the files are not there then they must have been deleted and that is why it’s throwing the 404 (Not found). EDIT: … Read more

Output the admin menu_position for each item

I’ve just finished a plugin that (amongst other things) allows the reordering of the admin menu. The way the admin menu is constructed is not the easiest thing to work with at all. That being said have a look at the admin_menu hook. You can access the global $menu array at that point – which … Read more

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