field = $value['type']; $this->name = $value['name']; $this->id = $value['id']; $this->default = isset( $value['default'] ) ? $value['default'] : ''; $this->value = isset( $value['value'] ) ? $value['value'] : ''; $this->description = isset( $value['desc'] ) ? $value['desc'] : ''; $this->options = isset( $value['options'] ) ? $value['options'] : ''; $this->dependency = isset( $value['dependency'] ) ? $value['dependency'] : ''; $this->pro = isset( $value['pro'] ) ? $value['pro'] : false; $this->pro_info = isset( $value['pro_info'] ) ? $value['pro_info'] : ''; $this->multiselect = isset( $value['multiselect'] ) ? $value['multiselect'] : false; $this->source = isset( $value['source'] ) ? $value['source'] : ''; } /** * HTML output of the field * * @since 1.0.0 */ public function render() { $options = $this->get_options(); $current = ''; $multiselect = $this->multiselect ? ' data-multiselect="1"' : ''; ob_start(); $is_pro = $this->pro && socialsnap()->pro || ! $this->pro; $is_pro_class = $is_pro ? '' : ' ss-pro-feature'; ?>
dependency ); ?>>
name ); ?> description ) { ?> icons->get_svg( 'info' ); // phpcs:ignore ?> pro_info ); } ?>
source ) { return $this->options; } if ( 'taxonomies' === $this->source ) { $args = array( 'public' => true, ); $taxonomies = get_taxonomies( $args, 'objects' ); $return = array(); if ( is_array( $taxonomies ) && ! empty( $taxonomies ) ) { foreach ( $taxonomies as $taxonomy ) { $terms = get_terms( array( 'taxonomy' => $taxonomy->name, 'hide_empty' => false, ) ); if ( is_array( $terms ) && ! empty( $terms ) ) { foreach ( $terms as $term ) { $return[ $taxonomy->name . ';' . $term->term_id ] = $taxonomy->labels->singular_name . ' - ' . $term->name; } } } } return $return; } } }