本文整理汇总了PHP中get_submit_button函数的典型用法代码示例。如果您正苦于以下问题:PHP get_submit_button函数的具体用法?PHP get_submit_button怎么用?PHP get_submit_button使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_submit_button函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: column_default
/**
* Generates content for a single row of the table
*
* @since 0.1-dev
* @access protected
*
* @param object $item The current item.
* @param string $column_name The current column name.
*/
protected function column_default($item, $column_name)
{
switch ($column_name) {
case 'name':
return esc_html($item['name']);
case 'created':
if (empty($item['created'])) {
return '—';
}
return date(get_option('date_format', 'r'), $item['created']);
case 'last_used':
if (empty($item['last_used'])) {
return '—';
}
return date(get_option('date_format', 'r'), $item['last_used']);
case 'last_ip':
if (empty($item['last_ip'])) {
return '—';
}
return $item['last_ip'];
case 'revoke':
return get_submit_button(__('Revoke'), 'delete', 'revoke-application-password', false);
default:
return 'WTF^^?';
}
}
开发者ID:georgestephanis,项目名称:application-passwords,代码行数:35,代码来源:class.application-passwords-list-table.php
示例2: dashboard_widget
public function dashboard_widget()
{
$projectId = 0;
if (empty($this->gadwp->config->options['ga_dash_token'])) {
echo '<p>' . __("This plugin needs an authorization:", 'google-analytics-dashboard-for-wp') . '</p><form action="' . menu_page_url('gadash_settings', false) . '" method="POST">' . get_submit_button(__("Authorize Plugin", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
return;
}
if (current_user_can('manage_options')) {
if ($this->gadwp->config->options['ga_dash_tableid_jail']) {
$projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
} else {
echo '<p>' . __("An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp') . '</p><form action="' . menu_page_url('gadash_settings', false) . '" method="POST">' . get_submit_button(__("Select Domain", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
return;
}
} else {
if ($this->gadwp->config->options['ga_dash_tableid_jail']) {
$projectId = $this->gadwp->config->options['ga_dash_tableid_jail'];
} else {
echo '<p>' . __("An admin should asign a default Google Analytics Profile.", 'google-analytics-dashboard-for-wp') . '</p><form action="' . menu_page_url('gadash_settings', false) . '" method="POST">' . get_submit_button(__("Select Domain", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
return;
}
}
if (!$projectId) {
echo '<p>' . __("Something went wrong while retrieving property data. You need to create and properly configure a Google Analytics account:", 'google-analytics-dashboard-for-wp') . '</p> <form action="https://deconf.com/how-to-set-up-google-analytics-on-your-website/" method="POST">' . get_submit_button(__("Find out more!", 'google-analytics-dashboard-for-wp'), 'secondary') . '</form>';
return;
}
?>
<div id="gadwp-window-1"></div>
<?php
}
示例3: wpcf_fields_radio_editor_callback
/**
* Editor callback form.
*/
function wpcf_fields_radio_editor_callback()
{
wpcf_admin_ajax_head('Insert checkbox', 'wpcf');
$field = wpcf_admin_fields_get_field($_GET['field_id']);
if (empty($field)) {
echo '<div class="message error"><p>' . __('Wrong field specified', 'wpcf') . '</p></div>';
wpcf_admin_ajax_footer();
return '';
}
$form = array();
$form['#form']['callback'] = 'wpcf_fields_radio_editor_submit';
$form['display'] = array('#type' => 'radios', '#default_value' => 'db', '#name' => 'display', '#options' => array('display_from_db' => array('#title' => __('Display the value of this field from the database', 'wpcf'), '#name' => 'display', '#value' => 'db', '#inline' => true, '#after' => '<br />'), 'display_values' => array('#title' => __('Show one of these values:', 'wpcf'), '#name' => 'display', '#value' => 'value')), '#inline' => true);
if (!empty($field['data']['options'])) {
$form['table-open'] = array('#type' => 'markup', '#markup' => '<table style="margin-top:20px;" cellpadding="0" cellspacing="8">');
foreach ($field['data']['options'] as $option_id => $option) {
if ($option_id == 'default') {
continue;
}
$value = isset($option['display_value']) ? $option['display_value'] : $option['value'];
$form['display-value-' . $option_id] = array('#type' => 'textfield', '#title' => $option['title'], '#name' => 'options[' . $option_id . ']', '#value' => $value, '#inline' => true, '#pattern' => '<tr><td style="text-align:right;"><LABEL></td><td><ELEMENT></td></tr>', '#attributes' => array('style' => 'width:200px;'));
}
$form['table-close'] = array('#type' => 'markup', '#markup' => '</table>');
}
$form['submit'] = array('#type' => 'markup', '#markup' => get_submit_button());
$f = wpcf_form('wpcf-form', $form);
echo '<form method="post" action="">';
echo $f->renderForm();
echo '</form>';
wpcf_admin_ajax_footer();
}
示例4: wpcf_fields_checkbox_editor_callback
/**
* Editor callback form.
*/
function wpcf_fields_checkbox_editor_callback()
{
$form = array();
$value_not_selected = '';
$value_selected = '';
if (isset($_GET['field_id'])) {
$field = wpcf_admin_fields_get_field($_GET['field_id']);
if (!empty($field)) {
if (isset($field['data']['display_value_not_selected'])) {
$value_not_selected = $field['data']['display_value_not_selected'];
}
if (isset($field['data']['display_value_selected'])) {
$value_selected = $field['data']['display_value_selected'];
}
}
}
$form['#form']['callback'] = 'wpcf_fields_checkbox_editor_submit';
$form['display'] = array('#type' => 'radios', '#default_value' => 'db', '#name' => 'display', '#options' => array('display_from_db' => array('#title' => __('Display the value of this field from the database', 'wpcf'), '#name' => 'display', '#value' => 'db', '#inline' => true, '#after' => '<br />'), 'display_values' => array('#title' => __('Show one of these two values:', 'wpcf'), '#name' => 'display', '#value' => 'value')), '#inline' => true);
$form['display-value-1'] = array('#type' => 'textfield', '#title' => '<td style="text-align:right;">' . __('Not selected:', 'wpcf') . '</td><td>', '#name' => 'display_value_not_selected', '#value' => $value_not_selected, '#inline' => true, '#before' => '<table><tr>', '#after' => '</td></tr>');
$form['display-value-2'] = array('#type' => 'textfield', '#title' => '<td style="text-align:right;">' . __('Selected:', 'wpcf') . '</td><td>', '#name' => 'display_value_selected', '#value' => $value_selected, '#after' => '</tr></table>');
$form['submit'] = array('#type' => 'markup', '#markup' => get_submit_button());
$f = wpcf_form('wpcf-form', $form);
wpcf_admin_ajax_head('Insert checkbox', 'wpcf');
echo '<form method="post" action="">';
echo $f->renderForm();
echo '</form>';
wpcf_admin_ajax_footer();
}
示例5: add_change_member_type_selectbox
public function add_change_member_type_selectbox($where = '')
{
//Since wp will not pass whether it is for top/bottom, let us use static var to deremine position
static $position;
if (!isset($position)) {
$position = 'top';
//assume it will be called from top
} else {
$position = 'bottom';
}
//only admin/super admin
if (!current_user_can('edit_users')) {
return;
}
$member_types = bp_get_member_types(array(), 'objects');
if (empty($member_types)) {
return;
}
$output = '<div class="alignright" id="bp-member-type-change-action_' . $position . '">' . '<label for="new_member_type_' . $position . '" class="screen-reader-text">' . __('Change member type to…', 'bp-member-type-generator') . '</label>
<select id="new_member_type_' . $position . '" name="new_member_type_' . $position . '">
<option value="">' . __('Change member type to…', 'bp-member-type-generator') . '</option>';
foreach ($member_types as $key => $type) {
$output .= sprintf('<option value="%s">%s</option>', esc_attr($key), $type->labels['singular_name']);
}
$output .= '</select>';
$output .= get_submit_button(__('Change', 'bp-member-type-generator'), 'secondary', 'change-member-type', false);
$output .= '</div>';
echo $output;
}
示例6: admin_post_thumbnail_html
/**
* Generate HTML on the featured image size
*
* @param $content
* @param $ID
*
* @return string
*/
public static function admin_post_thumbnail_html($content, $ID)
{
$content .= '<span class="spinner"></span>';
$content .= get_submit_button('Regenerate image sizes', 'primary', 'sis_featured', false, array('id' => 'sis_featured_regenerate', 'data-nonce' => wp_create_nonce('sis-regenerate-featured-' . $ID)));
$content .= '<div class="sis_message"></div>';
return $content;
}
示例7: buttons
function buttons()
{
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'display';
$html = "";
$html .= '<a href="' . get_home_url() . '?apollo=true&TB_iframe=true&width=640&height=632" class="preview thickbox thickbox-preview" title="Be sure to save your settings first">Preview</a>';
$html .= '<a id="clear" href="?page=apollo_general_settings&tab=' . $active_tab . '&refresh" class="clear-settings">Clear Settings</a>';
$html .= get_submit_button("Save Changes", "primary", "submit", false);
$html = '<span>' . $html . '</span>';
return $html;
}
示例8: render
public function render()
{
printf('<div class="puc-debug-bar-panel" id="puc-debug-bar-panel_%1$s" data-slug="%1$s" data-nonce="%2$s">', esc_attr($this->updateChecker->slug), esc_attr(wp_create_nonce('puc-ajax')));
$responseBox = '<div class="puc-ajax-response" style="display: none;"></div>';
echo '<h3>Configuration</h3>';
echo '<table class="puc-debug-data">';
$this->row('Plugin file', htmlentities($this->updateChecker->pluginFile));
$this->row('Slug', htmlentities($this->updateChecker->slug));
$this->row('DB option', htmlentities($this->updateChecker->optionName));
$requestInfoButton = function_exists('get_submit_button') ? get_submit_button('Request Info', 'secondary', 'puc-request-info-button', false) : '';
$this->row('Metadata URL', htmlentities($this->updateChecker->metadataUrl) . ' ' . $requestInfoButton . $responseBox);
if ($this->updateChecker->checkPeriod > 0) {
$this->row('Automatic checks', 'Every ' . $this->updateChecker->checkPeriod . ' hours');
} else {
$this->row('Automatic checks', 'Disabled');
}
if (isset($this->updateChecker->throttleRedundantChecks)) {
if ($this->updateChecker->throttleRedundantChecks && $this->updateChecker->checkPeriod > 0) {
$this->row('Throttling', sprintf('Enabled. If an update is already available, check for updates every %1$d hours instead of every %2$d hours.', $this->updateChecker->throttledCheckPeriod, $this->updateChecker->checkPeriod));
} else {
$this->row('Throttling', 'Disabled');
}
}
echo '</table>';
echo '<h3>Status</h3>';
echo '<table class="puc-debug-data">';
$state = $this->updateChecker->getUpdateState();
$checkNowButton = function_exists('get_submit_button') ? get_submit_button('Check Now', 'secondary', 'puc-check-now-button', false) : '';
if (isset($state, $state->lastCheck)) {
$this->row('Last check', $this->formatTimeWithDelta($state->lastCheck) . ' ' . $checkNowButton . $responseBox);
} else {
$this->row('Last check', 'Never');
}
$nextCheck = wp_next_scheduled($this->updateChecker->getCronHookName());
$this->row('Next automatic check', $this->formatTimeWithDelta($nextCheck));
if (isset($state, $state->checkedVersion)) {
$this->row('Checked version', htmlentities($state->checkedVersion));
$this->row('Cached update', $state->update);
}
$this->row('Update checker class', htmlentities(get_class($this->updateChecker)));
echo '</table>';
$update = $this->updateChecker->getUpdate();
if ($update !== null) {
echo '<h3>An Update Is Available</h3>';
echo '<table class="puc-debug-data">';
$fields = array('version', 'download_url', 'slug', 'homepage', 'upgrade_notice');
foreach ($fields as $field) {
$this->row(ucwords(str_replace('_', ' ', $field)), htmlentities($update->{$field}));
}
echo '</table>';
} else {
echo '<h3>No updates currently available</h3>';
}
echo '</div>';
}
示例9: bizz_builder_screen_options
function bizz_builder_screen_options($status, $args)
{
if ($args->base == 'toplevel_page_bizz-layout') {
$button = get_submit_button(__('Apply', 'bizzthemes'), 'button', 'screen-options-apply', false);
$user = get_current_user_id();
$usermeta = get_user_meta($user, 'templates_screen_options', true);
$saved1 = isset($usermeta['inactive_widgets']) ? $usermeta['inactive_widgets'] : false;
$checked1 = checked($saved1, 1, false);
return "<h5>" . __('Show on screen', 'bizzthemes') . "</h5>\r\r\n\t\t\t\t\t<p class='cmi_custom_fields'>\r\r\n\t\t\t\t\t\t<input type='checkbox' value='1' id='templates_screen[inactive_widgets]' name='templates_screen[inactive_widgets]' {$checked1} />\r\r\n\t\t\t\t\t\t<label for='templates_screen[inactive_widgets]'>" . __('Show Inactive Widgets', 'bizzthemes') . "</label>\r\r\n\t\t\t\t\t</p>\r\r\n\t\t\t\t\t{$button}\r\r\n\t\t\t\t\t<input type='hidden' name='wp_screen_options[option]' value='templates_screen_options' />\r\r\n\t\t\t\t\t<input type='hidden' name='wp_screen_options[value]' value='yes' />\r\r\n\t\t\t\t\t";
}
}
示例10: printForm
/**
* Return form HTML replacing variables in a template string.
*
* @return string
*/
private function printForm()
{
$title = apply_filters('the_title', $this->post->post_title);
$nonce = self::NONCE . get_current_blog_id();
$data = ['action' => esc_attr(Launcher::SLUG . '_send_mail'), 'postId' => $this->post->ID, 'postTitle' => esc_attr($title), 'recipient' => esc_attr($this->author->get('user_email')), 'messageLabel' => esc_html__('Message:', 'reject-notify'), 'button' => get_submit_button(esc_html__('Send', 'reject-notify')), 'nonce' => wp_nonce_field($nonce, self::NONCE, true, false), 'title' => sprintf(esc_html__('Send reject mail to %s', 'reject-notify'), esc_html($this->author->get('display_name'))), 'message' => vsprintf(esc_html__('Sorry %s, your post %s was rejected.', 'reject-notify'), [esc_html($this->author->get('display_name')), '"' . esc_html($title) . '"'])];
$template = file_get_contents(dirname($this->path) . '/templates/form.php');
foreach ($data as $key => $value) {
$template = str_replace("{{{{$key}}}}", $value, $template);
}
return $template;
}
示例11: wpcf_fields_url_editor_callback
/**
* Editor callback form.
*/
function wpcf_fields_url_editor_callback()
{
$form = array();
$form['#form']['callback'] = 'wpcf_fields_url_editor_submit';
$form['title'] = array('#type' => 'textfield', '#title' => __('Title', 'wpcf'), '#description' => __('If set, this text will be displayed instead of raw data'), '#name' => 'title');
$form['submit'] = array('#type' => 'markup', '#markup' => get_submit_button());
$f = wpcf_form('wpcf-form', $form);
wpcf_admin_ajax_head('Insert URL', 'wpcf');
echo '<form method="post" action="">';
echo $f->renderForm();
echo '</form>';
wpcf_admin_ajax_footer();
}
示例12: wpcf_fields_email_editor_callback
/**
* Editor callback form.
*/
function wpcf_fields_email_editor_callback()
{
$last_settings = wpcf_admin_fields_get_field_last_settings($_GET['field_id']);
$form = array();
$form['#form']['callback'] = 'wpcf_fields_email_editor_submit';
$form['title'] = array('#type' => 'textfield', '#title' => __('Title', 'wpcf'), '#description' => __('If set, this text will be displayed instead of raw data'), '#name' => 'title', '#value' => isset($last_settings['title']) ? $last_settings['title'] : '');
$form['submit'] = array('#type' => 'markup', '#markup' => get_submit_button());
$f = wpcf_form('wpcf-form', $form);
wpcf_admin_ajax_head('Insert email', 'wpcf');
echo '<form method="post" action="">';
echo $f->renderForm();
echo '</form>';
wpcf_admin_ajax_footer();
}
示例13: mtphr_dnt_settings_display
function mtphr_dnt_settings_display($active_tab = null)
{
?>
<!-- Create a header in the default WordPress 'wrap' container -->
<div class="wrap">
<div id="icon-themes" class="icon32"></div>
<h2><?php
_e('Ditty News Ticker Settings', 'ditty-news-ticker');
?>
</h2>
<?php
settings_errors();
?>
<?php
$tabs = mtphr_dnt_settings_tabs();
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
?>
<ul style="margin-bottom:20px;" class="subsubsub">
<?php
$num_tabs = count($tabs);
$count = 0;
foreach ($tabs as $key => $tab) {
$count++;
$current = $key == $active_tab ? 'class="current"' : '';
$sep = $count != $num_tabs ? ' |' : '';
echo '<li><a href="?post_type=ditty_news_ticker&page=mtphr_dnt_settings&tab=' . $key . '" ' . $current . '>' . ucfirst($key) . '</a>' . $sep . '</li>';
}
?>
</ul>
<br class="clear" />
<form method="post" action="options.php">
<?php
settings_fields($tabs[$active_tab]);
do_settings_sections($tabs[$active_tab]);
echo apply_filters('mtphr_dnt_settings_submit_button', get_submit_button());
?>
</form>
</div><!-- /.wrap -->
<?php
}
示例14: notice
/**
* Checks if there are existing settings from the Old iCal or Facebook Plugins
* and displays a notice with a button to migrated those using AJAX
*
* @return string
*/
public function notice()
{
if (!Tribe__Events__Aggregator__Page::instance()->is_screen()) {
return false;
}
if (($this->is_facebook_migrated() || !$this->has_facebook_setting()) && ($this->is_ical_migrated() || !$this->has_ical_setting())) {
return false;
}
$aggregator = Tribe__Events__Aggregator::instance();
$html = '<p>' . esc_html__('Thanks for activating Event Aggregator! It looks like you have some settings and imports configured on our legacy importer plugins. To complete your transition, we need to transfer those options to our new system.', 'the-events-calendar');
if (!$this->is_facebook_migrated() && $this->has_facebook_setting()) {
$html .= '<p style="display:inline-block;">' . get_submit_button(esc_html__('Migrate Facebook Events settings', 'the-events-calendar'), 'secondary', 'tribe-migrate-facebook-settings', false) . '<span class="spinner"></span></p>';
}
if (!$this->is_ical_migrated() && $this->has_ical_setting()) {
$html .= '<p style="display:inline-block;">' . get_submit_button(esc_html__('Migrate iCal Importer settings', 'the-events-calendar'), 'secondary', 'tribe-migrate-ical-settings', false) . '<span class="spinner"></span></p>';
}
return Tribe__Admin__Notices::instance()->render('tribe-aggregator-migrate-legacy-settings', $html);
}
示例15: file_gallery_list_meta_row
/**
* {@internal Missing Short Description}}
*
* @since 2.5.0
*
* @param unknown_type $entry
* @param unknown_type $count
* @return unknown
*/
function file_gallery_list_meta_row($entry, &$count)
{
static $update_nonce = false;
if (is_protected_meta($entry['meta_key'], 'post')) {
return;
}
if (!$update_nonce) {
$update_nonce = wp_create_nonce('add-meta');
}
$r = '';
++$count;
if ($count % 2) {
$style = 'alternate';
} else {
$style = '';
}
if (is_serialized($entry['meta_value'])) {
if (is_serialized_string($entry['meta_value'])) {
// this is a serialized string, so we should display it
$entry['meta_value'] = maybe_unserialize($entry['meta_value']);
} else {
// this is a serialized array/object so we should NOT display it
--$count;
return;
}
}
$entry['meta_key'] = esc_attr($entry['meta_key']);
$entry['meta_value'] = esc_textarea($entry['meta_value']);
// using a <textarea />
$entry['meta_id'] = (int) $entry['meta_id'];
$delete_nonce = wp_create_nonce('delete-meta_' . $entry['meta_id']);
$r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='{$style}'>";
$r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta[{$entry['meta_id']}][key]'>" . __('Key') . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' type='text' size='20' value='{$entry['meta_key']}' />";
$r .= "\n\t\t<div class='submit'>";
$r .= get_submit_button(__('Delete'), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array('data-wp-lists' => "delete:attachment-the-list:meta-{$entry['meta_id']}::_ajax_nonce={$delete_nonce}"));
$r .= "\n\t\t";
$r .= get_submit_button(__('Update'), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array('data-wp-lists' => "add:attachment-the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta={$update_nonce}"));
$r .= "</div>";
$r .= wp_nonce_field('change-meta', '_ajax_nonce', false, false);
$r .= "</td>";
$r .= "\n\t\t<td><label class='screen-reader-text' for='meta[{$entry['meta_id']}][value]'>" . __('Value') . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\n\t</tr>";
return $r;
}