It doesn’t seem possible to modify the <tr>
tag, but for making it hidden by default (or initially hidden), then you can use the sixth parameter passed to add_settings_field()
, which is $args
:
add_settings_field(
'my_field', // ID
'My Field', // Title
'my_field_callback', // Callback
'my-setting-admin', // Page/slug
'setting_section_id', // Section
array( 'class' => 'hidden' )
);
So as you can see, we set the tr
‘s class
to hidden
which applies display: none
to the tr
element. (hidden
is an existing CSS rule in wp-admin/css/common.css
which is loaded on the WordPress admin pages).
Related Posts:
- How can a plugin create a page/form in the front end?
- Looking for WordPress System Diagrams
- How to output message during plugin activation
- How to add Request header in WordPress remote api calls
- Init action hook running late after PayPal’s return url?
- Get specific color from admin color scheme
- wp_remote_get doesn’t work with secure connections https?
- How do you create a custom edit.php / edit pages page
- Check the Version of an Enqueue’d External Library
- Edit the output of wp_widget_rss_output()
- Why are two functions over-riding each other?
- How to Parse an Array of Elements in Gutenberg Block
- how to set context in WordPress for unit testing
- Custom rewrite rule serves content, but returns 404 error code
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- How to edit mySQL wp_posts table from plugin php?
- Creating a Wordpess Plugin that writes data to a csv file. The data doesn’t show in the csv file?
- Gutenberg – What is the best way to save/update post meta?
- Dequeue theme stylesheets but keep widget styling on custom page template
- WP_Query with tax_query, order by most ‘matches’
- Using the Settings API, how should I add multiple values to an option?
- WP custom menus error > menu name already exists?
- Problem with is_active_sidebar?
- Plugin updates, version dependencies, and backwards compatibility
- Where and how does WordPress store and use its plugin and hook information?
- Cache directory needed for plugin
- How to sanitize user input?
- Remove Internal Style Sheet if no Value Provided?
- Widget update function not saving values
- get_the_excerpt() is not returning an empty string when the_excerpt is blank?
- “Plugin could not be activated because it triggered a fatal error.”
- Storing product price data in the database
- Does the order of sections in readme.txt matter?
- get_query_var not works
- Correct check for any admin page with editor
- Add column in WP user but it goes wrong
- modify wordpress default search
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- How to perform a heavy and long process in cron jobs?
- Woocommerce extend tax report with custom column
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- Hook into Jetpacks Publicize without using a post type
- How to limit number of number of categories displayed by categories widget
- Dynamically creating classes for Widget API
- Is it necessary to do validation again when retrieving data from database?
- How to add new options to my WordPress plugin
- Using WordPress PHP code, how to bulk delete only 100 subscribers at a time from thousands of users?
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- Creating an empty page programatically
- Multiple API Endpoints (wp_remote_get)
- plugin_dir_url & plugin_basename not working when plugin dir is outside wordpress dir
- How to replace default comments with custom HTML?
- Invalid hook call on save, not edit when using swiper slider
- Call to undefined function is_home() or any conditional tags
- WP nonce field checkbox prints checked=’checked’ outside input field
- Shortcode not appearing when used as post content in wp_insert_post() or possibly, shortcode not being registered at all
- WooCommerce Endpoints content
- Make dynamic string translatable
- Creating two tables in database on activation hook
- wp_schedule_event is registered but function isn’t running
- Adding Custom CSS with PHP
- Simple plugin don’t display content
- How to receive notification of deprecated API elements and functions?
- Cannot output plugin twice with shortcode
- How to make an admin plugin menu page go full screen?
- It is possible to pass $args that sent by add_settings_field() inside another function?
- Change reminder email date to 14 days before
- Gutenberg – Call google map render function in save after DOM has been rendered
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- Home page is not loading, where in other pages are displaying on the site
- Custom table / Alternative to WP_List_Table
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Adding Amchart Interface to WordPress API
- WordPress Own Rewrite Rules
- WordPress with React: Saving and Using Data Collected with fetch
- Don’t print customizer styles when no setting has been used
- Buddy Press restrict the capability to edit users
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- tweaking the
- Plugin with functions inside a class & how to trigger WP CRON
- “Headers Already Sent” Nightmare on Plugin
- external Integration with wordpress timeout error
- add_settings_error on validating plugin options API
- Problem to return more than single line captions
- Unable to show a message after plugin activation
- How to get an array out of a nav menu if it’s a plugin?
- Use plupload to upload images and save them to custom folder and database table
- How to add conent (text) to Add New pages form of admin in WordPress
- Can I access WordPress API’s from within plugin scripts?
- Is there a way to make is_search() always return false
- Ajax url value to pass ‘variable’ to use in query
- Apply Filters Causing a 500 Internal Server Error
- How to do searching based on keywords added in page
- Open media box library from link
- Using tag or inline style attribute?
- remove () from category number [closed]
- Advanced Custom Fields conflicting with custom plugin when saving custom field
- Need someone to help you want to manage points for members to code interface functions? thank you
- WordPress plugin boilerplate AJAX functionality
- Run different permission_callback depending on HTTP method of custom REST API endpoint