How can I make it so the Add New Post page has Visibility set to Private by default?

since you’re developing a plug-in, I assume you don’t want to touch any files outside of wp-content/plugins or ../themes for that matter. However, if that’s not the case, follow along: Go to wp-admin/includes/meta-boxes.php and find: $visibility = ‘public’; $visibility_trans = __(‘Public’); Now change it to the obvious: $visibility = ‘private’; $visibility_trans = __(‘Private’); Again, this … Read more

Are drop-in plugins a product of design

It really depends on the developer and how they’ve been trained to use WordPress. In general, I’ve seen two schools of thought: Organic Some developers find a feature in a plugin that they think is really cool. Unfortunately, they aren’t quite sure how to implement it on their own but really want to include the … Read more

Loading external page template and enqueue script from plugin causes 403 forbidden error

Your CODE is fine, the reason you are getting 403 error is because $_SERVER[‘DOCUMENT_ROOT’] returns absolute PATH to your web root, not URL. JavaScript needs to be added as URL. So, you may use Load_Template_Scripts_wpa83855 function in your plugin and then use: wp_enqueue_script( ‘wtd’, plugins_url( ‘/js/wtd.js’ , __FILE__ ) ); CODE to add JavaScript. Note: … Read more

Is it possible to define a template for a custom post type within a plugin independent of the active theme?

You need to use the template_include filter which is the generic filter for all template inclusions. add_filter( ‘template_include’, ‘my_plugin_templates’ ); function my_plugin_templates( $template ) { $post_types = array( ‘project’ ); if ( is_post_type_archive( $post_types ) && ! file_exists( get_stylesheet_directory() . ‘/archive-project.php’ ) ) $template=”path/to/list/template/in/plugin/folder.php”; if ( is_singular( $post_types ) && ! file_exists( get_stylesheet_directory() . ‘/single-project.php’ … Read more

How to share category taxonomy with custom post type (The Event Calendar plugin)

You can use register_taxonomy_for_object_type() to use a taxonomy with a post type, without having to touch the post type registration code, example: function wpa_categories_for_events(){ register_taxonomy_for_object_type( ‘category’, ‘tribe_events’ ); } add_action( ‘init’, ‘wpa_categories_for_events’ ); To have events appear on the category pages, I believe you have to modify the default category queries via pre_get_posts to add … Read more

Schedule WordPress Auto-Updates to only run during business hours

This one is actually surprisingly simple; add this to your wp-config.php file and all automatic updates will be blocked when outside of the specified hours: // Suspend updates when outside of business hours, 9:00 AM to 5:30 PM $updates_suspended = (date(‘Hi’) < 0900 || date(‘Hi’) > 1730); define( ‘AUTOMATIC_UPDATER_DISABLED’, $updates_suspended ); You can also use … Read more