本文整理汇总了PHP中FW_Request::REQUEST方法的典型用法代码示例。如果您正苦于以下问题:PHP FW_Request::REQUEST方法的具体用法?PHP FW_Request::REQUEST怎么用?PHP FW_Request::REQUEST使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FW_Request
的用法示例。
在下文中一共展示了FW_Request::REQUEST方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_term
/**
* Save active language in term metadata.
*
* @param $term_id
* @param $tt_id
* @param $taxonomy
*/
function create_term($term_id, $tt_id, $taxonomy)
{
if ($this->is_public_tax_type($taxonomy) && (FW_Request::REQUEST('action') === 'add-tag' || FW_Request::REQUEST('action') === 'editpost' || FW_Request::REQUEST('action') === 'add-category')) {
$translation_id = FW_Request::POST('fw_options/fw_translate_id', $term_id);
$translation_lang = FW_Request::POST('fw_options/fw_translate_to', $this->get_parent()->get_admin_active_language());
$translations = $this->query_translation($translation_id);
$translation_exists = $this->translation_exists($translations, $translation_lang);
if (!empty($translation_exists)) {
$response = array('what' => 'taxonomy', 'action' => 'add-tag', 'id' => new WP_Error('translation_exists', __('The term translation does already exists.ACTION +++ ' . FW_Request::REQUEST('action'))));
$xmlResponse = new WP_Ajax_Response($response);
$xmlResponse->send();
}
fw_update_term_meta($term_id, 'translation_id', $translation_id);
fw_update_term_meta($term_id, 'translation_lang', $translation_lang);
if (!is_null(FW_Request::POST('fw_options/fw_second_translate_to'))) {
fw_update_term_meta($translation_id, 'translation_id', $translation_id);
fw_update_term_meta($translation_id, 'translation_lang', FW_Request::POST('fw_options/fw_second_translate_to'));
}
}
}
开发者ID:albertso,项目名称:Unyson-Translation-Extension,代码行数:27,代码来源:class-fw-extension-translate-terms.php
示例2: _admin_action_admin_init
/**
* @internal
*/
public function _admin_action_admin_init()
{
$nonce = FW_Request::REQUEST('_wpnonce');
// Auto-Install
// Is a part of process of getting rid of update notifications after auto-install
if (isset($_GET['auto-install-redirect'])) {
wp_redirect($_GET['auto-install-redirect']);
}
// Auto Install (a process of restoring from **demo install** archive)
if (wp_verify_nonce($nonce, 'backup-auto-install')) {
$this->do_backup_auto_install();
}
// Feedback
if ($post_id = $this->get_feedback_subject()) {
if (!$this->backup()->get_feedback($post_id)) {
wp_redirect($this->url_backup_page());
exit;
}
}
// Backup
if (wp_verify_nonce($nonce, 'backup-now')) {
$this->do_backup_now(FW_Request::GET('cron'));
}
if (wp_verify_nonce($nonce, 'backup-cancel')) {
$this->do_backup_cancel(FW_Request::GET('post'));
}
if (wp_verify_nonce($nonce, 'backup-delete')) {
$this->do_backup_delete(FW_Request::GET('post'));
}
if (wp_verify_nonce($nonce, 'backup-unschedule')) {
$this->do_backup_unschedule(FW_Request::GET('cron'));
}
if (wp_verify_nonce($nonce, 'backup-download')) {
$this->do_backup_download(FW_Request::GET('post'));
}
// Demo Install
if (wp_verify_nonce($nonce, 'backup-demo-install')) {
$this->do_backup_demo_install();
}
// Restore
if ($this->is_backup_restore()) {
$this->do_backup_restore(FW_Request::GET('post'));
}
}