Override Theme CSS with CSS from a plugin

You can try to dequeue the plugin stylesheet, then re-enqueue the stylesheet with your theme stylesheet added as a dependency which will ensure that the plugin stylesheet is loaded after your theme stylesheet. function custom_style_order() { if ( defined(‘JOB_MANAGER_PLUGIN_URL’) ) { //dequeue the original plugin stylesheet by its handle wp_dequeue_style( ‘wp-job-manager-frontend’ ); //re-enqueue the stylesheet … Read more

How Restrict access to admin dashboard by specific static ip?

By the time admin_init rolls around you should know if you’re doing AJAX or not. If you’re not, then check the IP. Keep in mind that anyone can fake that number. add_action(‘admin_init’, function() { if(defined(‘DOING_AJAX’) && DOING_AJAX) { return; // ignore ajax }; $ip = $_SERVER[ ‘REMOTE_ADDR’ ]; if($ip !== ‘10.0.0.0’) { wp_die(__(‘You are not … Read more

Best Way to Remove WordPress Meta Box based on Post Status

I will suggest to check the $post object in PHP before adding meta box. And add the meta box if status is draft or auto-draft. Consider this code function update_meta_boxes($current_post_type, $post) { $post_types = apply_filters(‘lsw_default_post_types’, LSW_Organize_Drafts::$post_types); remove_meta_box( ‘tagsdiv-lswdrafttype’, $post_types, ‘side’ ); if (isset($post->post_status) && ($post->post_status == ‘draft’ || $post->post_status == ‘auto-draft’)) { add_meta_box(‘lswdrafttype_custom’, __(‘Draft Type’, … Read more

Is revealing just the AUTH_KEY a security issue?

Well, AUTH_KEY and it´s brothers where introduced in WordPress 2.6 to improve safety for logged in users. They are used to encrypt and validate the information in your backend login cookie. While revealing the AUTH_KEY alone might not be a real security issue, you should nevertheless not output/use this anywhere to give less surface for … Read more