WP_MS_Sites_List_Table::extra_tablenav()wp-admin/includes/class-wp-ms-sites-list-table.php | Displays extra controls between bulk actions and pagination.
|
wp_print_community_events_markup()wp-admin/includes/dashboard.php | Prints the markup for the Community Events section of the Events and News Dashboard widget.
|
WP_Plugins_List_Table::search_box()wp-admin/includes/class-wp-plugins-list-table.php | Displays the search box.
|
network_step1()wp-admin/includes/network.php | Prints step 1 for Network installation process.
|
display_setup_form()wp-admin/install.php | Displays installer setup form.
|
WP_Screen::render_screen_options()wp-admin/includes/class-wp-screen.php | Renders the screen options tab.
|
WP_Plugins_List_Table::extra_tablenav()wp-admin/includes/class-wp-plugins-list-table.php | |
WP_Links_List_Table::extra_tablenav()wp-admin/includes/class-wp-links-list-table.php | |
install_theme_search_form()wp-admin/includes/theme-install.php | Displays search form for searching themes.
|
install_themes_dashboard()wp-admin/includes/theme-install.php | Displays tags filter for themes.
|
install_themes_upload()wp-admin/includes/theme-install.php | Displays a form to upload themes from zip files.
|
WP_List_Table::search_box()wp-admin/includes/class-wp-list-table.php | Displays the search box.
|
WP_List_Table::bulk_actions()wp-admin/includes/class-wp-list-table.php | Displays the bulk actions dropdown.
|
install_search_form()wp-admin/includes/plugin-install.php | Displays a search form for searching plugins.
|
install_plugins_upload()wp-admin/includes/plugin-install.php | Displays a form to upload plugins from zip files.
|
_wp_dashboard_control_callback()wp-admin/includes/dashboard.php | Outputs controls for the current dashboard widget.
|
wp_network_dashboard_right_now()wp-admin/includes/dashboard.php | |
wp_dashboard_quick_press()wp-admin/includes/dashboard.php | Displays the Quick Draft widget.
|
find_posts_div()wp-admin/includes/template.php | Outputs the modal window used for attaching media to posts or pages in the media-listing screen.
|
meta_form()wp-admin/includes/template.php | Prints the form in the Custom Fields meta box.
|
wp_import_upload_form()wp-admin/includes/template.php | Outputs the form used by the importers to accept the data to be imported.
|
WP_Users_List_Table::extra_tablenav()wp-admin/includes/class-wp-users-list-table.php | Outputs the controls to allow user roles to be changed in bulk.
|
media_upload_type_form()wp-admin/includes/media.php | Outputs the legacy media upload form for a given media type.
|
media_upload_gallery_form()wp-admin/includes/media.php | Adds gallery form to upload iframe.
|
media_upload_library_form()wp-admin/includes/media.php | Outputs the legacy media upload form for the media library.
|
media_upload_form()wp-admin/includes/media.php | Outputs the legacy media upload form.
|
link_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays link create form fields.
|
post_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays post submit form fields.
|
attachment_submit_meta_box()wp-admin/includes/meta-boxes.php | Displays attachment submit form fields.
|
WP_Media_List_Table::extra_tablenav()wp-admin/includes/class-wp-media-list-table.php | |
WP_Comments_List_Table::extra_tablenav()wp-admin/includes/class-wp-comments-list-table.php | |
wp_nav_menu_item_post_type_meta_box()wp-admin/includes/nav-menu.php | Displays a meta box for a post type menu item.
|
wp_nav_menu_item_taxonomy_meta_box()wp-admin/includes/nav-menu.php | Displays a meta box for a taxonomy menu item.
|
request_filesystem_credentials()wp-admin/includes/file.php | Displays a form to the user to request for their FTP/SSH details in order to connect to the filesystem.
|
WP_Posts_List_Table::inline_edit()wp-admin/includes/class-wp-posts-list-table.php | Outputs the hidden row displayed when inline editing
|
wp_widget_control()wp-admin/includes/widgets.php | Meta widget used to display the control form for a widget.
|
WP_Posts_List_Table::extra_tablenav()wp-admin/includes/class-wp-posts-list-table.php | |
Custom_Image_Header::step_1()wp-admin/includes/class-custom-image-header.php | Displays first step of custom header image page.
|
Custom_Image_Header::step_2()wp-admin/includes/class-custom-image-header.php | Displays second step of custom header image page.
|
confirm_delete_users()wp-admin/includes/ms.php | |
list_core_update()wp-admin/update-core.php | Lists available core updates.
|
Custom_Background::admin_page()wp-admin/includes/class-custom-background.php | Displays the custom background page.
|
Default Usage
This will output the following HTML, which will display a button with the text “Save Changes”.
Display a Secondary Button
WordPress styles secondary and primary buttons differently. Primary buttons are blue, and stand out more than secondary buttons, which are grey. By default,
submit_button()
outputs a primary button. To display a secondary button instead, set the$type
parameter to'secondary'
:Display a Delete Button
By default, WordPress doesn’t currently appear to have custom styling for delete buttons, but it does give them the
'delete'
HTML class. However, it’s possible that could change in the future, so it’s a good idea to specify the$type
as'delete'
when displaying a delete button:By default, delete buttons will be displayed as secondary buttons, not primary. If you want to display it as a primary button, you can do it like this:
Using the $name Parameter
The
$name
parameter may be used if you want to set the HTML name attribute for the button. By default, this will be'submit'
.By default, the
$name
is also used to fill out the button’sid
attribute. To change this, you can pass anid
via the$other_attributes
parameter:Using the $wrap Parameter
The
$wrap
parameter controls whether the button is wrapped in a paragraph tag, which it is by default. This can be a help or a hindrance depending on where an how you wish to display the button. To turn this behavior off, passfalse
for the fourth parameter:Specifying Other HTML Attributes
You can add any HTML attributes you chose to your button using the
$other_attributes
parameter. For example:Using Custom Text
To output a button with custom text, use the first parameter like this:
This example shows a plugin options page form with two submit buttons, each serving different purposes.