PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.4.0
StreamCast – bring live radio to your site with a sleek player v2.4.0
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
← All changes | frameworks/codestar-framework/fields/icon/icon.php +71 -71 2.3.42.4.0 View file →
@@ -1,71 +1,71 @@
1 -<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 -/**
3 - *
4 - * Field: icon
5 - *
6 - * @since 1.0.0
7 - * @version 1.0.0
8 - *
9 - */
10 -if ( ! class_exists( 'CSF_Field_icon' ) ) {
11 - class CSF_Field_icon extends CSF_Fields {
12 -
13 - public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14 - parent::__construct( $field, $value, $unique, $where, $parent );
15 - }
16 -
17 - public function render() {
18 -
19 - $args = wp_parse_args( $this->field, array(
20 - 'button_title' => esc_html__( 'Add Icon', 'csf' ),
21 - 'remove_title' => esc_html__( 'Remove Icon', 'csf' ),
22 - ) );
23 -
24 - echo $this->field_before();
25 -
26 - $nonce = wp_create_nonce( 'csf_icon_nonce' );
27 - $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28 -
29 - echo '<div class="csf-icon-select">';
30 - echo '<span class="csf-icon-preview'. esc_attr( $hidden ) .'"><i class="'. esc_attr( $this->value ) .'"></i></span>';
31 - echo '<a href="#" class="button button-primary csf-icon-add" data-nonce="'. esc_attr( $nonce ) .'">'. $args['button_title'] .'</a>';
32 - echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. esc_attr( $hidden ) .'">'. $args['remove_title'] .'</a>';
33 - echo '<input type="hidden" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="csf-icon-value"'. $this->field_attributes() .' />';
34 - echo '</div>';
35 -
36 - echo $this->field_after();
37 -
38 - }
39 -
40 - public function enqueue() {
41 - add_action( 'admin_footer', array( 'CSF_Field_icon', 'add_footer_modal_icon' ) );
42 - add_action( 'customize_controls_print_footer_scripts', array( 'CSF_Field_icon', 'add_footer_modal_icon' ) );
43 - }
44 -
45 - public static function add_footer_modal_icon() {
46 - ?>
47 - <div id="csf-modal-icon" class="csf-modal csf-modal-icon hidden">
48 - <div class="csf-modal-table">
49 - <div class="csf-modal-table-cell">
50 - <div class="csf-modal-overlay"></div>
51 - <div class="csf-modal-inner">
52 - <div class="csf-modal-title">
53 - <?php esc_html_e( 'Add Icon', 'csf' ); ?>
54 - <div class="csf-modal-close csf-icon-close"></div>
55 - </div>
56 - <div class="csf-modal-header">
57 - <input type="text" placeholder="<?php esc_html_e( 'Search...', 'csf' ); ?>" class="csf-icon-search" />
58 - </div>
59 - <div class="csf-modal-content">
60 - <div class="csf-modal-loading"><div class="csf-loading"></div></div>
61 - <div class="csf-modal-load"></div>
62 - </div>
63 - </div>
64 - </div>
65 - </div>
66 - </div>
67 - <?php
68 - }
69 -
70 - }
71 -}
1 +<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 +/**
3 + *
4 + * Field: icon
5 + *
6 + * @since 1.0.0
7 + * @version 1.0.0
8 + *
9 + */
10 +if ( ! class_exists( 'CSF_Field_icon' ) ) {
11 + class CSF_Field_icon extends CSF_Fields {
12 +
13 + public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14 + parent::__construct( $field, $value, $unique, $where, $parent );
15 + }
16 +
17 + public function render() {
18 +
19 + $args = wp_parse_args( $this->field, array(
20 + 'button_title' => esc_html__( 'Add Icon', 'streamcast' ),
21 + 'remove_title' => esc_html__( 'Remove Icon', 'streamcast' ),
22 + ) );
23 +
24 + echo $this->field_before(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
25 +
26 + $nonce = wp_create_nonce( 'csf_icon_nonce' );
27 + $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28 +
29 + echo '<div class="csf-icon-select">';
30 + echo '<span class="csf-icon-preview'. esc_attr( $hidden ) .'"><i class="'. esc_attr( $this->value ) .'"></i></span>';
31 + echo '<a href="#" class="button button-primary csf-icon-add" data-nonce="'. esc_attr( $nonce ) .'">'. wp_kses_post( $args['button_title'] ) .'</a>';
32 + echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. esc_attr( $hidden ) .'">'. wp_kses_post( $args['remove_title'] ) .'</a>';
33 + echo '<input type="hidden" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="csf-icon-value"'. $this->field_attributes() .' />'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
34 + echo '</div>';
35 +
36 + echo $this->field_after(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
37 +
38 + }
39 +
40 + public function enqueue() {
41 + add_action( 'admin_footer', array( 'CSF_Field_icon', 'add_footer_modal_icon' ) );
42 + add_action( 'customize_controls_print_footer_scripts', array( 'CSF_Field_icon', 'add_footer_modal_icon' ) );
43 + }
44 +
45 + public static function add_footer_modal_icon() {
46 + ?>
47 + <div id="csf-modal-icon" class="csf-modal csf-modal-icon hidden">
48 + <div class="csf-modal-table">
49 + <div class="csf-modal-table-cell">
50 + <div class="csf-modal-overlay"></div>
51 + <div class="csf-modal-inner">
52 + <div class="csf-modal-title">
53 + <?php esc_html_e( 'Add Icon', 'streamcast' ); ?>
54 + <div class="csf-modal-close csf-icon-close"></div>
55 + </div>
56 + <div class="csf-modal-header">
57 + <input type="text" placeholder="<?php esc_html_e( 'Search...', 'streamcast' ); ?>" class="csf-icon-search" />
58 + </div>
59 + <div class="csf-modal-content">
60 + <div class="csf-modal-loading"><div class="csf-loading"></div></div>
61 + <div class="csf-modal-load"></div>
62 + </div>
63 + </div>
64 + </div>
65 + </div>
66 + </div>
67 + <?php
68 + }
69 +
70 + }
71 +}