Changeset 2747284
- Timestamp:
- 06/23/2022 08:13:36 PM (4 years ago)
- Location:
- ldd-directory-lite/trunk/includes/admin
- Files:
-
- 2 edited
-
register-settings.php (modified) (20 diffs)
-
setup.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ldd-directory-lite/trunk/includes/admin/register-settings.php
r2359247 r2747284 672 672 } 673 673 674 parse_str( $_POST['_wp_http_referer'], $referrer);674 parse_str(sanitize_url($_POST['_wp_http_referer']), $referrer); 675 675 676 676 $settings = ldl_get_registered_settings(); 677 $tab = isset($referrer['tab']) ? $referrer['tab']: 'general';677 $tab = isset($referrer['tab']) ? sanitize_text_field($referrer['tab']) : 'general'; 678 678 679 679 $input = $input ? $input : array(); … … 875 875 $html = '<input type="checkbox" id="lddlite_settings[' . $args['id'] . ']" name="lddlite_settings[' . $args['id'] . ']" value="1" ' . $checked . '>'; 876 876 $html .= '<label for="lddlite_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>'; 877 878 echo $html; 877 $allowed_html = array( 878 'input' => array( 879 'type' => array(), 880 'id' => array(), 881 'name' => array(), 882 'value' => array(), 883 'checked' => array(), 884 885 )); 886 echo wp_kses($html,$allowed_html); 879 887 } 880 888 … … 882 890 function ldl_multicheck_callback($args) 883 891 { 892 893 $html = ''; 884 894 885 895 if (!empty($args['options'])) { … … 890 900 $enabled = null; 891 901 } 892 echo'<input name="lddlite_settings[' . $args['id'] . '][' . $key . ']" id="lddlite_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $option . '" ' . checked($option, $enabled, FALSE) . '> ';893 echo'<label for="lddlite_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';902 $html .= '<input name="lddlite_settings[' . $args['id'] . '][' . $key . ']" id="lddlite_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $option . '" ' . checked($option, $enabled, FALSE) . '> '; 903 $html .= '<label for="lddlite_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>'; 894 904 endforeach; 895 echo '<p class="description">' . $args['desc']. '</p>';905 $html .= '<p class="description">' . wp_kses_post($args['desc']) . '</p>'; 896 906 } 907 908 $allowed_html = array( 909 'input' => array( 910 'type' => array(), 911 'id' => array(), 912 'name' => array(), 913 'checked' => array(), 914 'value' => array(), 915 ),'p'=> array() 916 ); 917 echo wp_kses($html, $allowed_html); 897 918 } 898 919 … … 900 921 function ldl_radio_callback($args) 901 922 { 902 923 $html = ''; 903 924 foreach ($args['options'] as $key => $option) : 904 925 $checked = FALSE; … … 909 930 $checked = TRUE; 910 931 911 echo '<input name="lddlite_settings[' . $args['id'] . ']"" id="lddlite_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked(TRUE, $checked, FALSE) . '> ';912 echo'<label for="lddlite_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';932 $html .= '<input name="lddlite_settings[' . $args['id'] . ']"" id="lddlite_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked(TRUE, $checked, FALSE) . '> '; 933 $html .= '<label for="lddlite_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>'; 913 934 endforeach; 914 935 915 echo '<p class="description">' . $args['desc'] . '</p>'; 936 $html .= '<p class="description">' . wp_kses_post($args['desc']) . '</p>'; 937 938 $allowed_html = array( 939 'input' => array( 940 'type' => array(), 941 'id' => array(), 942 'name' => array(), 943 'checked' => array(), 944 'value' => array(), 945 ),'p'=> array() 946 ); 947 echo wp_kses($html, $allowed_html); 916 948 } 917 949 … … 919 951 { 920 952 953 $html = ''; 921 954 foreach ($args['options'] as $key => $option) : 922 955 $checked = FALSE; … … 927 960 $checked = TRUE; 928 961 929 echo"<div style='display:inline-block;'>";930 echo '<input name="lddlite_settings[' . $args['id'] . ']"" id="lddlite_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked(TRUE, $checked, FALSE) . '> ';931 echo '<label for="lddlite_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label>  ';932 echo"</div>";962 //$html .= "<div style='display:inline-block;'>"; 963 $html .= '<input name="lddlite_settings[' . $args['id'] . ']" id="lddlite_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked(TRUE, $checked, FALSE).'>' ; 964 $html .= '<label for="lddlite_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label> '; 965 // $html .= "</div>"; 933 966 934 967 endforeach; 935 968 936 echo '<p class="description">' . $args['desc'] . '</p>'; 969 $html .= '<p class="description">' . $args['desc'] . '</p>'; 970 971 $allowed_html = array( 972 'input' => array( 973 'type' => array(), 974 'id' => array(), 975 'name' => array(), 976 'checked' => array(), 977 'value' => array(), 978 ),'p'=> array() 979 ); 980 echo wp_kses($html, $allowed_html); 981 //echo $html; 982 983 937 984 } 938 985 … … 949 996 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 950 997 951 echo $html; 998 $allowed_html = array( 999 'input' => array( 1000 'type' => array(), 1001 'id' => array(), 1002 'name' => array(), 1003 'name' => array(), 1004 'value' => array(), 1005 ) ,'p'=> array()); echo wp_kses($html,$allowed_html); 952 1006 } 953 1007 function ldl_hidden_callback($args) … … 961 1015 $size = (isset($args['size']) && !is_null($args['size'])) ? $args['size'] : 'regular'; 962 1016 $html = '<input type="hidden" class="' . $size . '-text" id="lddlite_settings[' . $args['id'] . ']" name="lddlite_settings[' . $args['id'] . ']" value="' . esc_attr(stripslashes($value)) . '">'; 963 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 964 965 echo $html; 1017 $html .= '<p class="description"> ' . wp_kses_post($args['desc']) . '</p>'; 1018 1019 1020 $allowed_html = array( 1021 'input' => array( 1022 'type' => array(), 1023 'id' => array(), 1024 'name' => array(), 1025 'name' => array(), 1026 'value' => array(), 1027 ) ,'p'=> array()); echo wp_kses($html,$allowed_html); 966 1028 } 967 1029 … … 985 1047 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 986 1048 987 echo $html;1049 echo wp_kses_post($html); 988 1050 } 989 1051 … … 1002 1064 } 1003 1065 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1004 1005 echo $html; 1066 1067 $allowed_html = array( 1068 'input' => array( 1069 'type' => array(), 1070 'id' => array(), 1071 'name' => array(), 1072 'name' => array(), 1073 'value' => array(), 1074 ) ,'p'=> array()); echo wp_kses($html,$allowed_html); 1075 1076 1006 1077 } 1007 1078 … … 1024 1095 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1025 1096 1026 echo $html;1097 echo wp_kses_post($html); 1027 1098 1028 1099 } … … 1045 1116 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1046 1117 1047 echo $html; 1118 $allowed_html = array( 1119 'input' => array( 1120 'type' => array(), 1121 'id' => array(), 1122 'name' => array(), 1123 'name' => array(), 1124 'value' => array(), 1125 ) ,'p'=> array()); echo wp_kses($html,$allowed_html); 1048 1126 } 1049 1127 … … 1061 1139 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1062 1140 1063 echo $html;1141 echo wp_kses_post($html); 1064 1142 } 1065 1143 … … 1077 1155 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1078 1156 1079 echo $html;1157 echo wp_kses_post($html); 1080 1158 } 1081 1159 … … 1126 1204 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1127 1205 1128 echo $html; 1206 $allowed_html = array( 1207 'select' => array( 1208 1209 'id' => array(), 1210 'name' => array(), 1211 'name' => array(), 1212 'value' => array(), 1213 ), 1214 'option' => array( 'value' => array(), 1215 'selected' => array() 1216 ) 1217 ,'p'=> array() 1218 ); echo wp_kses($html,$allowed_html); 1219 1129 1220 } 1130 1221 … … 1145 1236 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1146 1237 1147 echo $html;1238 echo wp_kses_post($html); 1148 1239 } 1149 1240 … … 1162 1253 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1163 1254 1164 echo $html;1255 echo wp_kses_post($html); 1165 1256 } 1166 1257 … … 1180 1271 $html .= '<p class="description"> ' . $args['desc'] . '</p>'; 1181 1272 1182 echo $html; 1273 $allowed_html = array( 1274 1275 'button' => array( 1276 'type' => array(), 1277 'id' => array(), 1278 'aria-expanded' => array(), 1279 'style' => array(), 1280 ), 1281 'div' => array(), 1282 'span' => array( 'class' => array()), 1283 ); 1284 //echo wp_kses($html,$allowed_html); 1285 echo $html; 1286 1183 1287 } 1184 1288 -
ldd-directory-lite/trunk/includes/admin/setup.php
r1875584 r2747284 42 42 */ 43 43 function ldl_action_admin_menu_icon() { 44 echo "\n\t<style>"; 45 echo '#adminmenu .menu-icon-' . LDDLITE_POST_TYPE . ' div.wp-menu-image:before { content: \'\\f307\'; }'; 46 echo '</style>'; 44 $html = "\n\t<style>"; 45 $html .= '#adminmenu .menu-icon-' . LDDLITE_POST_TYPE . ' div.wp-menu-image:before { content: \'\\f307\'; }'; 46 $html .= '</style>'; 47 $allowed = array( 48 'style' => array()); 49 echo wp_kses($html , $allowed); 47 50 } 48 51 add_action('admin_head', 'ldl_action_admin_menu_icon');
Note: See TracChangeset
for help on using the changeset viewer.