How can I add a set featured image function to a theme that doesn’t already have it built in?

You can add this line to your functions.php file to add the post thumbnail option to all post types: add_theme_support( ‘post-thumbnails’ ); If you want it for only one post type, you pass an array of post type names as second argument: add_theme_support( ‘post-thumbnails’, array( ‘post’ ) ); #shown in posts only To display the … Read more

Best way to filter featured image text for a custom post type?

Regardless if you go the PHP or jQuery route, I suggest you set up your filters or enqueue your Javascript in the admin_head-post[-new].php or admin_print_scripts-post[-new].php hook. There you can be sure that the global variable $post_type is set, and can check whether it is slide. Since the post thumbnail code is called after these hooks, … Read more

Hide/Show only specific categories in wp-admin new-post.php

Something like this should do it. Replace wpse_77670_getPermittedCategories() with however you select the array of permitted categories, and ‘your_custom_category’ with whatever your custom taxonomy is for your custom post type. /** * filter terms checklist args to restrict which categories a user can specify * @param array $args arguments for function get_terms() * @param array … Read more

How to make custom bulk actions work on the media/upload page?

If you want to use your code, try this: If you want to check if the medias are attachments, you can try to use $_REQUEST[‘detached’] add_action( ‘load-upload.php’, ‘export_media_test’ ); function export_media_test() { if ( ! isset( $_REQUEST[‘action’] ) ) return; echo ‘Export Media’; if ( isset( $_REQUEST[‘detached’] ) ) { die( ‘No attachments’ ); } … Read more

How to create sub menu with a URL parameter?

You’d have to manipulate the global $submenu and modify the link in it. Or use jQuery. The following example adds a submenu in the Dashboard menu and changes the destination link just after. The submenu page will dump the contents of the global var. add_action( ‘admin_menu’, function() { add_submenu_page( ‘index.php’, ‘Sandbox Options’, ‘Options’, ‘administrator’, ‘sandbox_options’, … Read more

How to remove the site health dashboard widget?

The following snippet removes the registered site health dashboard widget from the dashboard. Add the code to your plugin or functions.php file: add_action(‘wp_dashboard_setup’, ‘remove_site_health_dashboard_widget’); function remove_site_health_dashboard_widget() { remove_meta_box(‘dashboard_site_health’, ‘dashboard’, ‘normal’); }

Making a client area in WordPress – Any good tutorials or plugins?

First, for invoicing/billing use the WP Invoice plugin: http://wordpress.org/extend/plugins/wp-invoice/ The “members” plugin may also be useful: http://wordpress.org/extend/plugins/members/ For a custom redirect, to send them to custom pages rather than just the admin panel use: http://wordpress.org/extend/plugins/peters-login-redirect/ If you had them register, greet them with a custom welcome message on the page they log-in to using this … Read more