mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-02 12:02:25 +08:00
26 lines
661 B
Text
26 lines
661 B
Text
function am_affwp_hide_license_key_field() {
|
|
|
|
$screen = get_current_screen();
|
|
|
|
if ( $screen->id !== 'affiliates_page_affiliate-wp-settings' ) {
|
|
return;
|
|
}
|
|
|
|
$first_tab = false;
|
|
|
|
if (
|
|
isset( $_GET['page'] ) && 'affiliate-wp-settings' === $_GET['page'] && ! isset( $_GET['tab'] ) ||
|
|
isset( $_GET['page'] ) && 'affiliate-wp-settings' === $_GET['page'] && isset( $_GET['tab'] ) && 'general' === $_GET['tab']
|
|
) {
|
|
$first_tab = true;
|
|
}
|
|
|
|
if ( ! $first_tab ) {
|
|
return;
|
|
}
|
|
|
|
?>
|
|
<style>.affiliates_page_affiliate-wp-settings .form-table tr:nth-child(-n+2) { display: none; }</style>
|
|
<?php
|
|
}
|
|
add_action( 'admin_head', 'am_affwp_hide_license_key_field' );
|