当前位置: 首页>>代码示例>>PHP>>正文


PHP __return_null函数代码示例

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


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

示例1: register_settings

 /**
  * Add all settings sections and fields
  *
  * @since 2.0
  * @return void
  */
 function register_settings()
 {
     foreach ($this->get_registered_settings() as $tab => $settings) {
         add_settings_section('fp5_settings_' . $tab, __return_null(), '__return_false', 'flowplayer5_settings');
         foreach ($settings as $key => $option) {
             $callback = !empty($option['callback']) ? $option['callback'] : array($this, $option['type'] . '_callback');
             add_settings_field('fp5_settings_general[' . $key . ']', isset($option['name']) ? $option['name'] : '', is_callable($callback) ? $callback : array($this, 'missing_callback'), 'flowplayer5_settings', 'fp5_settings_' . $tab, array('id' => $key, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'section' => $tab, 'size' => isset($option['size']) ? $option['size'] : null, 'button' => isset($option['button']) ? $option['button'] : __('Upload', 'flowplayer5'), 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : ''));
         }
     }
     // Creates our settings in the options table
     register_setting('fp5_settings_group', 'fp5_settings_general', array($this, 'sanitize_settings'));
 }
开发者ID:paolorossi,项目名称:wordpress-flowplayer,代码行数:18,代码来源:class-register-settings.php

示例2: saasaparilla_register_settings

/**
 * Add settings sections and fields
 *
 * @since       1.0.0
 * @return      void
 */
function saasaparilla_register_settings()
{
    if (get_option('saasaparilla_settings') == false) {
        add_option('saasaparilla_settings');
    }
    foreach (saasaparilla_get_registered_settings() as $tab => $settings) {
        add_settings_section('saasaparilla_settings_' . $tab, __return_null(), '__return_false', 'saasaparilla_settings_' . $tab);
        foreach ($settings as $option) {
            $name = isset($option['name']) ? $option['name'] : '';
            add_settings_field('saasaparilla_settings[' . $option['id'] . ']', $name, function_exists('saasaparilla_' . $option['type'] . '_callback') ? 'saasaparilla_' . $option['type'] . '_callback' : 'saasaparilla_missing_callback', 'saasaparilla_settings_' . $tab, 'saasaparilla_settings_' . $tab, array('section' => $tab, 'id' => isset($option['id']) ? $option['id'] : null, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'size' => isset($option['size']) ? $option['size'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : '', 'min' => isset($option['min']) ? $option['min'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'step' => isset($option['step']) ? $option['step'] : null, 'placeholder' => isset($option['placeholder']) ? $option['placeholder'] : null, 'rows' => isset($option['rows']) ? $option['rows'] : null, 'buttons' => isset($option['buttons']) ? $option['buttons'] : null, 'wpautop' => isset($option['wpautop']) ? $option['wpautop'] : null, 'teeny' => isset($option['teeny']) ? $option['teeny'] : null, 'notice' => isset($option['notice']) ? $option['notice'] : false, 'style' => isset($option['style']) ? $option['style'] : null, 'header' => isset($option['header']) ? $option['header'] : null, 'icon' => isset($option['icon']) ? $option['icon'] : null, 'class' => isset($option['class']) ? $option['class'] : null));
        }
    }
    register_setting('saasaparilla_settings', 'saasaparilla_settings', 'saasaparilla_settings_sanitize');
}
开发者ID:saivarunk,项目名称:SaaSaparilla,代码行数:20,代码来源:register.php

示例3: egt_register_settings

/**
 * Add all settings sections and fields
 *
 * @since  1.0
 * @author Bryan Monzon
 * @return void
*/
function egt_register_settings()
{
    if (false == get_option('egt_settings')) {
        add_option('egt_settings');
    }
    foreach (egt_get_registered_settings() as $tab => $settings) {
        add_settings_section('egt_settings_' . $tab, __return_null(), '__return_false', 'egt_settings_' . $tab);
        foreach ($settings as $option) {
            add_settings_field('egt_settings[' . $option['id'] . ']', $option['name'], function_exists('egt_' . $option['type'] . '_callback') ? 'egt_' . $option['type'] . '_callback' : 'egt_missing_callback', 'egt_settings_' . $tab, 'egt_settings_' . $tab, array('id' => $option['id'], 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => $option['name'], 'section' => $tab, 'size' => isset($option['size']) ? $option['size'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : ''));
        }
    }
    // Creates our settings in the options table
    register_setting('egt_settings', 'egt_settings', 'egt_settings_sanitize');
}
开发者ID:wpsetup,项目名称:easy-golf-tournaments,代码行数:21,代码来源:register-settings.php

示例4: admin_init

 /**
  * Registers the actual options via WordPress Settings API.
  *
  * @return void
  */
 static function admin_init()
 {
     if (false == get_option('portfolio_slideshow_options')) {
         add_option('portfolio_slideshow_options');
     }
     $registered_settings = self::get_registered_settings();
     foreach ($registered_settings as $tab => $settings) {
         add_settings_section('portfolio_slideshow_' . $tab, __return_null(), '__return_false', 'portfolio_slideshow');
         foreach ($settings as $option) {
             $name = isset($option['name']) ? $option['name'] : '';
             add_settings_field('portfolio_slideshow_' . $option['id'], $name, array(__CLASS__, 'callback_' . $option['type']), 'portfolio_slideshow', 'portfolio_slideshow_' . $tab, array('section' => $tab, 'id' => isset($option['id']) ? $option['id'] : null, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'size' => isset($option['size']) ? $option['size'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : '', 'min' => isset($option['min']) ? $option['min'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'step' => isset($option['step']) ? $option['step'] : null, 'placeholder' => isset($option['placeholder']) ? $option['placeholder'] : null));
         }
     }
     register_setting('portfolio_slideshow_options', 'portfolio_slideshow_options', array(__CLASS__, 'sanitize_options'));
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:20,代码来源:Settings.php

示例5: popmake_register_settings

/**
 * Add all settings sections and fields
 *
 * @since 1.0
 * @return void
 */
function popmake_register_settings()
{
    if (false == get_option('popmake_settings')) {
        add_option('popmake_settings', popmake_default_settings());
    }
    foreach (popmake_get_registered_settings() as $tab => $settings) {
        add_settings_section('popmake_settings_' . $tab, __return_null(), '__return_false', 'popmake_settings_' . $tab);
        foreach ($settings as $option) {
            $name = isset($option['name']) ? $option['name'] : '';
            add_settings_field('popmake_settings[' . $option['id'] . ']', $name, function_exists('popmake_' . $option['type'] . '_callback') ? 'popmake_' . $option['type'] . '_callback' : 'popmake_missing_callback', 'popmake_settings_' . $tab, 'popmake_settings_' . $tab, array('section' => $tab, 'id' => isset($option['id']) ? $option['id'] : null, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'size' => isset($option['size']) ? $option['size'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : '', 'min' => isset($option['min']) ? $option['min'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'step' => isset($option['step']) ? $option['step'] : null));
        }
    }
    // Creates our settings in the options table
    register_setting('popmake_settings', 'popmake_settings', 'popmake_settings_sanitize');
}
开发者ID:raminabsari,项目名称:phonicsschool,代码行数:21,代码来源:register-settings.php

示例6: register_settings

 /**
  * Add all settings sections and fields
  *
  * @since 1.0
  * @return void
  */
 function register_settings()
 {
     if (false == get_option('affwp_settings')) {
         add_option('affwp_settings');
     }
     foreach ($this->get_registered_settings() as $tab => $settings) {
         add_settings_section('affwp_settings_' . $tab, __return_null(), '__return_false', 'affwp_settings_' . $tab);
         foreach ($settings as $key => $option) {
             $name = isset($option['name']) ? $option['name'] : '';
             add_settings_field('affwp_settings[' . $key . ']', $name, is_callable(array($this, $option['type'] . '_callback')) ? array($this, $option['type'] . '_callback') : array($this, 'missing_callback'), 'affwp_settings_' . $tab, 'affwp_settings_' . $tab, array('id' => $key, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'section' => $tab, 'size' => isset($option['size']) ? $option['size'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'min' => isset($option['min']) ? $option['min'] : null, 'step' => isset($option['step']) ? $option['step'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : ''));
         }
     }
     // Creates our settings in the options table
     register_setting('affwp_settings', 'affwp_settings', array($this, 'sanitize_settings'));
 }
开发者ID:jwondrusch,项目名称:AffiliateWP,代码行数:21,代码来源:class-settings.php

示例7: register

 /**
  * Register the plugins core settings and options.
  *
  * @access private
  * @since  1.0
  * @static
  */
 public static function register()
 {
     if (FALSE === get_option('ez-toc-settings')) {
         add_option('ez-toc-settings', self::getDefaults());
     }
     foreach (self::getRegistered() as $section => $settings) {
         add_settings_section('ez_toc_settings_' . $section, __return_null(), '__return_false', 'ez_toc_settings_' . $section);
         foreach ($settings as $option) {
             $name = isset($option['name']) ? $option['name'] : '';
             add_settings_field('ez-toc-settings[' . $option['id'] . ']', $name, method_exists(__CLASS__, $option['type']) ? array(__CLASS__, $option['type']) : array(__CLASS__, 'missingCallback'), 'ez_toc_settings_' . $section, 'ez_toc_settings_' . $section, array('section' => $section, 'id' => isset($option['id']) ? $option['id'] : NULL, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : NULL, 'size' => isset($option['size']) ? $option['size'] : NULL, 'options' => isset($option['options']) ? $option['options'] : '', 'default' => isset($option['default']) ? $option['default'] : '', 'min' => isset($option['min']) ? $option['min'] : NULL, 'max' => isset($option['max']) ? $option['max'] : NULL, 'step' => isset($option['step']) ? $option['step'] : NULL, 'chosen' => isset($option['chosen']) ? $option['chosen'] : NULL, 'placeholder' => isset($option['placeholder']) ? $option['placeholder'] : NULL, 'allow_blank' => isset($option['allow_blank']) ? $option['allow_blank'] : TRUE, 'readonly' => isset($option['readonly']) ? $option['readonly'] : FALSE, 'faux' => isset($option['faux']) ? $option['faux'] : FALSE));
         }
     }
     // Creates our settings in the options table
     register_setting('ez-toc-settings', 'ez-toc-settings', array(__CLASS__, 'sanitize'));
 }
开发者ID:shazahm1,项目名称:Easy-Table-of-Contents,代码行数:22,代码来源:class.options.php

示例8: register_settings

 /**
  * Register all settings sections and fields.
  *
  * @since 	1.0.0
  * @return 	void
  */
 public function register_settings()
 {
     if (false == get_option('plugin_name_settings')) {
         add_option('plugin_name_settings', array(), '', 'yes');
     }
     foreach ($this->registered_settings as $tab => $settings) {
         // add_settings_section( $id, $title, $callback, $page )
         add_settings_section('plugin_name_settings_' . $tab, __return_null(), '__return_false', 'plugin_name_settings_' . $tab);
         foreach ($settings as $key => $option) {
             $_name = isset($option['name']) ? $option['name'] : $key;
             // add_settings_field( $id, $title, $callback, $page, $section, $args )
             add_settings_field('plugin_name_settings[' . $key . ']', $_name, method_exists($this->callback, $option['type'] . '_callback') ? array($this->callback, $option['type'] . '_callback') : array($this->callback, 'missing_callback'), 'plugin_name_settings_' . $tab, 'plugin_name_settings_' . $tab, array('id' => $key, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => $_name, 'section' => $tab, 'size' => isset($option['size']) ? $option['size'] : 'regular', 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : '', 'max' => isset($option['max']) ? $option['max'] : 999999, 'min' => isset($option['min']) ? $option['min'] : 0, 'step' => isset($option['step']) ? $option['step'] : 1));
         }
         // end foreach
     }
     // end foreach
     // Creates our settings in the options table
     register_setting('plugin_name_settings', 'plugin_name_settings', array($this->sanitization, 'settings_sanitize'));
 }
开发者ID:mavawi,项目名称:WordPress-Settings-Module,代码行数:25,代码来源:class-plugin-name-settings.php

示例9: register_settings

 /**
  * Add all settings sections and fields
  *
  * @since 1.0
  * @return void
  */
 function register_settings()
 {
     if (false == get_option('affwp_settings')) {
         add_option('affwp_settings');
     }
     foreach ($this->get_registered_settings() as $tab => $settings) {
         add_settings_section('affwp_settings_' . $tab, __return_null(), '__return_false', 'affwp_settings_' . $tab);
         foreach ($settings as $key => $option) {
             if ($option['type'] == 'checkbox' || $option['type'] == 'multicheck' || $option['type'] == 'radio') {
                 $name = isset($option['name']) ? $option['name'] : '';
             } else {
                 $name = isset($option['name']) ? '<label for="affwp_settings[' . $key . ']">' . $option['name'] . '</label>' : '';
             }
             $callback = !empty($option['callback']) ? $option['callback'] : array($this, $option['type'] . '_callback');
             add_settings_field('affwp_settings[' . $key . ']', $name, is_callable($callback) ? $callback : array($this, 'missing_callback'), 'affwp_settings_' . $tab, 'affwp_settings_' . $tab, array('id' => $key, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'section' => $tab, 'size' => isset($option['size']) ? $option['size'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'min' => isset($option['min']) ? $option['min'] : null, 'step' => isset($option['step']) ? $option['step'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : ''));
         }
     }
     // Creates our settings in the options table
     register_setting('affwp_settings', 'affwp_settings', array($this, 'sanitize_settings'));
 }
开发者ID:pmgarman,项目名称:AffiliateWP,代码行数:26,代码来源:class-settings.php

示例10: register_settings

 /**
  * Add all settings sections and fields
  *
  * @since 1.0.0
  *
  * @return void
  */
 public function register_settings()
 {
     // If blox_settings does not exist, create it. It should always exist, so this is just a backup
     if (false == get_option('blox_settings')) {
         add_option('blox_settings');
     }
     foreach ($this->get_registered_settings() as $tab => $settings) {
         add_settings_section('blox_settings_' . $tab, __return_null(), '__return_false', 'blox_settings_' . $tab);
         foreach ($settings as $option) {
             $name = isset($option['name']) ? $option['name'] : '';
             $callback = method_exists(__CLASS__, $option['type'] . '_callback') ? array($this, $option['type'] . '_callback') : array($this, 'missing_callback');
             add_settings_field('blox_settings[' . $option['id'] . ']', $name, $callback, 'blox_settings_' . $tab, 'blox_settings_' . $tab, array('section' => $tab, 'id' => isset($option['id']) ? $option['id'] : null, 'name' => isset($option['name']) ? $option['name'] : null, 'label' => !empty($option['label']) ? $option['label'] : '', 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'size' => isset($option['size']) ? $option['size'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'min' => isset($option['min']) ? $option['min'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'step' => isset($option['step']) ? $option['step'] : null, 'placeholder' => isset($option['placeholder']) ? $option['placeholder'] : null, 'class' => isset($option['class']) ? $option['class'] : null, 'default' => isset($option['default']) ? $option['default'] : '', 'sanitize' => isset($option['sanitize']) ? $option['sanitize'] : ''));
         }
     }
     // Creates our settings in the options table
     register_setting('blox_settings', 'blox_settings', array($this, 'settings_sanitize'));
 }
开发者ID:ndiego,项目名称:blox-lite,代码行数:24,代码来源:settings.php

示例11: maybe_process_form

 public static function maybe_process_form()
 {
     $nonce_value = isset($_REQUEST['sa_estimate_' . self::DEFAULT_NONCE]) ? $_REQUEST['sa_estimate_' . self::DEFAULT_NONCE] : false;
     if (!$nonce_value) {
         return;
     }
     if (!wp_verify_nonce($nonce_value, self::DEFAULT_NONCE)) {
         return;
     }
     do_action('si_process_estimate_submission');
     $success = self::process_form_submission();
     if ($success) {
         self::set_message(__('Estimate Submitted.', 'sprout-invoices'), self::MESSAGE_STATUS_INFO);
         wp_redirect(add_query_arg(self::SUBMISSION_SUCCESS_QV, true), apply_filters('si_estimate_submitted_redirect_url', __return_null()));
         exit;
     }
 }
开发者ID:danielbachhuber,项目名称:marcgratch.com,代码行数:17,代码来源:Estimate_Submission_Premium.php

示例12: _save_null

 public static function _save_null()
 {
     __return_null();
 }
开发者ID:EfncoPlugins,项目名称:sprout-invoices,代码行数:4,代码来源:_Controller.php

示例13: edd_register_settings

/**
 * Add all settings sections and fields
 *
 * @since 1.0
 * @return void
*/
function edd_register_settings()
{
    if (false == get_option('edd_settings')) {
        add_option('edd_settings');
    }
    foreach (edd_get_registered_settings() as $tab => $sections) {
        foreach ($sections as $section => $settings) {
            // Check for backwards compatibility
            $section_tabs = edd_get_settings_tab_sections($tab);
            if (!is_array($section_tabs) || !array_key_exists($section, $section_tabs)) {
                $section = 'main';
                $settings = $sections;
            }
            add_settings_section('edd_settings_' . $tab . '_' . $section, __return_null(), '__return_false', 'edd_settings_' . $tab . '_' . $section);
            foreach ($settings as $option) {
                // For backwards compatibility
                if (empty($option['id'])) {
                    continue;
                }
                $args = wp_parse_args($option, array('section' => $section, 'id' => null, 'desc' => '', 'name' => '', 'size' => null, 'options' => '', 'std' => '', 'min' => null, 'max' => null, 'step' => null, 'chosen' => null, 'placeholder' => null, 'allow_blank' => true, 'readonly' => false, 'faux' => false, 'tooltip_title' => false, 'tooltip_desc' => false, 'field_class' => ''));
                add_settings_field('edd_settings[' . $args['id'] . ']', $args['name'], function_exists('edd_' . $args['type'] . '_callback') ? 'edd_' . $args['type'] . '_callback' : 'edd_missing_callback', 'edd_settings_' . $tab . '_' . $section, 'edd_settings_' . $tab . '_' . $section, $args);
            }
        }
    }
    // Creates our settings in the options table
    register_setting('edd_settings', 'edd_settings', 'edd_settings_sanitize');
}
开发者ID:benjaminprojas,项目名称:Easy-Digital-Downloads,代码行数:33,代码来源:register-settings.php

示例14: shoestrap_blank

/**
 * Alias of __return_null
 */
function shoestrap_blank()
{
    _shoestrap_deprecated_function(__FUNCTION__, '3.2', '__return_null()');
    return __return_null();
}
开发者ID:MinecraftServernet,项目名称:shoestrap-3,代码行数:8,代码来源:deprecated.php

示例15: kbs_register_settings

/**
 * Add all settings sections and fields.
 *
 * @since	1.0
 * @return	void
*/
function kbs_register_settings()
{
    if (false == get_option('kbs_settings')) {
        add_option('kbs_settings');
    }
    foreach (kbs_get_registered_settings() as $tab => $sections) {
        foreach ($sections as $section => $settings) {
            // Check for backwards compatibility
            $section_tabs = kbs_get_settings_tab_sections($tab);
            if (!is_array($section_tabs) || !array_key_exists($section, $section_tabs)) {
                $section = 'main';
                $settings = $sections;
            }
            add_settings_section('kbs_settings_' . $tab . '_' . $section, __return_null(), '__return_false', 'kbs_settings_' . $tab . '_' . $section);
            foreach ($settings as $option) {
                // For backwards compatibility
                if (empty($option['id'])) {
                    continue;
                }
                $name = isset($option['name']) ? $option['name'] : '';
                add_settings_field('kbs_settings[' . $option['id'] . ']', $name, function_exists('kbs_' . $option['type'] . '_callback') ? 'kbs_' . $option['type'] . '_callback' : 'kbs_missing_callback', 'kbs_settings_' . $tab . '_' . $section, 'kbs_settings_' . $tab . '_' . $section, array('section' => $section, 'id' => isset($option['id']) ? $option['id'] : null, 'desc' => !empty($option['desc']) ? $option['desc'] : '', 'name' => isset($option['name']) ? $option['name'] : null, 'size' => isset($option['size']) ? $option['size'] : null, 'options' => isset($option['options']) ? $option['options'] : '', 'std' => isset($option['std']) ? $option['std'] : '', 'min' => isset($option['min']) ? $option['min'] : null, 'max' => isset($option['max']) ? $option['max'] : null, 'step' => isset($option['step']) ? $option['step'] : null, 'chosen' => isset($option['chosen']) ? $option['chosen'] : null, 'placeholder' => isset($option['placeholder']) ? $option['placeholder'] : null, 'allow_blank' => isset($option['allow_blank']) ? $option['allow_blank'] : true, 'readonly' => isset($option['readonly']) ? $option['readonly'] : false, 'faux' => isset($option['faux']) ? $option['faux'] : false));
            }
        }
    }
    // Creates our settings in the options table
    register_setting('kbs_settings', 'kbs_settings', 'kbs_settings_sanitize');
}
开发者ID:KB-Support,项目名称:kb-support,代码行数:33,代码来源:register-settings.php


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