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

PHP wp_parse_args函数代码示例

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

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



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

示例1: form

 /**
  * Render form
  *
  * @since 0.1.0
  *
  * @param Lsx_Properties_Widget $instance Class instance
  */
 function form($instance)
 {
     $instance = wp_parse_args((array) $instance, array('title' => '', 'order' => '', 'limit' => '', 'featured' => false, 'slider' => false));
     $title = strip_tags($instance['title']);
     $limit = strip_tags($instance['limit']);
     $isrand = '';
     if ($instance['order'] == 'rand') {
         $isrand = 'selected="selected"';
     }
     $isrecent = '';
     if ($instance['order'] == 'order_recent') {
         $isrecent = 'selected="selected"';
     }
     echo "<p><label for=\" " . $this->get_field_id('title') . "\">" . __('Title', 'happybeds-properties') . ": <input class=\"widefat\" id=\"" . $this->get_field_id('title') . "\" name=\"" . $this->get_field_name('title') . "\" type=\"text\" value=\"" . esc_attr($title) . "\" /></label></p>\r\n";
     echo "<p><label for=\" " . $this->get_field_id('limit') . "\">" . __('Limit', 'happybeds-properties') . ": <input id=\"" . $this->get_field_id('limit') . "\" name=\"" . $this->get_field_name('limit') . "\" type=\"number\" value=\"" . esc_attr($limit) . "\" /></label></p>\r\n";
     $featured = '';
     if (!empty($instance['featured'])) {
         $featured = 'checked="checked"';
     }
     echo "<p><label for=\"" . $this->get_field_id('featured') . "\">" . __('Show Featured Only', 'happybeds-properties') . ": <input id=\"" . $this->get_field_id('featured') . "\" " . $featured . " type=\"checkbox\" name=\"" . $this->get_field_name('featured') . "\" ></label>\r\n";
     $slider = '';
     if (!empty($instance['slider'])) {
         $slider = 'checked="checked"';
     }
     echo "<p><label for=\" " . $this->get_field_id('order') . "\">" . __('Order', 'happybeds-properties') . ": </label><select style=\"width:100%;\" name=\"" . $this->get_field_name('order') . "\">\r\n";
     echo "<option value=\"\"></option>\r\n";
     echo "<option value=\"rand\" " . $isrand . "\">" . __('Random', 'happybeds-properties') . "</option>\r\n";
     echo "<option value=\"order_recent\" " . $isrecent . ">" . __('Recent', 'happybeds-properties') . "</option>\r\n";
     echo "</select></p>\r\n";
     echo "<p><label for=\"" . $this->get_field_id('slider') . "\">" . __('Show as Slider', 'happybeds-properties') . ": <input id=\"" . $this->get_field_id('slider') . "\" " . $slider . " type=\"checkbox\" name=\"" . $this->get_field_name('slider') . "\" ></label>\r\n";
 }
开发者ID:JustinDMathew,项目名称:lsx-framework,代码行数:38,代码来源:class-widget.php


示例2: normalize_field

 /**
  * Add default value for 'taxonomy' field
  *
  * @param $field
  *
  * @return array
  */
 static function normalize_field($field)
 {
     $default_args = array('hide_empty' => false);
     // Set default args
     $field['options']['args'] = !isset($field['options']['args']) ? $default_args : wp_parse_args($field['options']['args'], $default_args);
     $tax = get_taxonomy($field['options']['taxonomy']);
     $field['placeholder'] = empty($field['placeholder']) ? sprintf(__('Select a %s', 'framework'), $tax->labels->singular_name) : $field['placeholder'];
     switch ($field['options']['type']) {
         case 'select_advanced':
             $field = RWMB_Select_Advanced_Field::normalize_field($field);
             break;
         case 'checkbox_list':
         case 'checkbox_tree':
             $field = RWMB_Checkbox_List_Field::normalize_field($field);
             break;
         case 'select':
         case 'select_tree':
             $field = RWMB_Select_Field::normalize_field($field);
             break;
         default:
             $field['options']['type'] = 'select';
             $field = RWMB_Select_Field::normalize_field($field);
     }
     if (in_array($field['options']['type'], array('checkbox_tree', 'select_tree'))) {
         if (isset($field['options']['args']['parent'])) {
             $field['options']['parent'] = $field['options']['args']['parent'];
             unset($field['options']['args']['parent']);
         } else {
             $field['options']['parent'] = 0;
         }
     }
     $field['field_name'] = "{$field['id']}[]";
     return $field;
 }
开发者ID:ahmedelhadi,项目名称:TestProject,代码行数:41,代码来源:taxonomy.php


示例3: form

    /** 
     *	Create the necessary form to customize the widget.
     *
     *	@uses		title	@since 0.1
     *
     *	@author		Nate Jacobs
     *	@since		0.1
     *
     *	@param		array
     */
    public function form($instance)
    {
        $instance = wp_parse_args((array) $instance, array('title' => __('Brickset Themes', 'bs_api')));
        $title = esc_attr($instance['title']);
        ?>
		<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title', 'bs_api');
        ?>
:</label>
			<input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
">
		</p>
		<?php 
    }
开发者ID:pedro-mendonca,项目名称:Brickset-API,代码行数:36,代码来源:class-theme-widget.php


示例4: parse_settings

 public static function parse_settings($editor_id, $settings)
 {
     $set = wp_parse_args($settings, array('wpautop' => true, 'media_buttons' => true, 'textarea_name' => $editor_id, 'textarea_rows' => 20, 'tabindex' => '', 'tabfocus_elements' => ':prev,:next', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => true));
     self::$this_tinymce = $set['tinymce'] && user_can_richedit();
     self::$this_quicktags = (bool) $set['quicktags'];
     if (self::$this_tinymce) {
         self::$has_tinymce = true;
     }
     if (self::$this_quicktags) {
         self::$has_quicktags = true;
     }
     if (empty($set['editor_height'])) {
         return $set;
     }
     if ('content' === $editor_id) {
         // A cookie (set when a user resizes the editor) overrides the height.
         $cookie = (int) get_user_setting('ed_size');
         // Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
         if (!$cookie && isset($_COOKIE['TinyMCE_content_size'])) {
             parse_str($_COOKIE['TinyMCE_content_size'], $cookie);
             $cookie = $cookie['ch'];
         }
         if ($cookie) {
             $set['editor_height'] = $cookie;
         }
     }
     if ($set['editor_height'] < 50) {
         $set['editor_height'] = 50;
     } elseif ($set['editor_height'] > 5000) {
         $set['editor_height'] = 5000;
     }
     return $set;
 }
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:33,代码来源:class-wp-editor.php


示例5: __construct

 /**
  * Constructor method for the UI_Stepper class.
  *
  * @since  4.0.0
  */
 function __construct($args = array())
 {
     $this->defaults_settings['id'] = 'cherry-ui-stepper-' . uniqid();
     $this->settings = wp_parse_args($args, $this->defaults_settings);
     add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_assets'));
     self::enqueue_assets();
 }
开发者ID:roberto-alarcon,项目名称:Neuroglobal,代码行数:12,代码来源:ui-stepper.php


示例6: form

    function form($instance)
    {
        $defaults = array('title' => '', 'link' => '');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        ?>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				Title (optional)
				<?php 
        echo aq_field_input('title', $block_id, $title, $size = 'full');
        ?>
			</label>
		</p>
		
		<p class="description">
			<label for="<?php 
        echo $this->get_field_id('link');
        ?>
">
				Link Download (optional)
				<?php 
        echo aq_field_input('link', $block_id, $link, $size = 'full');
        ?>
			</label>
		</p>
		
		<?php 
    }
开发者ID:egamboa,项目名称:estebangam,代码行数:33,代码来源:st-download-block.php


示例7: mm_ux_log

function mm_ux_log($args = array())
{
    $url = "https://ssl.google-analytics.com/collect";
    global $title;
    if (empty($_SERVER['REQUEST_URI'])) {
        return;
    }
    $path = explode('wp-admin', $_SERVER['REQUEST_URI']);
    if (empty($path) || empty($path[1])) {
        $path = array("", " ");
    }
    $defaults = array('v' => '1', 'tid' => 'UA-39246514-3', 't' => 'pageview', 'cid' => md5(get_option('siteurl')), 'uid' => md5(get_option('siteurl') . get_current_user_id()), 'cn' => 'mojo_wp_plugin', 'cs' => 'mojo_wp_plugin', 'cm' => 'plugin_admin', 'ul' => get_locale(), 'dp' => $path[1], 'sc' => '', 'ua' => @$_SERVER['HTTP_USER_AGENT'], 'dl' => $path[1], 'dh' => get_option('siteurl'), 'dt' => $title, 'ec' => '', 'ea' => '', 'el' => '', 'ev' => '');
    if (isset($_SERVER['REMOTE_ADDR'])) {
        $defaults['uip'] = $_SERVER['REMOTE_ADDR'];
    }
    $params = wp_parse_args($args, $defaults);
    $test = get_transient('mm_test', '');
    if (isset($test['key']) && isset($test['name'])) {
        $params['cm'] = $params['cm'] . "_" . $test['name'] . "_" . $test['key'];
    }
    //use test account for testing
    if (defined('WP_DEBUG') && WP_DEBUG) {
        $params['tid'] = 'UA-19617272-27';
    }
    $z = wp_rand(0, 1000000000);
    $query = http_build_query(array_filter($params));
    $args = array('body' => $query, 'method' => 'POST', 'blocking' => false);
    $url = add_query_arg(array('z' => $z), $url);
    wp_remote_post($url, $args);
}
开发者ID:hyperhy,项目名称:hyperhy,代码行数:30,代码来源:user-experience-tracking.php


示例8: get_valid_layout

 function get_valid_layout($layout = array())
 {
     // parse
     $layout = wp_parse_args($layout, array('key' => uniqid(), 'name' => '', 'label' => '', 'display' => 'block', 'sub_fields' => array(), 'min' => '', 'max' => ''));
     // return
     return $layout;
 }
开发者ID:Aqro,项目名称:NewDWM,代码行数:7,代码来源:flexible-content.php


示例9: render

 /**
  * Field Render Function.
  *
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since ReduxFramework 3.0.0
  */
 function render()
 {
     if (empty($this->field['min'])) {
         $this->field['min'] = 0;
     } else {
         $this->field['min'] = intval($this->field['min']);
     }
     if (empty($this->field['max'])) {
         $this->field['max'] = intval($this->field['min']) + 1;
     } else {
         $this->field['max'] = intval($this->field['max']);
     }
     if (empty($this->field['step']) || $this->field['step'] > $this->field['max']) {
         $this->field['step'] = 1;
     } else {
         $this->field['step'] = intval($this->field['step']);
     }
     if (empty($this->value) && !empty($this->field['default']) && intval($this->field['min']) >= 1) {
         $this->value = intval($this->field['default']);
     }
     if (empty($this->value) && intval($this->field['min']) >= 1) {
         $this->value = intval($this->field['min']);
     }
     if (empty($this->value)) {
         $this->value = 0;
     }
     // Extra Validation
     if ($this->value < $this->field['min']) {
         $this->value = intval($this->field['min']);
     } else {
         if ($this->value > $this->field['max']) {
             $this->value = intval($this->field['max']);
         }
     }
     $params = array('id' => '', 'min' => '', 'max' => '', 'step' => '', 'val' => '', 'default' => '');
     $params = wp_parse_args($this->field, $params);
     $params['val'] = $this->value;
     // Don't allow input edit if there's a step
     $readonly = "";
     if (isset($this->field['edit']) && $this->field['edit'] == false) {
         $readonly = ' readonly="readonly"';
     }
     // Use javascript globalization, better than any other method.
     global $wp_scripts;
     $data = $wp_scripts->get_data('redux-field-spinner-js', 'data');
     if (!empty($data)) {
         // Adding to the previous localize script object
         if (!is_array($data)) {
             $data = json_decode(str_replace('var reduxSpinners = ', '', substr($data, 0, -1)), true);
         }
         foreach ($data as $key => $value) {
             $localized_data[$key] = $value;
         }
         $wp_scripts->add_data('redux-field-spinner-js', 'data', '');
     }
     $localized_data[$this->field['id']] = $params;
     wp_localize_script('redux-field-spinner-js', 'reduxSpinners', $localized_data);
     echo '<input type="text" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" id="' . $this->field['id'] . '" value="' . $this->value . '" class="mini spinner-input' . $this->field['class'] . '"' . $readonly . '/>';
     echo '<div id="' . $this->field['id'] . '-spinner" class="redux_spinner" rel="' . $this->field['id'] . '"></div>';
 }
开发者ID:Bitcoinsulting,项目名称:website-ads,代码行数:67,代码来源:field_spinner.php


示例10: __construct

 /**
  * Construct function that set message and default args
  * @param string $msg  
  * @param array $args 
  */
 public function __construct($msg, $args = '')
 {
     $defaults = array('type' => 'error', 'where' => 'header', 'auto_close' => true, 'delay' => '5');
     $this->args = wp_parse_args($args, $defaults);
     $this->msg = $msg;
     $this->run();
 }
开发者ID:Saigesp,项目名称:wp-design-community,代码行数:12,代码来源:class-frontend-box.php


示例11: wpsr_digg

function wpsr_digg($args = '')
{
    global $post;
    $details = wpsr_get_post_details();
    $def_url = $details['permalink'];
    $def_title = $details['title'];
    $defaults = array('output' => 'button', 'url' => $def_url, 'title' => $def_title, 'type' => 'DiggMedium', 'text' => __('Digg this', 'wpsr'), 'image' => WPSR_PUBLIC_URL . 'buttons/digg-bt.png', 'params' => '');
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $digg_processed = "\n<!-- Start WP Socializer Plugin - Digg Button -->\n";
    switch ($output) {
        // Display the ordinary button
        case 'button':
            $digg_processed .= '<a class="DiggThisButton ' . $type . '" href="http://digg.com/submit?url=' . urlencode($url) . '&amp;title=' . urlencode($title) . '" ' . $params . '></a>';
            break;
            // Display the Image format
        // Display the Image format
        case 'image':
            $digg_processed .= '<a href="http://digg.com/submit?url=' . urlencode($url) . '&amp;title=' . urlencode($title) . '" ' . $params . '><img src="' . $image . '" alt="Digg!"  /></a>';
            break;
            // Display the Text format
        // Display the Text format
        case 'text':
            $digg_processed .= '<a href="http://digg.com/submit?url=' . urlencode($url) . '&amp;title=' . urlencode($title) . '" ' . $params . '>' . $text . '</a>';
            break;
    }
    $digg_processed .= "\n<!-- End WP Socializer Plugin - Digg Button -->\n";
    return $digg_processed;
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:29,代码来源:wpsr-digg.php


示例12: __construct

 /**
  * __construct function.
  * 
  * @access public
  * @return void
  */
 public function __construct($args)
 {
     global $NF_Pushover;
     $defaults = array('parent_slug' => 'options-general.php', 'page_title' => $NF_Pushover->name, 'menu_title' => $NF_Pushover->name, 'capability' => 'manage_options', 'menu_slug' => $NF_Pushover->token, 'default_tab' => isset($NF_Pushover->default_tab) ? $NF_Pushover->default_tab : '', 'screen_icon' => 'options-general');
     $this->args = wp_parse_args($args, $defaults);
     add_action('admin_menu', array($this, 'register_settings_screen'));
 }
开发者ID:emtv,项目名称:hackmsi,代码行数:13,代码来源:class-nf-pushover-settings-screen.php


示例13: woo_enforce_defaults

 function woo_enforce_defaults($instance)
 {
     $defaults = $this->woo_get_settings();
     $instance = wp_parse_args($instance, $defaults);
     if ($instance['limit'] < 1) {
         $instance['limit'] = 1;
     } elseif ($instance['limit'] > 10) {
         $instance['limit'] = 10;
     }
     $instance['width'] = absint($instance['width']);
     if ($instance['width'] < 1) {
         $instance['width'] = $defaults['width'];
     }
     $instance['height'] = absint($instance['height']);
     if ($instance['height'] < 1) {
         $instance['height'] = $defaults['height'];
     }
     if ($instance['sorting'] != 'random') {
         $instance['sorting'] = $defaults['sorting'];
     }
     if (!in_array($instance['size'], array('s', 'm', 't'))) {
         $instance['size'] = $defaults['size'];
     }
     if ($instance['type'] != 'group') {
         $instance['type'] = $defaults['type'];
     }
     return $instance;
 }
开发者ID:iplaydu,项目名称:Bob-Ellis-Shoes,代码行数:28,代码来源:widget-woo-flickr.php


示例14: getForm

 /**
  * Returns HTML settings form. Should be a collection of <tr> elements containing two columns.
  *
  * @return string HTML snippet
  */
 function getForm()
 {
     global $wpdb;
     $shipping = wp_parse_args(get_option('flat_rates'), array('southisland' => '', 'northisland' => '', 'continental' => '', 'all' => '', 'local' => '', 'northamerica' => '', 'southamerica' => '', 'asiapacific' => '', 'europe' => '', 'africa' => ''));
     $output = "<tr><td colspan='2'>";
     $output .= "<table>";
     $output .= "<tr><th colspan='2'><strong>" . __('Base Local', 'wp-e-commerce') . "</strong></th></tr>";
     switch (get_option('base_country')) {
         case 'NZ':
             $output .= $this->settings_form_shipping_price_field('southisland', __('South Island', 'wp-e-commerce'), $shipping['southisland']);
             $output .= $this->settings_form_shipping_price_field('northisland', __('North Island', 'wp-e-commerce'), $shipping['northisland']);
             break;
         case 'US':
             $output .= $this->settings_form_shipping_price_field('continental', __('Continental 48 States', 'wp-e-commerce'), $shipping['continental']);
             $output .= $this->settings_form_shipping_price_field('all', __('All 50 States', 'wp-e-commerce'), $shipping['all']);
             break;
         default:
             $output .= $this->settings_form_shipping_price_field('local', __('Domestic', 'wp-e-commerce'), $shipping['local']);
             break;
     }
     $output .= "<tr><th colspan='2'><strong>" . __('Base International', 'wp-e-commerce') . "</strong></th></tr>";
     $output .= $this->settings_form_shipping_price_field('northamerica', __('North America', 'wp-e-commerce'), $shipping['northamerica']);
     $output .= $this->settings_form_shipping_price_field('southamerica', __('South America', 'wp-e-commerce'), $shipping['southamerica']);
     $output .= $this->settings_form_shipping_price_field('asiapacific', __('Asia and Pacific', 'wp-e-commerce'), $shipping['asiapacific']);
     $output .= $this->settings_form_shipping_price_field('europe', __('Europe', 'wp-e-commerce'), $shipping['europe']);
     $output .= $this->settings_form_shipping_price_field('africa', __('Africa', 'wp-e-commerce'), $shipping['africa']);
     $output .= "</table>";
     $output .= "<br /><p class='description'>" . __('If you do not wish to ship to a particular region, leave the field blank. To offer free shipping to a region, enter 0.', 'wp-e-commerce') . "</p>";
     $output .= "</td></tr>";
     return $output;
 }
开发者ID:ashik968,项目名称:digiplot,代码行数:36,代码来源:flatrate.php


示例15: hybrid_register_sidebars

/**
 * Registers the default framework dynamic sidebars based on the sidebars the theme has added support 
 * for using add_theme_support().
 *
 * @since 0.7.0
 * @access private
 * @uses register_sidebar() Registers a sidebar with WordPress.
 * @link http://codex.wordpress.org/Function_Reference/register_sidebar
 * @return void
 */
function hybrid_register_sidebars()
{
    /* Get the theme-supported sidebars. */
    $supported_sidebars = get_theme_support('hybrid-core-sidebars');
    /* If the theme doesn't add support for any sidebars, return. */
    if (!is_array($supported_sidebars[0])) {
        return;
    }
    /* Get the available core framework sidebars. */
    $core_sidebars = hybrid_get_sidebars();
    /* Loop through the supported sidebars. */
    foreach ($supported_sidebars[0] as $sidebar) {
        /* Make sure the given sidebar is one of the core sidebars. */
        if (isset($core_sidebars[$sidebar])) {
            /* Set up some default sidebar arguments. */
            $defaults = array('before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-wrap widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
            /* Allow developers to filter the default sidebar arguments. */
            $defaults = apply_filters(hybrid_get_prefix() . '_sidebar_defaults', $defaults, $sidebar);
            /* Parse the sidebar arguments and defaults. */
            $args = wp_parse_args($core_sidebars[$sidebar], $defaults);
            /* If no 'id' was given, use the $sidebar variable and sanitize it. */
            $args['id'] = isset($args['id']) ? sanitize_key($args['id']) : sanitize_key($sidebar);
            /* Allow developers to filter the sidebar arguments. */
            $args = apply_filters(hybrid_get_prefix() . '_sidebar_args', $args, $sidebar);
            /* Register the sidebar. */
            register_sidebar($args);
        }
    }
}
开发者ID:jacko5,项目名称:bjj,代码行数:39,代码来源:sidebars.php


示例16: form

 /**
  * Displays the widget admin form
  *
  * @since 6.0
  * @access public
  */
 function form($instance)
 {
     $defaults = array('default_action' => 'login', 'logged_in_widget' => 1, 'show_title' => 1, 'show_log_link' => 1, 'show_reg_link' => 1, 'show_pass_link' => 1, 'show_gravatar' => 1, 'gravatar_size' => 50, 'register_widget' => 1, 'lostpassword_widget' => 1);
     $instance = wp_parse_args($instance, $defaults);
     $actions = array('login' => __('Login', 'theme-my-login'), 'register' => __('Register', 'theme-my-login'), 'lostpassword' => __('Lost Password', 'theme-my-login'));
     echo '<p>' . __('Default Action', 'theme-my-login') . '<br /><select name="' . $this->get_field_name('default_action') . '" id="' . $this->get_field_id('default_action') . '">';
     foreach ($actions as $action => $title) {
         $is_selected = $instance['default_action'] == $action ? ' selected="selected"' : '';
         echo '<option value="' . $action . '"' . $is_selected . '>' . $title . '</option>';
     }
     echo '</select></p>' . "\n";
     $is_checked = empty($instance['logged_in_widget']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('logged_in_widget') . '" type="checkbox" id="' . $this->get_field_id('logged_in_widget') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('logged_in_widget') . '">' . __('Show When Logged In', 'theme-my-login') . '</label></p>' . "\n";
     $is_checked = empty($instance['show_title']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('show_title') . '" type="checkbox" id="' . $this->get_field_id('show_title') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_title') . '">' . __('Show Title', 'theme-my-login') . '</label></p>' . "\n";
     $is_checked = empty($instance['show_log_link']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('show_log_link') . '" type="checkbox" id="' . $this->get_field_id('show_log_link') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_log_link') . '">' . __('Show Login Link', 'theme-my-login') . '</label></p>' . "\n";
     $is_checked = empty($instance['show_reg_link']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('show_reg_link') . '" type="checkbox" id="' . $this->get_field_id('show_reg_link') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_reg_link') . '">' . __('Show Register Link', 'theme-my-login') . '</label></p>' . "\n";
     $is_checked = empty($instance['show_pass_link']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('show_pass_link') . '" type="checkbox" id="' . $this->get_field_id('show_pass_link') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_pass_link') . '">' . __('Show Lost Password Link', 'theme-my-login') . '</label></p>' . "\n";
     $is_checked = empty($instance['show_gravatar']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('show_gravatar') . '" type="checkbox" id="' . $this->get_field_id('show_gravatar') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('show_gravatar') . '">' . __('Show Gravatar', 'theme-my-login') . '</label></p>' . "\n";
     echo '<p>' . __('Gravatar Size', 'theme-my-login') . ': <input name="' . $this->get_field_name('gravatar_size') . '" type="text" id="' . $this->get_field_id('gravatar_size') . '" value="' . $instance['gravatar_size'] . '" size="3" /> <label for="' . $this->get_field_id('gravatar_size') . '"></label></p>' . "\n";
     $is_checked = empty($instance['register_widget']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('register_widget') . '" type="checkbox" id="' . $this->get_field_id('register_widget') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('register_widget') . '">' . __('Allow Registration', 'theme-my-login') . '</label></p>' . "\n";
     $is_checked = empty($instance['lostpassword_widget']) ? '' : 'checked="checked" ';
     echo '<p><input name="' . $this->get_field_name('lostpassword_widget') . '" type="checkbox" id="' . $this->get_field_id('lostpassword_widget') . '" value="1" ' . $is_checked . '/> <label for="' . $this->get_field_id('lostpassword_widget') . '">' . __('Allow Password Recovery', 'theme-my-login') . '</label></p>' . "\n";
 }
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:35,代码来源:class-theme-my-login-widget.php


示例17: render

 /**
  * Field Render Function.
  *
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function render()
 {
     echo '</fieldset></td></tr><tr><td colspan="2"><fieldset class="redux-field redux-container-custom_font">';
     $nonce = wp_create_nonce("redux_{$this->parent->args['opt_name']}_custom_fonts");
     // No errors please
     $defaults = array('id' => '', 'url' => '', 'width' => '', 'height' => '', 'thumbnail' => '');
     $this->value = wp_parse_args($this->value, $defaults);
     $this->field['custom_fonts'] = apply_filters("redux/{$this->parent->args['opt_name']}/field/typography/custom_fonts", array());
     if (!empty($this->field['custom_fonts'])) {
         foreach ($this->field['custom_fonts'] as $section => $fonts) {
             if (empty($fonts)) {
                 continue;
             }
             echo '<h3>' . $section . '</h3>';
             echo '<table class="wp-list-table widefat plugins" cellspacing="0"><tbody>';
             foreach ($fonts as $font => $pieces) {
                 echo '<tr class="active">';
                 echo '<td class="plugin-title" style="min-width: 40%"><strong>' . $font . '</strong></td>';
                 echo '<td class="column-description desc"><div class="plugin-description">';
                 if (!empty($pieces)) {
                     foreach ($pieces as $piece) {
                         echo "<span class=\"button button-primary button-small font-pieces\">{$piece}</span> ";
                     }
                 }
                 echo '</div></td><td style="width: 140px;"><div class="action-row visible"><span style="display:none;"><a href="#" class="rename">Rename</a> | </span><a href="#" class="fontDelete delete" data-section="' . $section . '" data-name="' . $font . '" data-type="delete">Delete</a><span class="spinner" style="display: none;"></span></div></td></tr>';
             }
             echo '</tbody></table>';
             echo '<div class="upload_button_div"><span class="button media_add_font" data-nonce="' . $nonce . '" id="' . $this->field['id'] . '-custom_fonts">' . __('Add Font', 'redux-framework') . '</span></div><br />';
         }
     } else {
         echo "<h3>" . __('No Custom Fonts Found', 'redux-framework') . "</h3>";
         echo '<div class="upload_button_div"><span class="button media_add_font" data-nonce="' . $nonce . '" id="' . $this->field['id'] . '-custom_fonts">' . __('Add Font', 'redux-framework') . '</span></div>';
     }
     echo '</fieldset></td></tr>';
 }
开发者ID:egamboa,项目名称:estebangam,代码行数:44,代码来源:field_custom_fonts.php


示例18: normalize

 /**
  * Normalize parameters for field
  *
  * @param array $field
  *
  * @return array
  */
 static function normalize($field)
 {
     $field = parent::normalize($field);
     $field = wp_parse_args($field, array('prefix' => '', 'suffix' => '', 'std' => '', 'js_options' => array()));
     $field['js_options'] = wp_parse_args($field['js_options'], array('range' => 'min', 'value' => $field['std']));
     return $field;
 }
开发者ID:rilwis,项目名称:meta-box,代码行数:14,代码来源:slider.php


示例19: set_theme_mods

 /**
  * Update theme modifications for the current theme.
  * Note: Candidate core function.
  * http://core.trac.wordpress.org/ticket/20091
  *
  * @since 3.4.0
  *
  * @param array $mods Theme modifications.
  */
 public function set_theme_mods($mods)
 {
     $current = get_theme_mods();
     $mods = wp_parse_args($mods, $current);
     $theme = get_stylesheet();
     update_option("theme_mods_{$theme}", $mods);
 }
开发者ID:radman,项目名称:noobyo-blog,代码行数:16,代码来源:class-wp-customize.php


示例20: ci_the_post_thumbnail_full

 function ci_the_post_thumbnail_full($args = array())
 {
     $args = wp_parse_args((array) $args, array('class' => '', 'noalign' => false));
     $attr = array();
     if (ci_setting('featured_full_use_full') == 'full') {
         $attr['class'] = $args['class'];
         //			if($args['noalign'] === false)
         //			{
         //				$attr['class'] .= ' '.ci_setting('featured_single_align').' ';
         //			}
         if (empty($attr['class'])) {
             unset($attr['class']);
         }
         the_post_thumbnail('ci_featured_full', $attr);
     }
     if (ci_setting('featured_full_use_full') == 'single') {
         $attr['class'] = $args['class'];
         if ($args['noalign'] === false) {
             $attr['class'] .= ' ' . ci_setting('featured_single_align') . ' ';
         }
         if (empty($attr['class'])) {
             unset($attr['class']);
         }
         the_post_thumbnail('ci_featured_single', $attr);
     }
     if (ci_setting('featured_full_use_full') == 'disabled') {
         // Do nothing
     }
 }
开发者ID:nickolasnikolic,项目名称:wordpress-heroku-php,代码行数:29,代码来源:featured_image_fullwidth.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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