本文整理汇总了PHP中WPCF7_ContactForm::count方法的典型用法代码示例。如果您正苦于以下问题:PHP WPCF7_ContactForm::count方法的具体用法?PHP WPCF7_ContactForm::count怎么用?PHP WPCF7_ContactForm::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPCF7_ContactForm
的用法示例。
在下文中一共展示了WPCF7_ContactForm::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare_items
function prepare_items()
{
$current_screen = get_current_screen();
$per_page = $this->get_items_per_page('cfseven_contact_forms_per_page');
$this->_column_headers = $this->get_column_info();
$args = array('posts_per_page' => $per_page, 'orderby' => 'title', 'order' => 'ASC', 'offset' => ($this->get_pagenum() - 1) * $per_page);
if (!empty($_REQUEST['s'])) {
$args['s'] = $_REQUEST['s'];
}
if (!empty($_REQUEST['orderby'])) {
if ('title' == $_REQUEST['orderby']) {
$args['orderby'] = 'title';
} elseif ('author' == $_REQUEST['orderby']) {
$args['orderby'] = 'author';
} elseif ('date' == $_REQUEST['orderby']) {
$args['orderby'] = 'date';
}
}
if (!empty($_REQUEST['order'])) {
if ('asc' == strtolower($_REQUEST['order'])) {
$args['order'] = 'ASC';
} elseif ('desc' == strtolower($_REQUEST['order'])) {
$args['order'] = 'DESC';
}
}
$this->items = WPCF7_ContactForm::find($args);
$total_items = WPCF7_ContactForm::count();
$total_pages = ceil($total_items / $per_page);
$this->set_pagination_args(array('total_items' => $total_items, 'total_pages' => $total_pages, 'per_page' => $per_page));
}
示例2: wpcf7_admin_bulk_validate_page
function wpcf7_admin_bulk_validate_page()
{
$contact_forms = WPCF7_ContactForm::find();
$count = WPCF7_ContactForm::count();
$submit_text = sprintf(_n("Validate %s Contact Form Now", "Validate %s Contact Forms Now", $count, 'contact-form-7'), number_format_i18n($count));
?>
<div class="wrap">
<h1><?php
echo esc_html(__('Validate Configuration', 'contact-form-7'));
?>
</h1>
<form method="post" action="">
<input type="hidden" name="action" value="validate" />
<?php
wp_nonce_field('wpcf7-bulk-validate');
?>
<p><input type="submit" class="button" value="<?php
echo esc_attr($submit_text);
?>
" /></p>
</form>
<?php
echo wpcf7_link(__('http://contactform7.com/configuration-validator-faq/', 'contact-form-7'), __('FAQ about Configuration Validator', 'contact-form-7'));
?>
</div>
<?php
}