PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.9.2
Pods – Custom Content Types and Fields v3.3.9.2
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / ui / fields / link.php
pods / ui / fields Last commit date
_comment.php 1 day ago _db.php 1 day ago _hidden.php 1 day ago _label.php 1 day ago _row.php 1 day ago attachment.php 1 day ago checkbox.php 1 day ago cleditor.php 1 day ago codemirror.php 1 day ago color.php 1 day ago currency.php 1 day ago date.php 1 day ago datetime.php 1 day ago email.php 1 day ago link.php 1 day ago number.php 1 day ago oembed.php 1 day ago password.php 1 day ago phone.php 1 day ago radio.php 1 day ago select.php 1 day ago slider.php 1 day ago slug.php 1 day ago text.php 1 day ago textarea.php 1 day ago time.php 1 day ago tinymce.php 1 day ago website.php 1 day ago
link.php
85 lines
1 <?php
2
3 // Don't load directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 die( '-1' );
6 }
7
8 // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
9
10 wp_enqueue_script( 'wplink' );
11 wp_enqueue_style( 'editor-buttons' );
12
13 pods_form_enqueue_script( 'pods-link-picker', PODS_URL . 'ui/js/pods-link-picker.js', array( 'jquery' ), '1.0.0' );
14
15 PodsForm::field_method( 'link', 'validate_link_modal' );
16
17 $url_attributes = array();
18 $url_type = 'text';
19 if ( 1 === (int) pods_v( 'link_html5', $options ) ) {
20 $url_type = 'url';
21 }
22 $url_attributes['type'] = $url_type;
23 $url_attributes['class'] = 'linkPickerUrl';
24 $url_attributes['value'] = ( isset( $value['url'] ) ? $value['url'] : '' );
25 $url_attributes['tabindex'] = 2;
26 $url_name = $name . '[url]';
27 $url_attributes = PodsForm::merge_attributes( $url_attributes, $url_name, $form_field_type, $options );
28
29 $text_attributes = array();
30 $text_type = 'text';
31 $text_attributes['type'] = $text_type;
32 $text_attributes['class'] = 'linkPickerText';
33 $text_attributes['value'] = ( isset( $value['text'] ) ? $value['text'] : '' );
34 $text_attributes['tabindex'] = 2;
35 $text_name = $name . '[text]';
36 $text_attributes = PodsForm::merge_attributes( $text_attributes, $text_name, $form_field_type, $options );
37
38 $target_attributes = array();
39 $target_type = 'checkbox';
40 $target_attributes['type'] = $target_type;
41 $target_attributes['class'] = 'linkPickerTarget';
42 $target_attributes['value'] = '_blank';
43 $target_attributes['tabindex'] = 2;
44 $target_attributes['style'] = 'display: inline-block;';
45 if ( isset( $value['target'] ) && $value['target'] == '_blank' || ( ! isset( $value['target'] ) && ! empty( $options['link_new_window'] ) ) ) {
46 $target_attributes['checked'] = 'checked';
47 }
48 $target_name = $name . '[target]';
49 $target_attributes = PodsForm::merge_attributes( $target_attributes, $target_name, $form_field_type, $options );
50
51 $attributes = array();
52 $attributes = PodsForm::merge_attributes( $attributes, $name, $form_field_type, $options, 'pods-ui-field-link' );
53 $class_attributes = array( 'class' => $attributes['class'] );
54 ?>
55
56 <div<?php PodsForm::attributes( $class_attributes, $name, $form_field_type, $options ); ?>>
57 <div class="pods-link-options">
58 <p class="howto"><?php esc_html( 'Enter the destination URL' ); ?></p>
59 <p>
60 <div class="alignleft">
61 <label><span><?php esc_html( 'URL' ); ?></span><input<?php PodsForm::attributes( $url_attributes, $url_name, $form_field_type, $options ); ?> /></label>
62 </div>
63 <div class="alignleft">
64 <label><span><?php esc_html( 'Link Text' ); ?></span><input<?php PodsForm::attributes( $text_attributes, $text_name, $form_field_type, $options ); ?> /></label>
65 </div>
66 <div class="link-target">
67 <label>
68 <div>&nbsp;</div>
69 <input<?php PodsForm::attributes( $target_attributes, $target_name, $form_field_type, $options ); ?> /> <?php esc_html_e( 'Open link in a new tab', 'pods' ); ?>
70 </label>
71 </div>
72 </p> <br clear="both">
73
74 <?php if ( 1 == pods_v( 'link_select_existing', $options, 1 ) ) { ?>
75 <div class="howto link-existing-content" style="display: none;">
76 <a href="#" class="podsLinkPopup"><?php esc_html_e( 'Or link to existing content', 'pods' ); ?></a>
77 <textarea id="pods-link-editor-hidden" disabled="disabled" style="display: none;"></textarea>
78 </div>
79 <?php } ?>
80 </div>
81 </div>
82
83 <?php
84 PodsForm::regex( $form_field_type, $options );
85