Modify built-in post type properties

This is a pretty late answer, but I was looking to do something similar and figured it out. I wanted to get nav_menu_items into an RSS feed, which required changing the built in nav_menu_item post type property publicly_queryable. Anyway, it was actually pretty simple, here’s a generic function to do it: function change_wp_object() { $object … Read more

Thickbox hacking – removing fields

Tricky but once you understand how WordPress sets the sizes and the fields then the rest is easy: function thickbox_fields($form_fields, $post){ unset( $form_fields[‘post_title’], //disables “Title” field and so forth… $form_fields[‘url’], $form_fields[‘image_alt’], $form_fields[‘post_excerpt’], $form_fields[‘post_content’], $form_fields[‘align’], $form_fields[‘image-size’] ); //create the size input for full only and set display to none $size=”full”; $css_id = “image-size-{$size}-{$post->ID}”; $html = “<div … Read more

How to add filter in “Comments” at the admin panel?

Working Example [Update] From this Answer, by @TheDeadMedic, here’s an adaptation to show only comments from a specific post_id. A link to this action is inserted in the status row. Hello World is the post with ID 53. When clicked it displays only the comments of that post in the URL example.com/wp-admin/edit-comments.php?comment_status=all&hello_world=1: add_action( ‘current_screen’, ‘wpse_72210_comments_exclude_lazy_hook’, … Read more

Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area

You could over-ride the CSS by using the admin_print_scripts admin_head-media-upload-popup and add css to match your needs. This can be done via the functions.php file or by creating a plugin. Here is the code in a plugin format to begin adding style: <?php /* Plugin Name: Some Name Description: Custom Thickbox Styles */ add_action(‘admin_head-media-upload-popup’, ‘custom_tb_styles’); … Read more

Allow admin login at /admin

another option – redirect /admin/ to wp-login.php with a parse_query action hook: function wpa53048_parse_query( $query ){ if( $query->query_vars[‘pagename’] == ‘admin’ ): wp_redirect( wp_login_url() ); exit; endif; } add_action( ‘parse_query’, ‘wpa53048_parse_query’ ); EDIT Well the above apparently only works with certain permalink structures. Here’s another method hooked to parse_request: function wpa53048_parse_request( $query ){ if( $query->request == … Read more

Can I set a default dashboard layout for all users?

Hi @Relequestual: I think what you want is here: Dashboard Widgets API / Advanced: Forcing your widget to the top It doesn’t require you to change code per se, just to add the code like shown in the WordPress Codex to your theme’s functions.php file which is a standard way to customize and/or extend WordPress: … Read more

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