require/include php file in add_menu()

You can turn on output buffering, include (and evaluate) the PHP file, and save the output (of the evaluated code) in a variable, like so: ob_start(); include ‘docs/row_layouts.php’; $html = ob_get_clean(); Then just use ‘html’ => $html in the meta array when you call the $admin_bar->add_menu(). Or if you don’t need to evaluate any PHP … Read more

how to hide top bar button on /wp-admin/edit.php

So a straight forward way to do this is to use CSS if you want to pick out a few items to not display on the admin. These items you’ve provided look like the standard menu items with a different style attached, though I can’t be sure. If not, you’ll need to provide more clearer … Read more

Modify Contextual Help

If you want to remove some or all (default) help tabs, then you could do something like this inside your function. $current_screen = get_current_screen(); $white_list = array( ‘overview-link’, // If you want to keep default some tab title and content ); if ( $current_tabs = $current_screen->get_help_tabs() ) { foreach ($current_tabs as $tab_key => $tab_config) { … Read more

Weird white space in admin area

Well that didn’t take long to figure out.. I’ve dealt with this before, but could never figure it out. Obfuscated code. Impulsively I deleted the directory, but they’ll be back. If you see these weird random PHP files, your site needs to be scrubbed and relaunched from backups. Preferably XML data files with no code. … Read more

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