本文整理汇总了PHP中akismet_nonce_field函数的典型用法代码示例。如果您正苦于以下问题:PHP akismet_nonce_field函数的具体用法?PHP akismet_nonce_field怎么用?PHP akismet_nonce_field使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了akismet_nonce_field函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: akismet_caught
//.........这里部分代码省略.........
#akismetsearch p {
margin: 0;
padding: 0;
}
</style>
<div class="wrap">
<h2><?php
_e('Caught Spam');
?>
</h2>
<?php
$count = get_option('akismet_spam_count');
if ($count) {
?>
<p><?php
printf(__('Akismet has caught <strong>%1$s spam</strong> for you since you first installed it.'), number_format_i18n($count));
?>
</p>
<?php
}
$spam_count = akismet_spam_count();
if (0 == $spam_count) {
echo '<p>' . __('You have no spam currently in the queue. Must be your lucky day. :)') . '</p>';
echo '</div>';
} else {
echo '<p>' . __('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.') . '</p>';
if (!isset($_POST['s'])) {
?>
<form method="post" action="<?php
echo attribute_escape(add_query_arg('noheader', 'true'));
?>
">
<?php
akismet_nonce_field($akismet_nonce);
?>
<input type="hidden" name="action" value="delete" />
<?php
printf(__('There are currently %1$s comments identified as spam.'), $spam_count);
?>
<input type="submit" class="button delete" name="Submit" value="<?php
_e('Delete all');
?>
" />
<input type="hidden" name="display_time" value="<?php
echo current_time('mysql', 1);
?>
" />
</form>
<?php
}
?>
</div>
<div class="wrap">
<?php
if (isset($_POST['s'])) {
?>
<h2><?php
_e('Search');
?>
</h2>
<?php
} else {
echo '<p>' . __('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.') . '</p>';
}
if (isset($_POST['s'])) {
$s = $wpdb->escape($_POST['s']);
示例2: akismet_conf
//.........这里部分代码省略.........
foreach ($ms as $m) {
?>
<p style="padding: .5em; background-color: #<?php
echo $messages[$m]['color'];
?>
; color: #fff; font-weight: bold;"><?php
echo $messages[$m]['text'];
?>
</p>
<?php
}
?>
<p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php
echo get_option('wordpress_api_key');
?>
" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php
_e('<a href="http://akismet.com/get/">What is this?</a>');
?>
)</p>
<?php
if (isset($invalid_key) && $invalid_key) {
?>
<h3><?php
_e('Why might my key be invalid?');
?>
</h3>
<p><?php
_e('This can mean one of two things, either you copied the key wrong or that the plugin is unable to reach the Akismet servers, which is most often caused by an issue with your web host around firewalls or similar.');
?>
</p>
<?php
}
}
akismet_nonce_field($akismet_nonce);
?>
<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php
if (get_option('akismet_discard_month') == 'true') {
echo ' checked="checked" ';
}
?>
/> <?php
_e('Automatically discard spam comments on posts older than a month.');
?>
</label></p>
<p class="submit"><input type="submit" name="submit" value="<?php
_e('Update options »');
?>
" /></p>
</form>
<form action="" method="post" id="akismet-connectivity" style="margin: auto; width: 400px; ">
<h3><?php
_e('Server Connectivity');
?>
</h3>
<?php
if (!function_exists('fsockopen') || !function_exists('gethostbynamel')) {
?>
<p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php
_e('Network functions are disabled.');
?>
</p>
<p><?php
echo sprintf(__('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/');
?>
示例3: akismet_conf
//.........这里部分代码省略.........
<fieldset><legend class="screen-reader-text"><span><?php
_e('Settings');
?>
</span></legend>
<label for="akismet_discard_month" title="<?php
esc_attr_e('Auto-detete old spam');
?>
"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php
echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"' : '';
?>
> <span><?php
_e('Auto-delete spam submitted on posts more than a month old.');
?>
</span></label><br>
<label for="akismet_show_user_comments_approved" title="<?php
esc_attr_e('Show approved comments');
?>
"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php
echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"' : '';
?>
> <span><?php
_e('Show the number of comments you\'ve approved beside each comment author.');
?>
</span></label>
</fieldset>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
akismet_nonce_field($akismet_nonce);
?>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php
_e('Save Changes');
?>
">
</p>
</form>
<?php
if ($api_key) {
?>
<h3><?php
_e('Server Connectivity');
?>
</h3>
<form action="" method="post" id="akismet-connectivity">
<table class="form-table">
<tbody>
<tr>
<th><label for="key"><?php
_e('Server Status');
?>
</label></th>
<td>
<?php
if (!function_exists('fsockopen') || !function_exists('gethostbynamel')) {
?>
<p class="key-status failed"><?php
_e('Network functions are disabled.');
?>
</p>