Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Jason Wong

    (@eljkmw)

    Never mind. I figured out from another plugin’s thread, and modified it from there.
    Here’s my snippet that was inserted into functions.php.

    if ( is_plugin_active( 'aftership-woocommerce-tracking/aftership.php' ) ) {
    
    	// Remove AfterShip's WordPress API Key
    	function as_remove_wp_api_key() {
    	?>
    		<script type="text/javascript">
    		jQuery(function(){
    			var AfterShipWpAPIKeyTable = jQuery('#aftership_wp_generate_api_key').parents('table');
    			if(AfterShipWpAPIKeyTable){
    				jQuery(AfterShipWpAPIKeyTable).prev().remove();
    				jQuery(AfterShipWpAPIKeyTable).remove();
    			}
    		});
    		</script>
    	<?php
    	}
    	add_action( 'admin_notices', 'as_remove_wp_api_key' );
    }
    Plugin Author AfterShip & Automizely

    (@aftership)

    Hey Jason,
    Thanks for the update!

    Team AfterShip

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove "Generate API Key" from User Profile’ is closed to new replies.