• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP genesis_admin_redirect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中genesis_admin_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP genesis_admin_redirect函数的具体用法?PHP genesis_admin_redirect怎么用?PHP genesis_admin_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了genesis_admin_redirect函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: zpsettings_register_settings

/**
* zpsettings_register_settings function.
*/
function zpsettings_register_settings()
{
    register_setting(ZP_SETTINGS_FIELD, ZP_SETTINGS_FIELD);
    add_option(ZP_SETTINGS_FIELD, zpsettings_default_theme_options());
    if (genesis_get_option('reset', ZP_SETTINGS_FIELD)) {
        update_option(ZP_SETTINGS_FIELD, zpsettings_default_theme_options());
        genesis_admin_redirect(ZP_SETTINGS_FIELD, array('reset' => 'true'));
        exit;
    }
}
开发者ID:lukasalbrecht,项目名称:www.genesis-playground.dev,代码行数:13,代码来源:theme_settings.php


示例2: genesis_disable_scribe_nag

/**
 * This function detects a query flag, and disables the Scribe nag,
 * then redirects the user back to the SEO settings page.
 */
function genesis_disable_scribe_nag()
{
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'seo-settings') {
        return;
    }
    if (!isset($_REQUEST['dismiss-scribe']) || $_REQUEST['dismiss-scribe'] !== 'true') {
        return;
    }
    update_option('genesis-scribe-nag-disabled', 1);
    genesis_admin_redirect('seo-settings');
    exit;
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:16,代码来源:seo.php


示例3: register_genesis_responsive_slider_settings

/**
 * This registers the settings field
 */
function register_genesis_responsive_slider_settings()
{
    register_setting(GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD, GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD);
    add_option(GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD, genesis_responsive_slider_defaults(), '', 'yes');
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'genesis_responsive_slider') {
        return;
    }
    if (genesis_get_responsive_slider_option('reset')) {
        update_option(GENESIS_RESPONSIVE_SLIDER_SETTINGS_FIELD, genesis_responsive_slider_defaults());
        genesis_admin_redirect('genesis_responsive_slider', array('reset' => 'true'));
        exit;
    }
}
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:16,代码来源:admin.php


示例4: genesis_register_theme_settings

/**
 * This registers the settings field and adds defaults to the options table.
 * It also handles settings resets by pushing in the defaults.
 */
function genesis_register_theme_settings()
{
    register_setting(GENESIS_SETTINGS_FIELD, GENESIS_SETTINGS_FIELD);
    add_option(GENESIS_SETTINGS_FIELD, genesis_theme_settings_defaults());
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'genesis') {
        return;
    }
    if (genesis_get_option('reset')) {
        update_option(GENESIS_SETTINGS_FIELD, genesis_theme_settings_defaults());
        genesis_admin_redirect('genesis', array('reset' => 'true'));
        exit;
    }
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:17,代码来源:theme-settings.php


示例5: genesis_upgrade_redirect

/**
 * Redirect the user back to the theme settings page, refreshing the data and notifying the user that they have
 * successfully updated.
 *
 * @since 1.6.0
 *
 * @uses genesis_admin_redirect() Redirect the user to an admin page, and add query args to the URL string for alerts.
 *
 * @return null Returns early if not an admin page.
 */
function genesis_upgrade_redirect()
{
    if (!is_admin() || !current_user_can('edit_theme_options')) {
        return;
    }
    genesis_admin_redirect('genesis', array('upgraded' => 'true'));
    #genesis_admin_redirect( 'genesis-upgraded' );
    exit;
}
开发者ID:jpletner,项目名称:Avritek.Company.Site,代码行数:19,代码来源:upgrade.php


示例6: genesis_import

/**
 * This function handles the import.
 *
 * @since 1.4
 */
function genesis_import()
{
    if (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'genesis-import-export') {
        return;
    }
    if (empty($_REQUEST['genesis-import'])) {
        return;
    }
    check_admin_referer('genesis-import');
    // Verify nonce
    /** hookable */
    do_action('genesis_import', $_REQUEST['genesis-import'], $_FILES['genesis-import-upload']);
    /** Extract file contents */
    $upload = file_get_contents($_FILES['genesis-import-upload']['tmp_name']);
    /** Decode the JSON */
    $options = json_decode($upload, true);
    /** Check for errors */
    if (!$options || $_FILES['genesis-import-upload']['error']) {
        genesis_admin_redirect('genesis-import-export', array('error' => 'true'));
        exit;
    }
    /** Cycle through data, import settings */
    foreach ((array) $options as $key => $settings) {
        update_option($key, $settings);
    }
    /** Redirect, add success flag to the URI */
    genesis_admin_redirect('genesis-import-export', array('imported' => 'true'));
    exit;
}
开发者ID:elderxavier,项目名称:ALLAN-JUNIOR-IAN,代码行数:34,代码来源:import-export.php


示例7: import

 /**
  * Handle the file uploaded to import settings.
  *
  * Upon upload, the file contents are JSON-decoded. If there were errors, or no options to import, then reload the
  * page to show an error message.
  *
  * Otherwise, loop through the array of option sets, and update the data under those keys in the database.
  * Afterwards, reload the page with a success message.
  *
  * Calls genesis_import action is fired after checking we can proceed, but before attempting to extract the contents
  * from the uploaded file.
  *
  * @since 1.4.0
  *
  * @uses genesis_is_menu_page()   Check if we're on a Genesis page
  * @uses genesis_admin_redirect() Redirect user to an admin page
  *
  * @return null Return null if not correct admin page, we're not importing
  */
 public function import()
 {
     if (!genesis_is_menu_page('genesis-import-export')) {
         return;
     }
     if (empty($_REQUEST['genesis-import'])) {
         return;
     }
     check_admin_referer('genesis-import');
     do_action('genesis_import', $_REQUEST['genesis-import'], $_FILES['genesis-import-upload']);
     $upload = file_get_contents($_FILES['genesis-import-upload']['tmp_name']);
     $options = json_decode($upload, true);
     //* Check for errors
     if (!$options || $_FILES['genesis-import-upload']['error']) {
         genesis_admin_redirect('genesis-import-export', array('error' => 'true'));
         exit;
     }
     //* Identify the settings keys that we should import
     $exportables = $this->get_export_options();
     $importable_keys = array();
     foreach ($exportables as $exportable) {
         $importable_keys[] = $exportable['settings-field'];
     }
     //* Cycle through data, import Genesis settings
     foreach ((array) $options as $key => $settings) {
         if (in_array($key, $importable_keys)) {
             update_option($key, $settings);
         }
     }
     //* Redirect, add success flag to the URI
     genesis_admin_redirect('genesis-import-export', array('imported' => 'true'));
     exit;
 }
开发者ID:treydonovan,项目名称:innergame-anna,代码行数:52,代码来源:import-export.php


示例8: genesis_upgrade_redirect

/**
 * Redirects the user back to the theme settings page, refreshing the data and
 * notifying the user that they have successfully updated.
 *
 * @since 1.6.0
 *
 * @uses genesis_admin_redirect()
 *
 * @return null Returns early if not an admin page.
 */
function genesis_upgrade_redirect()
{
    if (!is_admin()) {
        return;
    }
    genesis_admin_redirect('genesis', array('upgraded' => 'true'));
    exit;
}
开发者ID:hscale,项目名称:webento,代码行数:18,代码来源:upgrade.php


示例9: register_settings

 /**
  * Register the database settings for storage.
  *
  * @since 1.8.0
  *
  * @return null Return early if admin page doesn't store settings, or user is not on the correct admin page.
  */
 public function register_settings()
 {
     // If this page doesn't store settings, no need to register them.
     if (!$this->settings_field) {
         return;
     }
     register_setting($this->settings_field, $this->settings_field);
     add_option($this->settings_field, $this->default_settings);
     if (!genesis_is_menu_page($this->page_id)) {
         return;
     }
     if (genesis_get_option('reset', $this->settings_field)) {
         if (update_option($this->settings_field, $this->default_settings)) {
             genesis_admin_redirect($this->page_id, array('reset' => 'true'));
         } else {
             genesis_admin_redirect($this->page_id, array('error' => 'true'));
         }
         exit;
     }
 }
开发者ID:netmagik,项目名称:netmagik,代码行数:27,代码来源:admin.php


示例10: genesis_upgrade_redirect

/**
 * Redirect the user back to the theme settings page, refreshing the data and notifying the user that they have
 * successfully updated.
 *
 * @since 1.6.0
 *
 * @return null Return early if not an admin page.
 */
function genesis_upgrade_redirect()
{
    if (!is_admin() || !current_user_can('edit_theme_options') || is_customize_preview()) {
        return;
    }
    // @codingStandardsIgnoreStart
    genesis_admin_redirect('genesis', array('upgraded' => 'true'));
    #genesis_admin_redirect( 'genesis-upgraded' );
    // @codingStandardsIgnoreEnd
    exit;
}
开发者ID:netmagik,项目名称:netmagik,代码行数:19,代码来源:upgrade.php


示例11: prose_update_redirect

/**
 * Redirects the user back to the design settings page, refreshing the data and
 * notifying the user that they have successfully updated.
 *
 * @since 1.5.0
 *
 * @uses genesis_admin_redirect()
 *
 * @return null Returns early if not an admin page.
 */
function prose_update_redirect()
{
    if (!is_admin()) {
        return;
    }
    genesis_admin_redirect('design-settings', array('upgraded' => 'true'));
    exit;
}
开发者ID:hscale,项目名称:webento,代码行数:18,代码来源:update.php



注:本文中的genesis_admin_redirect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP genesis_attr函数代码示例发布时间:2022-05-15
下一篇:
PHP generoi_alekentta函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap