From a783012ef259941d5a716ed7e26db10d4b175684 Mon Sep 17 00:00:00 2001 From: pablo-pacheco Date: Sat, 18 Mar 2017 16:43:52 -0300 Subject: [PATCH 1/2] Facilitate click prepending wpuf on label Prepend **wpuf** on label **for** attribute, so we are able to click on both labels, facilitating click --- src/class.settings-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class.settings-api.php b/src/class.settings-api.php index bbc97e1..b1d018b 100755 --- a/src/class.settings-api.php +++ b/src/class.settings-api.php @@ -127,7 +127,7 @@ function admin_init() { $args = array( 'id' => $name, 'class' => isset( $option['class'] ) ? $option['class'] : $name, - 'label_for' => "{$section}[{$name}]", + 'label_for' => "wpuf-{$section}[{$name}]", 'desc' => isset( $option['desc'] ) ? $option['desc'] : '', 'name' => $label, 'section' => $section, From 44fd29e1eb9e5f49914381296b228a6b698acc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20dos=20Santos=20Gon=C3=A7alves=20Pacheco?= Date: Fri, 20 Oct 2017 17:42:00 -0200 Subject: [PATCH 2/2] Create "title" setting field type option --- src/class.settings-api.php | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/class.settings-api.php b/src/class.settings-api.php index b1d018b..11d8653 100755 --- a/src/class.settings-api.php +++ b/src/class.settings-api.php @@ -69,8 +69,15 @@ function add_section( $section ) { * @param array $fields settings fields array */ function set_fields( $fields ) { + foreach ( $fields as $section => $field ) { + foreach ( $field as $key => $option ) { + if ( $option['type'] == 'title' ) { + $fields[ $section ][ $key ]['class'] = 'wedevs-title'; + $fields[ $section ][ $key ]['name'] = ''; + } + } + } $this->settings_fields = $fields; - return $this; } @@ -166,6 +173,19 @@ public function get_field_description( $args ) { return $desc; } + + /** + * Displays a title field + * + * @version 1.0.0 + * @since 1.0.0 + * + * @param array $args settings field args + */ + function callback_title( $args ) { + $html = $this->get_field_description( $args ); + echo $html; + } /** * Displays a text field for a settings field @@ -619,6 +639,18 @@ function _style_fix() { /** WordPress 3.8 Fix **/ .form-table th { padding: 20px 10px; } #wpbody-content .metabox-holder { padding-top: 5px; } + + /** For Title setting field **/ + #wpbody-content .metabox-holder h2{ padding: 0 !important; } + .wedevs-title th { + color: #23282d; + } + .wedevs-title label{ + font-size: 1.3em !important; + } + .wedevs-title * { + cursor: auto; + }