/
home
/
techb158
/
public_html
/
wp-content
/
plugins
/
meta-box
/
inc
/
fields
/
/home/techb158/public_html/wp-content/plugins/meta-box/inc/fields
mkdir
upload
Name
Size
Mode
Actions
autocomplete.php
3072
0666
edit
dl
rm
background.php
5457
0666
edit
dl
rm
block-editor.php
4991
0666
edit
dl
rm
button-group.php
1882
0666
edit
dl
rm
button.php
1290
0666
edit
dl
rm
checkbox-list.php
468
0666
edit
dl
rm
checkbox.php
1284
0666
edit
dl
rm
choice.php
1888
0666
edit
dl
rm
color.php
2553
0666
edit
dl
rm
custom-html.php
602
0666
edit
dl
rm
date.php
610
0666
edit
dl
rm
datetime.php
10093
0666
edit
dl
rm
divider.php
607
0666
edit
dl
rm
fieldset-text.php
3479
0666
edit
dl
rm
file-input.php
1977
0666
edit
dl
rm
file-upload.php
953
0666
edit
dl
rm
file.php
17665
0666
edit
dl
rm
heading.php
713
0666
edit
dl
rm
icon.php
8813
0666
edit
dl
rm
image-advanced.php
2229
0666
edit
dl
rm
image-select.php
2444
0666
edit
dl
rm
image-upload.php
719
0666
edit
dl
rm
image.php
4893
0666
edit
dl
rm
input-list.php
2714
0666
edit
dl
rm
input.php
3020
0666
edit
dl
rm
key-value.php
2951
0666
edit
dl
rm
link.php
4134
0666
edit
dl
rm
map.php
6738
0666
edit
dl
rm
media.php
6935
0666
edit
dl
rm
multiple-values.php
1361
0666
edit
dl
rm
number.php
910
0666
edit
dl
rm
object-choice.php
4475
0666
edit
dl
rm
oembed.php
4150
0666
edit
dl
rm
osm.php
5936
0666
edit
dl
rm
password.php
2263
0666
edit
dl
rm
post.php
6721
0666
edit
dl
rm
radio.php
270
0666
edit
dl
rm
range.php
1544
0666
edit
dl
rm
select-advanced.php
2457
0666
edit
dl
rm
select-tree.php
1547
0666
edit
dl
rm
select.php
2552
0666
edit
dl
rm
sidebar.php
1250
0666
edit
dl
rm
single-image.php
1770
0666
edit
dl
rm
slider.php
2349
0666
edit
dl
rm
switch.php
2426
0666
edit
dl
rm
taxonomy-advanced.php
2913
0666
edit
dl
rm
taxonomy.php
9293
0666
edit
dl
rm
text-list.php
3478
0666
edit
dl
rm
textarea.php
1612
0666
edit
dl
rm
time.php
1176
0666
edit
dl
rm
user.php
5210
0666
edit
dl
rm
video.php
3871
0666
edit
dl
rm
wysiwyg.php
2335
0666
edit
dl
rm
Edit:
/home/techb158/public_html/wp-content/plugins/meta-box/inc/fields/switch.php
(2426B)
<?php defined( 'ABSPATH' ) || die; /** * The Switch field. */ class RWMB_Switch_Field extends RWMB_Input_Field { public static function admin_enqueue_scripts() { wp_enqueue_style( 'rwmb-switch', RWMB_CSS_URL . 'switch.css', [], RWMB_VER ); wp_style_add_data( 'rwmb-switch', 'path', RWMB_CSS_DIR . 'switch.css' ); } /** * Get field HTML. * * @param mixed $meta Meta value. * @param array $field Field parameters. * * @return string */ public static function html( $meta, $field ) { $attributes = self::get_attributes( $field, 1 ); // Notes: allow to use HTML for on/off labels. $output = sprintf( '<label class="rwmb-switch-label rwmb-switch-label--' . esc_attr( $field['style'] ) . '"> <input %s %s> <div class="rwmb-switch-status"> <span class="rwmb-switch-slider"></span> <span class="rwmb-switch-on">' . $field['on_label'] . '</span> <span class="rwmb-switch-off">' . $field['off_label'] . '</span> </div> </label> ', self::render_attributes( $attributes ), checked( ! empty( $meta ), 1, false ) ); return $output; } /** * Normalize parameters for field. * * @param array $field Field parameters. * * @return array */ public static function normalize( $field ) { $field = parent::normalize( $field ); $field = wp_parse_args( $field, [ 'style' => 'rounded', 'on_label' => '', 'off_label' => '', ] ); return $field; } /** * Get the attributes for a field. * * @param array $field The field parameters. * @param mixed $value The attribute value. * * @return array */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); $attributes['type'] = 'checkbox'; return $attributes; } /** * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * * @param array $field Field parameters. * @param string $value The value. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * * @return string */ public static function format_single_value( $field, $value, $args, $post_id ) { $on = $field['on_label'] ?: __( 'On', 'meta-box' ); $off = $field['off_label'] ?: __( 'Off', 'meta-box' ); return $value ? $on : $off; } }
Save
cmd:
run