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

API to filter new user registration $POST data?

Well once I looked into it, it is quite simple. $_POST is global variable and contains all the POSTed data that was sent from the form. For example, to email yourself all the posted data submitted in the form, you you could use something like this: function email_me_post_data() { global $_POST; $msg = print_r($_POST, true); … Read more

How to move the code injected by a plugin below the default WordPress code? [closed]

Scripts must be inserted using wp_enqueue_script. This function allows you to define dependencies, so you can be sure they load after jquery. Like this: wp_enqueue_script(‘your-script-name’, ‘full-path-to-your-script’, array(‘jquery’)); Even better, register your script first. Anyway, look in the plugin code where it enqueues user scripts and make sure it adds the jquery dependency. Or, perhaps better, … Read more