Tag Info

New answers tagged

0

if ( !function_exists( 'wp_toolbar_frontend_admin_menu_links_extras' ) ) { function wp_toolbar_frontend_admin_menu_links_extras($wp_admin_bar) { if ( is_admin() || !is_admin_bar_showing() ) return; if ( !current_user_can('edit_pages') ) return; $wp_admin_bar->add_node(array( 'id' => 'homepage', ...


0

Sometimes i find wordpress can be quite finiky when it comes to referencing files within the plugin. Specifying a full path seems to fix the problem. Try replacing... market_admin/icon.png With... /wp-content/plugins/your-plugin-name-goes-here/your-file-name-goes-here.png


0

To dynamically add menu items you can use WP_Query, specifically get_posts or get_pages. Get pages is more consistent. Here's an example to add all pages to the Pages admin menu. You can change paramaters to exclude, include, orderby, etc in the $args below. To change to a custom post type just change $custom variable to your post type name. ...


3

First, like many things in WordPress, it's not like someone decided "let's make this neat and convenient". It was more like someone slapped it together for something, then it got used more in admin, then it got used a lot in admin, then it became kind of practice to use it for non-admin as well. Or something along these lines. Second, it's not as much what ...


-2

Ok.. so this is the solution, We need to include the file called pluggable.php correctly like this: EDIT: if(!is_admin()) { // Make sure it is not in the admin panel require_once('wp-includes/pluggable.php'); if(current_user_can('manage_options')) { // do stuff here } }


1

Apparently the function is not defined at the point of calling your code ..so wrap the code of yours in to a function and hook it to the init.


0

There are multiple reasons for this. Have you transferred your database? If so, you will see the installation form, instead of the log-in page. Are you getting an error? If so, which one? Are you sure everything on your new server is updated? We need more information in order to help you solve your problem. Please answer the questions above and provide ...


0

Another method is to insert this script into ADMIN HEAD to add anything to TinyMce: http://stackoverflow.com/a/24907894/2165415


0

Post categories are managed by the sub-menu item under "Post" on your site's admin menu. Once logged in to the WP admin, goto Posts > Categories.


0

Here's the full documentation on Iris. There you can see that you can set a "target" for where the actual pallette appears with a DOM element. Here's a sample code: Your JS: $('.color-picker').iris({ target: '#colorpickertarget' }); Your HTML <form> <input class="color-picker" type="text" /> <input type="submit"></form> <div ...


0

You say that you know about show_in_menu parameter for register_post_type() but it seems like you missed the options for this parameter: 'false' - do not display in the admin menu 'true' - display as a top level menu 'some string' - If an existing top level page such as 'tools.php' or 'edit.php?post_type=page', the post type will be placed as a sub menu of ...


0

Mamaduka answer pointed me to the right direction, here is the code for adding classes to the body in the dashboard. /** * Add a class or many to the body in the dashboard */ function add_admin_body_class( $classes ) { return "$classes my_class"; // Or: // return "$classes my_class_1 my_class_2 my_class_3"; } add_filter( 'admin_body_class', ...


0

I've found what I was looking for in wpengineer.com It's made by the $menu as global variable.


0

Set the install to default, all plugins inactive and the default theme. After this step will not reduce the load, analyze the install, like with the plugin "Debug Objects", view the queries tab, there will give you information about slow DB Queries.


0

The most common reason this happens is--plugins that add functionality to the Dashboard, especially columns in post/page info. Try deactivating any plugins that do that, and see what happens. Reactivate them one by one to see if it's a cumulative effect, or a specific plugin.


0

If you post type isn't public (doesn't have single view ) or archive (just because you use a custom query) why just not set it as non public? See register_post_type function parameters - specially public element ?


0

Asking this question gave me an idea. make the single-[posttype].php and inside it just put <?php wp_redirect(get_page_uri(get_page_by_path('your-page-slug')); ?> also works with get_page_by_title() This will direct the preview post and view post link on the admin create post page to the page you want.


0

add_action( 'admin_init', 'do_something_152677' ); function do_something_152677 () { // Global object containing current admin page global $pagenow; // If current page is post.php and post isset than query for its post type // if the post type is 'event' do something if ( 'post.php' === $pagenow && isset($_GET['post']) ...


1

Ok, I revisited this and revised my answer.. But like I said before: the hook you are (trying) to use won't/can't work for the purpose you are aiming for, simply because its only occurrence is in class-wp-posts-list-table.php, which nomen est omen is used to show the post list, the right place should be class-wp-terms-list-table.php. 1. What you ...


0

Welp the filter provided in the Wordpress forums won't seem to work either. I'm on multi-site. // Change the Theme My Login Login Template Header function tml_title_filter( $title, $action ) { if ( 'login' == $action ) return 'Login / Register'; return $title; } add_filter( 'tml_title', 'tml_title_filter', 10, 2 ); Ok, found the relevant ...


0

Navigation menus are technically terms, but there is pretty rich API around theme to abstract that away. wp_get_nav_menus() should do it. :)


0

The WordPress admin menu scrolls with the page if its height exceeds the height of the window (ie. the menu doesn't fit on the screen). If you're adding custom post types then this could well happen, especially on smaller screens. This is expected behaviour. You wouldn't be able to access the items at the bottom of the menu otherwise.



Top 50 recent answers are included