<?php
/**
 * Hide the "License Key" field from Affiliates -> Settings -> General.
 *
 * @link https://andrew.dev/snippets/hide-the-affiliatewp-license-key-field/
 *
 */
function am_affwp_hide_license_key_field() {

	$screen = get_current_screen();

	if ( $screen->id !== 'affiliates_page_affiliate-wp-settings' ) {
		return;
	}

	if ( isset( $_GET['page'] ) && 'affiliate-wp-settings' === $_GET['page'] ) : ?>
	<style>.affiliates_page_affiliate-wp-settings .form-table tr:nth-child(-n+2) { display: none; }</style>
	<?php endif;

}
add_action( 'admin_head', 'am_affwp_hide_license_key_field' );

Leave a Reply

Your email address will not be published. Required fields are marked *