....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 104.19.154.92  /  Your IP : 216.73.216.47
Web Server : Apache
System : Linux lon12.onrocket.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC 2023 x86_64
User : gd5hzp4 ( 1069)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/gd5hzp4/www/wp-content/plugins/user-registration/includes/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/gd5hzp4/www/wp-content/plugins/user-registration/includes/admin/class-ur-admin-settings.php
<?php
/**
 * UserRegistration Admin Settings Class
 *
 * @class    UR_Admin_Settings
 * @version  1.0.0
 * @package  UserRegistration/Admin
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * UR_Admin_Settings Class.
 */
class UR_Admin_Settings {

	/**
	 * Setting pages.
	 *
	 * @var array
	 */
	private static $settings = array();

	/**
	 * Error messages.
	 *
	 * @var array
	 */
	private static $errors = array();

	/**
	 * Update messages.
	 *
	 * @var array
	 */
	private static $messages = array();

	/**
	 * Include the settings page classes.
	 */
	public static function get_settings_pages() {

		if ( empty( self::$settings ) ) {
			$settings = array();

			include_once dirname( __FILE__ ) . '/settings/class-ur-settings-page.php';

			$settings[] = include 'settings/class-ur-settings-general.php';
			$settings[] = include 'settings/class-ur-settings-integration.php';
			$settings[] = include 'settings/class-ur-settings-email.php';
			$settings[] = include 'settings/class-ur-settings-import-export.php';

			self::$settings = apply_filters( 'user_registration_get_settings_pages', $settings );
		}

		return self::$settings;
	}

	/**
	 * Save the settings.
	 */
	public static function save() {
		global $current_tab;

		if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'user-registration-settings' ) ) {
			die( __( 'Action failed. Please refresh the page and retry.', 'user-registration' ) );
		}

		// Trigger actions.
		do_action( 'user_registration_settings_save_' . $current_tab );
		do_action( 'user_registration_update_options_' . $current_tab );
		do_action( 'user_registration_update_options' );

		$flag = apply_filters( 'show_user_registration_setting_message', true );

		if ( $flag ) {
			self::add_message( __( 'Your settings have been saved.', 'user-registration' ) );
		}

		// Flush rules.
		wp_schedule_single_event( time(), 'user_registration_flush_rewrite_rules' );

		do_action( 'user_registration_settings_saved' );
	}

	/**
	 * Add a message.
	 *
	 * @param string $text Text.
	 */
	public static function add_message( $text ) {
		self::$messages[] = $text;
	}

	/**
	 * Add an error.
	 *
	 * @param string $text Text.
	 */
	public static function add_error( $text ) {
		self::$errors[] = $text;
	}

	/**
	 * Output messages + errors.
	 *
	 * @echo string
	 */
	public static function show_messages() {
		if ( sizeof( self::$errors ) > 0 ) {
			foreach ( self::$errors as $error ) {
				echo '<div id="message" class="error inline"><p><strong>' . esc_html( $error ) . '</strong></p></div>';
			}
		} elseif ( sizeof( self::$messages ) > 0 ) {
			foreach ( self::$messages as $message ) {
				echo '<div id="message" class="updated inline"><p><strong>' . esc_html( $message ) . '</strong></p></div>';
			}
		}
	}

	/**
	 * Settings page.
	 *
	 * Handles the display of the main Social Sharing settings page in admin.
	 */
	public static function output() {
		global $current_section, $current_tab;

		$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';

		do_action( 'user_registration_settings_start' );

		wp_enqueue_script( 'user-registration-settings', UR()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris' ), UR_VERSION, true );

		wp_localize_script(
			'user-registration-settings',
			'user_registration_settings_params',
			array(
				'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'user-registration' ),
			)
		);

		// Include settings pages.
		self::get_settings_pages();

		// Get current tab/section
		$current_tab     = empty( $_GET['tab'] ) ? 'general' : sanitize_title( $_GET['tab'] );
		$current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );

		$flag = apply_filters( 'user_registration_settings_save_action', true );

		if ( $flag ) {

			// Save settings if data has been posted.
			if ( ! empty( $_POST ) ) {
				self::save();
			}
		}

		// Add any posted messages
		if ( ! empty( $_GET['ur_error'] ) ) {
			self::add_error( stripslashes( $_GET['ur_error'] ) );
		}

		if ( ! empty( $_GET['ur_message'] ) ) {
			self::add_message( stripslashes( $_GET['ur_error'] ) );
		}

		// Get tabs for the settings page
		$tabs = apply_filters( 'user_registration_settings_tabs_array', array() );

		if ( 'import_export' === $current_tab ) {
			$GLOBALS['hide_save_button'] = true;
		}

		include dirname( __FILE__ ) . '/views/html-admin-settings.php';
	}

	/**
	 * Get a setting from the settings API.
	 *
	 * @param mixed $option_name Option Name.
	 * @param mixed $default Default.
	 *
	 * @return string
	 */
	public static function get_option( $option_name, $default = '' ) {

		global $current_section;

		if ( 'add-new-popup' === $current_section ) {
			return $default;
		} else {
			// Array value.
			if ( strstr( $option_name, '[' ) ) {
				parse_str( $option_name, $option_array );

				// Option name is first key
				$option_name = current( array_keys( $option_array ) );

				// Get value.
				$option_values = get_option( $option_name, '' );

				$key = key( $option_array[ $option_name ] );

				if ( isset( $option_values[ $key ] ) ) {
					$option_value = $option_values[ $key ];
				} else {
					$option_value = null;
				}
			} else {
				$option_value = get_option( $option_name, null );
			}

			if ( is_array( $option_value ) ) {
				$option_value = array_map( 'stripslashes', $option_value );
			} elseif ( ! is_null( $option_value ) ) {
				$option_value = stripslashes( $option_value );
			}

			return null === $option_value ? $default : $option_value;
		}
	}

	/**
	 * Output admin fields.
	 *
	 * Loops though the user registration options array and outputs each field.
	 *
	 * @param array[] $options Opens array to output.
	 */
	public static function output_fields( $options ) {
		$settings = '';

		if( is_array( $options ) && !empty( $options ) ){

			$settings .= '<h3 class="ur-settings-section-header main_header">' . esc_html( ucwords( $options['title'] ) );
			$back_link = isset( $options['back_link'] ) ? $options['back_link'] : '';
			$back_link_text = isset( $options['back_link_text'] ) ? $options['back_link_text'] : '';

			if( isset( $options['back_link'] ) ) {
				$settings .= '<a href="' . $back_link . '" class="page-title-action">';

				if( isset( $options['back_link_text'] ) ) {
					$settings .= $back_link_text;
				}

				$settings .= '</a>';
			}
			$settings .= '</h3>';

			foreach ( $options['sections'] as $id => $section ) {
				if ( ! isset( $section['type'] ) ) {
					continue;
				}

				if( 'card' === $section['type'] ) {
					$settings .= '<div class="user-registration-card ur-mt-4 ur-border-0">';
					$settings .=  '<div class="user-registration-card__header ur-border-0">';

					if ( ! empty( $section['title'] ) ) {
						$settings .= '<h3 class="user-registration-card__title">' . esc_html( strtoupper( $section['title'] ) );

						if( isset( $section['back_link'] ) ) {
							$settings .= $section['back_link'];
						}

						$settings .= '</h3>';
					}
					$settings .= '</div>';

					if ( ! empty( $section['desc'] ) ) {
						$settings .= '<p class="ur-p-tag">' .  wptexturize( wp_kses_post( $section['desc'] ) )  . '</p>';
					}
					$settings .= '<div class="user-registration-card__body pt-0 pb-0">';
					$settings .=  '<table class="form-table">' . "\n\n";

					if ( ! empty( $id ) ) {
						do_action( 'user_registration_settings_' . sanitize_title( $id ) );
					}
				}

				foreach( $section['settings'] as $key => $value ) {

					if ( ! isset( $value['type'] ) ) {
						continue;
					}

					if ( ! isset( $value['id'] ) ) {
						$value['id'] = '';
					}
					if ( ! isset( $value['row_class'] ) ) {
						$value['row_class'] = '';
					}
					if ( ! isset( $value['rows'] ) ) {
						$value['rows'] = '';
					}
					if ( ! isset( $value['cols'] ) ) {
						$value['cols'] = '';
					}
					if ( ! isset( $value['title'] ) ) {
						$value['title'] = isset( $value['name'] ) ? $value['name'] : '';
					}
					if ( ! isset( $value['class'] ) ) {
						$value['class'] = '';
					}
					if ( ! isset( $value['css'] ) ) {
						$value['css'] = '';
					}
					if ( ! isset( $value['default'] ) ) {
						$value['default'] = '';
					}
					if ( ! isset( $value['desc'] ) ) {
						$value['desc'] = '';
					}
					if ( ! isset( $value['desc_tip'] ) ) {
						$value['desc_tip'] = false;
					}
					if ( ! isset( $value['desc_field'] ) ) {
						$value['desc_field'] = false;
					}
					if ( ! isset( $value['placeholder'] ) ) {
						$value['placeholder'] = '';
					}

					// Custom attribute handling
					$custom_attributes = array();

					if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) {
						foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) {
							$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
						}
					}

					// Description handling.
					$field_description = self::get_field_description( $value );
					extract( $field_description );

					// Switch based on type.
					switch ( $value['type'] ) {

						// Standard text inputs and subtypes like 'number'.
						case 'text':
						case 'email':
						case 'number':
						case 'password':
						case 'date':
							$option_value = self::get_option( $value['id'], $value['default'] );

							$settings .= '<tr valign="top" class="' . esc_attr( $value['row_class'] ) . '">';
							$settings .= '<th scope="row" class="titledesc">';
							$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ) . '</label>'. $tooltip_html . '</th>';
							$settings .= '<td class="forminp forminp-' . sanitize_title( $value['type'] ) . '">';
							$settings .= '<input
										name="' . esc_attr( $value['id'] ) . '"
										id="'. esc_attr( $value['id'] ) . '"
										type="' . esc_attr( $value['type'] ) . '"
										style="' . esc_attr( $value['css'] ) . '"
										value="' . esc_attr( $option_value ) . '"
										class="' . esc_attr( $value['class'] ) . '"
										placeholder="' . esc_attr( $value['placeholder'] ) . '"
										'. implode( ' ', $custom_attributes ) .' ' . $description . '</td></tr>';
							break;

						// Color picker.
						case 'color':
							$option_value = self::get_option( $value['id'], $value['default'] );
							$settings .= '<tr valign="top" class="' . esc_attr( $value['row_class'] ) . '">';
							$settings .= '<th scope="row" class="titledesc">';
							$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ) .'</label>';
							$settings .= $tooltip_html;
							$settings .= '</th>';
							$settings .= '<td class="forminp forminp-' . sanitize_title( $value['type'] ) . '">&lrm';
							$settings .= '<span class="colorpickpreview" style="background: '. esc_attr( $option_value ) . '"></span>';
							$settings .= '<input
										name="' . esc_attr( $value['id'] ) . '"
										id="' . esc_attr( $value['id'] ) . '"
										type="text"
										dir="ltr"
										style="' . esc_attr( $value['css'] ) . '"
										value="' . esc_attr( $option_value ) . '"
										class="' . esc_attr( $value['class'] ) .'colorpick"
										placeholder="' . esc_attr( $value['placeholder'] ) . '"
										' . implode( ' ', $custom_attributes ) . '/>&lrm;' . $description;
							$settings .= '<div id="colorPickerDiv_' . esc_attr( $value['id'] ) . '" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div></td></tr>';
							break;

						// Textarea.
						case 'textarea':
							$option_value = self::get_option( $value['id'], $value['default'] );

							$settings .= '<tr valign="top" class="'. esc_attr( $value['row_class'] ) . '">';
							$settings .= '<th scope="row" class="titledesc">';
							$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ) . '</label>';
							$settings .= $tooltip_html;
							$settings .= '</th>';
							$settings .= '<td class="forminp forminp-' . sanitize_title( $value['type'] ) . '">';
							$settings .= $description;
							$settings .= '<textarea
										name="' . esc_attr( $value['id'] ) . '"
										id="' . esc_attr( $value['id'] ) . '"
										style="' . esc_attr( $value['css'] ) .'"
										class="' . esc_attr( $value['class'] ) . '"
										rows="' . esc_attr( $value['rows'] ) . '"
										cols="' . esc_attr( $value['cols'] ) . '"
										placeholder="' . esc_attr( $value['placeholder'] ) . '"
										' . implode( ' ', $custom_attributes ) . '>'
										. esc_textarea( $option_value ) . '</textarea>';
							$settings .= '</td></tr>';
							break;

						// Select boxes.
						case 'select':
						case 'multiselect':
							$option_value = self::get_option( $value['id'], $value['default'] );

							$settings .= '<tr valign="top" class="' . esc_attr( $value['row_class'] ) .'">';
							$settings .= '<th scope="row" class="titledesc">';
							$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ) . '</label>';
							$settings .= $tooltip_html;
							$settings .= '</th>';
							$settings .= '<td class="forminp forminp-' . esc_html( sanitize_title( $value['type'] ) ) . '">';

							$multiple = '';
							$type = '';
							if( 'multiselect' == $value['type'] ) {
								$type = '[]';
								$multiple = 'multiple="multiple"';
							}

							$settings .= '<select
										name="' . esc_attr( $value['id'] ) . '' .$type . '"
										id="' . esc_attr( $value['id'] ) . '"
										style="' . esc_attr( $value['css'] ) . '"
										class="'. esc_attr( $value['class'] ). '"
										' . implode( ' ', $custom_attributes ) . '
										' . $multiple .'>';

							foreach ( $value['options'] as $key => $val ) {
								$selected = '';

								if ( is_array( $option_value ) ) {
									$selected = selected( in_array( $key, $option_value ), true, false );
								} else {
									$selected = selected( $option_value, $key, false );
								}

								$settings .= '<option value="' . esc_attr( $key ) . '" ' . esc_attr( $selected ) . '>';
								$settings .= esc_html( $val );
								$settings .= '</option>';
							}

							$settings .= '</select>' . esc_html( $description ) . '</td></tr>';
							break;

						// Radio inputs.
						case 'radio':
							$option_value = self::get_option( $value['id'], $value['default'] );
							$settings .= '<tr valign="top" class="' . esc_attr( $value['row_class'] ) . '">';
							$settings .= '<th scope="row" class="titledesc">';
							$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ). '</label>';
							$settings .= $tooltip_html;
							$settings .= '</th>';
							$settings .= '<td class="forminp forminp-' . sanitize_title( $value['type'] ) . '">';
							$settings .= '<fieldset>';
							$settings .= $description;
							$settings .= '<ul>';

							foreach ( $value['options'] as $key => $val ) {
								$settings .= '<li>';
								$settings .= '<label>';
								$settings .= '<input
												name="' . esc_attr( $value['id'] ) . '"
												value="' . $key . '"
												type="radio"
												style="' . esc_attr( $value['css'] ) . '"
												class="' . esc_attr( $value['class'] ) . '"
												' . implode( ' ', $custom_attributes ) . '
												' . checked( $key, $option_value, false ) . '
												/>' . $val . '</label>';
								$settings .= '</li>';
							}

							$settings .= '</ul>';
							$settings .= '</fieldset>';
							$settings .= '</td>';
							$settings .= '</tr>';
							break;

						// Checkbox input.
						case 'checkbox':
							$option_value = self::get_option( $value['id'], $value['default'] );

							$visbility_class = array();

							if ( ! isset( $value['hide_if_checked'] ) ) {
								$value['hide_if_checked'] = false;
							}
							if ( ! isset( $value['show_if_checked'] ) ) {
								$value['show_if_checked'] = false;
							}
							if ( 'yes' === $value['hide_if_checked'] || 'yes' === $value['show_if_checked'] ) {
								$visbility_class[] = 'hidden_option';
							}
							if ( 'option' === $value['hide_if_checked'] ) {
								$visbility_class[] = 'hide_options_if_checked';
							}
							if ( 'option' === $value['show_if_checked'] ) {
								$visbility_class[] = 'show_options_if_checked';
							}

							if ( ! isset( $value['checkboxgroup'] ) || 'start' === $value['checkboxgroup'] ) {
								$settings .= '<tr valign="top" class="' . esc_attr( implode( ' ', $visbility_class ) ) . ' ' . esc_attr( $value['row_class'] ) .'">';
								$settings .= '<th scope="row" class="titledesc">';
								$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ) . '</label>';
								$settings .= $tooltip_html;
								$settings .= '</th><td class="forminp forminp-checkbox"><fieldset>';
							} else {
								$settings .= '<fieldset class="' . esc_attr( implode( ' ', $visbility_class ) ) . '">';
							}

							$settings .= '<label for="' . $value['id'] . '">';
							$settings .= '<input
										name="' . esc_attr( $value['id'] ) .'"
										id="' . esc_attr( $value['id'] ) .'"
										type="checkbox"
										class="' . esc_attr( isset( $value['class'] ) ? $value['class'] : '' ) . '"
										value="1"
										'. checked( $option_value, 'yes', false ) .'
										'. implode( ' ', $custom_attributes ) .'/>'. $description . '</label>';

							if ( ! isset( $value['checkboxgroup'] ) || 'end' === $value['checkboxgroup'] ) {
								$settings .= '</fieldset>';
								$settings .= $desc_field;
								$settings .= '</td></tr>';
							} else {
								$settings .= '</fieldset>';
								$settings .= $desc_field;
							}
							break;

						// Single page selects.
						case 'single_select_page':
							$args = array(
								'name'             => $value['id'],
								'id'               => $value['id'],
								'sort_column'      => 'menu_order',
								'sort_order'       => 'ASC',
								'show_option_none' => ' ',
								'class'            => $value['class'],
								'echo'             => false,
								'selected'         => absint( self::get_option( $value['id'] ) ),
							);

							if ( isset( $value['args'] ) ) {
								$args = wp_parse_args( $value['args'], $args );
							}

							$settings .= '<tr valign="top" class="single_select_page '. esc_attr( $value['row_class'] ) .'" ' . ( ( isset( $value['display'] ) && $value['display'] === 'none' ) ? 'style="display:none"' : '' ) . '>';
							$settings .= '<th scope="row" class="titledesc">' . esc_html( $value['title'] ) . ' ' . $tooltip_html;
							$settings .= '</th>';
							$settings .= '<td class="forminp">';
							$settings .= str_replace( ' id=', " data-placeholder='" . esc_attr__( 'Select a page&hellip;', 'user-registration' ) . "' style='" . $value['css'] . "' class='" . $value['class'] . "' id=", wp_dropdown_pages( $args ) );
							$settings .= $description;
							$settings .= '</td></tr>';
							break;

						case 'tinymce':
							$editor_settings = array(
								'name'       => esc_attr( $value['id'] ),
								'id'         => esc_attr( $value['id'] ),
								'style'      => esc_attr( $value['css'] ),
								'default'    => esc_attr( $value['default'] ),
								'class'      => esc_attr( $value['class'] ),
								'quicktags'  => array( 'buttons' => 'em,strong,link' ),
								'tinymce'    => array(
									'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator',
									'theme_advanced_buttons2' => '',
								),
								'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
							);

							$option_value = self::get_option( $value['id'], $value['default'] );

							$settings .= '<tr valign="top" class="' . esc_attr( $value['row_class'] ) . '">';
							$settings .= '<th scope="row" class="titledesc">';
							$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_html( $value['title'] ) . '</label>';
							$settings .= $tooltip_html;
							$settings .= '</th>';
							$settings .= '<td class="forminp forminp-' . sanitize_title( $value['type'] ) . '">';
							$settings .= $description;

							// Output buffer for tinymce editor
							ob_start();
							wp_editor( $option_value, $value['id'], $editor_settings );
							$settings .= ob_get_clean();

							$settings .= '</td>';
							$settings .= '</tr>';
							break;

							case 'link' :
								$settings .= '<tr valign="top" class="' . esc_attr( $value['row_class'] ) . '">';
								$settings .= '<th scope="row" class="titledesc">';
								$settings .= '<label for="' . esc_attr( $value['id'] ) . '">' . esc_attr( $value['title'] ) . '</label>';
								$settings .= $tooltip_html;
								$settings .= '</th>';
								$settings .= '<td>';

								if ( isset( $value['buttons'] ) && is_array( $value['buttons'] ) ) {
									foreach ( $value['buttons'] as $button ) {
										$settings .= '<a
													href="' . esc_url( $button['href'] ) . '"
													class="button ' . esc_attr( $button['class'] ) . '">' . esc_html( $button['title'] ) . '</a>';
											}
										}

									$settings .= ( isset( $value['desc'] ) && isset( $value['desc_tip'] ) && true !== $value['desc_tip'] ) ? '<p class="description" >' . esc_html( $value['desc'] ) . '</p>' : '';
									$settings .= '</td>';
									$settings .= '</tr>';
								break;

						// Default: run an action.
						default:
							$settings = apply_filters( 'user_registration_admin_field_' . $value['type'], $settings, $value );
						break;
					}// End switch case.
				}
				$settings .= '</table>';
				$settings .=  '</div>';
				$settings .= '</div>';

				if ( ! empty( $section['id'] ) ) {
					do_action( 'user_registration_settings_' . sanitize_title( $section['id'] ) . '_after' );
				}
			}// End foreach.
		}
		echo $settings;
	}

	/**
	 * Helper function to get the formated description and tip HTML for a
	 * given form field. Plugins can call this when implementing their own custom
	 * settings types.
	 *
	 * @param  array $value The form field value array.
	 *
	 * @return array The description and tip as a 2 element array
	 */
	public static function get_field_description( $value ) {
		$description  = '';
		$tooltip_html = '';
		$desc_field = '';

		if ( true === $value['desc_tip'] ) {
			$tooltip_html = $value['desc'];
		} elseif ( ! empty( $value['desc_tip'] ) ) {
			$description  = $value['desc'];
			$tooltip_html = $value['desc_tip'];
		} elseif ( ! empty( $value['desc'] ) ) {
			$description = $value['desc'];
		}

		if ( ! empty( $value['desc_field'] ) ) {
			$desc_field = $value['desc_field'];
		}

		if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) {
			$description = '<p style="margin-top:0">' . wp_kses_post( $description ) . '</p>';
		} elseif ( $description && in_array( $value['type'], array( 'checkbox' ) ) ) {
			$description = wp_kses_post( $description );
		} elseif ( $description ) {
			$description = '<span class="description">' . wp_kses_post( $description ) . '</span>';
		}

		if ( $desc_field && in_array( $value['type'], array( 'textarea', 'radio', 'checkbox' ) ) ) {
			$desc_field = '<p class="description">' . wp_kses_post( $desc_field ) . '</p>';
		} elseif ( $desc_field ) {
			$desc_field = '<span class="description">' . wp_kses_post( $desc_field ) . '</span>';
		}

		if ( $tooltip_html ) {
			$tooltip_html = ur_help_tip( $tooltip_html );
		}

		return array(
			'description'  => $description,
			'desc_field'   => $desc_field,
			'tooltip_html' => $tooltip_html,
		);
	}

	/**
	 * Save admin fields.
	 *
	 * Loops though the user registration options array and outputs each field.
	 *
	 * @param  array $options Options array to output.
	 *
	 * @return bool
	 */
	public static function save_fields( $options ) {
		if ( empty( $_POST ) ) {
			return false;
		}

		// Options to update will be stored here and saved later.
		$update_options = array();

		if( empty( $options ) ){
			return false;
		}

		// Loop options and get values to save.
		foreach ( $options['sections'] as $id => $section ) {
			if ( ! isset( $id ) || ! isset( $section['type'] ) ) {
				continue;
			}

			foreach ( $section['settings'] as $option ) {
				// Get posted value.
				if ( strstr( $option['id'], '[' ) ) {
					parse_str( $option['id'], $option_name_array );
					$option_name = current( array_keys( $option_name_array ) );

					$setting_name = key( $option_name_array[ $option_name ] );
					$raw_value    = isset( $_POST[ $option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $option_name ][ $setting_name ] ) : null;
				} else {
					$option_name  = $option['id'];
					$setting_name = '';
					$raw_value    = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null;
				}

				// Format the value based on option type.
				switch ( $option['type'] ) {

					case 'checkbox':
						$value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no';
						break;
					case 'textarea':
						$value = wp_kses_post( trim( $raw_value ) );
						break;
					case 'multiselect':
						$value = array_filter( array_map( 'ur_clean', (array) $raw_value ) );
						break;
					case 'select':
						$allowed_values = empty( $option['options'] ) ? array() : array_keys( $option['options'] );
						if ( empty( $option['default'] ) && empty( $allowed_values ) ) {
							$value = null;
							break;
						}
						$default = ( empty( $option['default'] ) ? $allowed_values[0] : $option['default'] );
						$value   = in_array( $raw_value, $allowed_values ) ? $raw_value : $default;
						break;
					case 'tinymce':
						$value = wpautop( $raw_value );
						break;

					default:
						$value = ur_clean( $raw_value );
						break;
				}

				/**
				 * Sanitize the value of an option.
				 */
				$value = apply_filters( 'user_registration_admin_settings_sanitize_option', $value, $option, $raw_value );

				/**
				 * Sanitize the value of an option by option name.
				 */
				$value = apply_filters( "user_registration_admin_settings_sanitize_option_$option_name", $value, $option, $raw_value );

				if ( is_null( $value ) ) {
					continue;
				}

				// Check if option is an array and handle that differently to single values.
				if ( $option_name && $setting_name ) {
					if ( ! isset( $update_options[ $option_name ] ) ) {
						$update_options[ $option_name ] = get_option( $option_name, array() );
					}
					if ( ! is_array( $update_options[ $option_name ] ) ) {
						$update_options[ $option_name ] = array();
					}
					$update_options[ $option_name ][ $setting_name ] = $value;
				} else {
					$update_options[ $option_name ] = $value;
				}
			}
		}// End foreach().

		// Save all options in our array.
		foreach ( $update_options as $name => $value ) {
			update_option( $name, $value );
		}

		return true;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit