private static function after($description = '') { SB_Field::the_description($description); ?> </td> </tr> <?php }
public static function add_recaptcha_setting_field_callback() { $options = SB_Option::get(); $value = isset($options['global']['recaptcha']['site_key']) ? $options['global']['recaptcha']['site_key'] : ''; $args = array('id' => 'sb_core_global_recaptcha_site_key', 'name' => SB_Option::build_sb_option_name(array('global', 'recaptcha', 'site_key')), 'value' => $value, 'description' => __('The Google reCaptcha Site key, you can use this in the HTML code your site serves to users.', 'sb-core'), 'container_class' => 'margin-bottom'); SB_Field::text($args); $value = isset($options['global']['recaptcha']['secret_key']) ? $options['global']['recaptcha']['secret_key'] : ''; $args = array('id' => 'sb_core_global_recaptcha_secret_key', 'name' => SB_Option::build_sb_option_name(array('global', 'recaptcha', 'secret_key')), 'value' => $value, 'description' => __('The reCaptcha Secret key, you can use this for communication between your site and Google.', 'sb-core')); SB_Field::text($args); }
function sb_paginate_label_callback() { $options = SB_Option::get(); $value = isset($options['paginate']['label']) ? $options['paginate']['label'] : __('Trang', 'sb-paginate'); $id = 'sb_paginate_label'; $name = 'sb_options[paginate][label]'; $description = __('The label text to display before pagination.', 'sb-comment'); $args = array('id' => $id, 'name' => $name, 'value' => $value, 'description' => $description); SB_Field::text_field($args); }
public static function image_upload($args = array()) { $id = ''; $label = ''; $description = ''; $name = ''; if (is_array($args)) { extract($args, EXTR_OVERWRITE); } if (empty($id) || empty($name)) { return; } self::before($id, $label); $args['container_class'] = isset($args['container_class']) ? $args['container_class'] . ' small' : 'small'; $args['label'] = ''; SB_Field::media_upload_with_remove_and_preview($args); self::after($description); }
public static function image_upload($args = array()) { $name = self::get_name($args); $container_class = isset($args['container_class']) ? trim($args['container_class']) : ''; $container_class = SB_PHP::add_string_with_space_before($container_class, 'sb-media-upload'); $preview = isset($args['preview']) ? (bool) $args['preview'] : false; $label = isset($args['label']) ? $args['label'] : ''; $container_class = SB_PHP::add_string_with_space_before($container_class, 'sb-post-meta-row'); $tag = 'p'; if ($preview) { $tag = 'div'; } $value = isset($args['value']) ? $args['value'] : ''; $image_preview_class = 'image-preview'; if (!empty($value)) { $image_preview_class = SB_PHP::add_string_with_space_before($image_preview_class, 'has-image'); } ?> <<?php echo $tag; ?> class="<?php echo $container_class; ?> "> <label for="<?php echo esc_attr($name); ?> " class="display-block"><?php echo $label; ?> :</label> <?php SB_Field::media_upload_group($args); ?> <?php if ($preview) { ?> <div class="<?php echo $image_preview_class; ?> "> <?php if (!empty($value)) { ?> <img src="<?php echo $value; ?> " alt=""> <?php } ?> </div> <?php } ?> </<?php echo $tag; ?> > <?php }
public static function media_upload($args = array()) { SB_Field::media_upload_with_remove_and_preview($args); }
public static function media_upload($args = array()) { $container_class = ''; extract($args, EXTR_OVERWRITE); SB_PHP::add_string_with_space_before($container_class, 'sb-media-upload'); $upload_button_class = isset($args['upload_button_class']) ? $args['upload_button_class'] : ''; $upload_button_class = SB_PHP::add_string_with_space_before($upload_button_class, 'sb-widget-button delegate'); $args['upload_button_class'] = $upload_button_class; $remove_button_class = isset($args['remove_button_class']) ? $args['remove_button_class'] : ''; $remove_button_class = SB_PHP::add_string_with_space_before($remove_button_class, 'sb-widget-button delegate'); $args['remove_button_class'] = $remove_button_class; ?> <div class="<?php echo $container_class; ?> "> <?php SB_Field::media_upload_no_preview($args); ?> </div> <?php }