/home/techb158/public_html/wp-content/plugins/meta-box/inc/fields
NameSizeModeActions
autocomplete.php30720666editdlrm
background.php54570666editdlrm
block-editor.php49910666editdlrm
button-group.php18820666editdlrm
button.php12900666editdlrm
checkbox-list.php4680666editdlrm
checkbox.php12840666editdlrm
choice.php18880666editdlrm
color.php25530666editdlrm
custom-html.php6020666editdlrm
date.php6100666editdlrm
datetime.php100930666editdlrm
divider.php6070666editdlrm
fieldset-text.php34790666editdlrm
file-input.php19770666editdlrm
file-upload.php9530666editdlrm
file.php176650666editdlrm
heading.php7130666editdlrm
icon.php88130666editdlrm
image-advanced.php22290666editdlrm
image-select.php24440666editdlrm
image-upload.php7190666editdlrm
image.php48930666editdlrm
input-list.php27140666editdlrm
input.php30200666editdlrm
key-value.php29510666editdlrm
link.php41340666editdlrm
map.php67380666editdlrm
media.php69350666editdlrm
multiple-values.php13610666editdlrm
number.php9100666editdlrm
object-choice.php44750666editdlrm
oembed.php41500666editdlrm
osm.php59360666editdlrm
password.php22630666editdlrm
post.php67210666editdlrm
radio.php2700666editdlrm
range.php15440666editdlrm
select-advanced.php24570666editdlrm
select-tree.php15470666editdlrm
select.php25520666editdlrm
sidebar.php12500666editdlrm
single-image.php17700666editdlrm
slider.php23490666editdlrm
switch.php24260666editdlrm
taxonomy-advanced.php29130666editdlrm
taxonomy.php92930666editdlrm
text-list.php34780666editdlrm
textarea.php16120666editdlrm
time.php11760666editdlrm
user.php52100666editdlrm
video.php38710666editdlrm
wysiwyg.php23350666editdlrm
Edit: /home/techb158/public_html/wp-content/plugins/meta-box/inc/fields/oembed.php (4150B)
__( 'Embed HTML not available.', 'meta-box' ), ] ); $field['attributes'] = wp_parse_args( $field['attributes'], [ 'data-not-available' => $field['not_available_string'], ] ); return $field; } public static function admin_enqueue_scripts() { wp_enqueue_style( 'rwmb-oembed', RWMB_CSS_URL . 'oembed.css', [], RWMB_VER ); wp_style_add_data( 'rwmb-oembed', 'path', RWMB_CSS_DIR . 'oembed.css' ); wp_enqueue_script( 'rwmb-oembed', RWMB_JS_URL . 'oembed.js', [ 'jquery', 'underscore', 'rwmb' ], RWMB_VER, true ); wp_localize_script( 'rwmb-oembed', 'rwmbOembed', [ 'nonce' => wp_create_nonce( 'oembed_get' ), ] ); } public static function add_actions() { add_action( 'wp_ajax_rwmb_get_embed', [ __CLASS__, 'ajax_get_embed' ] ); } public static function ajax_get_embed() { check_ajax_referer( 'oembed_get' ); $request = rwmb_request(); $url = (string) $request->filter_post( 'url', FILTER_SANITIZE_URL ); $not_available = (string) $request->post( 'not_available' ); wp_send_json_success( self::get_embed( $url, $not_available ) ); } /** * Get embed html from url. * * @param string $url URL. * @param string $not_available Not available string displayed to users. * @return string */ public static function get_embed( $url, $not_available = '' ) { /** * Set arguments for getting embedded HTML. * Without arguments, default width will be taken from global $content_width, which can break UI in the admin. * * @link https://github.com/rilwis/meta-box/issues/801 * @see WP_oEmbed::fetch() * @see WP_Embed::shortcode() * @see wp_embed_defaults() */ $args = []; if ( is_admin() ) { $args['width'] = 360; } // Try oembed first. $embed = wp_oembed_get( $url, $args ); // If no oembed provides found, try WordPress auto embed. if ( ! $embed ) { global $wp_embed; $temp = $wp_embed->return_false_on_fail; $wp_embed->return_false_on_fail = true; // Do not fallback to make a link. $embed = $wp_embed->shortcode( $args, $url ); $wp_embed->return_false_on_fail = $temp; } if ( $not_available ) { $not_available = '
' . wp_kses_post( $not_available ) . '
'; } $not_available = apply_filters( 'rwmb_oembed_not_available_string', $not_available, $url ); return $embed ? $embed : $not_available; } /** * Get field HTML. * * @param mixed $meta Meta value. * @param array $field Field parameters. * @return string */ public static function html( $meta, $field ) { return parent::html( $meta, $field ) . sprintf( '
%s
', $meta ? self::get_embed( $meta, $field['not_available_string'] ) : '' ); } /** * Get the attributes for a field. * * @param array $field Field parameters. * @param mixed $value Meta value. * * @return array */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); $attributes['type'] = 'url'; 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 ) { return self::get_embed( $value, $field['not_available_string'] ); } }