id
stringlengths 40
40
| text
stringlengths 29
2.03k
| original_text
stringlengths 3
154k
| subdomain
stringclasses 20
values | metadata
dict | emb
listlengths 1.02k
1.02k
|
---|---|---|---|---|---|
4731cba6f7286b3546537b388294011c084c8448
|
Wordpress Stackexchange
Q: How to enable the tag in Wordpress posts and pages i can't understand why so simple feature are disabled by Wordpress Team.
I want have line breaking with "br" tag.
On one wordpress forum was idea to modificate editor.js (in wp-admin/js) and formating.php (in wp-includes) files. http://wordpress.org/support/topic/ltbrgt-stripping-problem-ultimate-solving
I was tryed to do this, but 0 good results.
A: First things first, modifying core files is extremely frowned upon you will have to make these changes with every upgrade and they can lead to security and other problems.
I'm pretty sure there is a plugin that will allow this. I did a simple search and here are a few to try:
http://wordpress.org/extend/plugins/preserved-html-editor-markup/
http://wordpress.org/extend/plugins/ultimate-tinymce/
|
Q: How to enable the tag in Wordpress posts and pages i can't understand why so simple feature are disabled by Wordpress Team.
I want have line breaking with "br" tag.
On one wordpress forum was idea to modificate editor.js (in wp-admin/js) and formating.php (in wp-includes) files. http://wordpress.org/support/topic/ltbrgt-stripping-problem-ultimate-solving
I was tryed to do this, but 0 good results.
A: First things first, modifying core files is extremely frowned upon you will have to make these changes with every upgrade and they can lead to security and other problems.
I'm pretty sure there is a plugin that will allow this. I did a simple search and here are a few to try:
http://wordpress.org/extend/plugins/preserved-html-editor-markup/
http://wordpress.org/extend/plugins/ultimate-tinymce/
|
wordpress
|
{
"language": "en",
"length": 113,
"provenance": "stackexchange_00019.jsonl.gz:418731",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/47881"
}
|
[
0.0633544921875,
-0.0207672119140625,
-0.0020313262939453125,
-0.034423828125,
0.017059326171875,
-0.027679443359375,
0.06866455078125,
0.0130615234375,
-0.006320953369140625,
0.029541015625,
-0.00913238525390625,
-0.0092315673828125,
0.0009427070617675781,
-0.0222625732421875,
-0.010986328125,
-0.0186920166015625,
0.0239410400390625,
0.0022335052490234375,
0.019622802734375,
-0.005466461181640625,
0.0069122314453125,
0.0226593017578125,
-0.023590087890625,
0.01277923583984375,
0.0134124755859375,
0.06494140625,
0.067626953125,
-0.0278167724609375,
0.0237884521484375,
0.00852203369140625,
0.0268707275390625,
-0.06396484375,
0.024505615234375,
0.056060791015625,
-0.0787353515625,
-0.031402587890625,
-0.01496124267578125,
0.0216217041015625,
-0.025054931640625,
0.022125244140625,
0.01319122314453125,
0.0092620849609375,
0.0574951171875,
0.01071929931640625,
0.0038299560546875,
-0.03656005859375,
0.023193359375,
-0.0312042236328125,
0.0192413330078125,
0.0013217926025390625,
-0.01062774658203125,
0.00835418701171875,
-0.0008177757263183594,
-0.0280303955078125,
-0.0016603469848632812,
0.01018524169921875,
-0.0224456787109375,
-0.0615234375,
0.006381988525390625,
0.048431396484375,
0.030364990234375,
-0.01561737060546875,
0.0109405517578125,
-0.01251983642578125,
-0.0014848709106445312,
-0.0117034912109375,
-0.00003647804260253906,
0.00919342041015625,
-0.044586181640625,
-0.0010690689086914062,
0.05010986328125,
-0.03302001953125,
0.006450653076171875,
-0.0246734619140625,
0.0224456787109375,
0.0115203857421875,
-0.022857666015625,
0.0010929107666015625,
0.026153564453125,
0.002288818359375,
0.04083251953125,
0.00177764892578125,
0.031463623046875,
-0.0285186767578125,
0.00037384033203125,
-0.024444580078125,
0.008453369140625,
-0.0023193359375,
-0.047454833984375,
-0.02935791015625,
-0.031219482421875,
-0.023406982421875,
-0.07275390625,
-0.0020847320556640625,
-0.014404296875,
-0.004657745361328125,
-0.01000213623046875,
-0.032867431640625,
0.0178680419921875,
0.03692626953125,
0.0243072509765625,
-0.058746337890625,
0.07373046875,
-0.017730712890625,
0.006801605224609375,
0.0033626556396484375,
-0.003307342529296875,
0.01250457763671875,
0.0452880859375,
0.029571533203125,
-0.008636474609375,
0.031280517578125,
-0.0020503997802734375,
-0.016693115234375,
0.0038242340087890625,
-0.0244903564453125,
-0.0472412109375,
0.05126953125,
-0.00470733642578125,
0.00438690185546875,
-0.0140380859375,
0.0171356201171875,
-0.0494384765625,
0.01666259765625,
-0.01153564453125,
-0.005268096923828125,
0.026611328125,
-0.001483917236328125,
-0.034332275390625,
-0.002948760986328125,
0.0233612060546875,
0.0221099853515625,
0.0016756057739257812,
0.044158935546875,
-0.02679443359375,
0.013427734375,
0.041259765625,
-0.0225372314453125,
-0.007396697998046875,
0.01364898681640625,
-0.0235443115234375,
-0.0223846435546875,
0.0016298294067382812,
-0.03192138671875,
-0.007648468017578125,
0.030120849609375,
0.021392822265625,
0.00478363037109375,
-0.004001617431640625,
-0.053924560546875,
0.0230865478515625,
-0.016265869140625,
0.065185546875,
0.0015001296997070312,
-0.034149169921875,
-0.06207275390625,
0.038360595703125,
-0.053436279296875,
-0.009552001953125,
-0.073486328125,
-0.01395416259765625,
-0.00476837158203125,
0.0545654296875,
-0.0357666015625,
-0.032989501953125,
0.01001739501953125,
-0.049530029296875,
-0.0024471282958984375,
0.0312347412109375,
0.0025463104248046875,
0.0260772705078125,
-0.007122039794921875,
0.005008697509765625,
0.01335906982421875,
0.01152801513671875,
0.0185546875,
-0.004425048828125,
-0.0089874267578125,
0.047119140625,
0.0227813720703125,
-0.005809783935546875,
-0.01326751708984375,
0.070556640625,
-0.017181396484375,
-0.061065673828125,
0.03216552734375,
0.01413726806640625,
0.0882568359375,
0.0201263427734375,
0.0350341796875,
0.024017333984375,
-0.0235443115234375,
0.01290130615234375,
0.007781982421875,
-0.00562286376953125,
-0.0721435546875,
-0.031005859375,
-0.036895751953125,
-0.0255889892578125,
0.03271484375,
0.0305328369140625,
-0.0186767578125,
0.00026035308837890625,
-0.02398681640625,
-0.03936767578125,
-0.0291748046875,
-0.0067901611328125,
0.0222015380859375,
0.0285186767578125,
0.005306243896484375,
-0.01038360595703125,
-0.0213623046875,
0.0159759521484375,
-0.02734375,
-0.0250091552734375,
0.037750244140625,
0.023712158203125,
0.0335693359375,
0.022186279296875,
-0.0081634521484375,
0.050567626953125,
-0.00311279296875,
0.041778564453125,
0.031829833984375,
-0.0123748779296875,
-0.0172882080078125,
-0.01297760009765625,
-0.0167694091796875,
-0.0160675048828125,
-0.00193023681640625,
0.0210113525390625,
0.0294952392578125,
0.025634765625,
0.0684814453125,
-0.0025348663330078125,
-0.0167236328125,
-0.0027294158935546875,
-0.036651611328125,
0.0194854736328125,
0.0293426513671875,
0.057708740234375,
0.054046630859375,
0.0078277587890625,
-0.025604248046875,
0.0643310546875,
-0.048370361328125,
0.01514434814453125,
-0.034881591796875,
0.004962921142578125,
0.05487060546875,
-0.023101806640625,
-0.00533294677734375,
0.01560211181640625,
-0.0271148681640625,
-0.0268707275390625,
0.048797607421875,
-0.0132598876953125,
0.00360870361328125,
0.00756072998046875,
-0.010498046875,
0.01192474365234375,
-0.0265350341796875,
-0.01151275634765625,
-0.02996826171875,
0.0154876708984375,
0.05206298828125,
0.059600830078125,
0.06317138671875,
-0.015838623046875,
0.0274810791015625,
-0.005664825439453125,
-0.006076812744140625,
0.0175323486328125,
0.057708740234375,
-0.0303192138671875,
0.039947509765625,
-0.0240631103515625,
-0.0051422119140625,
0.00933837890625,
0.040740966796875,
-0.0003426074981689453,
0.031951904296875,
0.0176544189453125,
-0.01061248779296875,
-0.007106781005859375,
-0.06768798828125,
0.01934814453125,
0.025848388671875,
-0.0260009765625,
-0.043701171875,
-0.00563812255859375,
0.037628173828125,
-0.020599365234375,
0.038421630859375,
-0.027099609375,
-0.005908966064453125,
0.0487060546875,
-0.046905517578125,
0.03564453125,
-0.02069091796875,
0.076904296875,
0.0643310546875,
-0.00496673583984375,
-0.005645751953125,
0.0189056396484375,
-0.0029354095458984375,
0.0224456787109375,
0.016845703125,
0.01236724853515625,
0.0238037109375,
-0.045745849609375,
0.007053375244140625,
0.037567138671875,
-0.0002225637435913086,
0.004180908203125,
-0.0242156982421875,
-0.0355224609375,
0.0323486328125,
-0.06591796875,
-0.0130767822265625,
-0.0176849365234375,
-0.083251953125,
0.005954742431640625,
0.051544189453125,
-0.054779052734375,
-0.01360321044921875,
0.1197509765625,
0.00821685791015625,
-0.0394287109375,
-0.0192108154296875,
-0.0251922607421875,
-0.037353515625,
-0.042510986328125,
0.021759033203125,
-0.0069580078125,
0.004230499267578125,
0.0022296905517578125,
0.058074951171875,
0.0009365081787109375,
-0.07049560546875,
0.001220703125,
-0.02587890625,
-0.0193328857421875,
0.0377197265625,
-0.00667572021484375,
-0.0166015625,
-0.0002613067626953125,
0.0005102157592773438,
0.0003676414489746094,
0.0092926025390625,
-0.0203704833984375,
-0.005977630615234375,
-0.0276641845703125,
-0.02996826171875,
0.001438140869140625,
0.032501220703125,
0.027618408203125,
-0.00981903076171875,
0.02557373046875,
-0.046417236328125,
-0.006847381591796875,
-0.0005855560302734375,
-0.0155181884765625,
0.0169525146484375,
-0.0298614501953125,
-0.005779266357421875,
-0.01390838623046875,
0.041229248046875,
0.0080413818359375,
0.01093292236328125,
0.0667724609375,
-0.037506103515625,
0.01389312744140625,
-0.01059722900390625,
-0.01398468017578125,
-0.05413818359375,
-0.0003762245178222656,
-0.01422119140625,
0.016143798828125,
-0.01995849609375,
-0.01244354248046875,
-0.0648193359375,
0.0132904052734375,
-0.09381103515625,
0.0211334228515625,
-0.00212860107421875,
-0.0452880859375,
0.0196075439453125,
-0.01441192626953125,
0.00820159912109375,
-0.0224456787109375,
0.019989013671875,
-0.01412200927734375,
-0.0079345703125,
-0.01451873779296875,
0.0091705322265625,
-0.031524658203125,
-0.0304107666015625,
-0.035858154296875,
-0.00679779052734375,
-0.035308837890625,
0.01141357421875,
-0.0300140380859375,
0.004329681396484375,
-0.017791748046875,
-0.0020427703857421875,
-0.01168060302734375,
-0.040283203125,
0.040252685546875,
-0.054443359375,
-0.0206451416015625,
0.05340576171875,
-0.047698974609375,
-0.0026092529296875,
-0.038818359375,
0.0011615753173828125,
-0.0897216796875,
0.002532958984375,
-0.06787109375,
0.052825927734375,
0.04248046875,
-0.0248260498046875,
-0.013824462890625,
0.0367431640625,
0.00676727294921875,
-0.031646728515625,
0.03289794921875,
0.019317626953125,
0.0002675056457519531,
-0.002101898193359375,
-0.004055023193359375,
-0.035736083984375,
0.004425048828125,
0.020263671875,
-0.0189361572265625,
0.0177001953125,
-0.0242767333984375,
-0.050811767578125,
0.028167724609375,
-0.04736328125,
-0.07257080078125,
-0.0231781005859375,
-0.048095703125,
0.01123809814453125,
-0.016326904296875,
-0.0283660888671875,
-0.030975341796875,
-0.08612060546875,
0.03656005859375,
-0.02490234375,
-0.00800323486328125,
0.0099334716796875,
0.059661865234375,
0.0124664306640625,
0.0017194747924804688,
-0.04119873046875,
0.04559326171875,
0.062347412109375,
0.0263214111328125,
0.039520263671875,
0.02484130859375,
-0.039306640625,
0.06085205078125,
0.04852294921875,
0.028076171875,
-0.0648193359375,
0.043304443359375,
0.010162353515625,
0.02728271484375,
0.0017194747924804688,
0.026580810546875,
0.0312042236328125,
0.020599365234375,
0.00913238525390625,
0.006923675537109375,
0.035736083984375,
-0.00774383544921875,
-0.01160430908203125,
-0.0172271728515625,
0.0035572052001953125,
-0.024200439453125,
-0.0027561187744140625,
0.017791748046875,
0.03155517578125,
0.057647705078125,
-0.00676727294921875,
0.0135345458984375,
0.01261138916015625,
-0.01544189453125,
-0.00470733642578125,
-0.00952911376953125,
-0.020477294921875,
0.0198211669921875,
-0.0278472900390625,
-0.034881591796875,
0.013031005859375,
-0.01435089111328125,
0.006763458251953125,
-0.0021800994873046875,
-0.010284423828125,
-0.0260162353515625,
0.002658843994140625,
0.051025390625,
0.005092620849609375,
0.013092041015625,
0.00548553466796875,
0.034912109375,
-0.015594482421875,
0.0213470458984375,
0.033905029296875,
0.017181396484375,
-0.01715087890625,
-0.01371002197265625,
-0.004375457763671875,
-0.01047515869140625,
0.02154541015625,
0.04339599609375,
0.0139312744140625,
0.0254669189453125,
-0.0288848876953125,
0.03814697265625,
0.0225067138671875,
0.0253753662109375,
-0.001041412353515625,
0.014404296875,
-0.0230255126953125,
0.0143280029296875,
-0.0216522216796875,
-0.04766845703125,
-0.0106964111328125,
0.00981903076171875,
0.04498291015625,
-0.0134124755859375,
-0.042724609375,
0.032958984375,
-0.0141143798828125,
-0.0172271728515625,
0.0279998779296875,
0.004261016845703125,
-0.0173797607421875,
-0.018829345703125,
-0.009552001953125,
0.025909423828125,
0.00772857666015625,
-0.0003077983856201172,
-0.0099639892578125,
-0.0254974365234375,
-0.0143280029296875,
0.0245513916015625,
-0.0301513671875,
-0.00865936279296875,
-0.00595855712890625,
0.003978729248046875,
-0.0090789794921875,
-0.0215606689453125,
0.0035572052001953125,
-0.006549835205078125,
-0.013153076171875,
0.0005159378051757812,
0.027557373046875,
-0.036773681640625,
-0.01385498046875,
-0.035797119140625,
0.0469970703125,
-0.034271240234375,
0.0028629302978515625,
0.07794189453125,
0.0528564453125,
-0.050445556640625,
-0.00789642333984375,
-0.06317138671875,
-0.0240478515625,
0.00101470947265625,
-0.01467132568359375,
-0.048858642578125,
-0.004848480224609375,
0.00846099853515625,
0.006282806396484375,
-0.00984954833984375,
-0.033203125,
-0.0162506103515625,
0.0672607421875,
0.04852294921875,
0.08880615234375,
-0.0158233642578125,
0.03863525390625,
-0.01141357421875,
0.0501708984375,
-0.0189208984375,
-0.01102447509765625,
-0.0078277587890625,
-0.00589752197265625,
0.04010009765625,
-0.00421905517578125,
-0.04888916015625,
-0.02508544921875,
-0.0167999267578125,
-0.01419830322265625,
0.038848876953125,
-0.0209808349609375,
0.01190948486328125,
0.0048065185546875,
0.0096893310546875,
-0.02008056640625,
-0.0285186767578125,
-0.01678466796875,
0.0193634033203125,
-0.0218963623046875,
-0.018585205078125,
-0.006336212158203125,
-0.0066680908203125,
-0.00835418701171875,
0.0308837890625,
-0.003826141357421875,
0.015869140625,
-0.0207061767578125,
0.00920867919921875,
-0.002887725830078125,
0.004222869873046875,
-0.00550079345703125,
0.0124969482421875,
0.0182342529296875,
0.01268768310546875,
-0.015869140625,
0.00676727294921875,
-0.006259918212890625,
0.016754150390625,
-0.0017194747924804688,
-0.0197601318359375,
0.0012826919555664062,
-0.0194091796875,
-0.0185394287109375,
0.032073974609375,
0.055877685546875,
0.084716796875,
-0.065673828125,
0.033233642578125,
0.023223876953125,
-0.022003173828125,
0.03900146484375,
-0.0242462158203125,
-0.026947021484375,
-0.055084228515625,
0.0830078125,
-0.0167083740234375,
-0.007152557373046875,
0.0250091552734375,
-0.009979248046875,
-0.0123138427734375,
-0.03851318359375,
0.07501220703125,
0.0157470703125,
-0.04656982421875,
0.029937744140625,
0.0218658447265625,
0.005252838134765625,
-0.0213470458984375,
0.0193328857421875,
0.01203155517578125,
-0.0269317626953125,
-0.0616455078125,
0.0260772705078125,
0.021270751953125,
-0.02398681640625,
-0.01464080810546875,
-0.01541900634765625,
-0.001678466796875,
0.04205322265625,
-0.03753662109375,
0.0070343017578125,
0.042266845703125,
-0.0855712890625,
-0.004207611083984375,
-0.0235748291015625,
0.00766754150390625,
0.02813720703125,
0.00689697265625,
0.00879669189453125,
0.01033782958984375,
-0.0257568359375,
-0.0095062255859375,
-0.02545166015625,
0.00769805908203125,
0.0224151611328125,
-0.02410888671875,
0.0142974853515625,
0.0198974609375,
0.0047607421875,
-0.046966552734375,
-0.017852783203125,
-0.03155517578125,
0.01303863525390625,
-0.05255126953125,
-0.0182952880859375,
0.01302337646484375,
-0.076416015625,
-0.055999755859375,
0.1116943359375,
-0.01285552978515625,
0.045013427734375,
0.0250244140625,
0.03118896484375,
-0.04010009765625,
0.01389312744140625,
-0.031158447265625,
0.0264129638671875,
-0.0216217041015625,
0.005558013916015625,
-0.0567626953125,
-0.004547119140625,
-0.005596160888671875,
0.042449951171875,
0.006580352783203125,
-0.002750396728515625,
0.00019073486328125,
-0.0250091552734375,
0.0091094970703125,
0.0516357421875,
0.018218994140625,
0.0049591064453125,
-0.0035762786865234375,
-0.001331329345703125,
-0.0302276611328125,
-0.0121307373046875,
0.031463623046875,
-0.067626953125,
-0.041015625,
0.019866943359375,
0.0109405517578125,
0.002353668212890625,
-0.01611328125,
-0.01141357421875,
-0.0014095306396484375,
-0.0099334716796875,
-0.002971649169921875,
-0.05206298828125,
-0.024566650390625,
0.05206298828125,
0.03204345703125,
-0.061248779296875,
-0.08685302734375,
-0.015350341796875,
0.017120361328125,
0.0205078125,
0.00984954833984375,
0.0104217529296875,
0.0018768310546875,
0.0321044921875,
-0.039825439453125,
-0.0028667449951171875,
-0.0028095245361328125,
-0.005466461181640625,
-0.0250701904296875,
-0.03912353515625,
-0.00539398193359375,
-0.07952880859375,
-0.01549530029296875,
0.08636474609375,
0.0093536376953125,
0.00018990039825439453,
-0.0006117820739746094,
-0.0031223297119140625,
-0.0016622543334960938,
0.0265350341796875,
-0.0242767333984375,
0.034423828125,
0.013031005859375,
0.0175628662109375,
0.02423095703125,
-0.0187225341796875,
-0.0041351318359375,
0.004642486572265625,
0.0187530517578125,
0.06536865234375,
-0.00933074951171875,
-0.014862060546875,
-0.058929443359375,
0.012542724609375,
0.005367279052734375,
0.0267486572265625,
0.043365478515625,
0.00894927978515625,
0.039459228515625,
-0.01495361328125,
-0.020477294921875,
0.034881591796875,
0.019622802734375,
0.002407073974609375,
0.002239227294921875,
-0.00542449951171875,
-0.01302337646484375,
0.0159454345703125,
-0.02337646484375,
0.01497650146484375,
0.027069091796875,
0.0028209686279296875,
-0.10272216796875,
-0.01511383056640625,
0.05938720703125,
-0.043365478515625,
-0.05731201171875,
-0.026275634765625,
0.011566162109375,
0.057525634765625,
0.02899169921875,
0.0364990234375,
0.026214599609375,
0.038177490234375,
-0.0082550048828125,
0.02099609375,
0.0050506591796875,
0.0009069442749023438,
0.005146026611328125,
0.019561767578125,
-0.0018100738525390625,
0.0296173095703125,
-0.05462646484375,
0.006923675537109375,
-0.029998779296875,
-0.06689453125,
0.0308380126953125,
0.033935546875,
-0.0260162353515625,
-0.0008835792541503906,
0.00829315185546875,
-0.0171966552734375,
0.03167724609375,
-0.027984619140625,
0.01470184326171875,
0.040740966796875,
0.00811004638671875,
0.0179290771484375,
-0.0499267578125,
-0.0377197265625,
-0.04132080078125,
0.04437255859375,
0.040374755859375,
0.060455322265625,
0.0031795501708984375,
0.03955078125,
-0.003223419189453125,
0.009857177734375,
-0.004150390625,
-0.0037784576416015625,
-0.004695892333984375,
0.023468017578125,
0.032867431640625,
-0.0061492919921875,
0.006916046142578125,
0.052520751953125,
0.02978515625,
-0.0240325927734375,
0.0303955078125,
-0.00704193115234375,
-0.01314544677734375,
-0.040008544921875,
0.0229034423828125,
-0.01137542724609375,
-0.041046142578125,
-0.028564453125,
-0.0032253265380859375,
0.0005574226379394531,
0.0307159423828125,
0.032562255859375,
-0.0006079673767089844,
0.00225067138671875,
-0.0262298583984375,
-0.00736236572265625,
0.0016460418701171875,
-0.030029296875,
0.0223846435546875,
-0.0007281303405761719,
-0.0276031494140625,
0.0158233642578125,
-0.0111083984375,
-0.001453399658203125,
0.00836181640625,
0.027862548828125,
0.01983642578125,
-0.038818359375,
0.038787841796875,
0.04315185546875,
0.0736083984375,
0.01003265380859375,
0.021697998046875,
0.01416015625,
0.00179290771484375,
0.0076446533203125,
-0.013336181640625,
-0.017242431640625,
0.00263214111328125,
-0.0037136077880859375,
0.0306854248046875,
0.006519317626953125,
-0.027984619140625,
-0.1021728515625,
-0.016571044921875,
0.0186309814453125,
-0.0099639892578125,
-0.023529052734375,
0.01617431640625,
-0.0401611328125,
0.00750732421875,
-0.01971435546875,
-0.0018796920776367188,
-0.01256561279296875,
0.0294952392578125,
-0.0121917724609375,
-0.04840087890625,
-0.053619384765625,
0.048492431640625,
-0.0418701171875,
0.060455322265625,
0.07647705078125,
-0.038055419921875,
-0.0192108154296875,
0.050506591796875,
0.040740966796875,
0.09552001953125,
-0.019500732421875,
-0.007465362548828125,
-0.01366424560546875,
0.00927734375,
-0.0305023193359375,
-0.037384033203125,
0.047149658203125,
-0.05902099609375,
-0.03790283203125,
-0.03240966796875,
0.016845703125,
0.010009765625,
-0.071533203125,
-0.10455322265625,
-0.01352691650390625,
-0.0122222900390625,
-0.03790283203125,
0.010009765625,
-0.01629638671875,
-0.00823211669921875,
0.01058197021484375,
0.0229644775390625,
-0.027252197265625,
-0.0199127197265625,
0.00998687744140625,
0.02227783203125,
0.03729248046875,
0.0125274658203125,
-0.003459930419921875,
-0.010162353515625,
0.03912353515625,
0.025604248046875,
0.0173797607421875,
-0.01381683349609375,
0.01226043701171875,
0.006076812744140625,
0.01629638671875,
-0.033966064453125,
0.0034027099609375,
0.00521087646484375,
0.006702423095703125,
0.015472412109375,
-0.06329345703125,
-0.054962158203125,
-0.037933349609375,
0.039306640625,
0.05316162109375,
0.0129547119140625,
-0.0194244384765625,
0.031494140625,
-0.03790283203125,
-0.0460205078125,
0.01361083984375,
0.0188140869140625,
-0.039398193359375,
0.013214111328125,
0.030303955078125,
-0.0010824203491210938,
0.00885009765625,
-0.00952911376953125,
-0.01708984375,
-0.0190277099609375,
-0.01052093505859375,
-0.0193634033203125,
-0.039520263671875,
-0.0075836181640625,
0.066162109375,
-0.050506591796875,
-0.015777587890625,
0.004779815673828125,
0.007701873779296875,
0.024658203125,
0.00839996337890625,
-0.0261077880859375,
0.0194549560546875,
-0.04107666015625,
0.0195465087890625,
-0.007686614990234375,
0.0200347900390625,
-0.03033447265625,
0.017059326171875,
0.016204833984375,
0.00829315185546875,
-0.0016155242919921875,
0.0118408203125,
-0.017425537109375,
-0.0168609619140625,
-0.025726318359375,
0.0019283294677734375,
-0.0130157470703125,
-0.007488250732421875,
-0.0296783447265625,
0.0235443115234375,
-0.0051727294921875,
0.0112457275390625,
-0.0028362274169921875,
-0.0009794235229492188,
0.003170013427734375,
0.04962158203125,
0.03265380859375,
-0.04302978515625,
0.0323486328125,
0.012603759765625,
0.053466796875,
0.017578125
] |
936b7bbafcc6602f488a0d904e52267ce383e807
|
Wordpress Stackexchange
Q: How to insert pictures without hard coded dimensions? How can I insert pictures into a post without any hard coded dimensions (e.g. <img src="" alt="" /> instead of <img src="" alt="" width="" height="" />)? I don't want my users to switch to the HTML tab and remove the parameters by themselves, so I was wondering if there is any filter I can use to achieve this?
Note: I'm already inserting them in "Full size".
A: I don't know if this is the best way to do this, but it works for me.
In the functions.php of the theme you are using, put this:
function remove_img_src($html)
{
$html = preg_replace('@(width|height)="([0-9])+" ?@i', '', $html);
return $html;
}
add_filter('image_send_to_editor', 'remove_img_src', 10, 8);
It uses regular expresions to change the output that is inserted in the editor.
|
Q: How to insert pictures without hard coded dimensions? How can I insert pictures into a post without any hard coded dimensions (e.g. <img src="" alt="" /> instead of <img src="" alt="" width="" height="" />)? I don't want my users to switch to the HTML tab and remove the parameters by themselves, so I was wondering if there is any filter I can use to achieve this?
Note: I'm already inserting them in "Full size".
A: I don't know if this is the best way to do this, but it works for me.
In the functions.php of the theme you are using, put this:
function remove_img_src($html)
{
$html = preg_replace('@(width|height)="([0-9])+" ?@i', '', $html);
return $html;
}
add_filter('image_send_to_editor', 'remove_img_src', 10, 8);
It uses regular expresions to change the output that is inserted in the editor.
A: Looks like you can do it with image captions, but not images at present:
From the wp-hackers mailing list:
I've got a filter I use that forces captions to be responsive on the
frontend. Definitely cuts down on the headaches.
Gist here: https://gist.github.com/2243601
Drew
A: I found a solution in the meantime: wp_get_attachment_image_src() to get the src for the images. I think it ends up by being the easiest solution and it requires no filters.
|
wordpress
|
{
"language": "en",
"length": 210,
"provenance": "stackexchange_00019.jsonl.gz:418732",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/47884"
}
|
[
0.036834716796875,
-0.0255584716796875,
0.0170135498046875,
0.0246734619140625,
-0.01580810546875,
-0.025421142578125,
0.058868408203125,
-0.0379638671875,
0.0106658935546875,
-0.004047393798828125,
-0.020843505859375,
0.01194000244140625,
-0.03253173828125,
-0.02392578125,
0.0078582763671875,
-0.0111541748046875,
0.0322265625,
-0.021270751953125,
0.036651611328125,
-0.005054473876953125,
0.0252532958984375,
0.00887298583984375,
0.038360595703125,
0.0273284912109375,
-0.00998687744140625,
0.01244354248046875,
0.055419921875,
-0.0372314453125,
-0.01407623291015625,
-0.033721923828125,
0.0172119140625,
0.0101776123046875,
0.032135009765625,
0.01904296875,
-0.030181884765625,
0.046966552734375,
-0.036376953125,
0.0174560546875,
0.00579833984375,
-0.005229949951171875,
0.00925445556640625,
-0.004184722900390625,
0.07208251953125,
-0.0146636962890625,
0.01132965087890625,
-0.00482940673828125,
0.0357666015625,
-0.032989501953125,
0.00891876220703125,
-0.0404052734375,
0.0282745361328125,
0.0299530029296875,
0.050048828125,
-0.006801605224609375,
-0.0279693603515625,
-0.000002086162567138672,
-0.033599853515625,
0.013427734375,
0.0208282470703125,
0.0212249755859375,
-0.028564453125,
-0.006011962890625,
0.01486968994140625,
-0.044036865234375,
0.00970458984375,
0.0008306503295898438,
-0.006443023681640625,
0.01422119140625,
-0.06866455078125,
0.004619598388671875,
0.041717529296875,
-0.053314208984375,
0.007358551025390625,
-0.047637939453125,
0.0004665851593017578,
0.058746337890625,
-0.0243072509765625,
0.00201416015625,
0.0208587646484375,
-0.029937744140625,
0.00519561767578125,
0.013427734375,
0.00034928321838378906,
-0.024444580078125,
0.026336669921875,
-0.0059356689453125,
-0.0066680908203125,
-0.006000518798828125,
-0.009918212890625,
-0.0092926025390625,
-0.010589599609375,
-0.018280029296875,
-0.035003662109375,
0.033721923828125,
-0.018341064453125,
-0.0037631988525390625,
-0.0128021240234375,
-0.012664794921875,
0.006175994873046875,
0.045684814453125,
0.016632080078125,
-0.050689697265625,
0.07366943359375,
-0.04986572265625,
0.035186767578125,
0.0079345703125,
-0.039154052734375,
-0.03265380859375,
0.0455322265625,
0.0224151611328125,
0.00665283203125,
0.0035037994384765625,
-0.0007457733154296875,
0.0170135498046875,
-0.0311126708984375,
0.042938232421875,
0.00116729736328125,
0.004589080810546875,
-0.0355224609375,
0.04266357421875,
-0.036590576171875,
0.0008988380432128906,
0.007709503173828125,
-0.0270538330078125,
0.026458740234375,
0.00527191162109375,
-0.005889892578125,
-0.016143798828125,
0.0235748291015625,
-0.0190582275390625,
-0.042022705078125,
0.0279541015625,
0.09600830078125,
0.0296783447265625,
0.0242767333984375,
0.005298614501953125,
-0.03619384765625,
-0.047119140625,
-0.01021575927734375,
0.0411376953125,
-0.062744140625,
-0.053619384765625,
0.0438232421875,
-0.03631591796875,
-0.01448822021484375,
0.0164642333984375,
-0.004955291748046875,
0.012298583984375,
0.00942230224609375,
-0.05450439453125,
0.016937255859375,
-0.063232421875,
0.00899505615234375,
0.028045654296875,
0.01226806640625,
0.0374755859375,
0.054443359375,
-0.008758544921875,
-0.0301361083984375,
-0.025360107421875,
-0.00997161865234375,
0.01800537109375,
0.0445556640625,
-0.06341552734375,
-0.031219482421875,
-0.0258026123046875,
-0.061004638671875,
-0.0049591064453125,
0.0273284912109375,
0.0634765625,
-0.00525665283203125,
-0.01531219482421875,
-0.029815673828125,
0.016448974609375,
-0.006809234619140625,
0.006488800048828125,
-0.023284912109375,
0.019317626953125,
-0.001789093017578125,
0.02764892578125,
0.01401519775390625,
-0.022369384765625,
0.03118896484375,
-0.00899505615234375,
-0.0479736328125,
-0.0163726806640625,
-0.00177764892578125,
0.007434844970703125,
0.024261474609375,
0.01238250732421875,
0.035247802734375,
0.005092620849609375,
0.00011819601058959961,
0.0029449462890625,
0.0004930496215820312,
-0.036346435546875,
0.0062103271484375,
-0.0185089111328125,
-0.01197052001953125,
0.0007147789001464844,
0.037567138671875,
0.0134735107421875,
0.0037441253662109375,
0.0025844573974609375,
0.01332855224609375,
0.005222320556640625,
0.0036296844482421875,
0.019317626953125,
-0.039306640625,
-0.005615234375,
0.024383544921875,
-0.0012311935424804688,
-0.0182342529296875,
0.0027561187744140625,
0.002410888671875,
-0.01125335693359375,
-0.0006814002990722656,
0.0201263427734375,
-0.02008056640625,
0.05255126953125,
-0.01788330078125,
-0.04498291015625,
-0.01158905029296875,
0.0205230712890625,
0.04608154296875,
0.021240234375,
-0.0203094482421875,
-0.0124053955078125,
0.015655517578125,
0.00922393798828125,
-0.01947021484375,
0.0452880859375,
-0.005435943603515625,
-0.01421356201171875,
-0.015960693359375,
0.00494384765625,
-0.00693511962890625,
-0.054534912109375,
0.0119476318359375,
0.04510498046875,
0.05377197265625,
0.05645751953125,
0.0064697265625,
-0.0159454345703125,
0.10601806640625,
-0.0158538818359375,
0.00362396240234375,
-0.029876708984375,
-0.0038814544677734375,
0.00008362531661987305,
-0.0106201171875,
-0.02716064453125,
0.0303192138671875,
-0.08734130859375,
0.0145111083984375,
0.0262298583984375,
-0.006744384765625,
-0.012542724609375,
0.03680419921875,
0.0267181396484375,
-0.003971099853515625,
0.06561279296875,
0.023406982421875,
0.014404296875,
0.035675048828125,
-0.006488800048828125,
0.0189208984375,
-0.003021240234375,
-0.036956787109375,
0.017791748046875,
0.03009033203125,
-0.0076751708984375,
-0.01922607421875,
-0.0092010498046875,
0.0400390625,
0.0144500732421875,
-0.0263671875,
0.015350341796875,
-0.019622802734375,
-0.00115203857421875,
-0.0033016204833984375,
0.04022216796875,
0.0343017578125,
-0.01812744140625,
-0.0284423828125,
-0.0184478759765625,
0.03887939453125,
-0.005275726318359375,
0.0296478271484375,
0.00826263427734375,
0.0477294921875,
0.0157012939453125,
0.032196044921875,
0.017303466796875,
-0.025482177734375,
-0.01033782958984375,
-0.017486572265625,
-0.05303955078125,
0.0396728515625,
0.0049591064453125,
0.08245849609375,
0.0955810546875,
0.0199127197265625,
0.019561767578125,
-0.01788330078125,
-0.013427734375,
-0.021209716796875,
-0.0030956268310546875,
-0.0224609375,
-0.02484130859375,
-0.037017822265625,
0.0158843994140625,
0.0177764892578125,
-0.006946563720703125,
-0.012359619140625,
-0.0240325927734375,
-0.0122528076171875,
0.00792694091796875,
-0.03948974609375,
0.003997802734375,
0.0287017822265625,
-0.056243896484375,
-0.0496826171875,
0.0111846923828125,
-0.04730224609375,
0.016876220703125,
0.032867431640625,
-0.0201873779296875,
-0.0280303955078125,
-0.01288604736328125,
0.0199737548828125,
-0.0294647216796875,
-0.0261688232421875,
0.0178985595703125,
0.01226043701171875,
0.0195159912109375,
0.009552001953125,
0.0014171600341796875,
0.002681732177734375,
-0.056060791015625,
-0.0007634162902832031,
0.03350830078125,
-0.0032482147216796875,
0.01788330078125,
0.03399658203125,
-0.053192138671875,
-0.0018510818481445312,
-0.0131683349609375,
0.01180267333984375,
0.03228759765625,
-0.01140594482421875,
0.00765228271484375,
-0.00604248046875,
-0.03857421875,
-0.0174560546875,
0.06378173828125,
-0.0005550384521484375,
-0.052398681640625,
0.019073486328125,
-0.07232666015625,
-0.00960540771484375,
-0.0193939208984375,
-0.0294036865234375,
0.00754547119140625,
-0.0030384063720703125,
0.01041412353515625,
-0.0224456787109375,
0.0284271240234375,
0.0225677490234375,
0.0284576416015625,
0.0226593017578125,
0.004741668701171875,
-0.01276397705078125,
-0.01076507568359375,
-0.021331787109375,
-0.042816162109375,
-0.004421234130859375,
-0.029144287109375,
0.042938232421875,
-0.0015954971313476562,
0.01222991943359375,
-0.01078033447265625,
0.01003265380859375,
-0.0191192626953125,
-0.017547607421875,
0.04144287109375,
0.005222320556640625,
0.06866455078125,
-0.05511474609375,
-0.038665771484375,
-0.04986572265625,
0.07861328125,
-0.05682373046875,
-0.01332855224609375,
0.010711669921875,
0.027313232421875,
-0.050048828125,
-0.0635986328125,
-0.054595947265625,
-0.005420684814453125,
0.00730133056640625,
-0.007442474365234375,
0.0008077621459960938,
-0.023101806640625,
-0.03375244140625,
0.006717681884765625,
-0.02655029296875,
-0.0016231536865234375,
0.0249481201171875,
0.08392333984375,
-0.0003829002380371094,
0.006011962890625,
-0.00453948974609375,
0.0137176513671875,
0.020111083984375,
0.008819580078125,
-0.10540771484375,
-0.01546478271484375,
-0.034210205078125,
0.08740234375,
-0.01861572265625,
0.041015625,
-0.054840087890625,
0.0484619140625,
-0.0237579345703125,
-0.0025196075439453125,
0.0208587646484375,
0.054962158203125,
-0.042205810546875,
-0.020782470703125,
0.004276275634765625,
-0.0655517578125,
-0.01007080078125,
-0.0281219482421875,
-0.00490570068359375,
0.0019197463989257812,
-0.03125,
-0.0297393798828125,
0.0017747879028320312,
-0.019622802734375,
-0.0279083251953125,
-0.0384521484375,
0.022857666015625,
0.0290374755859375,
0.016571044921875,
0.0031223297119140625,
-0.06011962890625,
-0.009857177734375,
0.03900146484375,
0.07080078125,
0.01474761962890625,
-0.0042266845703125,
0.07080078125,
0.01113128662109375,
-0.0290374755859375,
-0.07330322265625,
0.02032470703125,
0.03631591796875,
0.044403076171875,
0.0233917236328125,
0.0162353515625,
-0.029998779296875,
0.01904296875,
0.040863037109375,
0.031494140625,
-0.0758056640625,
0.050323486328125,
-0.005672454833984375,
-0.0108795166015625,
0.04119873046875,
-0.01340484619140625,
0.020660400390625,
0.015716552734375,
0.00310516357421875,
-0.005641937255859375,
0.0206146240234375,
0.009246826171875,
-0.01202392578125,
0.0003936290740966797,
-0.01381683349609375,
0.006015777587890625,
-0.01018524169921875,
0.040740966796875,
0.0033740997314453125,
0.0200042724609375,
0.00811004638671875,
-0.05108642578125,
-0.028778076171875,
0.00502777099609375,
0.00313568115234375,
-0.0232696533203125,
-0.0066375732421875,
0.03753662109375,
-0.01081085205078125,
0.0009756088256835938,
0.0244598388671875,
0.0145416259765625,
-0.053375244140625,
-0.0017747879028320312,
-0.004352569580078125,
-0.10015869140625,
0.03668212890625,
0.0056304931640625,
-0.0325927734375,
0.023773193359375,
0.01282501220703125,
0.03253173828125,
0.005001068115234375,
-0.01123046875,
0.01448822021484375,
0.0271148681640625,
-0.0254058837890625,
0.01326751708984375,
-0.0013523101806640625,
-0.014312744140625,
0.04638671875,
-0.00659942626953125,
-0.044403076171875,
0.0270843505859375,
0.01413726806640625,
0.005619049072265625,
0.037200927734375,
-0.002002716064453125,
0.0218505859375,
0.0162811279296875,
-0.0258941650390625,
0.0025653839111328125,
0.0260162353515625,
-0.03643798828125,
0.018402099609375,
0.021453857421875,
0.03558349609375,
-0.01546478271484375,
-0.043609619140625,
0.015655517578125,
-0.036651611328125,
-0.02490234375,
0.0313720703125,
-0.024810791015625,
-0.0694580078125,
-0.044342041015625,
0.01812744140625,
0.0418701171875,
-0.02398681640625,
-0.030670166015625,
0.005443572998046875,
-0.0250091552734375,
0.00992584228515625,
0.0226287841796875,
-0.015838623046875,
0.0006761550903320312,
-0.006603240966796875,
-0.0144500732421875,
-0.0284423828125,
-0.040557861328125,
0.01885986328125,
0.0250396728515625,
-0.0211944580078125,
-0.02239990234375,
0.049652099609375,
-0.0005335807800292969,
-0.00872802734375,
0.001804351806640625,
-0.0126800537109375,
0.0189361572265625,
0.01091766357421875,
0.032684326171875,
-0.0162811279296875,
-0.0206298828125,
-0.04705810546875,
-0.021881103515625,
-0.0244598388671875,
0.01461029052734375,
0.00627899169921875,
-0.0238494873046875,
0.0018453598022460938,
-0.01837158203125,
0.02362060546875,
-0.0207366943359375,
0.0171966552734375,
0.0034236907958984375,
0.033416748046875,
-0.0168609619140625,
0.057769775390625,
-0.0209503173828125,
-0.0234375,
0.0028133392333984375,
0.023162841796875,
-0.036102294921875,
-0.028106689453125,
0.0257110595703125,
-0.0160369873046875,
-0.0038471221923828125,
-0.033721923828125,
0.006351470947265625,
-0.002246856689453125,
0.0232696533203125,
-0.015350341796875,
-0.0184478759765625,
0.006114959716796875,
-0.00868988037109375,
-0.008575439453125,
-0.0036716461181640625,
-0.038818359375,
0.0367431640625,
-0.0108642578125,
0.0114593505859375,
-0.0103912353515625,
-0.03521728515625,
0.011871337890625,
0.007389068603515625,
0.006336212158203125,
0.0244903564453125,
-0.016693115234375,
0.0005340576171875,
0.042999267578125,
0.026031494140625,
-0.0469970703125,
0.050689697265625,
0.0211334228515625,
0.0693359375,
0.0286407470703125,
0.0271759033203125,
0.057373046875,
0.005634307861328125,
-0.0178375244140625,
0.006923675537109375,
0.035369873046875,
-0.0067596435546875,
-0.004543304443359375,
0.028228759765625,
-0.017913818359375,
0.04541015625,
0.04034423828125,
0.08953857421875,
-0.036468505859375,
0.0280914306640625,
0.0171356201171875,
-0.04766845703125,
0.07708740234375,
0.0023250579833984375,
0.02117919921875,
-0.00815582275390625,
0.003513336181640625,
0.0274810791015625,
-0.0082855224609375,
-0.004596710205078125,
-0.004833221435546875,
-0.0228424072265625,
-0.0183258056640625,
0.0103607177734375,
0.0177154541015625,
-0.03753662109375,
0.019012451171875,
0.03289794921875,
-0.0157623291015625,
-0.0155792236328125,
0.0301971435546875,
-0.00991058349609375,
-0.021575927734375,
-0.08026123046875,
-0.03948974609375,
0.020843505859375,
-0.0494384765625,
0.0137939453125,
0.02154541015625,
0.04595947265625,
0.051177978515625,
0.003650665283203125,
0.00603485107421875,
0.0220184326171875,
-0.01261138916015625,
0.04412841796875,
-0.024444580078125,
-0.00965118408203125,
0.01093292236328125,
-0.06939697265625,
-0.002712249755859375,
-0.0229949951171875,
0.03765869140625,
0.00804901123046875,
0.005565643310546875,
0.060638427734375,
0.0013093948364257812,
-0.04949951171875,
0.00716400146484375,
-0.022369384765625,
0.010711669921875,
-0.0074615478515625,
0.00795745849609375,
-0.04681396484375,
-0.0218048095703125,
-0.0220794677734375,
-0.055145263671875,
0.00726318359375,
-0.04736328125,
-0.09539794921875,
0.0997314453125,
0.01271820068359375,
0.045257568359375,
-0.01007843017578125,
0.0279388427734375,
-0.0130615234375,
0.00634002685546875,
-0.016326904296875,
-0.01187896728515625,
-0.034820556640625,
-0.0058135986328125,
-0.039306640625,
0.0083160400390625,
-0.03143310546875,
0.0318603515625,
0.0322265625,
-0.0018148422241210938,
-0.04400634765625,
0.01378631591796875,
0.07568359375,
0.051910400390625,
0.0347900390625,
0.0218353271484375,
-0.0102386474609375,
-0.009521484375,
0.01959228515625,
-0.0350341796875,
0.0157928466796875,
-0.01123809814453125,
-0.00986480712890625,
0.0201416015625,
0.0114593505859375,
0.0011186599731445312,
-0.028717041015625,
0.00028586387634277344,
-0.025360107421875,
-0.005970001220703125,
0.017791748046875,
-0.0044403076171875,
0.01168060302734375,
0.028717041015625,
-0.00557708740234375,
-0.0306396484375,
-0.06964111328125,
-0.00284576416015625,
0.019073486328125,
-0.00936126708984375,
0.019378662109375,
0.0179443359375,
0.01039886474609375,
0.0205841064453125,
-0.0194244384765625,
-0.00582122802734375,
0.01068878173828125,
-0.013641357421875,
0.0281524658203125,
0.002109527587890625,
-0.0003695487976074219,
-0.059326171875,
0.035675048828125,
0.06365966796875,
0.05242919921875,
-0.0406494140625,
0.0227508544921875,
0.0204620361328125,
0.047393798828125,
0.004673004150390625,
-0.0303192138671875,
0.020965576171875,
-0.07940673828125,
-0.032318115234375,
-0.021026611328125,
-0.00424957275390625,
0.00865936279296875,
0.04443359375,
-0.0085601806640625,
0.0024738311767578125,
-0.0264434814453125,
-0.031402587890625,
-0.0173797607421875,
-0.037322998046875,
0.0106658935546875,
0.047698974609375,
0.038665771484375,
0.037506103515625,
0.01171875,
-0.01450347900390625,
-0.051239013671875,
0.039825439453125,
-0.01403045654296875,
0.04364013671875,
-0.029052734375,
-0.012237548828125,
-0.018707275390625,
0.03106689453125,
-0.030029296875,
0.03863525390625,
0.048736572265625,
0.019744873046875,
-0.0655517578125,
-0.012451171875,
-0.00572967529296875,
-0.05120849609375,
0.016845703125,
-0.00269317626953125,
0.028167724609375,
0.066162109375,
0.0009112358093261719,
-0.0188446044921875,
0.01381683349609375,
0.08197021484375,
-0.0307769775390625,
0.049896240234375,
-0.019317626953125,
-0.01323699951171875,
0.02783203125,
-0.0310821533203125,
0.055450439453125,
-0.025848388671875,
-0.0103607177734375,
0.01267242431640625,
-0.01413726806640625,
-0.038330078125,
-0.00444793701171875,
0.0097808837890625,
-0.03448486328125,
0.050811767578125,
0.040863037109375,
-0.0181884765625,
-0.007732391357421875,
0.001190185546875,
0.04754638671875,
-0.0200042724609375,
-0.00478363037109375,
0.01369476318359375,
-0.004795074462890625,
0.0062103271484375,
-0.0345458984375,
0.025543212890625,
0.01441192626953125,
0.0843505859375,
-0.0419921875,
0.04638671875,
0.01259613037109375,
0.00824737548828125,
-0.00997161865234375,
0.0008378028869628906,
0.01377105712890625,
-0.0238494873046875,
-0.012298583984375,
-0.01348114013671875,
0.0302276611328125,
0.0284881591796875,
0.004131317138671875,
-0.0239410400390625,
-0.031036376953125,
0.00754547119140625,
0.0162506103515625,
0.03961181640625,
0.037933349609375,
-0.01038360595703125,
0.00107574462890625,
-0.02545166015625,
-0.0094451904296875,
0.023223876953125,
-0.01419830322265625,
-0.0087127685546875,
0.02191162109375,
0.0060882568359375,
-0.045135498046875,
0.056884765625,
-0.07098388671875,
0.07537841796875,
0.03802490234375,
-0.0014972686767578125,
-0.0248565673828125,
0.03717041015625,
-0.0050506591796875,
-0.01093292236328125,
0.032470703125,
0.015716552734375,
0.025726318359375,
-0.046875,
0.0013971328735351562,
0.046417236328125,
0.06494140625,
0.0000661611557006836,
0.0149993896484375,
0.0189208984375,
-0.02044677734375,
-0.01557159423828125,
0.04974365234375,
-0.01152801513671875,
-0.0285491943359375,
-0.0099945068359375,
-0.0072784423828125,
-0.004405975341796875,
-0.0119476318359375,
-0.00640106201171875,
-0.03253173828125,
0.046142578125,
0.0171356201171875,
-0.050262451171875,
-0.01387786865234375,
0.010528564453125,
0.015655517578125,
0.0035457611083984375,
-0.0030231475830078125,
0.0088958740234375,
0.05364990234375,
-0.027740478515625,
-0.06494140625,
-0.0192108154296875,
0.046142578125,
-0.044097900390625,
0.0521240234375,
0.03399658203125,
-0.0280914306640625,
0.0309906005859375,
0.057830810546875,
0.0372314453125,
0.10205078125,
-0.04632568359375,
-0.03302001953125,
-0.0159454345703125,
0.032989501953125,
-0.0017862319946289062,
-0.030731201171875,
0.0090789794921875,
-0.0261383056640625,
0.0157623291015625,
-0.0677490234375,
-0.0008897781372070312,
-0.00553131103515625,
-0.05633544921875,
-0.0875244140625,
0.0165557861328125,
-0.024200439453125,
-0.049346923828125,
0.04193115234375,
0.009124755859375,
-0.0101470947265625,
0.029541015625,
0.029083251953125,
-0.0035457611083984375,
0.0034008026123046875,
-0.037689208984375,
-0.0037403106689453125,
-0.0184326171875,
0.031982421875,
-0.0635986328125,
-0.048614501953125,
0.00638580322265625,
0.03369140625,
0.0013055801391601562,
0.038330078125,
-0.0186309814453125,
0.04376220703125,
0.0210113525390625,
-0.043792724609375,
0.0088653564453125,
-0.014312744140625,
-0.0255584716796875,
-0.035125732421875,
-0.01316070556640625,
-0.0070037841796875,
-0.0016088485717773438,
0.082763671875,
0.0614013671875,
0.01406097412109375,
-0.038787841796875,
0.01995849609375,
0.024017333984375,
0.028533935546875,
0.00214385986328125,
-0.0191192626953125,
-0.0235748291015625,
-0.04632568359375,
-0.0126800537109375,
0.006336212158203125,
0.0036163330078125,
-0.02105712890625,
-0.029052734375,
-0.012847900390625,
-0.01120758056640625,
0.00965118408203125,
-0.06951904296875,
0.060791015625,
0.036407470703125,
-0.035552978515625,
0.0270538330078125,
-0.040008544921875,
-0.00881195068359375,
0.030548095703125,
-0.04766845703125,
-0.031524658203125,
0.050140380859375,
-0.034698486328125,
0.0178985595703125,
-0.003231048583984375,
0.00605010986328125,
-0.05023193359375,
0.0450439453125,
0.00992584228515625,
-0.0018949508666992188,
-0.01971435546875,
0.0002918243408203125,
0.0290985107421875,
0.0177154541015625,
-0.01397705078125,
0.004436492919921875,
-0.0268096923828125,
-0.0711669921875,
-0.030059814453125,
-0.0093841552734375,
0.0156402587890625,
0.01123046875,
0.0526123046875,
-0.031585693359375,
0.0018281936645507812,
-0.0182037353515625,
-0.04510498046875,
-0.048797607421875,
-0.00936126708984375,
-0.00095367431640625,
-0.0172271728515625,
0.0035610198974609375
] |
30f6e75983e2399213310f73d1892d9b9c928aef
|
Wordpress Stackexchange
Q: wp_upload_dir how to get just the directory name . I imagine that this would be a breeze for some - but I'm having difficulty getting just the upload's directory name - not the full path - I've gotten this far:
$uploads = wp_upload_dir();
$upload_path = $uploads['baseurl']; // now how to get just the directory name?
anyone have any ideas?
thanks for sharing your experience. . .
A: This is what you get back from the function:
Array
(
[path] => C:\development\xampp\htdocs\example.com/content/uploads/2012/04
[url] => http://example.com/content/uploads/2012/04
[subdir] => /2012/04
[basedir] => C:\~\example.com/content/uploads
[baseurl] => http://example.com/content/uploads
[error] =>
)
So you can get the (as @OneTrickPony pointed out), folder/directory name with
echo wp_basename( $uploads['baseurl'] );
If you're running multisite and you defined the constant UPLOADS, then you access it from UPLOADS or BLOGUPLOADDIR.
EDIT
For multisites, you would get something like this:
Array
(
[path] => /var/www/example.com/public_html/wp-content/uploads/sites/2/2016/12,
[url] => http://example.com/wp-content/uploads/sites/2/2016/12,
[subdir] => /2016/12,
[basedir] => /var/www/example.com/public_html/wp-content/uploads/sites/2,
[baseurl] => http://example.com/wp-content/uploads/sites/2,
[error] => ,
)
Where the "2" after sites is the blog's ID
|
Q: wp_upload_dir how to get just the directory name . I imagine that this would be a breeze for some - but I'm having difficulty getting just the upload's directory name - not the full path - I've gotten this far:
$uploads = wp_upload_dir();
$upload_path = $uploads['baseurl']; // now how to get just the directory name?
anyone have any ideas?
thanks for sharing your experience. . .
A: This is what you get back from the function:
Array
(
[path] => C:\development\xampp\htdocs\example.com/content/uploads/2012/04
[url] => http://example.com/content/uploads/2012/04
[subdir] => /2012/04
[basedir] => C:\~\example.com/content/uploads
[baseurl] => http://example.com/content/uploads
[error] =>
)
So you can get the (as @OneTrickPony pointed out), folder/directory name with
echo wp_basename( $uploads['baseurl'] );
If you're running multisite and you defined the constant UPLOADS, then you access it from UPLOADS or BLOGUPLOADDIR.
EDIT
For multisites, you would get something like this:
Array
(
[path] => /var/www/example.com/public_html/wp-content/uploads/sites/2/2016/12,
[url] => http://example.com/wp-content/uploads/sites/2/2016/12,
[subdir] => /2016/12,
[basedir] => /var/www/example.com/public_html/wp-content/uploads/sites/2,
[baseurl] => http://example.com/wp-content/uploads/sites/2,
[error] => ,
)
Where the "2" after sites is the blog's ID
|
wordpress
|
{
"language": "en",
"length": 170,
"provenance": "stackexchange_00019.jsonl.gz:418753",
"question_score": "22",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/47970"
}
|
[
0.006206512451171875,
-0.0077667236328125,
-0.043670654296875,
-0.0174713134765625,
0.0019779205322265625,
-0.02093505859375,
0.0117034912109375,
-0.0012731552124023438,
0.020904541015625,
0.0184478759765625,
-0.01629638671875,
0.0030269622802734375,
-0.00772857666015625,
-0.039459228515625,
-0.00980377197265625,
-0.01214599609375,
0.0308685302734375,
-0.005474090576171875,
0.0285491943359375,
0.00820159912109375,
-0.0152130126953125,
0.042816162109375,
0.0106048583984375,
0.01174163818359375,
-0.0005660057067871094,
-0.006591796875,
0.036041259765625,
0.0013599395751953125,
-0.0153961181640625,
-0.03973388671875,
0.0006718635559082031,
0.026397705078125,
0.0212249755859375,
-0.022003173828125,
0.047454833984375,
0.0325927734375,
0.0206298828125,
-0.005504608154296875,
0.042755126953125,
0.00946807861328125,
0.030914306640625,
-0.02093505859375,
0.028717041015625,
0.005588531494140625,
-0.0097198486328125,
-0.0237274169921875,
0.033294677734375,
-0.005092620849609375,
0.0305328369140625,
0.043792724609375,
-0.01230621337890625,
0.01055908203125,
-0.0209197998046875,
0.002231597900390625,
-0.0051422119140625,
-0.023345947265625,
0.033782958984375,
0.0032138824462890625,
0.0306549072265625,
-0.049163818359375,
-0.05181884765625,
-0.00911712646484375,
0.028717041015625,
-0.0033779144287109375,
-0.0271759033203125,
0.0035552978515625,
-0.021026611328125,
0.0292816162109375,
-0.047607421875,
-0.03533935546875,
0.00913238525390625,
-0.0218505859375,
0.01312255859375,
-0.0272979736328125,
-0.03594970703125,
0.01605224609375,
-0.0303192138671875,
-0.05322265625,
0.045562744140625,
-0.030670166015625,
0.0039043426513671875,
-0.03302001953125,
-0.0665283203125,
-0.0070037841796875,
0.0396728515625,
0.0498046875,
-0.0020751953125,
-0.0238800048828125,
-0.007297515869140625,
0.057708740234375,
-0.027679443359375,
0.042022705078125,
0.03265380859375,
-0.002414703369140625,
-0.0145721435546875,
-0.0147552490234375,
0.027374267578125,
0.048004150390625,
-0.0355224609375,
-0.037078857421875,
-0.01020050048828125,
-0.02642822265625,
-0.0117645263671875,
-0.0215911865234375,
0.0325927734375,
0.04083251953125,
0.020751953125,
-0.020355224609375,
0.0477294921875,
-0.0090484619140625,
0.00782012939453125,
0.050872802734375,
-0.01399993896484375,
-0.042388916015625,
-0.0196685791015625,
0.0209808349609375,
-0.039825439453125,
0.0022602081298828125,
0.0263671875,
-0.00742340087890625,
-0.0211334228515625,
0.0296783447265625,
-0.039337158203125,
-0.0283966064453125,
0.036590576171875,
0.0016622543334960938,
0.00649261474609375,
-0.0013418197631835938,
-0.01349639892578125,
0.0266265869140625,
-0.033172607421875,
0.01284027099609375,
0.048828125,
-0.0192108154296875,
-0.01125335693359375,
-0.028045654296875,
0.03009033203125,
0.0163726806640625,
0.0035533905029296875,
0.038848876953125,
-0.022613525390625,
-0.03533935546875,
0.002193450927734375,
-0.020782470703125,
-0.0240020751953125,
0.03729248046875,
0.02587890625,
0.007965087890625,
-0.025848388671875,
-0.04608154296875,
-0.0287017822265625,
0.01346588134765625,
0.0258636474609375,
0.023040771484375,
-0.0316162109375,
-0.0557861328125,
0.0285491943359375,
-0.061553955078125,
0.0228118896484375,
-0.07086181640625,
0.0213775634765625,
-0.00957489013671875,
0.00891876220703125,
-0.0020122528076171875,
-0.027099609375,
-0.0192108154296875,
-0.03045654296875,
-0.0161285400390625,
0.022918701171875,
0.0106658935546875,
-0.004199981689453125,
-0.006397247314453125,
0.004848480224609375,
0.0128173828125,
0.003154754638671875,
0.0126190185546875,
0.0196380615234375,
0.00785064697265625,
0.0009312629699707031,
0.06463623046875,
0.0031528472900390625,
-0.0203094482421875,
0.0008382797241210938,
0.00447845458984375,
-0.04681396484375,
0.0296173095703125,
-0.007755279541015625,
0.029571533203125,
0.00911712646484375,
-0.005374908447265625,
0.0689697265625,
0.0205078125,
-0.0416259765625,
0.0068817138671875,
-0.009796142578125,
0.02337646484375,
-0.052764892578125,
0.0226898193359375,
-0.0236663818359375,
-0.0259246826171875,
0.046600341796875,
-0.00411224365234375,
0.028717041015625,
0.02044677734375,
0.0157928466796875,
-0.006389617919921875,
0.01116943359375,
-0.00905609130859375,
-0.0042724609375,
-0.00257110595703125,
0.0279083251953125,
0.0379638671875,
-0.035888671875,
-0.08148193359375,
-0.039398193359375,
0.043548583984375,
-0.0362548828125,
0.018707275390625,
-0.032257080078125,
0.066650390625,
-0.038665771484375,
-0.0189056396484375,
-0.04168701171875,
-0.00402069091796875,
0.046356201171875,
-0.0209503173828125,
-0.0174407958984375,
-0.0255889892578125,
0.057647705078125,
-0.006183624267578125,
-0.0377197265625,
0.0250396728515625,
-0.02032470703125,
0.0180206298828125,
-0.01456451416015625,
-0.01715087890625,
-0.022552490234375,
-0.07196044921875,
0.027252197265625,
0.049774169921875,
0.039337158203125,
0.04534912109375,
0.0171661376953125,
0.0290069580078125,
0.0496826171875,
-0.04461669921875,
-0.003902435302734375,
-0.001575469970703125,
-0.01531982421875,
0.04052734375,
-0.031585693359375,
-0.004230499267578125,
-0.005374908447265625,
-0.0340576171875,
-0.017669677734375,
0.044891357421875,
-0.016143798828125,
-0.02203369140625,
0.0120849609375,
0.00782012939453125,
0.01090240478515625,
-0.01479339599609375,
-0.0189361572265625,
-0.01160430908203125,
-0.015533447265625,
0.0494384765625,
0.0102081298828125,
0.031463623046875,
-0.03192138671875,
0.037933349609375,
0.0167694091796875,
-0.0270538330078125,
-0.0178375244140625,
0.06298828125,
0.04547119140625,
-0.0390625,
-0.017120361328125,
-0.012725830078125,
-0.022247314453125,
0.01213836669921875,
-0.0264129638671875,
0.031890869140625,
-0.0164794921875,
-0.012420654296875,
-0.049774169921875,
-0.0193328857421875,
0.0290679931640625,
0.01172637939453125,
-0.001556396484375,
0.00650787353515625,
0.0218353271484375,
0.039886474609375,
-0.0286712646484375,
0.04217529296875,
0.0004038810729980469,
-0.00409698486328125,
0.0638427734375,
-0.007579803466796875,
0.021209716796875,
0.0062103271484375,
0.005451202392578125,
0.03387451171875,
0.01136016845703125,
-0.024658203125,
0.0023708343505859375,
0.01262664794921875,
0.0035152435302734375,
0.00962066650390625,
-0.0112762451171875,
0.007106781005859375,
-0.056427001953125,
0.00737762451171875,
0.0021381378173828125,
-0.0218505859375,
-0.02191162109375,
-0.0244293212890625,
-0.01227569580078125,
-0.01629638671875,
-0.11572265625,
-0.0792236328125,
0.0100860595703125,
-0.069091796875,
0.0207672119140625,
-0.00928497314453125,
-0.036376953125,
-0.028900146484375,
0.02996826171875,
-0.007556915283203125,
-0.0103302001953125,
-0.00537109375,
-0.040130615234375,
-0.0300445556640625,
-0.061859130859375,
0.0025157928466796875,
-0.0012121200561523438,
0.01200103759765625,
0.0169525146484375,
-0.0176849365234375,
-0.0019893646240234375,
-0.0103607177734375,
0.0120849609375,
0.07086181640625,
-0.013824462890625,
-0.04583740234375,
-0.01168060302734375,
-0.004642486572265625,
-0.0008001327514648438,
-0.01035308837890625,
0.0023651123046875,
0.03314208984375,
-0.019195556640625,
-0.0003299713134765625,
0.0226898193359375,
-0.0217132568359375,
-0.007457733154296875,
0.0423583984375,
0.00732421875,
-0.0357666015625,
-0.0144500732421875,
-0.08367919921875,
-0.01904296875,
-0.04071044921875,
-0.059783935546875,
0.0328369140625,
0.022705078125,
0.0228118896484375,
-0.00942230224609375,
0.019989013671875,
-0.013916015625,
0.039520263671875,
-0.0256195068359375,
-0.0293426513671875,
0.0287628173828125,
-0.004535675048828125,
0.0088043212890625,
0.032684326171875,
0.044708251953125,
0.006504058837890625,
-0.018280029296875,
0.006805419921875,
0.0272674560546875,
-0.00688934326171875,
-0.0189971923828125,
-0.060028076171875,
-0.050323486328125,
0.031646728515625,
-0.073974609375,
0.020416259765625,
-0.07635498046875,
-0.01313018798828125,
-0.06005859375,
0.07183837890625,
-0.040985107421875,
-0.01515960693359375,
-0.0274505615234375,
0.0095672607421875,
-0.0160980224609375,
-0.059844970703125,
-0.03192138671875,
0.002655029296875,
-0.0592041015625,
0.0009326934814453125,
-0.0177154541015625,
-0.01503753662109375,
0.0162200927734375,
-0.089111328125,
-0.0206298828125,
-0.044952392578125,
0.031982421875,
-0.07659912109375,
0.02777099609375,
0.006946563720703125,
0.039276123046875,
-0.028961181640625,
-0.006244659423828125,
-0.051116943359375,
-0.0706787109375,
-0.0335693359375,
0.046783447265625,
0.036346435546875,
-0.052581787109375,
0.039398193359375,
-0.043121337890625,
0.068115234375,
-0.00830841064453125,
0.0244903564453125,
-0.0207061767578125,
0.00800323486328125,
-0.00501251220703125,
0.000017344951629638672,
0.00937652587890625,
-0.01666259765625,
0.005527496337890625,
-0.06524658203125,
-0.05181884765625,
-0.035614013671875,
-0.02655029296875,
0.03887939453125,
-0.0223541259765625,
-0.0034770965576171875,
-0.01297760009765625,
-0.037109375,
-0.048126220703125,
0.025543212890625,
-0.052978515625,
0.0192108154296875,
-0.035369873046875,
-0.03173828125,
0.05816650390625,
0.0255889892578125,
-0.012786865234375,
0.0076904296875,
0.07635498046875,
0.005645751953125,
-0.04693603515625,
-0.05181884765625,
0.0023212432861328125,
0.035888671875,
-0.005268096923828125,
0.07354736328125,
0.06207275390625,
-0.004253387451171875,
0.019195556640625,
0.023223876953125,
0.007335662841796875,
0.0440673828125,
-0.01174163818359375,
0.0233306884765625,
-0.015777587890625,
-0.017059326171875,
0.01922607421875,
-0.0357666015625,
0.0012826919555664062,
-0.03277587890625,
0.016510009765625,
-0.0281829833984375,
0.0313720703125,
0.006992340087890625,
-0.0029315948486328125,
-0.05035400390625,
-0.06451416015625,
0.01593017578125,
-0.04986572265625,
0.0305633544921875,
0.02056884765625,
-0.01506805419921875,
0.04931640625,
0.04644775390625,
-0.01207733154296875,
0.0186920166015625,
0.019378662109375,
0.0250701904296875,
0.0098419189453125,
0.0406494140625,
-0.0174713134765625,
-0.0143585205078125,
0.00766754150390625,
-0.00040030479431152344,
0.01201629638671875,
-0.023468017578125,
-0.02386474609375,
-0.004852294921875,
0.035491943359375,
-0.0053558349609375,
-0.052520751953125,
0.01078033447265625,
0.0482177734375,
-0.0238189697265625,
0.0129852294921875,
-0.0268707275390625,
0.007320404052734375,
-0.0447998046875,
0.026885986328125,
-0.0008778572082519531,
-0.004058837890625,
-0.00836944580078125,
0.01348876953125,
0.0013885498046875,
-0.01134490966796875,
-0.00307464599609375,
-0.005275726318359375,
0.010589599609375,
0.03631591796875,
0.005084991455078125,
0.00678253173828125,
0.0027751922607421875,
0.02374267578125,
0.0298004150390625,
-0.034393310546875,
0.0170745849609375,
0.01401519775390625,
0.0654296875,
0.01248931884765625,
-0.032958984375,
-0.0133056640625,
-0.076416015625,
0.008544921875,
-0.02288818359375,
-0.0521240234375,
-0.0012340545654296875,
-0.00897216796875,
-0.0138702392578125,
0.028900146484375,
-0.0020732879638671875,
-0.0027637481689453125,
-0.00927734375,
-0.01413726806640625,
-0.03070068359375,
0.03167724609375,
-0.07183837890625,
0.003482818603515625,
0.0259552001953125,
-0.0218658447265625,
0.0010900497436523438,
0.01837158203125,
-0.02850341796875,
-0.01407623291015625,
-0.0253143310546875,
-0.0406494140625,
0.0677490234375,
-0.052520751953125,
0.01294708251953125,
-0.0233917236328125,
0.0106353759765625,
-0.04022216796875,
0.0224609375,
0.037017822265625,
0.02984619140625,
-0.0401611328125,
0.0249481201171875,
-0.047210693359375,
0.0138702392578125,
0.0230560302734375,
-0.0384521484375,
-0.034576416015625,
-0.0531005859375,
-0.041656494140625,
0.0026378631591796875,
0.0164031982421875,
0.073486328125,
-0.0100250244140625,
0.0304107666015625,
-0.035308837890625,
0.0074920654296875,
-0.0174102783203125,
0.0191497802734375,
0.0034961700439453125,
0.01678466796875,
0.0020236968994140625,
0.013031005859375,
0.0124053955078125,
-0.0295867919921875,
-0.0008091926574707031,
-0.054718017578125,
-0.006160736083984375,
-0.00830841064453125,
0.01605224609375,
0.03173828125,
0.02630615234375,
0.01678466796875,
-0.0088653564453125,
0.002170562744140625,
0.00406646728515625,
-0.028961181640625,
0.01032257080078125,
-0.025360107421875,
-0.01050567626953125,
-0.0408935546875,
-0.00954437255859375,
0.007259368896484375,
0.003017425537109375,
0.006069183349609375,
0.0120849609375,
0.0041046142578125,
0.01389312744140625,
0.0018520355224609375,
-0.029937744140625,
0.036590576171875,
0.1009521484375,
0.0261688232421875,
0.0855712890625,
0.040985107421875,
0.034332275390625,
0.044342041015625,
0.0291900634765625,
0.019073486328125,
-0.007465362548828125,
0.090087890625,
0.032073974609375,
-0.009490966796875,
0.07171630859375,
-0.03204345703125,
0.0122833251953125,
-0.0012369155883789062,
0.04339599609375,
-0.00750732421875,
0.00780487060546875,
0.0357666015625,
-0.010223388671875,
0.0004906654357910156,
-0.0009398460388183594,
-0.0148773193359375,
-0.01377105712890625,
0.004238128662109375,
-0.01126861572265625,
-0.0222015380859375,
-0.009490966796875,
0.0192413330078125,
-0.0105438232421875,
0.0193634033203125,
0.040283203125,
0.012451171875,
0.0022068023681640625,
-0.037628173828125,
0.0133819580078125,
-0.012725830078125,
-0.00970458984375,
-0.0144195556640625,
-0.01033782958984375,
-0.0252838134765625,
-0.05023193359375,
-0.0142364501953125,
-0.0321044921875,
-0.007549285888671875,
0.02099609375,
-0.01436614990234375,
0.0386962890625,
0.054229736328125,
-0.0168609619140625,
-0.006984710693359375,
0.033294677734375,
-0.01346588134765625,
0.0284423828125,
0.0117340087890625,
0.010650634765625,
-0.01087188720703125,
-0.01323699951171875,
-0.005107879638671875,
-0.038299560546875,
0.0120086669921875,
0.02386474609375,
0.023345947265625,
0.005645751953125,
-0.057281494140625,
-0.0048675537109375,
0.0504150390625,
0.01416015625,
-0.0003085136413574219,
0.0360107421875,
0.014739990234375,
-0.046142578125,
-0.0433349609375,
0.0200042724609375,
-0.06195068359375,
0.00881195068359375,
0.01146697998046875,
-0.048370361328125,
0.0950927734375,
0.004680633544921875,
0.03564453125,
0.05999755859375,
0.0230255126953125,
-0.0626220703125,
-0.01233673095703125,
-0.0266876220703125,
0.010528564453125,
0.01123809814453125,
-0.0001322031021118164,
-0.060699462890625,
0.001819610595703125,
-0.04425048828125,
0.046173095703125,
0.04815673828125,
0.013702392578125,
-0.0139007568359375,
-0.0227813720703125,
0.0330810546875,
0.049346923828125,
0.0022430419921875,
0.0084381103515625,
0.0227508544921875,
0.038543701171875,
0.047088623046875,
-0.046112060546875,
0.01898193359375,
-0.022796630859375,
-0.006591796875,
0.0286865234375,
0.0165557861328125,
0.01352691650390625,
-0.005214691162109375,
-0.0318603515625,
-0.009033203125,
0.0037136077880859375,
0.007350921630859375,
-0.03192138671875,
-0.0052642822265625,
0.046112060546875,
0.050201416015625,
-0.037200927734375,
-0.0145416259765625,
-0.0208282470703125,
0.050689697265625,
0.022705078125,
-0.00501251220703125,
0.019012451171875,
0.0056915283203125,
0.01313018798828125,
0.04180908203125,
-0.0150604248046875,
0.03399658203125,
0.02301025390625,
0.054168701171875,
0.01971435546875,
0.0235595703125,
-0.03411865234375,
0.00390625,
0.02777099609375,
0.037750244140625,
-0.0391845703125,
-0.030364990234375,
0.0206298828125,
0.0029964447021484375,
-0.0301513671875,
0.00323486328125,
-0.002864837646484375,
-0.0102386474609375,
0.01073455810546875,
-0.04119873046875,
-0.0012569427490234375,
0.0181732177734375,
0.02581787109375,
-0.01029205322265625,
-0.04937744140625,
-0.006313323974609375,
-0.011474609375,
-0.00888824462890625,
-0.0113372802734375,
-0.004638671875,
0.020843505859375,
-0.0147705078125,
0.04168701171875,
-0.0540771484375,
-0.004032135009765625,
0.0023441314697265625,
0.07275390625,
-0.01513671875,
0.00004357099533081055,
-0.044708251953125,
-0.06854248046875,
0.02008056640625,
0.04119873046875,
0.076171875,
0.037139892578125,
0.063720703125,
0.0019683837890625,
-0.027191162109375,
0.032073974609375,
0.007656097412109375,
-0.0111846923828125,
0.03326416015625,
-0.036956787109375,
0.00897979736328125,
-0.002544403076171875,
-0.018707275390625,
-0.01139068603515625,
-0.0435791015625,
0.076904296875,
-0.045928955078125,
0.0253753662109375,
-0.0183563232421875,
-0.0220184326171875,
0.010498046875,
-0.0261993408203125,
0.007549285888671875,
-0.034088134765625,
-0.03521728515625,
0.015716552734375,
-0.08062744140625,
0.0027370452880859375,
0.01273345947265625,
0.02740478515625,
0.0154571533203125,
0.02447509765625,
0.0040130615234375,
0.019561767578125,
0.0033931732177734375,
-0.0030059814453125,
-0.00152587890625,
0.046051025390625,
0.051177978515625,
0.035888671875,
-0.0129547119140625,
-0.00848388671875,
-0.01387786865234375,
0.0299530029296875,
0.03851318359375,
0.0819091796875,
-0.02435302734375,
0.032684326171875,
0.0338134765625,
-0.002574920654296875,
-0.01296234130859375,
-0.0009288787841796875,
0.0229034423828125,
-0.0291595458984375,
0.0030269622802734375,
-0.0162353515625,
-0.002185821533203125,
-0.007442474365234375,
0.03656005859375,
-0.0618896484375,
-0.037109375,
-0.003765106201171875,
0.02374267578125,
0.03125,
0.03759765625,
-0.012725830078125,
-0.03839111328125,
-0.03997802734375,
0.00371551513671875,
0.046661376953125,
0.0693359375,
-0.0343017578125,
0.0242156982421875,
-0.016021728515625,
-0.0276336669921875,
0.042205810546875,
-0.030792236328125,
0.049652099609375,
0.034637451171875,
-0.0367431640625,
-0.052703857421875,
-0.005207061767578125,
-0.001537322998046875,
-0.03155517578125,
0.0038890838623046875,
0.0380859375,
0.0030689239501953125,
-0.0206298828125,
-0.0201263427734375,
-0.017822265625,
0.012786865234375,
-0.0157012939453125,
0.00867462158203125,
-0.011566162109375,
0.0103912353515625,
-0.00978851318359375,
-0.08355712890625,
-0.004863739013671875,
-0.0238800048828125,
0.006694793701171875,
0.035430908203125,
-0.00989532470703125,
0.01364898681640625,
0.01375579833984375,
-0.007213592529296875,
0.028167724609375,
0.002925872802734375,
-0.030975341796875,
0.0001386404037475586,
-0.0233306884765625,
0.0243682861328125,
-0.0224761962890625,
0.0465087890625,
-0.0165557861328125,
0.0232086181640625,
-0.01457977294921875,
-0.036224365234375,
-0.0234222412109375,
0.0634765625,
-0.0186614990234375,
0.0218048095703125,
0.0278778076171875,
-0.032318115234375,
0.01174163818359375,
0.0065460205078125,
-0.0025119781494140625,
0.0673828125,
-0.0096588134765625,
-0.0258331298828125,
-0.0138397216796875,
-0.002529144287109375,
0.011199951171875,
-0.0157928466796875,
-0.0023174285888671875,
-0.03466796875,
-0.018463134765625,
-0.009490966796875,
-0.03448486328125,
-0.0216522216796875,
-0.05865478515625,
-0.057098388671875,
0.034912109375,
0.00665283203125,
-0.045806884765625,
-0.0153350830078125,
0.0211944580078125,
-0.0011358261108398438,
0.0313720703125,
-0.0015039443969726562,
-0.01727294921875,
0.00852203369140625,
0.0222625732421875,
0.02899169921875,
0.0208740234375,
0.0233001708984375,
0.0149078369140625,
-0.06268310546875,
-0.00739288330078125,
-0.0234222412109375,
0.000018596649169921875,
0.056976318359375,
-0.0252838134765625,
0.046905517578125,
0.06964111328125,
-0.01702880859375,
0.03338623046875,
-0.0162506103515625,
-0.0679931640625,
-0.0108795166015625,
-0.0216827392578125,
-0.06317138671875,
-0.033660888671875,
0.0625,
0.08258056640625,
0.033294677734375,
-0.036590576171875,
-0.03436279296875,
0.00015079975128173828,
-0.0028095245361328125,
0.0005559921264648438,
0.0285491943359375,
-0.050689697265625,
-0.004302978515625,
0.018035888671875,
-0.001888275146484375,
-0.0760498046875,
-0.00600433349609375,
-0.04681396484375,
-0.031402587890625,
-0.024993896484375,
0.0023212432861328125,
0.03668212890625,
-0.035858154296875,
0.054168701171875,
-0.0271148681640625,
0.02325439453125,
-0.019439697265625,
0.03863525390625,
0.02081298828125,
-0.011383056640625,
-0.01337432861328125,
0.0172271728515625,
-0.010711669921875,
-0.0094451904296875,
0.01528167724609375,
0.01146697998046875,
0.00821685791015625,
-0.0022735595703125,
0.009246826171875,
-0.0335693359375,
-0.03070068359375,
-0.0440673828125,
0.02166748046875,
0.0071563720703125,
-0.040374755859375,
0.085205078125,
0.00664520263671875,
0.01548004150390625,
-0.0190582275390625,
0.04962158203125,
-0.01488494873046875,
-0.02239990234375,
0.016815185546875,
-0.031402587890625,
-0.0009965896606445312,
0.0077362060546875,
-0.00041294097900390625,
-0.06494140625,
0.060272216796875,
0.006587982177734375,
0.017333984375,
0.0264892578125
] |
1e65bffb533456733487c8d3ecde99f52167e825
|
Wordpress Stackexchange
Q: I put my blog on a subpage, how do I get page title? I've got my blog setup on a subpage (not the front page) and I'm using the template file home.php, how can I get the contents from the page editor onto this subpage?
If I change the title of the page it changes in the nav menu, but how can I get this to display on the page? (i.e. as the <h1> header)
A: Untested, but try:
<?php
echo get_the_title( get_option( 'page_for_posts' ) );
?>
But it's somewhat hackish. Really, the page_on_front and page_for_posts are intended to be nothing more than placeholders for the site front page and blog posts index page.
|
Q: I put my blog on a subpage, how do I get page title? I've got my blog setup on a subpage (not the front page) and I'm using the template file home.php, how can I get the contents from the page editor onto this subpage?
If I change the title of the page it changes in the nav menu, but how can I get this to display on the page? (i.e. as the <h1> header)
A: Untested, but try:
<?php
echo get_the_title( get_option( 'page_for_posts' ) );
?>
But it's somewhat hackish. Really, the page_on_front and page_for_posts are intended to be nothing more than placeholders for the site front page and blog posts index page.
|
wordpress
|
{
"language": "en",
"length": 115,
"provenance": "stackexchange_00019.jsonl.gz:418762",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48006"
}
|
[
-0.0279388427734375,
-0.023834228515625,
0.00469970703125,
0.0631103515625,
-0.043243408203125,
-0.0340576171875,
0.034912109375,
-0.05169677734375,
0.0019283294677734375,
-0.005519866943359375,
-0.0472412109375,
0.0212249755859375,
-0.0435791015625,
-0.0126495361328125,
0.0111541748046875,
-0.058441162109375,
0.04461669921875,
-0.04833984375,
0.0286407470703125,
0.01438140869140625,
-0.0041351318359375,
0.04718017578125,
0.03314208984375,
-0.004451751708984375,
0.0253448486328125,
-0.04345703125,
0.030120849609375,
0.0180511474609375,
0.0142364501953125,
0.0014820098876953125,
0.023345947265625,
-0.0160064697265625,
0.03009033203125,
-0.01088714599609375,
0.01096343994140625,
0.035888671875,
0.004634857177734375,
0.0008549690246582031,
0.013519287109375,
0.0207061767578125,
0.0138702392578125,
0.0053253173828125,
-0.0018224716186523438,
0.05181884765625,
-0.0145721435546875,
-0.0557861328125,
0.01959228515625,
-0.04083251953125,
-0.021484375,
-0.0157470703125,
0.0109405517578125,
0.0020904541015625,
0.0292816162109375,
-0.00040841102600097656,
-0.02001953125,
-0.039154052734375,
0.039642333984375,
0.00836181640625,
0.04864501953125,
-0.04864501953125,
-0.05413818359375,
-0.005641937255859375,
0.038970947265625,
-0.01082611083984375,
0.006122589111328125,
0.01727294921875,
0.05999755859375,
0.01361083984375,
-0.0214996337890625,
0.0008215904235839844,
0.00388336181640625,
-0.020172119140625,
0.012237548828125,
-0.039764404296875,
-0.025787353515625,
0.015777587890625,
0.0027523040771484375,
-0.02435302734375,
0.0088958740234375,
-0.03204345703125,
0.001068115234375,
0.002300262451171875,
-0.023223876953125,
-0.00033855438232421875,
-0.00162506103515625,
0.0146331787109375,
-0.016998291015625,
-0.0111541748046875,
-0.0204620361328125,
-0.01091766357421875,
-0.0188140869140625,
-0.0004558563232421875,
-0.0096893310546875,
-0.0108489990234375,
-0.02642822265625,
-0.018463134765625,
0.0015821456909179688,
0.0828857421875,
-0.034912109375,
0.037933349609375,
-0.047760009765625,
-0.01360321044921875,
0.0285797119140625,
-0.080078125,
0.01233673095703125,
-0.0026340484619140625,
-0.00501251220703125,
0.00888824462890625,
0.0433349609375,
0.0269317626953125,
-0.0256500244140625,
0.0361328125,
-0.0152587890625,
-0.042877197265625,
-0.02069091796875,
0.054351806640625,
-0.01018524169921875,
-0.0269775390625,
0.008056640625,
0.0016880035400390625,
0.02520751953125,
0.06500244140625,
-0.0310821533203125,
-0.03363037109375,
-0.0031833648681640625,
-0.00626373291015625,
-0.006015777587890625,
-0.0305938720703125,
-0.005046844482421875,
0.0234375,
-0.0250396728515625,
0.0191192626953125,
0.043792724609375,
0.0038013458251953125,
-0.01450347900390625,
-0.0362548828125,
-0.0157623291015625,
-0.005405426025390625,
-0.00980377197265625,
-0.00289154052734375,
0.006244659423828125,
-0.0130462646484375,
0.024139404296875,
-0.0230255126953125,
-0.0219268798828125,
0.0064697265625,
0.008392333984375,
0.036102294921875,
-0.01290130615234375,
-0.043243408203125,
0.0257110595703125,
-0.0343017578125,
-0.0211181640625,
0.0196075439453125,
0.047271728515625,
-0.04754638671875,
0.00812530517578125,
-0.0229644775390625,
0.07421875,
-0.01367950439453125,
0.008453369140625,
0.01425933837890625,
0.01396942138671875,
-0.01129150390625,
-0.037353515625,
-0.0234375,
-0.00789642333984375,
-0.017181396484375,
0.01166534423828125,
-0.027130126953125,
0.03924560546875,
-0.01355743408203125,
-0.0197601318359375,
-0.004421234130859375,
0.00682830810546875,
0.0003895759582519531,
-0.009552001953125,
-0.01090240478515625,
-0.00466156005859375,
0.08416748046875,
0.02606201171875,
-0.01171875,
-0.0107269287109375,
0.00971221923828125,
-0.0198211669921875,
-0.0290985107421875,
0.0113983154296875,
0.0177764892578125,
0.010498046875,
0.039520263671875,
0.00879669189453125,
0.006526947021484375,
-0.0576171875,
0.0259246826171875,
-0.01617431640625,
0.0000451207160949707,
-0.013519287109375,
0.00995635986328125,
-0.0171051025390625,
-0.0037746429443359375,
-0.0343017578125,
-0.01203155517578125,
-0.00008958578109741211,
0.0416259765625,
0.01885986328125,
-0.0204010009765625,
-0.0013608932495117188,
0.0039043426513671875,
0.06353759765625,
0.0299530029296875,
-0.0294342041015625,
-0.0208282470703125,
0.048614501953125,
-0.0908203125,
-0.0635986328125,
0.005954742431640625,
-0.028533935546875,
-0.0174560546875,
-0.009185791015625,
-0.0078887939453125,
0.0021419525146484375,
0.00580596923828125,
-0.0270843505859375,
0.0177154541015625,
0.0704345703125,
-0.049774169921875,
-0.0005726814270019531,
-0.059295654296875,
0.033843994140625,
0.008270263671875,
-0.0806884765625,
0.04150390625,
0.025726318359375,
0.006504058837890625,
-0.04486083984375,
-0.005962371826171875,
-0.031005859375,
-0.026885986328125,
-0.01110076904296875,
0.053314208984375,
0.03350830078125,
0.0216827392578125,
0.006221771240234375,
0.0191650390625,
0.040740966796875,
-0.0268402099609375,
0.017578125,
-0.0025386810302734375,
0.03009033203125,
0.07025146484375,
-0.008819580078125,
-0.01273345947265625,
0.0141448974609375,
-0.0423583984375,
0.0036258697509765625,
0.0538330078125,
0.005229949951171875,
0.0013885498046875,
0.0016946792602539062,
-0.009979248046875,
0.00684356689453125,
-0.00414276123046875,
-0.028594970703125,
0.0005893707275390625,
0.06829833984375,
0.025543212890625,
0.039215087890625,
0.025482177734375,
-0.05706787109375,
0.037384033203125,
0.0153350830078125,
0.0266265869140625,
0.01074981689453125,
0.039093017578125,
0.049774169921875,
-0.02197265625,
0.0027408599853515625,
-0.041473388671875,
-0.01378631591796875,
0.0106353759765625,
-0.006725311279296875,
0.0157318115234375,
0.01959228515625,
-0.0103759765625,
0.01317596435546875,
-0.049774169921875,
0.0200042724609375,
0.0142974853515625,
0.0197906494140625,
0.0290069580078125,
0.0208892822265625,
0.024566650390625,
-0.042755126953125,
0.06097412109375,
-0.00909423828125,
-0.0098724365234375,
0.037933349609375,
-0.05511474609375,
0.044677734375,
-0.0090484619140625,
0.0689697265625,
0.0732421875,
-0.00586700439453125,
0.01367950439453125,
0.0213775634765625,
-0.030303955078125,
0.0159912109375,
0.010498046875,
-0.0065460205078125,
0.02874755859375,
-0.08074951171875,
0.03472900390625,
0.008209228515625,
0.033203125,
-0.01413726806640625,
-0.040252685546875,
-0.004985809326171875,
0.01236724853515625,
-0.0731201171875,
-0.04473876953125,
0.018798828125,
-0.07440185546875,
0.00974273681640625,
-0.0155487060546875,
-0.04583740234375,
-0.01300811767578125,
0.032318115234375,
0.005039215087890625,
0.00719451904296875,
-0.0231475830078125,
-0.0291900634765625,
-0.032012939453125,
-0.07244873046875,
-0.00833892822265625,
-0.0007719993591308594,
0.01023101806640625,
-0.00797271728515625,
0.04107666015625,
-0.0197601318359375,
-0.06463623046875,
-0.01497650146484375,
0.04888916015625,
-0.00321197509765625,
-0.013519287109375,
0.0246429443359375,
-0.0396728515625,
-0.005764007568359375,
0.0214691162109375,
-0.04376220703125,
-0.0015964508056640625,
0.0098876953125,
-0.019134521484375,
-0.03985595703125,
-0.020416259765625,
-0.01314544677734375,
-0.0017404556274414062,
0.052490234375,
0.0203704833984375,
0.0006842613220214844,
-0.02716064453125,
-0.010528564453125,
-0.0289459228515625,
-0.06298828125,
-0.0298919677734375,
0.041900634765625,
0.0043182373046875,
-0.031219482421875,
-0.0131072998046875,
-0.0027866363525390625,
0.003955841064453125,
0.0037860870361328125,
-0.00897216796875,
-0.01030731201171875,
-0.0011548995971679688,
0.006832122802734375,
0.00909423828125,
0.01458740234375,
0.002655029296875,
0.05023193359375,
0.01727294921875,
0.0212249755859375,
-0.02362060546875,
0.04864501953125,
-0.0496826171875,
-0.05657958984375,
0.039642333984375,
-0.029266357421875,
0.025115966796875,
-0.03857421875,
-0.03179931640625,
0.01007843017578125,
0.09832763671875,
-0.0379638671875,
-0.00690460205078125,
0.007457733154296875,
0.006649017333984375,
0.002040863037109375,
-0.026763916015625,
-0.044525146484375,
-0.016204833984375,
-0.093505859375,
0.01110076904296875,
-0.0322265625,
-0.020355224609375,
-0.0225372314453125,
0.0623779296875,
-0.04559326171875,
-0.03515625,
0.0196990966796875,
-0.0177001953125,
-0.03179931640625,
0.053436279296875,
-0.05230712890625,
0.03533935546875,
-0.041839599609375,
-0.020050048828125,
-0.0267333984375,
-0.018035888671875,
0.0689697265625,
0.0020275115966796875,
-0.0261688232421875,
-0.02880859375,
-0.010498046875,
0.03265380859375,
-0.0030803680419921875,
0.00861358642578125,
0.0011301040649414062,
0.00945281982421875,
0.0017976760864257812,
-0.010986328125,
-0.005161285400390625,
-0.037109375,
-0.00811004638671875,
-0.0005116462707519531,
-0.031341552734375,
0.02093505859375,
-0.005558013916015625,
0.0258026123046875,
0.021697998046875,
-0.01715087890625,
-0.033660888671875,
-0.040985107421875,
0.02935791015625,
0.01335906982421875,
0.01236724853515625,
0.0209197998046875,
-0.040008544921875,
-0.0189361572265625,
0.0275115966796875,
0.0237884521484375,
-0.01280975341796875,
-0.0003120899200439453,
0.0396728515625,
0.02691650390625,
-0.0222015380859375,
0.00750732421875,
0.01467132568359375,
0.03497314453125,
-0.0161895751953125,
0.049652099609375,
0.00952911376953125,
-0.0223388671875,
0.0748291015625,
-0.00566864013671875,
0.002384185791015625,
-0.0026721954345703125,
0.034149169921875,
-0.0041046142578125,
-0.029083251953125,
0.0255584716796875,
-0.010986328125,
0.00167083740234375,
-0.00867462158203125,
-0.022857666015625,
-0.00974273681640625,
-0.0206146240234375,
0.014556884765625,
-0.036102294921875,
0.090087890625,
0.0159759521484375,
-0.0258331298828125,
0.004528045654296875,
0.006816864013671875,
0.02203369140625,
0.0106201171875,
0.0101776123046875,
-0.00909423828125,
0.01265716552734375,
-0.0111083984375,
0.012359619140625,
0.00543212890625,
0.0014886856079101562,
0.033416748046875,
-0.046295166015625,
-0.02545166015625,
0.016632080078125,
-0.0040130615234375,
0.023834228515625,
-0.01385498046875,
-0.03515625,
-0.019195556640625,
-0.005664825439453125,
0.01143646240234375,
0.03680419921875,
-0.0206298828125,
-0.003143310546875,
0.0382080078125,
-0.017669677734375,
-0.0009984970092773438,
0.0106964111328125,
-0.004833221435546875,
-0.0218353271484375,
-0.003997802734375,
0.020416259765625,
-0.01103973388671875,
0.0040283203125,
0.0885009765625,
-0.01395416259765625,
0.052032470703125,
-0.03131103515625,
0.007617950439453125,
0.0262603759765625,
0.00371551513671875,
0.00919342041015625,
0.0273284912109375,
0.004871368408203125,
-0.016693115234375,
0.046173095703125,
-0.0253448486328125,
0.00881195068359375,
0.0188751220703125,
0.048828125,
0.03106689453125,
-0.007183074951171875,
-0.00574493408203125,
-0.04583740234375,
-0.00817108154296875,
0.048797607421875,
-0.0186767578125,
-0.07122802734375,
-0.02642822265625,
-0.016693115234375,
0.027313232421875,
-0.0291595458984375,
-0.0193634033203125,
0.00537109375,
-0.0104522705078125,
0.05224609375,
-0.02752685546875,
-0.00010263919830322266,
0.026947021484375,
0.0091400146484375,
-0.0465087890625,
0.02142333984375,
0.03656005859375,
-0.034027099609375,
-0.050506591796875,
-0.01184844970703125,
-0.033203125,
0.072021484375,
-0.01385498046875,
0.038116455078125,
-0.0312042236328125,
-0.00820159912109375,
-0.026885986328125,
0.01329803466796875,
0.03692626953125,
0.024810791015625,
-0.088134765625,
0.01271820068359375,
-0.0531005859375,
0.0089111328125,
-0.036224365234375,
-0.043182373046875,
-0.049285888671875,
-0.031158447265625,
-0.01161956787109375,
0.00258636474609375,
-0.0343017578125,
-0.038421630859375,
-0.042694091796875,
0.0260162353515625,
0.04058837890625,
0.033355712890625,
-0.018585205078125,
0.07171630859375,
-0.00885009765625,
0.0231170654296875,
-0.01259613037109375,
0.023406982421875,
-0.0185394287109375,
-0.005817413330078125,
0.006832122802734375,
-0.01959228515625,
-0.007904052734375,
-0.01457977294921875,
-0.004894256591796875,
-0.0093994140625,
0.03131103515625,
0.0031452178955078125,
0.0112152099609375,
-0.00653839111328125,
0.01288604736328125,
-0.0121612548828125,
-0.041259765625,
-0.013397216796875,
-0.055694580078125,
0.048065185546875,
-0.0175628662109375,
0.01482391357421875,
-0.0205078125,
0.0011034011840820312,
-0.00399017333984375,
-0.0206756591796875,
-0.0167388916015625,
0.0330810546875,
-0.028961181640625,
0.05523681640625,
0.12451171875,
0.0274658203125,
0.070556640625,
0.050201416015625,
0.01113128662109375,
0.00576019287109375,
0.0298919677734375,
-0.02850341796875,
-0.0267486572265625,
0.0271453857421875,
0.0006513595581054688,
-0.0212554931640625,
0.00788116455078125,
-0.0205535888671875,
0.02044677734375,
0.050933837890625,
0.06744384765625,
-0.05926513671875,
0.007022857666015625,
0.01430511474609375,
-0.007236480712890625,
0.0404052734375,
0.0113067626953125,
-0.005626678466796875,
-0.0142669677734375,
0.035064697265625,
-0.0186614990234375,
-0.01198577880859375,
0.0196685791015625,
0.00019311904907226562,
-0.0060272216796875,
-0.032196044921875,
0.07220458984375,
0.0201416015625,
-0.0228424072265625,
0.0105438232421875,
0.00848388671875,
0.008056640625,
-0.042877197265625,
0.005863189697265625,
-0.00933837890625,
-0.00405120849609375,
-0.045013427734375,
0.0241851806640625,
0.0160980224609375,
0.01352691650390625,
-0.03558349609375,
0.017120361328125,
-0.01715087890625,
0.0570068359375,
-0.039703369140625,
0.0193634033203125,
0.044830322265625,
-0.0596923828125,
0.01271820068359375,
0.00832366943359375,
0.025604248046875,
0.0027141571044921875,
-0.030487060546875,
0.0004892349243164062,
-0.0296783447265625,
-0.0029125213623046875,
-0.021575927734375,
-0.057861328125,
0.10467529296875,
-0.0166168212890625,
-0.03546142578125,
0.004245758056640625,
-0.010284423828125,
-0.0018091201782226562,
-0.00421905517578125,
0.021942138671875,
-0.0034656524658203125,
0.051055908203125,
0.000728607177734375,
0.038604736328125,
-0.016876220703125,
-0.0011568069458007812,
-0.060882568359375,
0.08038330078125,
-0.0185546875,
0.01551055908203125,
0.01088714599609375,
0.039306640625,
-0.0217437744140625,
-0.0032634735107421875,
-0.039459228515625,
0.05999755859375,
0.002422332763671875,
0.062347412109375,
-0.06842041015625,
-0.01190185546875,
0.036865234375,
0.05029296875,
0.00856781005859375,
0.00041556358337402344,
0.00975799560546875,
-0.028961181640625,
0.014129638671875,
0.04248046875,
0.010650634765625,
0.005779266357421875,
0.000736236572265625,
0.0176849365234375,
0.021453857421875,
-0.028289794921875,
0.016204833984375,
-0.0024127960205078125,
-0.015960693359375,
0.0400390625,
0.0031299591064453125,
-0.02203369140625,
0.042572021484375,
-0.0419921875,
-0.036224365234375,
0.027252197265625,
0.0156707763671875,
-0.0223236083984375,
0.001255035400390625,
0.046783447265625,
0.046173095703125,
-0.034271240234375,
-0.0295867919921875,
-0.0177459716796875,
0.042388916015625,
0.0174407958984375,
-0.005153656005859375,
-0.0162811279296875,
0.0036907196044921875,
0.0333251953125,
-0.008636474609375,
-0.019317626953125,
0.0479736328125,
-0.0018205642700195312,
0.055572509765625,
0.0301513671875,
0.032073974609375,
-0.04583740234375,
-0.0178070068359375,
0.033050537109375,
0.06292724609375,
-0.038970947265625,
0.0023059844970703125,
0.01401519775390625,
-0.0180206298828125,
-0.0335693359375,
-0.04931640625,
-0.054443359375,
0.010345458984375,
0.01617431640625,
0.01387786865234375,
-0.0021495819091796875,
0.0240325927734375,
-0.006549835205078125,
0.0108184814453125,
0.0010595321655273438,
0.0131072998046875,
0.02801513671875,
-0.03228759765625,
0.0168304443359375,
-0.01204681396484375,
0.02154541015625,
0.010528564453125,
0.04327392578125,
-0.0230712890625,
0.00885772705078125,
0.00424957275390625,
0.030792236328125,
-0.007354736328125,
-0.00799560546875,
-0.048858642578125,
-0.06768798828125,
0.01540374755859375,
0.03289794921875,
0.032440185546875,
-0.0110321044921875,
0.03466796875,
0.028045654296875,
-0.0389404296875,
-0.00347137451171875,
-0.006420135498046875,
-0.0164947509765625,
0.02093505859375,
-0.00971221923828125,
0.0024929046630859375,
0.0078277587890625,
-0.0293426513671875,
-0.0157623291015625,
0.01088714599609375,
0.043487548828125,
-0.0277252197265625,
0.04876708984375,
-0.0013227462768554688,
0.004116058349609375,
0.0321044921875,
-0.01235198974609375,
0.0184326171875,
-0.01073455810546875,
-0.068603515625,
0.00701141357421875,
-0.056488037109375,
-0.0455322265625,
0.02471923828125,
0.04681396484375,
-0.00841522216796875,
-0.016998291015625,
-0.021209716796875,
0.014495849609375,
0.02301025390625,
-0.03717041015625,
0.007110595703125,
0.08526611328125,
0.0227203369140625,
0.037689208984375,
-0.0733642578125,
-0.0550537109375,
-0.03314208984375,
0.032501220703125,
0.0180816650390625,
0.024139404296875,
0.0128326416015625,
0.039581298828125,
-0.0197906494140625,
0.03631591796875,
-0.045257568359375,
-0.0286407470703125,
0.055389404296875,
0.005702972412109375,
0.01457977294921875,
-0.025604248046875,
-0.071044921875,
0.05084228515625,
0.019439697265625,
-0.0153045654296875,
0.061126708984375,
-0.017120361328125,
-0.00897216796875,
-0.048187255859375,
-0.0026531219482421875,
-0.005809783935546875,
0.034088134765625,
0.0186614990234375,
-0.0265350341796875,
0.0596923828125,
0.03753662109375,
0.01274871826171875,
0.03057861328125,
0.008880615234375,
-0.041351318359375,
0.033447265625,
-0.05224609375,
0.05328369140625,
0.03466796875,
-0.0184326171875,
-0.027557373046875,
0.061004638671875,
0.01361083984375,
0.032012939453125,
0.03131103515625,
0.052459716796875,
0.054168701171875,
-0.0253753662109375,
0.0180816650390625,
-0.0499267578125,
0.0208282470703125,
-0.019073486328125,
0.005878448486328125,
-0.0108642578125,
0.031951904296875,
-0.038055419921875,
-0.039154052734375,
-0.01812744140625,
-0.0643310546875,
-0.0135650634765625,
0.0277862548828125,
-0.04937744140625,
-0.0306549072265625,
-0.060577392578125,
-0.032379150390625,
0.023284912109375,
-0.032928466796875,
0.022308349609375,
-0.0374755859375,
-0.0300445556640625,
0.023468017578125,
-0.0266265869140625,
-0.0158843994140625,
0.00475311279296875,
0.000044286251068115234,
-0.0452880859375,
0.03436279296875,
-0.046722412109375,
-0.043487548828125,
-0.01177978515625,
0.0277099609375,
0.059051513671875,
-0.0284271240234375,
0.016387939453125,
0.007221221923828125,
0.01267242431640625,
0.06817626953125,
-0.043548583984375,
-0.0067901611328125,
0.0170440673828125,
-0.002410888671875,
-0.0082855224609375,
-0.061187744140625,
-0.0009665489196777344,
-0.05078125,
-0.00453948974609375,
-0.00170135498046875,
-0.0086822509765625,
0.0118865966796875,
-0.0305328369140625,
-0.00635528564453125,
0.041656494140625,
0.014617919921875,
-0.0325927734375,
-0.0109710693359375,
-0.0022430419921875,
-0.01259613037109375,
-0.0009241104125976562,
0.00986480712890625,
-0.03936767578125,
-0.0017118453979492188,
0.021270751953125,
0.0121002197265625,
0.047332763671875,
0.01788330078125,
0.02008056640625,
-0.0122833251953125,
0.007038116455078125,
-0.0176544189453125,
-0.0301513671875,
0.0239105224609375,
-0.0362548828125,
0.0299072265625,
0.021514892578125,
-0.06622314453125,
-0.048675537109375,
-0.01275634765625,
0.039459228515625,
0.0015687942504882812,
-0.01305389404296875,
-0.024444580078125,
-0.026702880859375,
0.052459716796875,
0.0207061767578125,
0.0113677978515625,
-0.003017425537109375,
0.0214080810546875,
-0.017852783203125,
-0.06622314453125,
0.005435943603515625,
0.01983642578125,
-0.033782958984375,
0.0154876708984375,
0.01226043701171875,
-0.040008544921875,
-0.036956787109375,
-0.00339508056640625,
-0.06719970703125,
0.006389617919921875,
-0.027923583984375,
0.0007567405700683594,
0.000667572021484375,
-0.0528564453125,
0.07244873046875,
-0.046661376953125,
-0.0110931396484375,
0.0169830322265625,
0.0308685302734375,
0.01374053955078125,
0.0226898193359375,
0.00955963134765625,
0.0297698974609375,
-0.0509033203125,
0.000020623207092285156,
0.01053619384765625,
0.02691650390625,
-0.037567138671875,
-0.020172119140625,
-0.0013704299926757812,
0.0210418701171875,
-0.0108184814453125,
0.00701904296875,
0.01212310791015625,
0.03448486328125,
-0.002483367919921875,
0.0562744140625,
0.01531982421875,
0.0225372314453125,
-0.002033233642578125,
0.059326171875,
0.0027751922607421875,
-0.034027099609375,
0.01230621337890625,
-0.041046142578125,
-0.0072174072265625,
0.01207733154296875,
-0.049041748046875,
-0.040252685546875,
0.0032196044921875,
-0.01537322998046875,
0.000823974609375,
0.01763916015625
] |
3cf20fe2868d548660aa8265eba6def32d5f49c4
|
Wordpress Stackexchange
Q: Remove Tag from theme support I would remove Tag capability from classic Post type,
can I use remove_theme_support( $feature ); and how to do this ?
Thanks in advance
A: You can do it with something like this:
add_action( 'init', 'wpse48017_remove_tags' );
function wpse48017_remove_tags() {
global $wp_taxonomies;
$tax = 'post_tag'; // this may be wrong, I never remember the names on the defaults
if( taxonomy_exists( $tax ) )
unset( $wp_taxonomies[$tax] );
}
There was a move to get a function implemented but that hasn't hit yet.
|
Q: Remove Tag from theme support I would remove Tag capability from classic Post type,
can I use remove_theme_support( $feature ); and how to do this ?
Thanks in advance
A: You can do it with something like this:
add_action( 'init', 'wpse48017_remove_tags' );
function wpse48017_remove_tags() {
global $wp_taxonomies;
$tax = 'post_tag'; // this may be wrong, I never remember the names on the defaults
if( taxonomy_exists( $tax ) )
unset( $wp_taxonomies[$tax] );
}
There was a move to get a function implemented but that hasn't hit yet.
A: As of WordPress 3.7, there is an unregister_taxonomy_for_object_type function available for just this sort of thing.
In your case:
// Remove tags support from posts
function myprefix_unregister_tags() {
unregister_taxonomy_for_object_type('post_tag', 'post');
}
add_action('init', 'myprefix_unregister_tags');
View the documentation for this function here.
A: @m0r7if3r's answer actually produces an error in the in the 'Right Now' Dashboard widget. Even with errors turned off, the 'Tags' row is displayed with a blank count. I extended that solution to also hide 'Tags' from this Dashboard widget:
add_action( 'init', 'wpse48017_remove_tags' );
function wpse48017_remove_tags(){
global $wp_taxonomies;
unset($wp_taxonomies['post_tag']);
global $pagenow;
if( $pagenow == 'index.php' ){
add_action( 'admin_head', 'ob_start', 0, 0 );
add_action( 'right_now_content_table_end', 'wpse48017_remove_tags_dashboard' );
}
}
function wpse48017_remove_tags_dashboard(){
#echo '<pre>'.htmlentities( ob_get_clean(), 0, null, true );die();
echo preg_replace('#(Categories</a></td></tr>)<tr>([\s\S]*?number_format\(\) expects parameter 1 to be double, object given[\s\S]*?)?<td class="first b b-tags.*?</tr>#','$1',ob_get_clean());
}
There are probably other areas where removing tags produces errors, or breaks hardcoded links. So I thought of making this a community wiki, but that discussion probably belongs on core.trac.wordpress.org.
A: You may try:
function remove_unused_taxonomies() {
register_taxonomy(
'post_tag', // or any other taxonomy name e.g. 'category'
array()
);
}
add_action( 'init', 'remove_unused_taxonomies' );
It's not permanent, it will just hide taxonomy links in admin menu.
|
wordpress
|
{
"language": "en",
"length": 286,
"provenance": "stackexchange_00019.jsonl.gz:418768",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48017"
}
|
[
0.032318115234375,
0.01396942138671875,
-0.0236053466796875,
0.0016345977783203125,
0.061553955078125,
-0.050689697265625,
0.09332275390625,
-0.01134490966796875,
0.0113983154296875,
0.01215362548828125,
0.0111541748046875,
-0.039520263671875,
-0.0223846435546875,
-0.03448486328125,
-0.035919189453125,
-0.0345458984375,
0.029052734375,
-0.02752685546875,
0.025054931640625,
-0.01050567626953125,
0.023681640625,
0.01303863525390625,
0.008209228515625,
0.04901123046875,
0.0080718994140625,
0.01395416259765625,
0.049835205078125,
-0.01148223876953125,
-0.0081024169921875,
-0.0243988037109375,
0.0097808837890625,
0.0235443115234375,
-0.007747650146484375,
0.056427001953125,
-0.02789306640625,
-0.0165252685546875,
-0.01074981689453125,
0.017669677734375,
0.022613525390625,
0.004871368408203125,
0.0013980865478515625,
-0.00018644332885742188,
-0.0170745849609375,
-0.022857666015625,
-0.0222930908203125,
-0.0253753662109375,
0.00867462158203125,
-0.0279693603515625,
0.01058197021484375,
-0.0231475830078125,
0.0241851806640625,
-0.00013113021850585938,
0.050201416015625,
-0.062744140625,
-0.02691650390625,
-0.01422882080078125,
-0.02410888671875,
-0.0097808837890625,
0.03314208984375,
0.024169921875,
-0.01192474365234375,
-0.018646240234375,
0.0072174072265625,
-0.038299560546875,
0.00799560546875,
0.015655517578125,
0.0252532958984375,
0.0093841552734375,
-0.055389404296875,
0.0137176513671875,
0.038543701171875,
-0.05047607421875,
-0.005084991455078125,
0.00531768798828125,
0.01532745361328125,
-0.034332275390625,
0.017822265625,
-0.01038360595703125,
0.01125335693359375,
0.040863037109375,
0.024322509765625,
-0.0214385986328125,
-0.0187835693359375,
0.00809478759765625,
0.01611328125,
0.0289764404296875,
-0.0013332366943359375,
-0.0172271728515625,
-0.0347900390625,
-0.02203369140625,
-0.0229949951171875,
-0.03424072265625,
-0.048828125,
0.017608642578125,
0.0011796951293945312,
-0.00798797607421875,
0.032958984375,
0.0230560302734375,
0.00476837158203125,
-0.013092041015625,
0.0281524658203125,
-0.0560302734375,
0.005584716796875,
-0.01397705078125,
0.00714111328125,
0.038909912109375,
-0.0085601806640625,
-0.0244293212890625,
0.02581787109375,
0.0299224853515625,
0.01071929931640625,
-0.0202484130859375,
0.00466156005859375,
-0.017974853515625,
-0.024688720703125,
0.0032501220703125,
-0.0214080810546875,
0.00926971435546875,
-0.01277923583984375,
-0.005603790283203125,
0.021148681640625,
0.035186767578125,
-0.02886962890625,
-0.016937255859375,
-0.0092926025390625,
-0.006534576416015625,
-0.0268402099609375,
-0.0125274658203125,
-0.0152740478515625,
0.01305389404296875,
-0.041778564453125,
0.016937255859375,
0.073974609375,
0.0192718505859375,
0.0009584426879882812,
-0.021575927734375,
0.04241943359375,
-0.037384033203125,
-0.00872039794921875,
0.004634857177734375,
0.05328369140625,
-0.038604736328125,
-0.0394287109375,
-0.0057220458984375,
0.057281494140625,
0.0003376007080078125,
0.0301361083984375,
0.034271240234375,
0.016693115234375,
-0.0306549072265625,
0.0762939453125,
-0.00299835205078125,
0.060333251953125,
-0.00048160552978515625,
0.0127105712890625,
-0.0285491943359375,
0.0487060546875,
-0.04327392578125,
-0.0333251953125,
-0.059906005859375,
0.001407623291015625,
-0.0413818359375,
-0.027984619140625,
-0.035552978515625,
-0.06890869140625,
0.05224609375,
-0.0211334228515625,
-0.0035247802734375,
0.029296875,
-0.01329803466796875,
0.005054473876953125,
-0.04180908203125,
0.04669189453125,
0.021820068359375,
-0.00550079345703125,
0.0687255859375,
-0.01091766357421875,
0.0352783203125,
0.0221099853515625,
0.0252685546875,
0.006069183349609375,
-0.0511474609375,
0.060150146484375,
-0.01190948486328125,
-0.078369140625,
0.005603790283203125,
0.0167999267578125,
0.07440185546875,
0.017425537109375,
0.022613525390625,
0.045928955078125,
-0.0231170654296875,
-0.0179290771484375,
-0.0007824897766113281,
0.041259765625,
-0.0265350341796875,
-0.046295166015625,
-0.0399169921875,
0.01216888427734375,
-0.0014629364013671875,
0.023162841796875,
0.040313720703125,
-0.00868988037109375,
-0.00629425048828125,
-0.047760009765625,
0.0252227783203125,
-0.0230255126953125,
0.048919677734375,
-0.050384521484375,
-0.016326904296875,
0.040252685546875,
-0.029327392578125,
-0.027862548828125,
0.0054931640625,
-0.0140838623046875,
-0.01203155517578125,
-0.003787994384765625,
0.0051422119140625,
0.0162353515625,
0.01013946533203125,
0.024871826171875,
-0.01248931884765625,
0.005878448486328125,
0.00402069091796875,
0.018798828125,
0.005580902099609375,
-0.0201568603515625,
-0.0104827880859375,
0.00037479400634765625,
0.01030731201171875,
-0.031402587890625,
0.028076171875,
0.036224365234375,
0.006999969482421875,
-0.014862060546875,
0.0021266937255859375,
0.037994384765625,
-0.092041015625,
-0.00518798828125,
0.051025390625,
0.02435302734375,
0.0078887939453125,
-0.0294647216796875,
-0.0200042724609375,
0.051239013671875,
-0.011749267578125,
-0.002201080322265625,
-0.006988525390625,
0.006710052490234375,
0.0117034912109375,
0.005634307861328125,
0.0057830810546875,
0.0288238525390625,
-0.01739501953125,
0.022613525390625,
0.03936767578125,
-0.01519775390625,
-0.0205230712890625,
0.01029205322265625,
-0.03387451171875,
0.0291900634765625,
-0.059356689453125,
-0.07537841796875,
-0.0032482147216796875,
0.062103271484375,
0.0120849609375,
0.04571533203125,
0.02276611328125,
-0.030914306640625,
-0.0009379386901855469,
0.01849365234375,
0.0105133056640625,
-0.006412506103515625,
0.06536865234375,
-0.0196075439453125,
0.007732391357421875,
-0.02008056640625,
-0.00475311279296875,
-0.0221405029296875,
0.02935791015625,
-0.00183868408203125,
0.072509765625,
0.02154541015625,
-0.0155181884765625,
-0.0328369140625,
-0.04559326171875,
0.0009150505065917969,
0.0065460205078125,
-0.012908935546875,
-0.037750244140625,
-0.033477783203125,
0.055908203125,
-0.0236968994140625,
0.043212890625,
0.046112060546875,
-0.0010194778442382812,
-0.0272674560546875,
-0.0242767333984375,
0.0277252197265625,
-0.01270294189453125,
0.04449462890625,
0.08087158203125,
0.0016269683837890625,
0.016845703125,
0.0343017578125,
-0.0199127197265625,
0.03179931640625,
0.01103973388671875,
0.00617218017578125,
0.026885986328125,
-0.057861328125,
0.03143310546875,
0.02093505859375,
0.00006318092346191406,
-0.005405426025390625,
-0.052886962890625,
-0.025146484375,
0.0055084228515625,
-0.07208251953125,
-0.0174713134765625,
0.06610107421875,
-0.0246734619140625,
-0.03033447265625,
-0.01690673828125,
-0.03851318359375,
-0.01412200927734375,
-0.002349853515625,
-0.020477294921875,
0.002025604248046875,
-0.0302581787109375,
-0.0535888671875,
-0.057098388671875,
-0.059356689453125,
-0.025482177734375,
-0.00803375244140625,
0.0030574798583984375,
0.01335906982421875,
0.11480712890625,
0.02935791015625,
-0.05126953125,
0.041046142578125,
-0.0270233154296875,
-0.0279541015625,
0.045623779296875,
0.043914794921875,
-0.0274810791015625,
0.0206146240234375,
0.01554107666015625,
-0.03338623046875,
0.0247344970703125,
-0.017578125,
-0.046600341796875,
-0.02825927734375,
-0.0106201171875,
-0.01097869873046875,
-0.01383209228515625,
0.03173828125,
-0.016937255859375,
-0.01708984375,
-0.053924560546875,
-0.027191162109375,
0.0160675048828125,
-0.0138397216796875,
0.007625579833984375,
-0.0267333984375,
-0.007396697998046875,
0.01479339599609375,
0.031982421875,
0.0105438232421875,
0.01751708984375,
0.0140228271484375,
-0.00925445556640625,
0.04473876953125,
-0.0021572113037109375,
0.005519866943359375,
-0.032989501953125,
0.00629425048828125,
-0.035247802734375,
0.02996826171875,
-0.00713348388671875,
-0.009368896484375,
-0.020416259765625,
-0.00800323486328125,
-0.037841796875,
-0.043487548828125,
0.04791259765625,
-0.01207733154296875,
-0.020355224609375,
0.0122833251953125,
-0.0169830322265625,
0.0275421142578125,
0.06549072265625,
-0.0673828125,
-0.016357421875,
-0.01274871826171875,
0.00476837158203125,
0.041839599609375,
-0.00537109375,
-0.0229644775390625,
-0.03802490234375,
-0.09417724609375,
0.004077911376953125,
-0.0218353271484375,
-0.0207061767578125,
-0.03948974609375,
0.009429931640625,
-0.064208984375,
-0.04833984375,
0.045867919921875,
-0.059783935546875,
0.02459716796875,
-0.035247802734375,
0.006778717041015625,
-0.0633544921875,
-0.038543701171875,
-0.032562255859375,
-0.0382080078125,
0.01367950439453125,
-0.06475830078125,
0.00937652587890625,
0.0168914794921875,
0.02508544921875,
0.006893157958984375,
0.0283966064453125,
0.0269775390625,
0.006805419921875,
-0.0100250244140625,
-0.01319122314453125,
-0.01995849609375,
0.027099609375,
0.006015777587890625,
0.0035953521728515625,
-0.024322509765625,
0.0037822723388671875,
-0.0198211669921875,
0.07073974609375,
0.01415252685546875,
0.039306640625,
0.038482666015625,
-0.021820068359375,
-0.020111083984375,
-0.0196533203125,
-0.050567626953125,
-0.0178680419921875,
-0.03521728515625,
-0.00998687744140625,
0.0019626617431640625,
-0.0219573974609375,
0.0628662109375,
0.01030731201171875,
-0.02508544921875,
-0.0021839141845703125,
0.09027099609375,
0.023040771484375,
-0.03155517578125,
-0.04296875,
0.01593017578125,
0.04327392578125,
0.01541900634765625,
0.02996826171875,
0.00742340087890625,
-0.045257568359375,
0.056060791015625,
0.02301025390625,
-0.0142669677734375,
-0.036102294921875,
0.058502197265625,
-0.01059722900390625,
-0.00030493736267089844,
-0.0032215118408203125,
-0.05126953125,
0.056243896484375,
-0.01372528076171875,
-0.0021457672119140625,
-0.01499176025390625,
0.01149749755859375,
0.027069091796875,
0.0222320556640625,
-0.023406982421875,
-0.03436279296875,
-0.04052734375,
0.0206756591796875,
0.043975830078125,
-0.026275634765625,
0.01629638671875,
-0.00524139404296875,
0.0010967254638671875,
-0.03216552734375,
0.007175445556640625,
-0.056610107421875,
-0.0213470458984375,
-0.0369873046875,
0.01232147216796875,
-0.0157928466796875,
0.002933502197265625,
-0.0171356201171875,
0.01512908935546875,
-0.02252197265625,
-0.035186767578125,
-0.04278564453125,
-0.05645751953125,
0.018646240234375,
0.0173187255859375,
0.03863525390625,
-0.00940704345703125,
0.0418701171875,
0.0274505615234375,
-0.0164031982421875,
-0.00673675537109375,
-0.0423583984375,
0.00725555419921875,
-0.06085205078125,
-0.01611328125,
-0.009521484375,
-0.00896453857421875,
0.03948974609375,
0.0009455680847167969,
-0.0077667236328125,
0.0294952392578125,
-0.014495849609375,
0.0040740966796875,
-0.0313720703125,
0.046173095703125,
0.0054168701171875,
-0.0328369140625,
0.037017822265625,
0.000904083251953125,
0.026153564453125,
-0.018218994140625,
0.006221771240234375,
0.038970947265625,
0.01271820068359375,
-0.0184326171875,
-0.0276336669921875,
0.018463134765625,
-0.007053375244140625,
0.016754150390625,
0.0177459716796875,
-0.0312347412109375,
-0.03619384765625,
-0.0107421875,
0.045806884765625,
0.056488037109375,
-0.0306854248046875,
-0.003711700439453125,
0.04949951171875,
-0.0193328857421875,
0.025360107421875,
0.0303802490234375,
-0.0129241943359375,
-0.01338958740234375,
-0.00864410400390625,
-0.02984619140625,
-0.006877899169921875,
-0.0027618408203125,
-0.048248291015625,
-0.043853759765625,
-0.0008664131164550781,
-0.00943756103515625,
0.0230865478515625,
-0.032257080078125,
0.02783203125,
-0.0161285400390625,
-0.009368896484375,
0.0100555419921875,
-0.007228851318359375,
0.0679931640625,
0.041473388671875,
-0.05401611328125,
-0.0016603469848632812,
-0.0556640625,
-0.0008411407470703125,
-0.0202484130859375,
-0.058349609375,
-0.042877197265625,
-0.0084686279296875,
0.024444580078125,
0.00873565673828125,
0.006744384765625,
-0.0261383056640625,
0.000637054443359375,
0.0265045166015625,
0.029083251953125,
0.057098388671875,
-0.00762939453125,
0.0264129638671875,
-0.013275146484375,
0.00487518310546875,
0.01070404052734375,
0.01551055908203125,
0.0251007080078125,
-0.037841796875,
-0.0107879638671875,
-0.0736083984375,
-0.0090484619140625,
0.01354217529296875,
-0.034454345703125,
0.0240936279296875,
0.046356201171875,
0.00777435302734375,
-0.0082550048828125,
-0.00482177734375,
0.01806640625,
-0.034912109375,
-0.0018663406372070312,
-0.032196044921875,
-0.01021575927734375,
-0.0205078125,
0.01195526123046875,
0.032318115234375,
-0.009368896484375,
0.0278167724609375,
-0.0216064453125,
-0.0109405517578125,
0.00018727779388427734,
0.00032520294189453125,
0.0092926025390625,
0.02099609375,
0.013946533203125,
-0.004428863525390625,
0.0340576171875,
-0.0038089752197265625,
0.0247650146484375,
0.004749298095703125,
0.004962921142578125,
-0.057708740234375,
-0.033935546875,
0.0255584716796875,
0.0297088623046875,
0.01898193359375,
0.06378173828125,
-0.006526947021484375,
-0.0155029296875,
0.02874755859375,
0.046630859375,
-0.0504150390625,
0.003498077392578125,
0.034088134765625,
0.01751708984375,
0.0273284912109375,
0.007221221923828125,
0.0004286766052246094,
-0.03466796875,
-0.005878448486328125,
0.035614013671875,
-0.003993988037109375,
0.0017862319946289062,
0.0239715576171875,
-0.0238037109375,
-0.0023479461669921875,
0.0230712890625,
0.0136260986328125,
-0.0242156982421875,
0.007659912109375,
0.0097198486328125,
-0.0176239013671875,
0.0010232925415039062,
0.0548095703125,
-0.00888824462890625,
-0.032958984375,
-0.07763671875,
-0.006893157958984375,
0.039581298828125,
-0.07122802734375,
0.0231475830078125,
-0.02886962890625,
0.01364898681640625,
0.0214691162109375,
-0.036163330078125,
0.0161590576171875,
-0.008514404296875,
-0.0450439453125,
-0.0789794921875,
-0.035736083984375,
0.0239105224609375,
-0.003910064697265625,
0.003021240234375,
0.03607177734375,
-0.016448974609375,
-0.08209228515625,
-0.0164642333984375,
-0.0291900634765625,
0.06866455078125,
-0.040069580078125,
-0.01549530029296875,
-0.00009620189666748047,
0.04620361328125,
0.019775390625,
-0.01357269287109375,
0.0019159317016601562,
-0.0196380615234375,
-0.004680633544921875,
-0.013458251953125,
-0.0235595703125,
0.006999969482421875,
-0.0168304443359375,
-0.066650390625,
0.12457275390625,
0.015838623046875,
0.016693115234375,
0.0015926361083984375,
0.053009033203125,
-0.04620361328125,
0.026641845703125,
-0.03240966796875,
0.059173583984375,
0.016357421875,
0.0043487548828125,
0.01352691650390625,
0.0180206298828125,
0.013824462890625,
-0.016326904296875,
0.01593017578125,
-0.00293731689453125,
0.040802001953125,
-0.006679534912109375,
0.028228759765625,
0.039031982421875,
-0.01294708251953125,
-0.0257568359375,
-0.010040283203125,
-0.0081634521484375,
-0.01216888427734375,
-0.04132080078125,
0.031494140625,
-0.06622314453125,
-0.036529541015625,
-0.00038695335388183594,
0.032379150390625,
0.040802001953125,
-0.0204620361328125,
-0.0125885009765625,
-0.035919189453125,
0.001049041748046875,
0.0215911865234375,
0.0275115966796875,
-0.00116729736328125,
0.01523590087890625,
0.01116180419921875,
-0.0311737060546875,
0.020233154296875,
-0.0419921875,
0.053497314453125,
0.006404876708984375,
0.06866455078125,
0.0157928466796875,
0.03472900390625,
0.03656005859375,
-0.048492431640625,
0.03668212890625,
-0.0016641616821289062,
-0.063232421875,
0.02972412109375,
-0.00691986083984375,
0.01430511474609375,
-0.05303955078125,
0.055206298828125,
0.018341064453125,
0.0256195068359375,
-0.040863037109375,
0.00627899169921875,
0.0208892822265625,
0.01229095458984375,
-0.00379180908203125,
-0.033599853515625,
0.023590087890625,
0.0014352798461914062,
0.0127716064453125,
-0.046051025390625,
-0.0120849609375,
0.0288848876953125,
0.035003662109375,
-0.004802703857421875,
0.0290069580078125,
-0.04754638671875,
-0.03741455078125,
-0.05712890625,
0.03717041015625,
0.033935546875,
0.01849365234375,
-0.004863739013671875,
0.058349609375,
0.05694580078125,
-0.005825042724609375,
-0.00037670135498046875,
0.052398681640625,
0.0008111000061035156,
-0.0128631591796875,
-0.0114898681640625,
-0.053070068359375,
-0.01194000244140625,
0.0162353515625,
-0.01094818115234375,
0.005443572998046875,
0.00846099853515625,
0.02984619140625,
-0.0066375732421875,
-0.01122283935546875,
0.035430908203125,
-0.01348876953125,
-0.0161895751953125,
-0.0562744140625,
-0.0158538818359375,
0.0133056640625,
-0.00911712646484375,
0.040557861328125,
-0.0396728515625,
0.025970458984375,
-0.0014047622680664062,
0.0007781982421875,
0.005985260009765625,
-0.019439697265625,
0.050567626953125,
-0.004364013671875,
0.033905029296875,
0.0240936279296875,
-0.0504150390625,
0.00099945068359375,
-0.06695556640625,
0.01215362548828125,
0.01837158203125,
0.0204315185546875,
-0.019805908203125,
0.046051025390625,
0.0458984375,
-0.03399658203125,
0.0247039794921875,
0.0157012939453125,
-0.0012197494506835938,
0.046630859375,
0.02783203125,
0.02099609375,
-0.034423828125,
-0.01629638671875,
0.01096343994140625,
0.0273284912109375,
-0.01439666748046875,
0.052093505859375,
-0.01277923583984375,
-0.0042724609375,
-0.045806884765625,
0.058837890625,
-0.059356689453125,
-0.0294342041015625,
0.031951904296875,
0.026580810546875,
0.0138702392578125,
-0.0159912109375,
-0.038665771484375,
0.01776123046875,
0.044281005859375,
-0.006908416748046875,
0.01007843017578125,
0.01245880126953125,
0.0130462646484375,
-0.005458831787109375,
0.032684326171875,
-0.01528167724609375,
-0.036895751953125,
-0.0487060546875,
-0.00470733642578125,
0.0234375,
0.06005859375,
0.0213623046875,
0.003566741943359375,
-0.00583648681640625,
0.008056640625,
0.0175018310546875,
0.0299072265625,
-0.0097503662109375,
0.0200958251953125,
-0.00756072998046875,
-0.0504150390625,
0.044403076171875,
-0.00495147705078125,
0.0311126708984375,
0.01004791259765625,
0.0587158203125,
0.049041748046875,
-0.0487060546875,
0.01021575927734375,
0.0028667449951171875,
0.02447509765625,
-0.014251708984375,
-0.00354766845703125,
-0.01088714599609375,
0.0114288330078125,
-0.001110076904296875,
0.008392333984375,
-0.03216552734375,
-0.024932861328125,
-0.012847900390625,
0.0229949951171875,
-0.035186767578125,
-0.0577392578125,
-0.09210205078125,
-0.00907135009765625,
0.0406494140625,
0.0052032470703125,
-0.03143310546875,
0.01263427734375,
-0.01016998291015625,
0.0002982616424560547,
0.01464080810546875,
-0.02532958984375,
-0.0004944801330566406,
0.0104217529296875,
-0.0261993408203125,
-0.044769287109375,
-0.06268310546875,
0.03350830078125,
-0.069091796875,
0.036407470703125,
0.02618408203125,
-0.0369873046875,
0.00901031494140625,
0.049652099609375,
0.032501220703125,
0.09210205078125,
0.0217132568359375,
-0.0182952880859375,
0.0037975311279296875,
0.011383056640625,
-0.0322265625,
-0.055755615234375,
0.02325439453125,
-0.06280517578125,
-0.0201263427734375,
-0.03924560546875,
0.003261566162109375,
0.01154327392578125,
-0.048095703125,
-0.10009765625,
0.0430908203125,
-0.02392578125,
-0.034454345703125,
-0.00015270709991455078,
0.003940582275390625,
-0.00811004638671875,
-0.005466461181640625,
0.002857208251953125,
-0.015777587890625,
-0.002307891845703125,
0.0174560546875,
0.0153350830078125,
0.054901123046875,
0.005863189697265625,
0.001129150390625,
0.0129852294921875,
0.021820068359375,
0.0163726806640625,
0.019989013671875,
0.0237884521484375,
-0.0204620361328125,
0.031005859375,
0.0308074951171875,
-0.0687255859375,
-0.01125335693359375,
-0.0372314453125,
0.0279998779296875,
-0.0010709762573242188,
-0.05059814453125,
0.0109710693359375,
-0.0245361328125,
0.029388427734375,
-0.00263214111328125,
-0.0040283203125,
0.0023403167724609375,
-0.0273590087890625,
-0.015472412109375,
-0.02569580078125,
-0.011688232421875,
0.02935791015625,
-0.07403564453125,
-0.0148162841796875,
0.031768798828125,
-0.0054473876953125,
0.0286102294921875,
-0.03497314453125,
-0.0297088623046875,
0.003055572509765625,
-0.0210418701171875,
0.0157012939453125,
-0.08013916015625,
0.045257568359375,
-0.0298919677734375,
-0.006168365478515625,
-0.0115966796875,
-0.033294677734375,
-0.0007829666137695312,
-0.01377105712890625,
-0.0230560302734375,
-0.004383087158203125,
-0.008941650390625,
0.0171356201171875,
0.0230712890625,
0.0207366943359375,
0.005306243896484375,
0.00589752197265625,
-0.00213623046875,
-0.003482818603515625,
0.01557159423828125,
0.01403045654296875,
0.0276336669921875,
-0.0233306884765625,
0.0225982666015625,
-0.0017747879028320312,
-0.002628326416015625,
-0.0294647216796875,
0.0267181396484375,
-0.01824951171875,
0.043487548828125,
-0.0286102294921875,
0.0014820098876953125,
0.00977325439453125,
-0.01216888427734375,
0.008392333984375,
0.0154571533203125,
0.030426025390625,
-0.047637939453125,
0.045257568359375,
-0.0010747909545898438,
0.0301513671875,
0.031768798828125
] |
b023b8c2c16bbe219827764677097e9f50e62d57
|
Wordpress Stackexchange
Q: How to get the path to the current theme? This code is used to get the directory of the current plugin: plugin_dir_url( __FILE__ ).
What should I use to get the directory of the current theme?
A: I think you have to be a little careful because it depends on what you are trying to do.
If you are using a child theme get_template_directory(); will still go to the parent theme. However get_stylesheet_directory(); will go to the current theme, child or parent. Also, both these functions return absolute server paths.
If you wanted a fully formed URI, for links or images, you should use get_template_directory_uri(); or get_stylesheet_directory_uri(); using the correct one for the reasons stated.
Summary
*
*get_stylesheet_directory(): file path to current Theme directory
*get_stylesheet_directory_uri(): url path to current Theme directory
*get_template_directory(): file path to parent Theme directory
*get_template_directory_uri(): url path to parent Theme directory
|
Q: How to get the path to the current theme? This code is used to get the directory of the current plugin: plugin_dir_url( __FILE__ ).
What should I use to get the directory of the current theme?
A: I think you have to be a little careful because it depends on what you are trying to do.
If you are using a child theme get_template_directory(); will still go to the parent theme. However get_stylesheet_directory(); will go to the current theme, child or parent. Also, both these functions return absolute server paths.
If you wanted a fully formed URI, for links or images, you should use get_template_directory_uri(); or get_stylesheet_directory_uri(); using the correct one for the reasons stated.
Summary
*
*get_stylesheet_directory(): file path to current Theme directory
*get_stylesheet_directory_uri(): url path to current Theme directory
*get_template_directory(): file path to parent Theme directory
*get_template_directory_uri(): url path to parent Theme directory
A: get_stylesheet_directory_uri is what you want. it returns the URL of the current theme. get_stylesheet_directory will return the file path on the server.
For example:
<img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/image.png" />
If you need the parent theme, get_template_directory and get_template_directory_uri are the equivalents.
If there is no parent theme then both will return the same value.
Further reading:
*
*get_stylesheet_directory
*
*absolute folder path of current theme
*e.g. /var/www/yoursite/wp-content/themes/child_theme
*get_template_directory
*
*absolute folder path of parent theme
*e.g. /var/www/yoursite/wp-content/themes/parent_theme
*get_stylesheet_directory_uri
*
*full URL of current theme
*e.g. https://example.com/wp-content/themes/child_theme
*get_template_directory_uri
*
*full URL of parent theme
*e.g. https://example.com/wp-content/themes/parent_theme
|
wordpress
|
{
"language": "en",
"length": 243,
"provenance": "stackexchange_00019.jsonl.gz:418805",
"question_score": "41",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48128"
}
|
[
-0.006229400634765625,
-0.035186767578125,
-0.025054931640625,
-0.0361328125,
-0.034881591796875,
-0.00910186767578125,
-0.0199127197265625,
0.033905029296875,
0.017669677734375,
0.034210205078125,
0.0024356842041015625,
0.006404876708984375,
-0.0275726318359375,
-0.0298919677734375,
-0.0322265625,
-0.00768280029296875,
0.054656982421875,
-0.05792236328125,
0.033905029296875,
0.0007691383361816406,
0.006153106689453125,
0.03704833984375,
0.062042236328125,
0.0799560546875,
0.0259246826171875,
-0.003139495849609375,
0.05670166015625,
-0.03955078125,
0.01226043701171875,
-0.04278564453125,
0.015777587890625,
0.01313018798828125,
0.02978515625,
-0.01206207275390625,
0.0232696533203125,
0.008880615234375,
0.0103759765625,
-0.009124755859375,
0.014404296875,
0.00913238525390625,
0.0264739990234375,
-0.01207733154296875,
-0.04351806640625,
0.053131103515625,
-0.05364990234375,
-0.04473876953125,
0.01947021484375,
-0.00531768798828125,
-0.0007429122924804688,
0.033203125,
0.0285491943359375,
0.004047393798828125,
0.032867431640625,
0.0070343017578125,
-0.01271820068359375,
-0.0184173583984375,
-0.0033550262451171875,
-0.0211639404296875,
0.0275115966796875,
-0.06280517578125,
-0.04266357421875,
-0.03179931640625,
0.06011962890625,
0.034637451171875,
0.0168914794921875,
0.00152587890625,
-0.0054473876953125,
0.0247344970703125,
-0.033935546875,
0.00463104248046875,
0.0183563232421875,
-0.033447265625,
0.021148681640625,
-0.02557373046875,
-0.013397216796875,
-0.0103759765625,
-0.0128173828125,
-0.0309295654296875,
0.038299560546875,
-0.02386474609375,
-0.0101165771484375,
-0.004772186279296875,
-0.06829833984375,
-0.01219940185546875,
0.018646240234375,
0.028533935546875,
-0.0102386474609375,
-0.01380157470703125,
-0.0263671875,
-0.00876617431640625,
-0.034088134765625,
0.0122833251953125,
0.00482177734375,
-0.0251922607421875,
-0.04193115234375,
-0.002971649169921875,
0.056671142578125,
0.072265625,
-0.0518798828125,
0.004581451416015625,
-0.036285400390625,
-0.0257568359375,
0.0255126953125,
-0.03167724609375,
-0.01119232177734375,
0.018798828125,
0.01947021484375,
-0.0010004043579101562,
0.01641845703125,
0.0166168212890625,
-0.00012600421905517578,
0.0245361328125,
-0.027923583984375,
-0.033782958984375,
-0.00952911376953125,
0.049285888671875,
-0.035797119140625,
-0.0099639892578125,
0.0089263916015625,
0.015411376953125,
0.0098114013671875,
0.0291900634765625,
-0.005046844482421875,
-0.028900146484375,
-0.0035190582275390625,
-0.01279449462890625,
-0.040252685546875,
-0.02215576171875,
0.0254669189453125,
0.01605224609375,
-0.0213470458984375,
-0.0130767822265625,
0.010955810546875,
0.002338409423828125,
-0.0084686279296875,
-0.017242431640625,
-0.003879547119140625,
-0.0221099853515625,
-0.00078582763671875,
-0.02178955078125,
0.00433349609375,
0.0005035400390625,
0.0248870849609375,
-0.0255126953125,
-0.04180908203125,
-0.0012340545654296875,
-0.00160980224609375,
0.03436279296875,
-0.024566650390625,
-0.0223541259765625,
-0.0134429931640625,
-0.008819580078125,
0.0101165771484375,
0.00933074951171875,
0.029388427734375,
-0.03192138671875,
0.01629638671875,
-0.033721923828125,
0.03778076171875,
-0.027587890625,
0.01849365234375,
0.00823211669921875,
0.04144287109375,
0.0088043212890625,
-0.01849365234375,
-0.0191802978515625,
-0.041778564453125,
-0.0111236572265625,
0.01197052001953125,
-0.00870513916015625,
0.027069091796875,
-0.02056884765625,
-0.004856109619140625,
-0.0188446044921875,
-0.0090179443359375,
-0.006259918212890625,
-0.0242462158203125,
-0.00922393798828125,
0.044219970703125,
0.031982421875,
-0.01265716552734375,
-0.0202484130859375,
0.0279541015625,
-0.0115814208984375,
-0.01010894775390625,
0.0029087066650390625,
-0.00072479248046875,
-0.0113525390625,
0.01275634765625,
0.008209228515625,
0.0074005126953125,
0.02813720703125,
-0.05010986328125,
0.0115509033203125,
-0.0007119178771972656,
0.0277862548828125,
-0.01096343994140625,
0.03277587890625,
-0.01486968994140625,
-0.0171051025390625,
-0.0014286041259765625,
-0.01454925537109375,
0.0193023681640625,
-0.0241241455078125,
-0.036773681640625,
-0.0130767822265625,
-0.01116180419921875,
0.039398193359375,
0.0157928466796875,
0.010406494140625,
-0.0056304931640625,
-0.01041412353515625,
0.0106964111328125,
-0.06756591796875,
-0.0288238525390625,
0.062408447265625,
-0.0249786376953125,
0.00617218017578125,
0.0020465850830078125,
0.02294921875,
0.006618499755859375,
-0.0016508102416992188,
0.003704071044921875,
0.0027179718017578125,
0.0243988037109375,
0.01190185546875,
-0.017303466796875,
0.0037593841552734375,
-0.01262664794921875,
0.0526123046875,
-0.0777587890625,
0.0005855560302734375,
-0.02197265625,
0.0238800048828125,
-0.0020160675048828125,
-0.020294189453125,
0.00814056396484375,
-0.05328369140625,
0.037445068359375,
0.0311126708984375,
0.034149169921875,
0.055755615234375,
0.005832672119140625,
-0.00559234619140625,
0.060211181640625,
-0.0587158203125,
-0.01084136962890625,
-0.01258087158203125,
0.05023193359375,
0.0626220703125,
-0.0017347335815429688,
-0.018829345703125,
0.00514984130859375,
-0.03155517578125,
0.0116729736328125,
0.023345947265625,
-0.006801605224609375,
-0.01079559326171875,
-0.00882720947265625,
0.008697509765625,
0.01137542724609375,
0.0104522705078125,
-0.0293426513671875,
0.0181121826171875,
-0.0297088623046875,
0.0338134765625,
-0.01287841796875,
-0.0064849853515625,
-0.01042938232421875,
0.004924774169921875,
0.022705078125,
-0.0160369873046875,
0.0118408203125,
0.06219482421875,
0.005741119384765625,
-0.0275115966796875,
0.001499176025390625,
-0.027587890625,
0.00922393798828125,
0.025726318359375,
-0.0206756591796875,
-0.005062103271484375,
-0.01593017578125,
-0.0062713623046875,
-0.0198822021484375,
-0.05877685546875,
0.034454345703125,
0.048614501953125,
0.036773681640625,
0.0394287109375,
0.055694580078125,
0.0159759521484375,
-0.0308990478515625,
0.06781005859375,
-0.03277587890625,
-0.00887298583984375,
0.0662841796875,
0.040771484375,
0.00557708740234375,
0.01531219482421875,
-0.011199951171875,
0.0084686279296875,
-0.01187896728515625,
-0.032196044921875,
0.0032062530517578125,
-0.0188140869140625,
0.0227508544921875,
-0.0260467529296875,
-0.032257080078125,
0.0070648193359375,
-0.0711669921875,
-0.003337860107421875,
0.01503753662109375,
-0.00908660888671875,
-0.01317596435546875,
-0.0465087890625,
-0.03607177734375,
-0.0221405029296875,
-0.114501953125,
-0.0673828125,
0.0120697021484375,
-0.068115234375,
-0.0010824203491210938,
-0.03228759765625,
-0.0274505615234375,
-0.003322601318359375,
-0.0197296142578125,
0.0031681060791015625,
0.020416259765625,
-0.049285888671875,
-0.05157470703125,
-0.0682373046875,
-0.08868408203125,
-0.0286865234375,
0.0002465248107910156,
-0.00787353515625,
-0.00716400146484375,
0.031585693359375,
-0.007228851318359375,
-0.0428466796875,
-0.0195770263671875,
0.055999755859375,
0.01361083984375,
-0.01293182373046875,
0.0206451416015625,
0.0160369873046875,
0.0063629150390625,
0.0210113525390625,
-0.0190887451171875,
0.038970947265625,
-0.044281005859375,
-0.0298919677734375,
-0.02239990234375,
-0.0281982421875,
-0.026123046875,
0.031036376953125,
0.0175628662109375,
-0.017059326171875,
0.01171112060546875,
-0.06927490234375,
-0.047088623046875,
-0.0345458984375,
-0.07098388671875,
0.10699462890625,
0.04364013671875,
0.007904052734375,
0.007389068603515625,
0.035888671875,
0.0013828277587890625,
0.0192718505859375,
0.012939453125,
-0.021484375,
0.07666015625,
-0.0003533363342285156,
0.0023899078369140625,
-0.032379150390625,
0.05810546875,
-0.0009026527404785156,
0.006389617919921875,
0.02008056640625,
0.0110626220703125,
-0.016845703125,
0.005802154541015625,
-0.05108642578125,
-0.052215576171875,
0.049163818359375,
-0.01397705078125,
0.0032367706298828125,
-0.038421630859375,
-0.02392578125,
-0.017730712890625,
0.07672119140625,
-0.057373046875,
-0.0186920166015625,
0.0135345458984375,
0.0264892578125,
-0.03631591796875,
-0.05914306640625,
-0.055419921875,
-0.021697998046875,
-0.09588623046875,
-0.003612518310546875,
-0.029876708984375,
-0.0428466796875,
0.0169525146484375,
-0.036285400390625,
-0.0418701171875,
-0.0584716796875,
0.0404052734375,
-0.03143310546875,
0.005435943603515625,
0.0526123046875,
0.0004210472106933594,
0.0207061767578125,
-0.0199737548828125,
-0.0264739990234375,
-0.052093505859375,
-0.0276031494140625,
0.00577545166015625,
0.06243896484375,
0.0130462646484375,
-0.0194854736328125,
-0.0120391845703125,
0.05621337890625,
-0.006473541259765625,
0.042999267578125,
0.00710296630859375,
0.00873565673828125,
0.0174560546875,
-0.002559661865234375,
0.0251617431640625,
-0.01554107666015625,
0.00383758544921875,
-0.01580810546875,
-0.049468994140625,
-0.022216796875,
-0.020538330078125,
-0.005825042724609375,
0.02880859375,
-0.04315185546875,
-0.032318115234375,
-0.0010051727294921875,
-0.0125885009765625,
0.002044677734375,
-0.011474609375,
-0.0197601318359375,
0.01470947265625,
-0.0350341796875,
0.05242919921875,
0.00777435302734375,
-0.007183074951171875,
-0.00858306884765625,
0.08172607421875,
0.018768310546875,
-0.027496337890625,
0.0034809112548828125,
0.019989013671875,
0.03515625,
0.0268096923828125,
0.0194854736328125,
0.0171966552734375,
-0.04833984375,
0.04742431640625,
0.0263519287109375,
-0.005664825439453125,
0.0120391845703125,
0.056732177734375,
-0.01153564453125,
-0.0220184326171875,
0.01177215576171875,
-0.0038242340087890625,
-0.00984954833984375,
0.032470703125,
-0.033843994140625,
0.00038933753967285156,
-0.045989990234375,
0.0299530029296875,
0.0039825439453125,
0.01169586181640625,
-0.053802490234375,
-0.0640869140625,
0.0135498046875,
0.0144195556640625,
0.02105712890625,
0.054107666015625,
-0.0230712890625,
0.07220458984375,
0.018646240234375,
-0.0117950439453125,
0.023040771484375,
0.060577392578125,
0.025238037109375,
0.03253173828125,
0.02325439453125,
-0.0166473388671875,
-0.0229949951171875,
-0.0045013427734375,
0.052520751953125,
-0.00817108154296875,
-0.0266265869140625,
-0.03326416015625,
-0.016357421875,
0.011932373046875,
0.022735595703125,
-0.01183319091796875,
0.054718017578125,
0.006397247314453125,
-0.03363037109375,
-0.0396728515625,
-0.048370361328125,
-0.02386474609375,
-0.07073974609375,
0.0133819580078125,
-0.0082550048828125,
-0.0011386871337890625,
0.011993408203125,
0.0321044921875,
-0.0014972686767578125,
0.02032470703125,
-0.003055572509765625,
-0.017425537109375,
-0.019683837890625,
0.01361846923828125,
0.01085662841796875,
-0.01739501953125,
0.04193115234375,
-0.0301361083984375,
0.05316162109375,
-0.01983642578125,
0.01190948486328125,
-0.00916290283203125,
0.034088134765625,
-0.0433349609375,
-0.0400390625,
0.05633544921875,
-0.022369384765625,
-0.005947113037109375,
0.0178985595703125,
-0.01177978515625,
-0.0352783203125,
-0.004726409912109375,
0.0273895263671875,
0.034637451171875,
-0.003448486328125,
-0.031524658203125,
0.0258636474609375,
-0.0438232421875,
-0.01314544677734375,
0.034942626953125,
-0.0667724609375,
0.02606201171875,
0.03045654296875,
-0.043212890625,
-0.00675201416015625,
0.0301971435546875,
-0.0758056640625,
-0.0309295654296875,
-0.0198822021484375,
-0.036346435546875,
0.043701171875,
-0.009002685546875,
0.048187255859375,
-0.025726318359375,
-0.043670654296875,
-0.00841522216796875,
-0.0028934478759765625,
0.05914306640625,
0.03955078125,
-0.0833740234375,
0.03717041015625,
-0.06451416015625,
0.00885009765625,
-0.0286102294921875,
-0.06640625,
-0.0421142578125,
-0.0289306640625,
-0.0279388427734375,
-0.01092529296875,
0.025177001953125,
0.046295166015625,
-0.0179290771484375,
0.044677734375,
-0.00824737548828125,
0.032867431640625,
-0.0006937980651855469,
0.062042236328125,
0.01406097412109375,
0.01424407958984375,
0.0101776123046875,
0.0292205810546875,
-0.0125274658203125,
-0.0120391845703125,
0.0121612548828125,
0.01360321044921875,
-0.007801055908203125,
-0.04425048828125,
0.03009033203125,
-0.006145477294921875,
0.06298828125,
0.0023860931396484375,
-0.01139068603515625,
-0.0120086669921875,
-0.0168304443359375,
-0.0153961181640625,
0.0399169921875,
0.0214385986328125,
0.00922393798828125,
-0.0235443115234375,
-0.01428985595703125,
-0.0059356689453125,
0.01410675048828125,
-0.00389862060546875,
0.0192108154296875,
-0.0035724639892578125,
0.006500244140625,
0.0131988525390625,
-0.07037353515625,
0.1068115234375,
0.10308837890625,
-0.0012578964233398438,
0.04736328125,
0.0218963623046875,
0.0069427490234375,
0.003917694091796875,
0.038482666015625,
0.01316070556640625,
-0.007518768310546875,
0.0767822265625,
0.0284576416015625,
-0.006763458251953125,
0.037017822265625,
-0.0297393798828125,
0.01494598388671875,
-0.0034923553466796875,
0.0400390625,
-0.0186767578125,
0.0257720947265625,
0.0294189453125,
-0.013092041015625,
0.0135955810546875,
0.011383056640625,
0.01332855224609375,
0.01268768310546875,
0.00669097900390625,
0.004062652587890625,
0.0032863616943359375,
0.01751708984375,
-0.0103912353515625,
-0.0167694091796875,
0.0026092529296875,
0.02056884765625,
-0.01361846923828125,
-0.0247802734375,
-0.052581787109375,
0.0309906005859375,
-0.061309814453125,
-0.0180206298828125,
-0.006549835205078125,
-0.0086517333984375,
-0.0257568359375,
-0.022003173828125,
0.0193328857421875,
-0.025238037109375,
0.017425537109375,
-0.005832672119140625,
-0.0019273757934570312,
0.0179290771484375,
0.05010986328125,
-0.0255889892578125,
0.0035037994384765625,
0.031890869140625,
0.00719451904296875,
0.01812744140625,
0.00699615478515625,
0.0177001953125,
0.0313720703125,
-0.055023193359375,
-0.00676727294921875,
-0.046966552734375,
0.049224853515625,
-0.00628662109375,
0.0169830322265625,
0.0748291015625,
-0.034881591796875,
-0.019561767578125,
0.0280914306640625,
0.00991058349609375,
-0.0184783935546875,
-0.0036449432373046875,
0.02215576171875,
-0.04083251953125,
0.0250396728515625,
0.01163482666015625,
0.048583984375,
0.0019893646240234375,
0.01568603515625,
-0.032379150390625,
0.05755615234375,
-0.0237579345703125,
0.03399658203125,
0.03240966796875,
0.010498046875,
-0.0031147003173828125,
-0.002513885498046875,
-0.01349639892578125,
0.035125732421875,
-0.00653076171875,
-0.009613037109375,
-0.039215087890625,
0.0021686553955078125,
-0.0294036865234375,
0.021697998046875,
0.06927490234375,
0.0232391357421875,
-0.0284423828125,
-0.009979248046875,
0.044769287109375,
0.0310211181640625,
-0.01419830322265625,
0.042144775390625,
0.0182037353515625,
0.00298309326171875,
0.0182647705078125,
-0.007213592529296875,
0.038238525390625,
-0.028533935546875,
-0.0109405517578125,
0.044189453125,
-0.009185791015625,
-0.03253173828125,
-0.0134429931640625,
-0.01084136962890625,
-0.033966064453125,
0.0030059814453125,
0.01611328125,
-0.035400390625,
0.0038909912109375,
0.035064697265625,
0.029327392578125,
-0.016143798828125,
-0.01885986328125,
-0.01352691650390625,
0.041534423828125,
-0.00118255615234375,
0.0210113525390625,
-0.025390625,
0.0100555419921875,
-0.00916290283203125,
-0.007167816162109375,
-0.00591278076171875,
0.035675048828125,
-0.04156494140625,
0.0283050537109375,
0.027374267578125,
0.022186279296875,
-0.0082550048828125,
0.034881591796875,
0.007106781005859375,
0.0096282958984375,
-0.045318603515625,
-0.0435791015625,
0.0152435302734375,
-0.023406982421875,
-0.0157928466796875,
0.0213470458984375,
-0.0269317626953125,
-0.01374053955078125,
0.008392333984375,
-0.044586181640625,
-0.022430419921875,
0.0139617919921875,
0.02130126953125,
-0.01049041748046875,
-0.055999755859375,
0.00044226646423339844,
-0.0134124755859375,
-0.0218658447265625,
0.01250457763671875,
0.00577545166015625,
-0.0025196075439453125,
-0.01029205322265625,
0.037811279296875,
-0.001979827880859375,
0.0006780624389648438,
0.00855255126953125,
0.0157470703125,
-0.0207977294921875,
-0.0011510848999023438,
-0.0100860595703125,
-0.0287628173828125,
0.0070037841796875,
0.01788330078125,
0.051788330078125,
0.0188751220703125,
0.0198211669921875,
-0.0263824462890625,
-0.0031948089599609375,
0.01641845703125,
-0.024017333984375,
-0.01250457763671875,
0.035125732421875,
-0.05047607421875,
0.0333251953125,
-0.0226593017578125,
-0.01033782958984375,
-0.023651123046875,
-0.005523681640625,
0.030853271484375,
-0.041229248046875,
0.044952392578125,
-0.01441192626953125,
-0.0032329559326171875,
0.008880615234375,
-0.036956787109375,
0.0157623291015625,
-0.028839111328125,
-0.045074462890625,
-0.004207611083984375,
-0.0163421630859375,
0.0200042724609375,
-0.00788116455078125,
0.0255889892578125,
0.004184722900390625,
0.0242462158203125,
0.0034198760986328125,
-0.0037746429443359375,
0.0014333724975585938,
-0.01216888427734375,
0.0125732421875,
0.0208282470703125,
0.0167083740234375,
0.0272216796875,
-0.005916595458984375,
-0.029937744140625,
-0.048095703125,
0.054840087890625,
0.06231689453125,
0.0697021484375,
-0.043212890625,
0.0596923828125,
0.019287109375,
0.004413604736328125,
-0.0262603759765625,
-0.0010080337524414062,
0.041778564453125,
-0.034149169921875,
-0.01922607421875,
-0.00952911376953125,
-0.0693359375,
-0.01549530029296875,
0.051971435546875,
-0.0152130126953125,
-0.0196685791015625,
0.025482177734375,
0.031402587890625,
0.0035800933837890625,
0.038848876953125,
-0.0190887451171875,
-0.055450439453125,
-0.046661376953125,
0.0029239654541015625,
0.015625,
0.025177001953125,
-0.00988006591796875,
0.01885986328125,
0.01434326171875,
-0.0279693603515625,
0.02093505859375,
-0.0032958984375,
0.037384033203125,
0.0391845703125,
-0.0413818359375,
-0.05511474609375,
0.0081024169921875,
-0.0098114013671875,
0.0142059326171875,
-0.01108551025390625,
0.09906005859375,
-0.01401519775390625,
-0.0250701904296875,
0.006320953369140625,
-0.0265045166015625,
0.042510986328125,
0.0005359649658203125,
0.01751708984375,
-0.023223876953125,
0.030426025390625,
0.006473541259765625,
-0.10015869140625,
-0.01318359375,
-0.050689697265625,
0.0006384849548339844,
0.0288543701171875,
-0.01546478271484375,
-0.0163726806640625,
0.00868988037109375,
0.0240936279296875,
0.0142669677734375,
0.00833892822265625,
-0.059478759765625,
0.02587890625,
-0.0137176513671875,
0.043975830078125,
-0.0080413818359375,
0.0211029052734375,
-0.007053375244140625,
0.00818634033203125,
-0.01071929931640625,
-0.006397247314453125,
-0.030059814453125,
0.00540924072265625,
-0.00824737548828125,
0.0201873779296875,
0.0133056640625,
0.002017974853515625,
0.005126953125,
0.06585693359375,
-0.0051727294921875,
0.11700439453125,
-0.048309326171875,
-0.0193023681640625,
-0.002109527587890625,
-0.0022754669189453125,
-0.0199127197265625,
-0.031829833984375,
0.019500732421875,
-0.016815185546875,
-0.0160369873046875,
-0.035888671875,
-0.0011053085327148438,
0.009674072265625,
-0.043670654296875,
-0.054534912109375,
0.0239105224609375,
-0.00804901123046875,
-0.045806884765625,
-0.0233917236328125,
0.0290374755859375,
-0.0031280517578125,
-0.0115203857421875,
-0.00257110595703125,
-0.030426025390625,
0.0041351318359375,
0.0318603515625,
0.034210205078125,
0.050811767578125,
0.0019664764404296875,
0.027313232421875,
-0.05828857421875,
0.02203369140625,
-0.00554656982421875,
0.041900634765625,
-0.0086212158203125,
0.0028285980224609375,
-0.0054473876953125,
0.047210693359375,
-0.0193634033203125,
-0.0046539306640625,
0.00432586669921875,
0.0016527175903320312,
-0.047882080078125,
-0.0205841064453125,
0.0290069580078125,
0.020721435546875,
0.043914794921875,
0.042633056640625,
-0.007503509521484375,
-0.036590576171875,
-0.062225341796875,
-0.0305633544921875,
-0.035064697265625,
0.0022487640380859375,
0.041778564453125,
-0.08575439453125,
0.0289154052734375,
0.0367431640625,
-0.00262451171875,
-0.0338134765625,
-0.0213165283203125,
-0.03350830078125,
-0.0226593017578125,
-0.035797119140625,
-0.0088348388671875,
0.0059356689453125,
-0.004993438720703125,
0.05853271484375,
-0.024566650390625,
0.044189453125,
-0.0023899078369140625,
0.0193634033203125,
0.0640869140625,
0.026641845703125,
0.031402587890625,
0.050933837890625,
-0.0543212890625,
-0.0112457275390625,
0.0204315185546875,
0.0433349609375,
-0.003627777099609375,
-0.03662109375,
0.0294647216796875,
-0.00041794776916503906,
-0.045562744140625,
-0.0166015625,
0.025604248046875,
0.0247650146484375,
-0.0458984375,
0.10504150390625,
0.01473236083984375,
0.0518798828125,
-0.006740570068359375,
0.06005859375,
-0.021087646484375,
-0.0257568359375,
-0.0195159912109375,
-0.03271484375,
-0.007282257080078125,
-0.01284027099609375,
-0.005123138427734375,
-0.0584716796875,
0.042633056640625,
-0.0159454345703125,
0.0018253326416015625,
0.032379150390625
] |
69d03dd870d5810f975a5c826210ec80d3d9414d
|
Wordpress Stackexchange
Q: How to get Category Id from Post Id ? I need to get any post category id from the post id(Not for current) Post.
How can i ?
Thanks
A: You can try this code for getting category id from post id:
global $post;
$category_detail=get_the_category( $post->ID );
|
Q: How to get Category Id from Post Id ? I need to get any post category id from the post id(Not for current) Post.
How can i ?
Thanks
A: You can try this code for getting category id from post id:
global $post;
$category_detail=get_the_category( $post->ID );
A: Take a look at wp_get_post_categories function. It returns an array of categories' ID for specific post.
$post_categories = wp_get_post_categories( $post_id );
|
wordpress
|
{
"language": "en",
"length": 70,
"provenance": "stackexchange_00019.jsonl.gz:418842",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48262"
}
|
[
0.053253173828125,
-0.00905609130859375,
-0.00994110107421875,
-0.035247802734375,
0.0289764404296875,
-0.030517578125,
0.037841796875,
0.0069122314453125,
-0.014373779296875,
0.01727294921875,
-0.021148681640625,
0.00276947021484375,
-0.011444091796875,
-0.029449462890625,
-0.0014209747314453125,
-0.028656005859375,
0.037994384765625,
-0.0168304443359375,
0.0307159423828125,
-0.007808685302734375,
-0.0021343231201171875,
0.0070037841796875,
0.034423828125,
0.044952392578125,
0.042633056640625,
-0.0194244384765625,
0.0037403106689453125,
-0.01538848876953125,
0.01100921630859375,
-0.019378662109375,
0.026092529296875,
0.003040313720703125,
-0.0022869110107421875,
-0.026275634765625,
0.058624267578125,
0.0193328857421875,
0.0050048828125,
0.00640106201171875,
0.06011962890625,
-0.0222625732421875,
0.0310516357421875,
-0.022918701171875,
0.045318603515625,
-0.0085296630859375,
0.00299072265625,
-0.01934814453125,
0.015960693359375,
-0.0538330078125,
0.0230712890625,
-0.042388916015625,
0.018646240234375,
0.022369384765625,
0.04461669921875,
-0.00861358642578125,
-0.019561767578125,
-0.00350189208984375,
-0.00466156005859375,
-0.019073486328125,
0.05877685546875,
-0.037841796875,
-0.0638427734375,
-0.06707763671875,
0.05792236328125,
-0.031585693359375,
0.00887298583984375,
0.0027523040771484375,
0.056640625,
0.03118896484375,
-0.035247802734375,
-0.00433349609375,
0.02691650390625,
-0.01509857177734375,
-0.0013227462768554688,
0.0016565322875976562,
-0.0223846435546875,
-0.07440185546875,
0.05706787109375,
-0.0460205078125,
-0.0253448486328125,
0.0276336669921875,
-0.01153564453125,
-0.019195556640625,
-0.053253173828125,
-0.01251983642578125,
-0.00008279085159301758,
0.00843048095703125,
-0.01528167724609375,
-0.00894927978515625,
-0.0240020751953125,
-0.058929443359375,
-0.015960693359375,
-0.0212249755859375,
-0.055145263671875,
0.011444091796875,
-0.0137939453125,
-0.044158935546875,
0.022705078125,
0.05963134765625,
-0.044464111328125,
-0.00031828880310058594,
-0.01214599609375,
-0.0173797607421875,
0.00943756103515625,
-0.038482666015625,
-0.00589752197265625,
0.0023174285888671875,
0.0152130126953125,
0.0026988983154296875,
0.0281982421875,
0.031982421875,
-0.0220184326171875,
0.0266876220703125,
0.006832122802734375,
0.00930023193359375,
-0.041473388671875,
0.022186279296875,
-0.0221405029296875,
-0.0039005279541015625,
-0.016998291015625,
0.01169586181640625,
0.005687713623046875,
0.01837158203125,
0.02740478515625,
0.01078033447265625,
0.007152557373046875,
0.0311431884765625,
-0.0100250244140625,
-0.056304931640625,
0.0197296142578125,
-0.04876708984375,
-0.0433349609375,
0.037506103515625,
0.066162109375,
0.03155517578125,
0.0156707763671875,
0.00023305416107177734,
-0.0196533203125,
-0.0129241943359375,
0.00258636474609375,
-0.001964569091796875,
-0.005260467529296875,
-0.01477813720703125,
0.035186767578125,
-0.005016326904296875,
-0.005954742431640625,
0.0196075439453125,
0.01186370849609375,
0.00850677490234375,
-0.01326751708984375,
-0.0308685302734375,
-0.006038665771484375,
-0.019134521484375,
0.01480865478515625,
0.0191650390625,
0.035247802734375,
-0.003040313720703125,
0.06982421875,
-0.0343017578125,
-0.01338958740234375,
-0.0413818359375,
0.050811767578125,
0.0325927734375,
0.0289764404296875,
0.046539306640625,
0.01241302490234375,
-0.033233642578125,
-0.030181884765625,
-0.0098724365234375,
0.022552490234375,
0.055572509765625,
0.03179931640625,
0.0006375312805175781,
-0.0055389404296875,
0.0009298324584960938,
-0.00997161865234375,
-0.01512908935546875,
-0.013702392578125,
-0.06695556640625,
0.030303955078125,
0.045196533203125,
-0.025390625,
-0.038909912109375,
-0.06488037109375,
0.0273895263671875,
-0.01837158203125,
0.0450439453125,
0.01241302490234375,
0.0770263671875,
-0.001667022705078125,
0.019989013671875,
-0.0200653076171875,
0.0011606216430664062,
-0.060699462890625,
-0.00902557373046875,
0.01244354248046875,
0.00495147705078125,
-0.0158843994140625,
-0.00037860870361328125,
0.0106048583984375,
-0.00568389892578125,
0.0180511474609375,
-0.0034427642822265625,
-0.0162353515625,
0.033416748046875,
-0.0232086181640625,
-0.0189666748046875,
0.0082244873046875,
0.0046844482421875,
0.005401611328125,
0.016326904296875,
0.022491455078125,
-0.007495880126953125,
0.006900787353515625,
-0.07684326171875,
-0.045928955078125,
0.0477294921875,
-0.0261077880859375,
-0.03240966796875,
-0.0418701171875,
-0.00675201416015625,
-0.06463623046875,
0.01153564453125,
-0.06622314453125,
0.0250091552734375,
0.049285888671875,
0.02349853515625,
-0.0119781494140625,
-0.00982666015625,
0.039764404296875,
0.0411376953125,
-0.07720947265625,
-0.034942626953125,
0.012451171875,
0.026458740234375,
-0.01812744140625,
-0.0058441162109375,
0.018951416015625,
-0.0430908203125,
0.0135498046875,
0.032989501953125,
0.0406494140625,
-0.0016527175903320312,
-0.0163726806640625,
-0.0228271484375,
0.031341552734375,
-0.037750244140625,
-0.00432586669921875,
-0.0273284912109375,
0.0258331298828125,
0.046722412109375,
0.036163330078125,
0.0241241455078125,
0.01129913330078125,
0.0081787109375,
0.01419830322265625,
0.033447265625,
0.00193023681640625,
0.000024199485778808594,
-0.0218353271484375,
0.0205230712890625,
0.00021982192993164062,
-0.01983642578125,
-0.028076171875,
-0.0040283203125,
0.0139007568359375,
0.0239105224609375,
0.038970947265625,
0.03955078125,
-0.01416015625,
0.0020732879638671875,
-0.0030498504638671875,
0.01000213623046875,
0.004390716552734375,
0.04949951171875,
0.01158905029296875,
0.01543426513671875,
-0.033721923828125,
-0.0181427001953125,
0.01477813720703125,
0.029296875,
0.00521087646484375,
0.06817626953125,
0.0250091552734375,
-0.01477813720703125,
-0.0123748779296875,
-0.06463623046875,
-0.00888824462890625,
-0.0182037353515625,
-0.0533447265625,
-0.007740020751953125,
0.01145172119140625,
0.049468994140625,
-0.006832122802734375,
0.0067901611328125,
-0.01166534423828125,
0.0143280029296875,
0.0167999267578125,
-0.037200927734375,
0.0186309814453125,
-0.0192718505859375,
0.0274200439453125,
0.058837890625,
0.0030727386474609375,
0.0204315185546875,
0.004398345947265625,
-0.0103302001953125,
0.034149169921875,
-0.01153564453125,
-0.0012025833129882812,
0.01103973388671875,
-0.046417236328125,
0.0293426513671875,
0.0257720947265625,
0.09234619140625,
-0.0233612060546875,
-0.05194091796875,
0.0177154541015625,
0.04022216796875,
-0.0638427734375,
-0.08636474609375,
0.00609588623046875,
-0.01303863525390625,
0.0016222000122070312,
-0.01532745361328125,
-0.0022373199462890625,
-0.0095367431640625,
-0.026214599609375,
0.0011539459228515625,
0.03179931640625,
-0.019561767578125,
-0.0709228515625,
-0.027374267578125,
-0.0743408203125,
-0.02911376953125,
-0.0192108154296875,
0.00510406494140625,
0.016754150390625,
0.03948974609375,
0.0189971923828125,
-0.0206756591796875,
0.0169677734375,
0.04351806640625,
-0.02777099609375,
-0.01459503173828125,
-0.005634307861328125,
-0.01490020751953125,
0.0017251968383789062,
0.016082763671875,
-0.0251312255859375,
0.0013370513916015625,
0.0131378173828125,
-0.005855560302734375,
-0.022369384765625,
0.032073974609375,
0.01515960693359375,
0.005847930908203125,
0.01557159423828125,
0.045623779296875,
0.023590087890625,
-0.002635955810546875,
-0.01197052001953125,
-0.0175628662109375,
-0.033966064453125,
-0.0189361572265625,
0.02288818359375,
-0.0006861686706542969,
-0.03350830078125,
0.0006995201110839844,
-0.004787445068359375,
-0.00940704345703125,
-0.01476287841796875,
-0.03900146484375,
0.05377197265625,
0.0100860595703125,
0.036468505859375,
0.0205535888671875,
-0.034515380859375,
-0.041015625,
0.0189666748046875,
-0.04034423828125,
0.00021064281463623047,
-0.02166748046875,
0.0277252197265625,
-0.012481689453125,
-0.050750732421875,
0.03863525390625,
-0.022705078125,
-0.01910400390625,
-0.0180511474609375,
-0.02099609375,
0.020477294921875,
0.08447265625,
-0.006641387939453125,
-0.0204925537109375,
-0.0271453857421875,
-0.005725860595703125,
-0.01296234130859375,
-0.0313720703125,
-0.035797119140625,
-0.01788330078125,
-0.039031982421875,
0.0140228271484375,
0.0010738372802734375,
-0.0120391845703125,
-0.0233001708984375,
0.066162109375,
-0.029327392578125,
-0.01216888427734375,
0.041107177734375,
-0.03466796875,
0.0192413330078125,
-0.003910064697265625,
0.00913238525390625,
0.000055789947509765625,
-0.0386962890625,
-0.0109710693359375,
-0.01739501953125,
-0.0012235641479492188,
-0.007366180419921875,
0.0033016204833984375,
0.005695343017578125,
0.01031494140625,
-0.0128326416015625,
0.01363372802734375,
0.0031719207763671875,
0.0266571044921875,
-0.01480865478515625,
0.0200653076171875,
-0.0303955078125,
-0.024993896484375,
-0.01111602783203125,
-0.032928466796875,
-0.015777587890625,
-0.0306396484375,
-0.01119232177734375,
0.0278472900390625,
-0.043426513671875,
-0.0018024444580078125,
-0.043853759765625,
-0.01410675048828125,
-0.06884765625,
-0.0312347412109375,
-0.004909515380859375,
-0.00007790327072143555,
-0.0274505615234375,
0.016815185546875,
-0.0294036865234375,
-0.06402587890625,
0.07427978515625,
0.05133056640625,
-0.007038116455078125,
-0.016754150390625,
0.062225341796875,
0.0023975372314453125,
-0.05810546875,
-0.057952880859375,
0.0158538818359375,
0.044464111328125,
-0.0213165283203125,
0.05950927734375,
0.02874755859375,
-0.033111572265625,
0.09112548828125,
0.022613525390625,
-0.021820068359375,
-0.036712646484375,
0.085693359375,
-0.0159912109375,
-0.0200958251953125,
0.0114288330078125,
-0.05841064453125,
0.04644775390625,
0.01148223876953125,
-0.0257720947265625,
-0.002307891845703125,
-0.0247802734375,
0.049041748046875,
-0.0142059326171875,
0.036376953125,
-0.042755126953125,
-0.0134735107421875,
0.00852203369140625,
0.0294036865234375,
0.00753021240234375,
0.047210693359375,
-0.0041046142578125,
0.00978851318359375,
0.00481414794921875,
-0.00592041015625,
-0.00617218017578125,
0.01342010498046875,
-0.009368896484375,
0.013519287109375,
0.0102691650390625,
-0.021942138671875,
-0.01381683349609375,
0.00019168853759765625,
0.00370025634765625,
-0.030029296875,
-0.048828125,
-0.007556915283203125,
-0.0106353759765625,
0.00650787353515625,
0.04510498046875,
-0.04534912109375,
0.0255889892578125,
0.0283050537109375,
-0.01282501220703125,
-0.0016651153564453125,
-0.06683349609375,
-0.0236663818359375,
-0.03228759765625,
0.0072784423828125,
0.0030536651611328125,
-0.006809234619140625,
0.040374755859375,
0.046661376953125,
-0.0024204254150390625,
0.0360107421875,
-0.0229949951171875,
0.047698974609375,
0.004634857177734375,
0.02777099609375,
0.00972747802734375,
-0.0143890380859375,
0.00928497314453125,
-0.02069091796875,
-0.0078887939453125,
-0.051666259765625,
0.0114288330078125,
0.01534271240234375,
0.039215087890625,
0.00931549072265625,
-0.036102294921875,
0.0239105224609375,
-0.0169219970703125,
-0.01026153564453125,
0.0020503997802734375,
-0.0016803741455078125,
-0.0191802978515625,
-0.01146697998046875,
0.0020542144775390625,
0.0043487548828125,
0.017120361328125,
-0.0136566162109375,
0.005153656005859375,
-0.0206298828125,
0.0318603515625,
-0.004547119140625,
0.008544921875,
-0.0026702880859375,
0.0003769397735595703,
-0.057403564453125,
-0.025543212890625,
-0.01531982421875,
0.0225677490234375,
0.010040283203125,
-0.005962371826171875,
-0.047698974609375,
0.0325927734375,
0.01043701171875,
0.07257080078125,
-0.022216796875,
-0.044342041015625,
0.03509521484375,
-0.0125579833984375,
0.06561279296875,
0.033660888671875,
-0.033843994140625,
-0.002140045166015625,
-0.04010009765625,
-0.008544921875,
0.02264404296875,
-0.0491943359375,
-0.0248870849609375,
-0.031494140625,
0.006439208984375,
0.00701904296875,
0.01044464111328125,
0.0112152099609375,
-0.0283660888671875,
0.0253753662109375,
0.026214599609375,
0.0284423828125,
-0.00698089599609375,
0.029693603515625,
0.0168609619140625,
0.0243682861328125,
0.0034999847412109375,
0.005748748779296875,
-0.0164794921875,
-0.0221710205078125,
-0.0173187255859375,
-0.04010009765625,
0.00997161865234375,
0.033233642578125,
0.0109405517578125,
-0.0199127197265625,
-0.0035114288330078125,
0.008636474609375,
0.0028743743896484375,
-0.004119873046875,
0.00678253173828125,
-0.0085296630859375,
-0.0295562744140625,
0.0038280487060546875,
-0.0245208740234375,
0.033782958984375,
-0.0182037353515625,
-0.001018524169921875,
0.0042266845703125,
0.032135009765625,
-0.006397247314453125,
-0.04437255859375,
0.00620269775390625,
0.03546142578125,
-0.014068603515625,
0.040863037109375,
0.053497314453125,
0.0272216796875,
0.0248260498046875,
0.00099945068359375,
0.02191162109375,
-0.031707763671875,
0.0316162109375,
-0.0117950439453125,
-0.0223846435546875,
0.051605224609375,
0.0168304443359375,
-0.0274810791015625,
0.02593994140625,
-0.0416259765625,
0.002044677734375,
0.000728607177734375,
0.054595947265625,
-0.023223876953125,
0.0225067138671875,
0.0439453125,
-0.042449951171875,
-0.023162841796875,
0.0249176025390625,
-0.023040771484375,
-0.0118865966796875,
0.0103607177734375,
-0.040924072265625,
-0.029144287109375,
-0.0018033981323242188,
-0.008026123046875,
-0.0029087066650390625,
-0.009552001953125,
0.039215087890625,
0.0241851806640625,
-0.040283203125,
0.00409698486328125,
0.027740478515625,
0.0226593017578125,
-0.053466796875,
-0.006847381591796875,
0.038787841796875,
-0.01058197021484375,
-0.061737060546875,
0.080078125,
0.01509857177734375,
0.030548095703125,
0.0160675048828125,
-0.01544952392578125,
0.0098114013671875,
0.0228424072265625,
-0.0003943443298339844,
-0.00530242919921875,
-0.0023975372314453125,
-0.056427001953125,
0.0249481201171875,
-0.0084381103515625,
-0.0008115768432617188,
0.05889892578125,
-0.0160064697265625,
0.005619049072265625,
0.005855560302734375,
0.012603759765625,
-0.021514892578125,
-0.0168304443359375,
0.09161376953125,
-0.0635986328125,
0.0018205642700195312,
0.0170440673828125,
0.0633544921875,
0.006389617919921875,
-0.012847900390625,
0.00446319580078125,
0.0083770751953125,
0.08612060546875,
-0.005977630615234375,
0.0855712890625,
0.00470733642578125,
-0.005634307861328125,
-0.0693359375,
0.0272216796875,
0.007472991943359375,
0.02264404296875,
-0.0031604766845703125,
-0.00873565673828125,
-0.00299835205078125,
-0.019744873046875,
-0.056549072265625,
0.06890869140625,
0.007305145263671875,
0.02471923828125,
-0.05157470703125,
-0.0120391845703125,
-0.00025391578674316406,
0.026092529296875,
0.095703125,
0.0208892822265625,
-0.0216064453125,
-0.025482177734375,
0.0203857421875,
0.05938720703125,
-0.006107330322265625,
0.01317596435546875,
0.0164642333984375,
0.0166168212890625,
0.05181884765625,
-0.01389312744140625,
0.04339599609375,
-0.0226898193359375,
0.0034580230712890625,
0.01264190673828125,
0.036773681640625,
0.043701171875,
0.01788330078125,
-0.01806640625,
-0.0238494873046875,
0.02349853515625,
0.0203704833984375,
-0.0085906982421875,
0.0004963874816894531,
0.066650390625,
0.06085205078125,
-0.054107666015625,
0.003326416015625,
-0.035858154296875,
0.0723876953125,
0.005466461181640625,
0.029815673828125,
0.02008056640625,
0.01511383056640625,
0.07244873046875,
0.015655517578125,
0.019378662109375,
0.028594970703125,
-0.006107330322265625,
0.07769775390625,
0.034332275390625,
0.021392822265625,
-0.05120849609375,
-0.0187225341796875,
0.039276123046875,
0.09033203125,
-0.04815673828125,
-0.0206146240234375,
0.0276641845703125,
0.02716064453125,
0.0005741119384765625,
0.002735137939453125,
0.027618408203125,
0.004550933837890625,
0.05224609375,
-0.0662841796875,
-0.0009260177612304688,
0.016326904296875,
0.0784912109375,
0.004154205322265625,
-0.012115478515625,
-0.08734130859375,
-0.062103271484375,
-0.07586669921875,
0.01465606689453125,
0.0323486328125,
0.0694580078125,
0.027618408203125,
0.072509765625,
-0.0011491775512695312,
-0.039886474609375,
0.022491455078125,
0.029754638671875,
0.022430419921875,
-0.0193023681640625,
0.0091094970703125,
-0.03106689453125,
0.016998291015625,
0.0125274658203125,
0.002712249755859375,
-0.0092315673828125,
0.0433349609375,
0.043212890625,
-0.029571533203125,
-0.03338623046875,
0.00027370452880859375,
-0.019012451171875,
0.0201568603515625,
-0.036712646484375,
0.0222015380859375,
0.0170745849609375,
-0.007564544677734375,
-0.00003892183303833008,
-0.01313018798828125,
0.0714111328125,
0.002471923828125,
0.04443359375,
0.0146942138671875,
-0.007904052734375,
0.017425537109375,
-0.010986328125,
0.0229034423828125,
0.01195526123046875,
-0.057708740234375,
-0.00876617431640625,
-0.04058837890625,
-0.0028743743896484375,
0.03704833984375,
0.027862548828125,
-0.017822265625,
0.0268402099609375,
-0.0195159912109375,
-0.0131378173828125,
0.0306396484375,
-0.004993438720703125,
0.0040435791015625,
-0.004100799560546875,
0.0120391845703125,
-0.00988006591796875,
-0.0340576171875,
-0.02545166015625,
-0.0001608133316040039,
0.0245208740234375,
0.0487060546875,
-0.0413818359375,
0.039520263671875,
0.031829833984375,
-0.042327880859375,
0.071533203125,
-0.10247802734375,
-0.03826904296875,
0.05621337890625,
-0.006195068359375,
0.005176544189453125,
-0.00785064697265625,
-0.027374267578125,
0.0338134765625,
0.038299560546875,
0.00345611572265625,
0.0237579345703125,
-0.01197052001953125,
0.009490966796875,
-0.01617431640625,
0.01554107666015625,
-0.015655517578125,
0.0008869171142578125,
-0.0372314453125,
-0.039154052734375,
0.050445556640625,
0.046905517578125,
0.004596710205078125,
0.002620697021484375,
-0.0187225341796875,
-0.0003669261932373047,
-0.0005068778991699219,
0.032379150390625,
-0.01007843017578125,
0.0310821533203125,
-0.059173583984375,
0.0037689208984375,
0.0261383056640625,
-0.003131866455078125,
0.0185699462890625,
0.021697998046875,
-0.00046944618225097656,
0.02056884765625,
-0.0219879150390625,
-0.005107879638671875,
0.03387451171875,
0.056793212890625,
0.0023021697998046875,
0.033966064453125,
-0.01165008544921875,
-0.004589080810546875,
-0.0113525390625,
-0.047698974609375,
-0.0298309326171875,
-0.054962158203125,
-0.003383636474609375,
0.020263671875,
-0.0341796875,
-0.0135498046875,
-0.027252197265625,
-0.01418304443359375,
0.004512786865234375,
-0.01357269287109375,
-0.005420684814453125,
0.002918243408203125,
-0.01983642578125,
0.0333251953125,
-0.043426513671875,
-0.01251220703125,
0.00753021240234375,
0.035369873046875,
-0.07183837890625,
0.00586700439453125,
-0.0213623046875,
-0.04022216796875,
-0.023193359375,
0.045867919921875,
0.0263824462890625,
-0.053466796875,
-0.0175018310546875,
0.0909423828125,
0.055389404296875,
0.12109375,
0.040191650390625,
-0.0119781494140625,
0.0029506683349609375,
0.0263671875,
-0.03973388671875,
-0.03204345703125,
0.03314208984375,
-0.0252227783203125,
-0.0256500244140625,
-0.00989532470703125,
0.0187835693359375,
0.042694091796875,
-0.010498046875,
-0.027801513671875,
0.05047607421875,
-0.0201568603515625,
-0.032440185546875,
-0.0289459228515625,
0.002918243408203125,
0.015625,
-0.0125885009765625,
-0.00894927978515625,
-0.04656982421875,
-0.0285186767578125,
0.021392822265625,
0.0301361083984375,
-0.004322052001953125,
0.044158935546875,
-0.016815185546875,
-0.05352783203125,
0.0171966552734375,
0.0014095306396484375,
0.04833984375,
-0.0162353515625,
0.006465911865234375,
-0.03167724609375,
0.0020294189453125,
-0.0684814453125,
-0.044769287109375,
-0.022735595703125,
0.048004150390625,
0.004322052001953125,
-0.04193115234375,
-0.030792236328125,
-0.0111083984375,
0.0186920166015625,
0.022674560546875,
0.0106201171875,
-0.0240020751953125,
-0.01270294189453125,
-0.0208282470703125,
-0.033599853515625,
-0.006023406982421875,
0.02166748046875,
-0.042205810546875,
0.018218994140625,
-0.0014591217041015625,
-0.01497650146484375,
0.009979248046875,
-0.039642333984375,
-0.043365478515625,
-0.004688262939453125,
-0.05108642578125,
-0.0115203857421875,
-0.0287017822265625,
0.03948974609375,
0.0020961761474609375,
-0.0347900390625,
-0.037872314453125,
-0.0131378173828125,
-0.0161590576171875,
-0.0180206298828125,
-0.03729248046875,
-0.0006799697875976562,
0.00775909423828125,
-0.008453369140625,
-0.006397247314453125,
0.0149383544921875,
0.005886077880859375,
0.016998291015625,
0.001434326171875,
-0.016571044921875,
0.0362548828125,
0.0171661376953125,
0.031829833984375,
-0.0246734619140625,
0.018646240234375,
0.022613525390625,
0.0233306884765625,
0.007144927978515625,
0.0037670135498046875,
-0.004673004150390625,
0.07330322265625,
-0.0139617919921875,
-0.0477294921875,
0.01263427734375,
-0.05706787109375,
-0.00887298583984375,
0.0210418701171875,
0.0205078125,
-0.0172119140625,
0.029205322265625,
0.002864837646484375,
0.01480865478515625,
0.01268768310546875
] |
6001c931ac156e0d9a94c26277ebdc12552a6e74
|
Wordpress Stackexchange
Q: Removing an admin page added by a 3rd party plugin. Gravity forms in this example I'm trying to hide a help page from editors, added by the gravity forms plugin. I believe I've run into the same issue before with other plugins, so I'd like to know the correct way to do it for 3rd party plugins. This is what I have so far which does not work. It does of course work for other WP menus so I'm wondering if the function is only limited to WP menus?
function remove_menu_links() {
if( !current_user_can('manage_options') ) {
remove_menu_page('admin.php?page=gf_help'); // this is the pages url
}
}
add_action( 'admin_menu', 'remove_menu_links');
A: You need to add your hook at the end of the queue and then remove menu by slug:
function remove_menu_links() {
if( !current_user_can( 'manage_options' ) ) {
remove_menu_page( 'gf_edit_forms' ); // this is the pages url
}
}
add_action( 'admin_menu', 'remove_menu_links', 9999 );
If you want to remove submenu you need to use following snippet:
function remove_menu_links() {
if( !current_user_can( 'manage_options' ) ) {
remove_submenu_page( 'gf_edit_forms', 'gf_help' );
}
}
add_action( 'admin_menu', 'remove_menu_links', 9999 );
|
Q: Removing an admin page added by a 3rd party plugin. Gravity forms in this example I'm trying to hide a help page from editors, added by the gravity forms plugin. I believe I've run into the same issue before with other plugins, so I'd like to know the correct way to do it for 3rd party plugins. This is what I have so far which does not work. It does of course work for other WP menus so I'm wondering if the function is only limited to WP menus?
function remove_menu_links() {
if( !current_user_can('manage_options') ) {
remove_menu_page('admin.php?page=gf_help'); // this is the pages url
}
}
add_action( 'admin_menu', 'remove_menu_links');
A: You need to add your hook at the end of the queue and then remove menu by slug:
function remove_menu_links() {
if( !current_user_can( 'manage_options' ) ) {
remove_menu_page( 'gf_edit_forms' ); // this is the pages url
}
}
add_action( 'admin_menu', 'remove_menu_links', 9999 );
If you want to remove submenu you need to use following snippet:
function remove_menu_links() {
if( !current_user_can( 'manage_options' ) ) {
remove_submenu_page( 'gf_edit_forms', 'gf_help' );
}
}
add_action( 'admin_menu', 'remove_menu_links', 9999 );
A: Ok, Eugene's Answer works in the case of a plugin that doesn't deals with custom capabilities.
http://codex.wordpress.org/Roles_and_Capabilities
The WordPress Plugin API allows Roles and Capabilities to be added, removed and changed. Since Plugins might change Roles and Capabilities, just the default ones are addressed in this article.
So, if his code works without checking for the capability, we have to look how GravityForms executes his add_submenu_page action.
And for that, we drop the whole plugin folder inside a good code editor (NotePad++, TextMate, etc) and do a global search and find our stuff.
// wp-content/plugins/gravityforms/gravityforms.php
// all parameters removed from the original code, except $page_title and $capability
add_submenu_page(
$parent_slug,
__("Help", "gravityforms"),
$menu_title,
$has_full_access ? "gform_full_access" : $min_cap,
$menu_slug,
$function
);
And a few lines before we see:
$has_full_access = current_user_can("gform_full_access");
$min_cap = GFCommon::current_user_can_which(GFCommon::all_caps());
if(empty($min_cap))
$min_cap = "gform_full_access";
Now we go ahead with Members plugin, which btw GF recognizes, and we have the following in its config screen for the Editor role.
BUT NOTING THAT gform_full_access doesn't appears in this list. It has to be manually added through the plugin interface...
After that and marking the full access capability, the remove_submenu_page works as expected to the Editor role.
Reference code for all submenus (remembering the first one is the very top menu).
function remove_menu_links() {
if( !current_user_can( 'manage_options' ) ) {
// remove_submenu_page( 'gf_edit_forms', 'gf_edit_forms' );
// remove_submenu_page( 'gf_edit_forms', 'gf_new_form' );
// remove_submenu_page( 'gf_edit_forms', 'gf_new_formf_help' );
// remove_submenu_page( 'gf_edit_forms', 'gf_entries' );
// remove_submenu_page( 'gf_edit_forms', 'gf_settings' );
// remove_submenu_page( 'gf_edit_forms', 'gf_export' );
// remove_submenu_page( 'gf_edit_forms', 'gf_update' );
// remove_submenu_page( 'gf_edit_forms', 'gf_addons' );
remove_submenu_page( 'gf_edit_forms', 'gf_help' );
}
}
add_action( 'admin_menu', 'remove_menu_links', 9999 );
Plugin of interest
Adminimize does this hiding magic in the blink of an eye and is completely PRO.
A: The GravityForms plugin renames the top level menu item to match the first of the sub-menu.
For example; if you've added just the gravityforms_view_entries capability to the Editor role, then the first sub-menu item will be "Entries", so the parent menu will be "gf_entries" not "gf_edit_forms". So, the following code will remove the "Help" item from the sub-menu for Editors with just that capability:
function remove_menu_links() {
remove_submenu_page( 'gf_entries', 'gf_help' );
}
add_action( 'admin_menu', 'remove_menu_links', 9999 )
;
Hope this helps.
A: This was driving me insane. The answers provided here got me most of the way, but that particular darned Gravity Forms menu item is a little weird.
I managed to get to the root of it by analysing the $submenu global variable which contains all the menu data. The following snippet should kill the update submenu item for you, when hooked into admin_menu() as listed above :)
remove_submenu_page( 'gf_edit_forms', 'gf_update' );
A: Nothing above worked for me, but at least I can hide it with CSS.
#toplevel_page_gf_help{display:none;}
A: you can hide it with css only if you want,
search for a plugin to add css on admin panel :
a[href="admin.php?page=gf_help"] {
display: none !important;
}
|
wordpress
|
{
"language": "en",
"length": 673,
"provenance": "stackexchange_00019.jsonl.gz:418843",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48269"
}
|
[
0.075927734375,
0.0222320556640625,
0.020294189453125,
0.0159912109375,
0.032440185546875,
-0.04461669921875,
0.07244873046875,
-0.0670166015625,
-0.01004791259765625,
0.018707275390625,
0.0240325927734375,
-0.039306640625,
-0.0099639892578125,
-0.049896240234375,
-0.0211181640625,
-0.0245361328125,
0.01546478271484375,
-0.0008916854858398438,
0.023529052734375,
-0.004352569580078125,
-0.0014276504516601562,
0.01282501220703125,
0.00768280029296875,
0.03265380859375,
0.0231475830078125,
-0.0655517578125,
0.020233154296875,
0.0227813720703125,
-0.002857208251953125,
-0.0079498291015625,
0.0032024383544921875,
0.006275177001953125,
-0.0238800048828125,
0.03424072265625,
0.0369873046875,
-0.017669677734375,
0.01480865478515625,
0.0097503662109375,
0.03436279296875,
-0.005779266357421875,
0.0198974609375,
0.006195068359375,
-0.021392822265625,
0.03448486328125,
-0.0234527587890625,
-0.07391357421875,
0.04290771484375,
-0.019622802734375,
-0.00025844573974609375,
0.0157928466796875,
0.025909423828125,
-0.0006055831909179688,
0.029937744140625,
0.03399658203125,
-0.017547607421875,
-0.021820068359375,
-0.0223388671875,
0.004425048828125,
0.031402587890625,
0.0325927734375,
-0.0128173828125,
-0.0208740234375,
0.0044403076171875,
-0.048736572265625,
-0.0288543701171875,
0.0166473388671875,
-0.0084991455078125,
0.003589630126953125,
-0.05029296875,
-0.00794219970703125,
0.0203704833984375,
-0.041168212890625,
0.0142822265625,
0.00852203369140625,
-0.040130615234375,
-0.032867431640625,
0.0236663818359375,
-0.004108428955078125,
0.0240325927734375,
-0.00995635986328125,
0.002811431884765625,
0.0269775390625,
-0.0626220703125,
0.030517578125,
-0.01137542724609375,
0.056182861328125,
-0.0220794677734375,
-0.0380859375,
-0.01059722900390625,
-0.0006289482116699219,
-0.00827789306640625,
-0.02630615234375,
0.007396697998046875,
0.0162200927734375,
-0.00994873046875,
-0.021514892578125,
0.051239013671875,
0.04241943359375,
0.0228424072265625,
-0.004558563232421875,
0.0298614501953125,
-0.057861328125,
0.0309295654296875,
-0.040985107421875,
-0.01399993896484375,
0.04669189453125,
0.01221466064453125,
-0.018218994140625,
0.0009531974792480469,
0.0031299591064453125,
-0.0102691650390625,
-0.01702880859375,
-0.0237884521484375,
-0.0218505859375,
0.004543304443359375,
0.03692626953125,
-0.0287628173828125,
0.010040283203125,
0.0020618438720703125,
0.0104522705078125,
-0.0308990478515625,
-0.01177215576171875,
0.007762908935546875,
-0.047607421875,
0.0008997917175292969,
-0.0242919921875,
-0.044189453125,
0.0166168212890625,
0.01629638671875,
-0.00919342041015625,
-0.027984619140625,
0.0153961181640625,
0.0650634765625,
0.04290771484375,
0.0231170654296875,
-0.0091552734375,
-0.00853729248046875,
-0.047210693359375,
0.007144927978515625,
0.00734710693359375,
0.0241851806640625,
-0.031402587890625,
-0.007534027099609375,
0.00983428955078125,
-0.003200531005859375,
0.00860595703125,
-0.0011539459228515625,
0.00498199462890625,
0.032501220703125,
-0.0178985595703125,
-0.0199432373046875,
-0.048309326171875,
0.056976318359375,
0.005283355712890625,
-0.0347900390625,
-0.016571044921875,
0.0631103515625,
-0.046417236328125,
-0.0283355712890625,
-0.06561279296875,
-0.03912353515625,
-0.01114654541015625,
0.035003662109375,
-0.10614013671875,
-0.102294921875,
0.005157470703125,
-0.034759521484375,
-0.00865936279296875,
0.0310821533203125,
-0.0196685791015625,
0.044036865234375,
-0.0435791015625,
-0.0093994140625,
0.0286102294921875,
0.015167236328125,
0.0455322265625,
0.023284912109375,
0.0276031494140625,
0.00348663330078125,
0.039825439453125,
0.00832366943359375,
-0.02655029296875,
0.058929443359375,
-0.0240325927734375,
-0.068603515625,
0.034332275390625,
0.004573822021484375,
0.045806884765625,
0.0177154541015625,
0.01346588134765625,
0.06976318359375,
0.022735595703125,
0.003688812255859375,
-0.043212890625,
0.019500732421875,
-0.007720947265625,
-0.0026645660400390625,
0.0004506111145019531,
-0.005615234375,
0.006175994873046875,
-0.0221099853515625,
0.034576416015625,
-0.01045989990234375,
0.045318603515625,
-0.04888916015625,
0.047576904296875,
-0.03936767578125,
0.042816162109375,
-0.005474090576171875,
0.00865936279296875,
-0.0025386810302734375,
-0.01678466796875,
-0.029266357421875,
0.019622802734375,
0.00743865966796875,
0.0181121826171875,
-0.017303466796875,
0.058685302734375,
-0.0128173828125,
0.076416015625,
-0.0079345703125,
-0.053985595703125,
0.006343841552734375,
-0.0208282470703125,
0.01678466796875,
-0.010986328125,
-0.0167388916015625,
-0.02044677734375,
0.00385284423828125,
-0.002780914306640625,
-0.0123138427734375,
0.0413818359375,
0.02667236328125,
0.038604736328125,
-0.021759033203125,
0.004421234130859375,
-0.0144500732421875,
-0.037017822265625,
-0.0208282470703125,
0.0288238525390625,
0.0517578125,
-0.00662994384765625,
-0.005100250244140625,
-0.03271484375,
0.00981903076171875,
-0.072021484375,
0.0152587890625,
-0.0249786376953125,
-0.0016088485717773438,
-0.005168914794921875,
0.0113677978515625,
0.0035381317138671875,
0.044525146484375,
0.04290771484375,
0.0223236083984375,
0.0302734375,
-0.01210784912109375,
-0.0285491943359375,
0.02911376953125,
-0.023345947265625,
0.02044677734375,
-0.0452880859375,
-0.0472412109375,
-0.0089263916015625,
0.005222320556640625,
-0.0167694091796875,
0.0187225341796875,
0.0089874267578125,
-0.00319671630859375,
-0.04052734375,
0.0311126708984375,
0.026123046875,
-0.0278167724609375,
-0.01165008544921875,
0.046051025390625,
-0.051177978515625,
-0.06146240234375,
0.030853271484375,
-0.0244140625,
-0.0200653076171875,
-0.026214599609375,
0.01435089111328125,
0.0220794677734375,
-0.0114898681640625,
-0.00324249267578125,
-0.01422882080078125,
0.0222320556640625,
-0.0289306640625,
0.021209716796875,
-0.005859375,
0.0300445556640625,
-0.0182037353515625,
-0.02960205078125,
0.023345947265625,
-0.00974273681640625,
-0.04278564453125,
0.0260162353515625,
-0.006259918212890625,
0.0086822509765625,
-0.0142059326171875,
0.025909423828125,
0.03668212890625,
-0.003894805908203125,
-0.0196685791015625,
0.0192718505859375,
-0.0250091552734375,
0.0016851425170898438,
0.01409912109375,
0.01012420654296875,
-0.0007886886596679688,
-0.019256591796875,
0.063232421875,
-0.0013799667358398438,
-0.0362548828125,
-0.025238037109375,
-0.05426025390625,
-0.051300048828125,
-0.01837158203125,
-0.09942626953125,
-0.01557159423828125,
0.0227203369140625,
-0.031890869140625,
0.026275634765625,
0.031097412109375,
-0.0206756591796875,
-0.0259552001953125,
0.07904052734375,
0.01407623291015625,
0.019775390625,
-0.009368896484375,
-0.036529541015625,
0.0159912109375,
-0.0269317626953125,
0.04364013671875,
-0.002716064453125,
-0.006744384765625,
0.016021728515625,
0.050872802734375,
0.0098419189453125,
-0.059967041015625,
0.0248870849609375,
-0.0188446044921875,
-0.035980224609375,
0.037109375,
0.01123046875,
-0.006969451904296875,
0.005794525146484375,
0.0177459716796875,
-0.00798797607421875,
-0.0054779052734375,
0.016845703125,
-0.03399658203125,
0.0008273124694824219,
-0.007030487060546875,
0.0157928466796875,
-0.053497314453125,
-0.01357269287109375,
0.0248870849609375,
0.0029506683349609375,
-0.0284881591796875,
-0.039154052734375,
-0.0193328857421875,
-0.05792236328125,
0.048614501953125,
0.0217742919921875,
-0.0017671585083007812,
0.001964569091796875,
0.0294342041015625,
0.033935546875,
0.01509857177734375,
0.0195770263671875,
0.02850341796875,
-0.052642822265625,
-0.0167694091796875,
0.00799560546875,
-0.0207977294921875,
0.0306854248046875,
-0.0160064697265625,
0.00537872314453125,
0.0197906494140625,
0.00803375244140625,
0.021087646484375,
-0.0032558441162109375,
0.0089111328125,
0.027923583984375,
0.0223388671875,
-0.0208740234375,
0.03790283203125,
-0.0287017822265625,
0.00153350830078125,
-0.040313720703125,
0.0279388427734375,
-0.051971435546875,
-0.0303802490234375,
-0.01410675048828125,
0.00579071044921875,
0.021240234375,
-0.019073486328125,
-0.00893402099609375,
-0.0271759033203125,
-0.10321044921875,
-0.0102691650390625,
-0.0013141632080078125,
-0.040283203125,
-0.02032470703125,
0.06121826171875,
-0.07073974609375,
-0.0256195068359375,
0.032958984375,
-0.022735595703125,
-0.021484375,
0.0494384765625,
-0.0220947265625,
-0.014251708984375,
-0.037506103515625,
0.0013523101806640625,
-0.042449951171875,
-0.00870513916015625,
-0.0240936279296875,
0.04754638671875,
0.033416748046875,
-0.01385498046875,
-0.0195465087890625,
0.022674560546875,
0.04986572265625,
0.02325439453125,
0.021728515625,
-0.031707763671875,
0.00666046142578125,
0.0006318092346191406,
0.0277557373046875,
-0.0255126953125,
0.031982421875,
0.0166015625,
-0.056427001953125,
-0.00560760498046875,
-0.0236358642578125,
0.00626373291015625,
0.035797119140625,
-0.055938720703125,
-0.0517578125,
-0.0257110595703125,
-0.050262451171875,
-0.023834228515625,
-0.005573272705078125,
-0.031463623046875,
-0.005313873291015625,
-0.060699462890625,
-0.0120391845703125,
-0.048553466796875,
-0.022979736328125,
0.02850341796875,
0.0006957054138183594,
0.0173492431640625,
0.0025386810302734375,
-0.01776123046875,
0.014556884765625,
0.0266265869140625,
-0.0328369140625,
0.075439453125,
0.045257568359375,
-0.01523590087890625,
0.0621337890625,
-0.0104827880859375,
0.053558349609375,
-0.06744384765625,
0.0279083251953125,
-0.00771331787109375,
0.0003638267517089844,
0.0271453857421875,
0.007404327392578125,
0.02264404296875,
-0.0194854736328125,
-0.006420135498046875,
-0.01155853271484375,
-0.01486968994140625,
0.030517578125,
0.023345947265625,
0.01049041748046875,
-0.0252838134765625,
-0.0311126708984375,
-0.0004444122314453125,
0.0093536376953125,
0.03717041015625,
0.01611328125,
0.01116180419921875,
0.024322509765625,
0.028533935546875,
-0.009124755859375,
-0.00563812255859375,
0.01428985595703125,
-0.042449951171875,
0.0494384765625,
-0.04534912109375,
-0.01348114013671875,
-0.003902435302734375,
0.00341796875,
0.08599853515625,
0.00443267822265625,
-0.027069091796875,
-0.046173095703125,
-0.00988006591796875,
-0.00012958049774169922,
-0.00893402099609375,
0.0072479248046875,
0.043548583984375,
-0.006557464599609375,
-0.015533447265625,
-0.01158905029296875,
-0.00151824951171875,
-0.035400390625,
-0.0531005859375,
-0.0015554428100585938,
0.003170013427734375,
-0.0199737548828125,
0.0127105712890625,
0.029388427734375,
0.018218994140625,
0.0177764892578125,
-0.018341064453125,
0.0245819091796875,
-0.006359100341796875,
0.0084228515625,
-0.0035152435302734375,
0.0302734375,
0.012451171875,
-0.0214691162109375,
0.0316162109375,
-0.01483154296875,
-0.031494140625,
0.027435302734375,
0.0142822265625,
-0.0009331703186035156,
0.0162811279296875,
-0.0100250244140625,
0.01055145263671875,
-0.036529541015625,
0.086181640625,
0.0229339599609375,
-0.08966064453125,
-0.020965576171875,
0.041259765625,
0.01593017578125,
-0.034423828125,
-0.01453399658203125,
0.0257415771484375,
-0.01010894775390625,
-0.003116607666015625,
-0.00010907649993896484,
-0.07781982421875,
0.017730712890625,
0.04119873046875,
-0.0225982666015625,
-0.0035419464111328125,
0.0108795166015625,
-0.0921630859375,
-0.06304931640625,
-0.004245758056640625,
0.0191497802734375,
0.042266845703125,
-0.00846099853515625,
0.01380157470703125,
-0.0260772705078125,
-0.0092010498046875,
-0.02313232421875,
-0.007587432861328125,
0.053802490234375,
0.024078369140625,
-0.037750244140625,
-0.0088958740234375,
-0.01149749755859375,
-0.0118255615234375,
-0.0264739990234375,
-0.024932861328125,
-0.009002685546875,
0.0004513263702392578,
-0.011260986328125,
-0.006198883056640625,
-0.01038360595703125,
0.0149993896484375,
-0.00501251220703125,
0.0242462158203125,
0.0192413330078125,
0.01293182373046875,
-0.0020275115966796875,
0.045379638671875,
0.01239776611328125,
0.0194244384765625,
0.0259857177734375,
0.031829833984375,
-0.0072021484375,
-0.0228729248046875,
-0.0007572174072265625,
-0.03582763671875,
-0.009796142578125,
-0.01210784912109375,
-0.0216064453125,
0.033172607421875,
0.064208984375,
0.007419586181640625,
0.003803253173828125,
-0.010406494140625,
0.0024852752685546875,
-0.044586181640625,
0.0307464599609375,
-0.0186920166015625,
-0.0066986083984375,
-0.006572723388671875,
-0.023773193359375,
0.027740478515625,
0.00856781005859375,
-0.004764556884765625,
-0.00014483928680419922,
-0.0211029052734375,
0.0132904052734375,
0.02032470703125,
-0.02569580078125,
0.04437255859375,
0.072509765625,
0.019195556640625,
0.03692626953125,
0.0184783935546875,
0.0224761962890625,
-0.0021991729736328125,
-0.01548004150390625,
0.03826904296875,
0.00901031494140625,
0.037384033203125,
-0.00814056396484375,
0.053436279296875,
0.047515869140625,
-0.005069732666015625,
0.0162506103515625,
0.0740966796875,
0.048126220703125,
-0.1195068359375,
0.0160675048828125,
0.01189422607421875,
0.0309600830078125,
0.060272216796875,
-0.003093719482421875,
0.0029315948486328125,
-0.037506103515625,
0.010406494140625,
-0.0205841064453125,
-0.0240631103515625,
-0.02044677734375,
-0.02020263671875,
-0.024688720703125,
0.003917694091796875,
0.052520751953125,
0.0140380859375,
0.032928466796875,
-0.0275421142578125,
-0.0372314453125,
0.0004916191101074219,
0.00426483154296875,
-0.01031494140625,
0.031768798828125,
-0.0280609130859375,
-0.05133056640625,
-0.0019283294677734375,
-0.048583984375,
-0.01413726806640625,
0.0291290283203125,
0.018463134765625,
-0.00759124755859375,
0.049713134765625,
-0.0289459228515625,
0.007678985595703125,
0.0188140869140625,
-0.02325439453125,
-0.01166534423828125,
-0.0462646484375,
0.01399993896484375,
-0.00774383544921875,
-0.0372314453125,
0.0189666748046875,
-0.0196533203125,
-0.05352783203125,
-0.0204010009765625,
0.020660400390625,
0.1279296875,
-0.033233642578125,
-0.0406494140625,
-0.00004279613494873047,
0.0253753662109375,
-0.0168609619140625,
-0.039306640625,
0.04632568359375,
-0.054656982421875,
-0.0117034912109375,
0.001300811767578125,
0.0017671585083007812,
-0.0177764892578125,
-0.036865234375,
-0.0811767578125,
0.08746337890625,
-0.026611328125,
0.051055908203125,
-0.0310211181640625,
0.042633056640625,
0.017242431640625,
0.0269012451171875,
-0.039520263671875,
0.057281494140625,
0.04290771484375,
0.026214599609375,
0.00029778480529785156,
-0.004604339599609375,
0.0186614990234375,
0.0019521713256835938,
-0.0222015380859375,
-0.007740020751953125,
0.0177154541015625,
0.0025539398193359375,
0.033447265625,
0.02154541015625,
0.007472991943359375,
0.005023956298828125,
-0.0016937255859375,
-0.0084228515625,
0.026092529296875,
-0.028411865234375,
0.047882080078125,
-0.056854248046875,
-0.005512237548828125,
0.006061553955078125,
0.01500701904296875,
0.0184478759765625,
-0.0309906005859375,
-0.0007524490356445312,
-0.01177215576171875,
-0.00797271728515625,
0.00945281982421875,
-0.0167236328125,
-0.00311279296875,
-0.0192413330078125,
-0.0268096923828125,
-0.011749267578125,
0.00637054443359375,
-0.0176544189453125,
0.0156402587890625,
0.0196075439453125,
0.00626373291015625,
0.01032257080078125,
0.02264404296875,
0.0008769035339355469,
-0.032318115234375,
0.0024013519287109375,
0.017120361328125,
-0.038421630859375,
0.040618896484375,
0.0112457275390625,
0.025848388671875,
-0.048309326171875,
-0.0070343017578125,
0.02825927734375,
0.05303955078125,
-0.04058837890625,
-0.03466796875,
0.007476806640625,
0.00942230224609375,
0.0191650390625,
0.0169525146484375,
0.032745361328125,
-0.0095367431640625,
0.033966064453125,
-0.03204345703125,
0.00296783447265625,
0.017852783203125,
0.0115814208984375,
-0.01495361328125,
-0.0204315185546875,
-0.007274627685546875,
0.0248870849609375,
-0.053497314453125,
0.00923919677734375,
0.021148681640625,
0.05267333984375,
0.0225677490234375,
0.06256103515625,
0.0173187255859375,
-0.029510498046875,
-0.0068511962890625,
-0.00028967857360839844,
-0.03607177734375,
0.01422119140625,
-0.0755615234375,
-0.063232421875,
0.0064849853515625,
0.052459716796875,
0.0242919921875,
0.033905029296875,
0.039703369140625,
-0.0020046234130859375,
-0.0083465576171875,
0.006633758544921875,
0.0279541015625,
-0.0263214111328125,
-0.014495849609375,
-0.004558563232421875,
-0.01239776611328125,
-0.006031036376953125,
-0.01291656494140625,
0.004116058349609375,
0.018646240234375,
-0.00005936622619628906,
-0.035186767578125,
-0.0147857666015625,
-0.0032958984375,
-0.0233306884765625,
0.04986572265625,
0.00691986083984375,
0.006084442138671875,
0.0092620849609375,
-0.09246826171875,
-0.030731201171875,
-0.01248931884765625,
0.0170135498046875,
0.0090484619140625,
0.017364501953125,
-0.039764404296875,
0.07342529296875,
0.01031494140625,
0.006076812744140625,
-0.01134490966796875,
-0.005435943603515625,
0.00847625732421875,
-0.0035552978515625,
0.023468017578125,
0.0112152099609375,
-0.0009732246398925781,
0.0133056640625,
0.0167236328125,
-0.0023708343505859375,
0.01079559326171875,
0.01523590087890625,
0.0079345703125,
0.0005841255187988281,
-0.01568603515625,
0.0008864402770996094,
-0.03009033203125,
-0.015777587890625,
0.002033233642578125,
-0.00252532958984375,
-0.00498199462890625,
0.0025730133056640625,
-0.030242919921875,
0.0105133056640625,
0.04571533203125,
-0.02410888671875,
-0.0200653076171875,
0.040496826171875,
0.01285552978515625,
-0.0038928985595703125,
-0.00884246826171875,
-0.0318603515625,
0.0033969879150390625,
0.0042266845703125,
-0.0178070068359375,
0.005096435546875,
-0.007160186767578125,
0.017791748046875,
0.0278472900390625,
-0.0146026611328125,
-0.0012569427490234375,
-0.01352691650390625,
-0.00415802001953125,
-0.031646728515625,
0.0226593017578125,
-0.0250091552734375,
0.01934814453125,
0.056671142578125,
0.00513458251953125,
0.049774169921875,
0.017730712890625,
0.0164031982421875,
0.0689697265625,
-0.0242767333984375,
0.00984954833984375,
-0.02972412109375,
-0.0064849853515625,
-0.03155517578125,
-0.0252532958984375,
0.00472259521484375,
-0.01067352294921875,
-0.03131103515625,
0.029022216796875,
-0.04339599609375,
-0.0345458984375,
0.003360748291015625,
0.01561737060546875,
-0.0171966552734375,
-0.054534912109375,
-0.105712890625,
0.00875091552734375,
0.02911376953125,
0.038604736328125,
-0.11505126953125,
0.058837890625,
0.01300811767578125,
0.06414794921875,
-0.0011806488037109375,
0.0550537109375,
-0.040985107421875,
-0.03533935546875,
-0.028717041015625,
-0.00616455078125,
-0.05181884765625,
0.050628662109375,
-0.0079803466796875,
0.0010614395141601562,
0.01371002197265625,
-0.0170440673828125,
0.03472900390625,
-0.004528045654296875,
0.0102081298828125,
0.041656494140625,
0.0003910064697265625,
-0.00867462158203125,
0.00942230224609375,
-0.00835418701171875,
0.00528717041015625,
-0.0287628173828125,
-0.006496429443359375,
-0.052032470703125,
-0.00687408447265625,
0.00717926025390625,
-0.0075531005859375,
0.0008778572082519531,
-0.053131103515625,
-0.10345458984375,
0.03753662109375,
-0.0018596649169921875,
-0.043548583984375,
0.018524169921875,
-0.01117706298828125,
-0.0221099853515625,
0.00797271728515625,
0.0014162063598632812,
0.001544952392578125,
-0.0017366409301757812,
0.0230712890625,
0.016357421875,
0.0743408203125,
-0.0103607177734375,
0.016998291015625,
-0.007137298583984375,
0.0311279296875,
0.003261566162109375,
0.032440185546875,
0.029998779296875,
-0.0175018310546875,
0.050933837890625,
0.056884765625,
-0.0263519287109375,
0.013336181640625,
-0.0185394287109375,
-0.052886962890625,
0.01108551025390625,
-0.034698486328125,
-0.0245208740234375,
-0.01312255859375,
0.07049560546875,
0.0233612060546875,
0.027252197265625,
-0.017852783203125,
-0.02874755859375,
-0.034423828125,
0.011566162109375,
-0.02813720703125,
0.0222015380859375,
-0.092529296875,
-0.0242462158203125,
0.0248260498046875,
-0.0199127197265625,
-0.041046142578125,
0.00576019287109375,
-0.051605224609375,
-0.00786590576171875,
0.0103912353515625,
0.0248565673828125,
-0.023651123046875,
0.036865234375,
0.053070068359375,
-0.04815673828125,
-0.0187530517578125,
-0.005584716796875,
-0.005565643310546875,
0.018402099609375,
-0.0399169921875,
-0.002960205078125,
-0.0094146728515625,
-0.061614990234375,
0.040924072265625,
-0.024566650390625,
0.052642822265625,
-0.0703125,
-0.0291748046875,
-0.01367950439453125,
0.0222625732421875,
0.00299835205078125,
0.02899169921875,
-0.004932403564453125,
0.04547119140625,
0.0190887451171875,
0.0286102294921875,
0.0056304931640625,
0.04852294921875,
-0.014862060546875,
0.05230712890625,
0.016876220703125,
-0.038543701171875,
0.041534423828125,
-0.0283355712890625,
-0.006671905517578125,
-0.0015926361083984375,
-0.0345458984375,
-0.07672119140625,
0.041595458984375,
0.0184478759765625,
0.015838623046875,
0.0377197265625
] |
2700a933ff1f1c23bf4f81fb45bf0edc584e8a5c
|
Wordpress Stackexchange
Q: Should we use get_template_part() in functions files instead of include_once? I'm using the theme-check plugin to check my theme for errors and recommendations, I'm using get_template_part() in theme files like header.php and index.php but in functions.php I'm using include_once() theme-check is not pointing at these, it's pointing at include_once used in a widgets.php file which is included in functions.php
my question is should we use get_template_part() instead of all include_once() and include() or just use it for getting frequently used markup only ? I know it's only recommended to use get_template_part() but I like to follow best practices and recommendations.
thanks in advance.
A: Your functions.php doesn’t create output, so you should use locate_template().
Example:
locate_template( 'php/functions.nav-menu.php', TRUE, TRUE );
You’ll find this function in wp-includes/theme.php. The first parameter is the file path relative to the theme root, the second tells WordPress to load it (or not), and the third to load it just once.
Now a child theme can override the file by just placing a file with the same name to the same place in its own theme root.
|
Q: Should we use get_template_part() in functions files instead of include_once? I'm using the theme-check plugin to check my theme for errors and recommendations, I'm using get_template_part() in theme files like header.php and index.php but in functions.php I'm using include_once() theme-check is not pointing at these, it's pointing at include_once used in a widgets.php file which is included in functions.php
my question is should we use get_template_part() instead of all include_once() and include() or just use it for getting frequently used markup only ? I know it's only recommended to use get_template_part() but I like to follow best practices and recommendations.
thanks in advance.
A: Your functions.php doesn’t create output, so you should use locate_template().
Example:
locate_template( 'php/functions.nav-menu.php', TRUE, TRUE );
You’ll find this function in wp-includes/theme.php. The first parameter is the file path relative to the theme root, the second tells WordPress to load it (or not), and the third to load it just once.
Now a child theme can override the file by just placing a file with the same name to the same place in its own theme root.
|
wordpress
|
{
"language": "en",
"length": 182,
"provenance": "stackexchange_00019.jsonl.gz:418849",
"question_score": "10",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48283"
}
|
[
0.03375244140625,
-0.0088958740234375,
0.0165557861328125,
-0.0391845703125,
0.00145721435546875,
0.00411224365234375,
0.00423431396484375,
-0.0228729248046875,
-0.01372528076171875,
0.037139892578125,
-0.0256805419921875,
0.027191162109375,
-0.01280975341796875,
-0.0008225440979003906,
-0.023651123046875,
-0.0172271728515625,
0.0240020751953125,
-0.039398193359375,
-0.001148223876953125,
-0.01264190673828125,
0.03802490234375,
0.005615234375,
-0.0225982666015625,
0.0284576416015625,
0.031494140625,
-0.059295654296875,
0.015777587890625,
-0.0216827392578125,
-0.0051116943359375,
-0.043304443359375,
0.016815185546875,
0.053558349609375,
0.01239776611328125,
0.006992340087890625,
-0.01739501953125,
-0.024658203125,
-0.006626129150390625,
0.01514434814453125,
-0.0028667449951171875,
0.020050048828125,
0.0223541259765625,
-0.017181396484375,
-0.02349853515625,
0.0540771484375,
-0.0235748291015625,
-0.046417236328125,
0.0121917724609375,
-0.042816162109375,
-0.004871368408203125,
0.041259765625,
0.035552978515625,
-0.036651611328125,
0.04296875,
-0.002292633056640625,
-0.0107421875,
-0.028411865234375,
-0.0185394287109375,
-0.011383056640625,
0.031524658203125,
0.00923919677734375,
-0.020782470703125,
-0.00942230224609375,
0.0159912109375,
-0.016571044921875,
-0.0019702911376953125,
-0.00411224365234375,
-0.011505126953125,
0.0260467529296875,
-0.0682373046875,
-0.0093536376953125,
0.04095458984375,
-0.050079345703125,
0.0009860992431640625,
-0.0123138427734375,
-0.004123687744140625,
-0.0140380859375,
0.0173187255859375,
-0.018035888671875,
0.0043792724609375,
0.01090240478515625,
-0.036773681640625,
0.002910614013671875,
-0.021636962890625,
-0.0526123046875,
0.025726318359375,
-0.004604339599609375,
-0.02032470703125,
0.0015478134155273438,
-0.04534912109375,
-0.0018510818481445312,
-0.0302581787109375,
-0.0269012451171875,
-0.0259246826171875,
-0.0123291015625,
0.01165008544921875,
-0.0247039794921875,
0.01194000244140625,
0.077392578125,
-0.02947998046875,
0.050018310546875,
-0.0172271728515625,
-0.022918701171875,
0.051788330078125,
-0.059661865234375,
0.019317626953125,
0.0675048828125,
-0.028961181640625,
0.036651611328125,
0.054595947265625,
0.038055419921875,
0.03973388671875,
-0.0037860870361328125,
-0.0171661376953125,
-0.0762939453125,
-0.0023956298828125,
0.05218505859375,
-0.009735107421875,
-0.00934600830078125,
0.035980224609375,
0.0022029876708984375,
0.03485107421875,
0.031585693359375,
0.038818359375,
-0.0295562744140625,
-0.01262664794921875,
-0.01065826416015625,
-0.046112060546875,
-0.046905517578125,
-0.06298828125,
0.053009033203125,
-0.0105743408203125,
-0.00811004638671875,
-0.0008778572082519531,
0.023712158203125,
-0.03302001953125,
-0.032867431640625,
-0.00829315185546875,
0.0144195556640625,
0.0263519287109375,
-0.04315185546875,
0.00833892822265625,
0.0008416175842285156,
0.0216217041015625,
0.0157012939453125,
-0.0357666015625,
-0.0103759765625,
0.0183258056640625,
0.0179595947265625,
-0.0020351409912109375,
-0.0240631103515625,
0.0061187744140625,
-0.03497314453125,
0.0273590087890625,
0.002826690673828125,
0.0001436471939086914,
-0.046295166015625,
-0.032135009765625,
-0.0194244384765625,
0.0285186767578125,
-0.0096435546875,
-0.0113983154296875,
-0.01491546630859375,
-0.0151214599609375,
-0.055877685546875,
-0.064208984375,
0.0106353759765625,
0.0098876953125,
0.005706787109375,
0.01351165771484375,
-0.01206207275390625,
0.01898193359375,
-0.0193634033203125,
-0.01605224609375,
0.0257568359375,
0.0257415771484375,
0.035888671875,
0.0196075439453125,
0.038360595703125,
-0.00849151611328125,
0.0401611328125,
-0.01361083984375,
-0.05084228515625,
0.062408447265625,
-0.048187255859375,
-0.07489013671875,
0.015777587890625,
0.004241943359375,
0.0263824462890625,
0.0300750732421875,
0.0159912109375,
0.052581787109375,
0.01549530029296875,
-0.0277252197265625,
0.030181884765625,
0.007171630859375,
-0.02886962890625,
0.0092926025390625,
0.0038661956787109375,
-0.005054473876953125,
-0.0221405029296875,
0.02667236328125,
-0.019683837890625,
0.0374755859375,
-0.01499176025390625,
-0.04364013671875,
0.01181793212890625,
-0.038055419921875,
0.0279693603515625,
-0.0179595947265625,
0.04376220703125,
0.00942230224609375,
0.021759033203125,
-0.03961181640625,
0.0107574462890625,
-0.0014209747314453125,
-0.01898193359375,
-0.00527191162109375,
0.039398193359375,
0.007495880126953125,
0.035186767578125,
0.0211181640625,
-0.005817413330078125,
0.005126953125,
0.024871826171875,
0.00626373291015625,
0.0291595458984375,
-0.0421142578125,
-0.00696563720703125,
-0.068115234375,
0.03875732421875,
-0.08367919921875,
0.049774169921875,
-0.0007677078247070312,
0.0186767578125,
-0.030181884765625,
-0.0070953369140625,
-0.00128936767578125,
-0.012969970703125,
-0.00439453125,
0.0250701904296875,
0.040191650390625,
0.042266845703125,
-0.020782470703125,
-0.005126953125,
0.029571533203125,
-0.08843994140625,
-0.01349639892578125,
0.010986328125,
0.0298004150390625,
0.01125335693359375,
0.01192474365234375,
-0.0266571044921875,
0.0299224853515625,
-0.034332275390625,
0.0239105224609375,
0.0253448486328125,
-0.042144775390625,
-0.0281982421875,
-0.0279998779296875,
0.01255035400390625,
0.020843505859375,
-0.0141448974609375,
-0.00390625,
-0.0010442733764648438,
0.0413818359375,
-0.00496673583984375,
0.0165863037109375,
0.0026798248291015625,
-0.0262451171875,
0.004817962646484375,
0.0177001953125,
0.0027065277099609375,
0.01071929931640625,
0.06243896484375,
-0.0216522216796875,
0.004940032958984375,
-0.01384735107421875,
-0.00952911376953125,
-0.036956787109375,
0.01129913330078125,
-0.0169830322265625,
0.029632568359375,
-0.040283203125,
-0.00754547119140625,
-0.03265380859375,
-0.03668212890625,
-0.0111541748046875,
0.0281524658203125,
0.065673828125,
0.0364990234375,
0.040557861328125,
0.0196075439453125,
-0.0222320556640625,
0.07183837890625,
-0.0328369140625,
-0.0193939208984375,
0.0127716064453125,
0.01187896728515625,
-0.01262664794921875,
0.01551055908203125,
0.0460205078125,
0.03076171875,
-0.0025119781494140625,
-0.007129669189453125,
-0.000980377197265625,
0.023040771484375,
0.02288818359375,
-0.0184478759765625,
-0.021026611328125,
-0.041473388671875,
-0.01541900634765625,
-0.0123443603515625,
0.0259246826171875,
0.05078125,
-0.018341064453125,
-0.052490234375,
-0.0153656005859375,
0.0013399124145507812,
-0.06549072265625,
-0.056854248046875,
0.0105438232421875,
-0.044952392578125,
-0.00885009765625,
-0.003070831298828125,
-0.032196044921875,
-0.0299072265625,
0.01165771484375,
0.0113067626953125,
0.01568603515625,
-0.03192138671875,
-0.05010986328125,
-0.05279541015625,
-0.07843017578125,
-0.020050048828125,
-0.0018281936645507812,
-0.0008544921875,
-0.0188446044921875,
0.081787109375,
-0.006786346435546875,
-0.0726318359375,
-0.0299530029296875,
0.053009033203125,
-0.00904083251953125,
-0.006366729736328125,
0.0276641845703125,
-0.03302001953125,
-0.029327392578125,
0.0237884521484375,
-0.053924560546875,
-0.0269012451171875,
0.0095062255859375,
-0.037811279296875,
-0.022674560546875,
-0.03289794921875,
0.025238037109375,
0.061065673828125,
0.0104522705078125,
0.0026149749755859375,
0.0760498046875,
-0.025482177734375,
-0.0447998046875,
-0.017578125,
-0.06427001953125,
0.052459716796875,
0.0523681640625,
-0.004390716552734375,
0.00431060791015625,
-0.0004127025604248047,
0.032989501953125,
0.006534576416015625,
0.019012451171875,
-0.0012598037719726562,
0.051483154296875,
0.004100799560546875,
0.0185546875,
-0.0538330078125,
0.0206146240234375,
-0.020050048828125,
-0.0244903564453125,
-0.0068511962890625,
0.01346588134765625,
-0.00865936279296875,
0.0082550048828125,
-0.035919189453125,
-0.02874755859375,
0.03173828125,
0.004451751708984375,
0.035797119140625,
-0.030792236328125,
-0.015960693359375,
-0.02301025390625,
0.0731201171875,
0.0019550323486328125,
-0.018707275390625,
-0.0033512115478515625,
-0.000751495361328125,
-0.042449951171875,
-0.0173492431640625,
-0.0399169921875,
0.0009188652038574219,
-0.044281005859375,
-0.0029773712158203125,
-0.01080322265625,
-0.0169677734375,
-0.0102691650390625,
0.0104217529296875,
-0.0204315185546875,
-0.021881103515625,
0.00986480712890625,
-0.000026881694793701172,
0.009246826171875,
0.058441162109375,
-0.01448822021484375,
0.0298919677734375,
-0.004131317138671875,
-0.043426513671875,
-0.0277557373046875,
-0.01181793212890625,
-0.06982421875,
0.08392333984375,
0.07861328125,
-0.043792724609375,
-0.006500244140625,
0.036346435546875,
0.0263824462890625,
0.0183258056640625,
0.014984130859375,
0.00405120849609375,
0.00943756103515625,
-0.0135498046875,
0.0234375,
-0.0267791748046875,
-0.01499176025390625,
-0.02069091796875,
-0.0933837890625,
-0.020965576171875,
-0.0011892318725585938,
0.01084136962890625,
0.0645751953125,
-0.035186767578125,
-0.04620361328125,
-0.0236663818359375,
0.004276275634765625,
-0.00777435302734375,
0.03594970703125,
-0.031280517578125,
-0.01549530029296875,
-0.0303802490234375,
0.0352783203125,
0.0186614990234375,
-0.0035400390625,
0.00433349609375,
0.07537841796875,
0.025421142578125,
-0.03839111328125,
-0.0130767822265625,
0.0124664306640625,
0.031768798828125,
-0.0323486328125,
0.0109405517578125,
0.0030841827392578125,
-0.050262451171875,
0.06427001953125,
-0.0027561187744140625,
-0.00742340087890625,
0.003108978271484375,
0.06890869140625,
-0.0012845993041992188,
-0.01290130615234375,
0.019073486328125,
-0.01352691650390625,
-0.016448974609375,
0.0259246826171875,
0.01520538330078125,
-0.043426513671875,
0.01444244384765625,
0.049041748046875,
0.00037598609924316406,
-0.005695343017578125,
-0.044647216796875,
-0.024200439453125,
-0.01157379150390625,
0.05816650390625,
0.02752685546875,
0.0302886962890625,
0.01168060302734375,
0.036956787109375,
0.050872802734375,
-0.01277923583984375,
0.0584716796875,
0.05718994140625,
-0.003269195556640625,
0.0259552001953125,
0.0443115234375,
-0.0229949951171875,
-0.01441192626953125,
-0.00273895263671875,
0.0171661376953125,
0.0042877197265625,
-0.0005502700805664062,
-0.0253448486328125,
0.00475311279296875,
-0.01560211181640625,
-0.005649566650390625,
-0.00757598876953125,
0.04010009765625,
-0.012237548828125,
-0.031768798828125,
-0.0027446746826171875,
-0.034515380859375,
-0.033660888671875,
-0.04345703125,
-0.00765228271484375,
0.01430511474609375,
-0.023406982421875,
0.0294952392578125,
-0.0284423828125,
0.0197296142578125,
-0.026336669921875,
-0.01538848876953125,
-0.001575469970703125,
-0.01187896728515625,
0.01641845703125,
0.031402587890625,
-0.025665283203125,
0.0048370361328125,
-0.00901031494140625,
0.0225982666015625,
-0.0178070068359375,
-0.0029582977294921875,
-0.007534027099609375,
0.0298919677734375,
-0.04132080078125,
-0.0225677490234375,
0.034210205078125,
-0.01983642578125,
0.0091552734375,
0.0274505615234375,
0.006092071533203125,
-0.035736083984375,
-0.005889892578125,
0.011749267578125,
0.0224609375,
-0.0129547119140625,
-0.0130767822265625,
0.0301361083984375,
-0.0012788772583007812,
0.010345458984375,
0.02691650390625,
-0.058929443359375,
0.0228271484375,
0.03753662109375,
-0.0382080078125,
0.0007610321044921875,
0.024139404296875,
-0.07318115234375,
-0.047088623046875,
-0.006168365478515625,
-0.0203094482421875,
0.053985595703125,
-0.0260162353515625,
0.0042877197265625,
-0.0168914794921875,
-0.00476837158203125,
-0.0262451171875,
0.01345062255859375,
0.057830810546875,
0.0296478271484375,
-0.0574951171875,
-0.0038661956787109375,
-0.053466796875,
-0.002532958984375,
-0.05743408203125,
-0.07171630859375,
-0.03521728515625,
0.0228271484375,
-0.03265380859375,
0.01100921630859375,
-0.007114410400390625,
0.03582763671875,
0.01297760009765625,
0.017425537109375,
-0.0419921875,
0.037933349609375,
-0.043487548828125,
0.08636474609375,
0.022613525390625,
0.0051422119140625,
-0.0045623779296875,
0.0230560302734375,
-0.01541900634765625,
0.01308441162109375,
0.00963592529296875,
0.00415802001953125,
0.0082244873046875,
-0.045074462890625,
0.01690673828125,
-0.00800323486328125,
0.072998046875,
0.005916595458984375,
0.04351806640625,
-0.02490234375,
0.00409698486328125,
-0.006866455078125,
0.0214080810546875,
-0.043121337890625,
-0.01210784912109375,
0.041259765625,
-0.0095977783203125,
-0.01375579833984375,
0.01319122314453125,
-0.038330078125,
0.044921875,
0.0308837890625,
0.00794219970703125,
-0.031402587890625,
-0.06884765625,
0.08062744140625,
0.035491943359375,
0.01502227783203125,
0.0272369384765625,
-0.0179595947265625,
0.004085540771484375,
-0.0154876708984375,
0.025390625,
-0.037567138671875,
-0.0185699462890625,
0.035919189453125,
-0.006801605224609375,
-0.0133209228515625,
0.004451751708984375,
-0.020843505859375,
-0.012451171875,
0.03692626953125,
0.02294921875,
-0.06494140625,
0.00043082237243652344,
-0.009521484375,
0.005828857421875,
0.0001137852668762207,
-0.006069183349609375,
-0.0207672119140625,
-0.045867919921875,
0.05999755859375,
0.0019664764404296875,
-0.00040435791015625,
0.023834228515625,
-0.016143798828125,
-0.0126953125,
-0.0265960693359375,
0.08306884765625,
0.0185089111328125,
-0.002338409423828125,
-0.01418304443359375,
0.00695037841796875,
0.006443023681640625,
-0.00769805908203125,
0.03887939453125,
-0.034423828125,
0.0019445419311523438,
-0.008148193359375,
-0.000047147274017333984,
-0.0168609619140625,
-0.00971221923828125,
0.0322265625,
0.00374603271484375,
0.0134735107421875,
0.036163330078125,
-0.01084136962890625,
0.0198822021484375,
-0.003383636474609375,
-0.00553131103515625,
-0.049713134765625,
-0.00562286376953125,
0.00787353515625,
0.031280517578125,
-0.033935546875,
0.0203399658203125,
-0.0443115234375,
0.01050567626953125,
-0.0228271484375,
-0.018341064453125,
0.06951904296875,
-0.025787353515625,
-0.0166168212890625,
0.023651123046875,
0.0287322998046875,
-0.01421356201171875,
-0.0028362274169921875,
0.07049560546875,
-0.06707763671875,
-0.023651123046875,
0.029541015625,
-0.007480621337890625,
-0.049774169921875,
0.0024814605712890625,
-0.05340576171875,
0.129150390625,
0.037261962890625,
0.0230865478515625,
0.0164794921875,
0.060089111328125,
-0.0540771484375,
0.031097412109375,
-0.02490234375,
0.022674560546875,
0.038238525390625,
0.04547119140625,
-0.0241851806640625,
-0.0082855224609375,
0.0030364990234375,
0.035186767578125,
0.01495361328125,
0.00495147705078125,
0.0095367431640625,
0.018768310546875,
0.06402587890625,
0.043975830078125,
0.017303466796875,
0.0003447532653808594,
0.0134124755859375,
0.0084686279296875,
0.005115509033203125,
-0.03460693359375,
0.0211334228515625,
-0.03607177734375,
-0.0041961669921875,
0.0285186767578125,
-0.002162933349609375,
-0.0126495361328125,
-0.0288848876953125,
-0.037139892578125,
-0.043487548828125,
-0.0208740234375,
0.0239715576171875,
-0.01312255859375,
-0.0033130645751953125,
-0.0230865478515625,
0.01468658447265625,
-0.08172607421875,
0.01470947265625,
-0.027740478515625,
0.038665771484375,
0.0125732421875,
0.023193359375,
-0.00855255126953125,
0.006076812744140625,
0.0154876708984375,
0.0005826950073242188,
-0.00604248046875,
0.034332275390625,
0.00001049041748046875,
0.042694091796875,
0.00678253173828125,
0.043609619140625,
-0.008148193359375,
0.030853271484375,
0.0125579833984375,
0.031463623046875,
-0.023223876953125,
-0.004276275634765625,
0.004299163818359375,
0.0176239013671875,
-0.0144195556640625,
0.0060272216796875,
0.01409912109375,
0.031341552734375,
0.039520263671875,
0.00748443603515625,
-0.025390625,
0.0138092041015625,
-0.0014972686767578125,
-0.004505157470703125,
-0.0008335113525390625,
0.0248260498046875,
0.01139068603515625,
-0.037811279296875,
0.0474853515625,
0.0101318359375,
0.0196685791015625,
-0.017120361328125,
0.055694580078125,
0.00487518310546875,
-0.0033664703369140625,
-0.024566650390625,
0.0313720703125,
-0.01910400390625,
0.0194091796875,
-0.0196533203125,
-0.024017333984375,
0.00955963134765625,
0.0283050537109375,
0.00757598876953125,
-0.021636962890625,
0.01416015625,
0.01485443115234375,
-0.0321044921875,
-0.009521484375,
0.02685546875,
-0.01534271240234375,
0.027587890625,
-0.029052734375,
-0.007007598876953125,
-0.01186370849609375,
-0.0156402587890625,
-0.017852783203125,
-0.022552490234375,
0.0304412841796875,
-0.0194091796875,
0.023529052734375,
-0.008697509765625,
-0.0019388198852539062,
0.042266845703125,
-0.026519775390625,
0.03619384765625,
0.00799560546875,
-0.055938720703125,
0.002105712890625,
-0.0175323486328125,
-0.057037353515625,
0.00821685791015625,
0.041046142578125,
-0.0240936279296875,
0.01514434814453125,
0.0159149169921875,
0.00548553466796875,
0.00830078125,
-0.005519866943359375,
-0.006237030029296875,
0.00022172927856445312,
0.036041259765625,
0.0137481689453125,
-0.01183319091796875,
-0.007442474365234375,
-0.01849365234375,
0.0467529296875,
0.04815673828125,
0.06158447265625,
-0.0251922607421875,
0.03729248046875,
-0.006988525390625,
0.01459503173828125,
-0.031707763671875,
-0.02166748046875,
0.04095458984375,
-0.01812744140625,
-0.0160064697265625,
-0.006694793701171875,
-0.0928955078125,
0.005855560302734375,
0.04058837890625,
-0.0489501953125,
0.03765869140625,
0.0245208740234375,
0.0058441162109375,
-0.051116943359375,
0.0021514892578125,
-0.01255035400390625,
-0.00800323486328125,
-0.02325439453125,
0.002429962158203125,
0.043548583984375,
0.0240478515625,
-0.027313232421875,
0.03363037109375,
0.021209716796875,
-0.023193359375,
-0.0008521080017089844,
-0.0231475830078125,
0.00597381591796875,
0.0306396484375,
-0.00865936279296875,
-0.042938232421875,
0.0011816024780273438,
-0.017913818359375,
0.0020503997802734375,
0.01067352294921875,
0.034942626953125,
-0.011016845703125,
-0.03216552734375,
0.024322509765625,
0.00339508056640625,
0.022186279296875,
-0.05975341796875,
0.005115509033203125,
0.0260467529296875,
0.0150146484375,
0.0096282958984375,
-0.021026611328125,
-0.005817413330078125,
-0.0235748291015625,
-0.016082763671875,
0.0034122467041015625,
-0.0135498046875,
-0.02349853515625,
-0.0015277862548828125,
0.0259246826171875,
0.0333251953125,
-0.0042724609375,
-0.057464599609375,
0.033172607421875,
-0.033477783203125,
0.06976318359375,
-0.021728515625,
-0.01340484619140625,
0.005645751953125,
0.00807952880859375,
-0.025848388671875,
0.01131439208984375,
-0.0186920166015625,
-0.01239776611328125,
0.00811767578125,
0.023040771484375,
0.05792236328125,
-0.001316070556640625,
-0.0295562744140625,
0.0587158203125,
0.007770538330078125,
0.1112060546875,
-0.078369140625,
-0.0307769775390625,
0.02001953125,
-0.00995635986328125,
0.005580902099609375,
0.0019683837890625,
-0.00811767578125,
-0.0143280029296875,
0.0081329345703125,
0.007602691650390625,
0.000598907470703125,
0.0082550048828125,
-0.046478271484375,
-0.0892333984375,
0.04150390625,
-0.0079803466796875,
-0.045196533203125,
-0.04681396484375,
-0.03857421875,
-0.0108184814453125,
0.0318603515625,
-0.0194244384765625,
0.0014591217041015625,
-0.0340576171875,
0.06707763671875,
0.0138702392578125,
0.027130126953125,
0.03277587890625,
0.0008635520935058594,
-0.0509033203125,
-0.005786895751953125,
-0.028289794921875,
0.00849151611328125,
-0.0262908935546875,
-0.009796142578125,
0.0212249755859375,
0.03240966796875,
-0.040130615234375,
-0.030120849609375,
0.0158233642578125,
0.0302734375,
-0.0295867919921875,
-0.007526397705078125,
0.00197601318359375,
0.01152801513671875,
0.0635986328125,
0.03662109375,
0.006053924560546875,
-0.05157470703125,
-0.0166015625,
-0.009490966796875,
-0.06707763671875,
0.004184722900390625,
0.04669189453125,
-0.07659912109375,
0.0179290771484375,
0.0214385986328125,
-0.058837890625,
-0.003025054931640625,
-0.007709503173828125,
-0.0701904296875,
0.042205810546875,
-0.036407470703125,
-0.013519287109375,
-0.0258026123046875,
-0.034820556640625,
0.0367431640625,
-0.005889892578125,
0.0120391845703125,
-0.0136871337890625,
0.03350830078125,
0.005603790283203125,
0.01403045654296875,
0.034332275390625,
0.06793212890625,
-0.08856201171875,
-0.0230712890625,
0.0216217041015625,
0.023468017578125,
-0.0274658203125,
-0.01177978515625,
0.0136260986328125,
-0.0108795166015625,
-0.01318359375,
-0.042236328125,
-0.0237579345703125,
0.06622314453125,
-0.034393310546875,
0.09033203125,
-0.01666259765625,
0.115478515625,
-0.00959014892578125,
0.059326171875,
-0.00811004638671875,
-0.0012989044189453125,
0.00699615478515625,
-0.0124053955078125,
0.00600433349609375,
0.022003173828125,
-0.01312255859375,
-0.035369873046875,
0.01171112060546875,
-0.03375244140625,
0.0035419464111328125,
0.0005283355712890625
] |
9ca8e133cf8ac6e0a01d2801350c8187a555df2a
|
Wordpress Stackexchange
Q: What is the function to get plugin base url in multisite? I'm using this function plugins_url().
But it always echoes main site url even in subsite.
So i'm getting ajax errors like Domains, protocols and ports must match.
Lets say my main domain name is blahblah.com and my subdomain is mysubdomain.blahblah.com
Is there any function available that returns mysubdomain.blahblah.com/wp-content/plugins instead of blahblah.com/wp-content/plugins?
Thanks
Update:
As of now i'm using like this.
home_url( '/' ).'wp-content/plugins/'.str_replace(basename(__FILE__),"",plugin_basename(__FILE__))
Here wp-content/plugins/ text hard coded.
So any other alternative method there?
A: The plugins_url() function is designed to work in WordPress Multisite. Here is an example of its proper usage:
<?php
echo "<img src="' .plugins_url( 'images/wordpress.png' , __FILE__ ). '" > ';
?>
If you are using this function in a file that is nested inside a
subdirectory, you should use PHP's dirname() function:
<?php
echo "<img src="' .plugins_url( 'images/wordpress.png' , dirname(__FILE__) ). '" > ';
?>
|
Q: What is the function to get plugin base url in multisite? I'm using this function plugins_url().
But it always echoes main site url even in subsite.
So i'm getting ajax errors like Domains, protocols and ports must match.
Lets say my main domain name is blahblah.com and my subdomain is mysubdomain.blahblah.com
Is there any function available that returns mysubdomain.blahblah.com/wp-content/plugins instead of blahblah.com/wp-content/plugins?
Thanks
Update:
As of now i'm using like this.
home_url( '/' ).'wp-content/plugins/'.str_replace(basename(__FILE__),"",plugin_basename(__FILE__))
Here wp-content/plugins/ text hard coded.
So any other alternative method there?
A: The plugins_url() function is designed to work in WordPress Multisite. Here is an example of its proper usage:
<?php
echo "<img src="' .plugins_url( 'images/wordpress.png' , __FILE__ ). '" > ';
?>
If you are using this function in a file that is nested inside a
subdirectory, you should use PHP's dirname() function:
<?php
echo "<img src="' .plugins_url( 'images/wordpress.png' , dirname(__FILE__) ). '" > ';
?>
|
wordpress
|
{
"language": "en",
"length": 152,
"provenance": "stackexchange_00019.jsonl.gz:418858",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48316"
}
|
[
0.05767822265625,
-0.01557159423828125,
0.01009368896484375,
-0.0254974365234375,
0.00057220458984375,
-0.016845703125,
0.031280517578125,
-0.0198822021484375,
-0.0020923614501953125,
0.016082763671875,
-0.01494598388671875,
0.0089263916015625,
-0.046630859375,
-0.0231781005859375,
-0.019622802734375,
-0.0180511474609375,
0.0222930908203125,
-0.01043701171875,
-0.002811431884765625,
-0.0008225440979003906,
0.01032257080078125,
0.0163421630859375,
-0.0152130126953125,
0.04595947265625,
0.0214996337890625,
-0.017333984375,
0.094970703125,
-0.044891357421875,
0.007171630859375,
-0.045440673828125,
0.0184173583984375,
0.00872039794921875,
0.03131103515625,
-0.0176544189453125,
0.027740478515625,
0.01690673828125,
0.0036182403564453125,
-0.0018033981323242188,
0.0245819091796875,
-0.0007309913635253906,
0.01556396484375,
-0.01544189453125,
0.041534423828125,
0.0274505615234375,
0.002079010009765625,
-0.05535888671875,
0.048858642578125,
-0.0198211669921875,
0.0235443115234375,
0.025726318359375,
0.01059722900390625,
-0.0016889572143554688,
0.01038360595703125,
-0.0013885498046875,
-0.020965576171875,
-0.03546142578125,
-0.0181884765625,
0.036224365234375,
0.045013427734375,
-0.008026123046875,
-0.03704833984375,
-0.0037097930908203125,
0.0201568603515625,
-0.006725311279296875,
-0.0101318359375,
-0.007190704345703125,
-0.0274505615234375,
0.0139617919921875,
-0.025848388671875,
0.0082550048828125,
0.0290069580078125,
-0.03564453125,
0.0157012939453125,
-0.00766754150390625,
-0.039581298828125,
-0.005886077880859375,
-0.01666259765625,
-0.01346588134765625,
0.056884765625,
-0.05755615234375,
0.0071563720703125,
-0.01306915283203125,
-0.0144195556640625,
0.0143890380859375,
0.0045623779296875,
0.047332763671875,
0.00024116039276123047,
-0.00983428955078125,
-0.043182373046875,
0.0297393798828125,
-0.0316162109375,
0.0008306503295898438,
-0.004718780517578125,
0.00337982177734375,
-0.006786346435546875,
0.0193634033203125,
0.01033782958984375,
0.0240478515625,
0.0008397102355957031,
-0.0085296630859375,
0.0218505859375,
-0.052001953125,
0.0141448974609375,
-0.029693603515625,
0.00948333740234375,
0.07513427734375,
0.033447265625,
0.0180816650390625,
0.036712646484375,
-0.004535675048828125,
0.0286102294921875,
0.0281829833984375,
-0.048187255859375,
-0.054595947265625,
0.00414276123046875,
0.0179443359375,
-0.06317138671875,
0.00980377197265625,
0.0115203857421875,
-0.00281524658203125,
-0.01549530029296875,
0.0246429443359375,
-0.0183563232421875,
0.0111541748046875,
0.0037059783935546875,
-0.0003304481506347656,
0.01324462890625,
-0.047576904296875,
-0.0193328857421875,
-0.00856781005859375,
-0.0286712646484375,
0.01934814453125,
0.052703857421875,
0.00980377197265625,
0.0134735107421875,
-0.01357269287109375,
0.01983642578125,
0.0167388916015625,
-0.00677490234375,
0.01544952392578125,
0.0020198822021484375,
-0.0206756591796875,
0.018890380859375,
-0.0242156982421875,
-0.008270263671875,
0.0033931732177734375,
0.01751708984375,
0.033050537109375,
-0.0094757080078125,
-0.0362548828125,
0.0219573974609375,
-0.01540374755859375,
0.038726806640625,
0.003520965576171875,
-0.00878143310546875,
-0.026885986328125,
0.048583984375,
-0.04669189453125,
0.0007500648498535156,
-0.051727294921875,
-0.0005064010620117188,
-0.0237274169921875,
0.006870269775390625,
-0.021331787109375,
-0.046173095703125,
-0.0015382766723632812,
-0.041168212890625,
-0.0186004638671875,
0.02435302734375,
0.0143585205078125,
0.0012292861938476562,
0.0017604827880859375,
-0.00867462158203125,
0.044281005859375,
0.029571533203125,
0.0232086181640625,
-0.006343841552734375,
0.03790283203125,
0.03515625,
0.048828125,
0.0002524852752685547,
-0.0229339599609375,
0.09332275390625,
-0.023193359375,
-0.06317138671875,
0.04864501953125,
-0.0005927085876464844,
0.06427001953125,
-0.0006818771362304688,
0.005046844482421875,
0.04034423828125,
0.016326904296875,
-0.0531005859375,
0.0156707763671875,
-0.032440185546875,
0.013885498046875,
0.001529693603515625,
0.038330078125,
-0.0335693359375,
-0.0070037841796875,
0.0037937164306640625,
-0.00615692138671875,
0.0198211669921875,
0.005901336669921875,
-0.01120758056640625,
-0.007312774658203125,
-0.005077362060546875,
0.0219268798828125,
0.01055145263671875,
0.036956787109375,
0.0031108856201171875,
0.04510498046875,
-0.0012111663818359375,
-0.074462890625,
-0.0107574462890625,
0.03656005859375,
-0.00830841064453125,
0.007411956787109375,
0.009185791015625,
0.0306396484375,
-0.0012884140014648438,
-0.002468109130859375,
-0.0270538330078125,
-0.044219970703125,
0.0338134765625,
0.01178741455078125,
-0.0301361083984375,
-0.0106201171875,
-0.008819580078125,
0.0199432373046875,
-0.04949951171875,
0.030242919921875,
0.0064239501953125,
0.042755126953125,
-0.020416259765625,
-0.013397216796875,
0.024078369140625,
-0.050048828125,
0.023651123046875,
0.033935546875,
0.044219970703125,
0.027252197265625,
-0.007259368896484375,
-0.034332275390625,
0.0200347900390625,
-0.05499267578125,
0.0062103271484375,
-0.0223236083984375,
0.0272216796875,
0.0535888671875,
-0.042816162109375,
-0.021270751953125,
0.026214599609375,
-0.043212890625,
-0.019195556640625,
0.03759765625,
-0.02130126953125,
-0.042633056640625,
-0.0002567768096923828,
0.002994537353515625,
0.0296478271484375,
-0.00608062744140625,
-0.041229248046875,
0.01397705078125,
-0.037200927734375,
0.00745391845703125,
-0.004528045654296875,
0.00446319580078125,
-0.00534820556640625,
0.0026531219482421875,
0.021453857421875,
-0.011749267578125,
-0.033050537109375,
0.0255126953125,
0.081787109375,
-0.03900146484375,
-0.04083251953125,
-0.00797271728515625,
-0.00461578369140625,
0.009368896484375,
-0.032501220703125,
0.006809234619140625,
-0.0258331298828125,
-0.0115203857421875,
-0.04736328125,
-0.042388916015625,
0.026824951171875,
0.0285186767578125,
0.0176849365234375,
-0.001102447509765625,
0.028350830078125,
0.0200653076171875,
-0.0183258056640625,
0.046417236328125,
-0.0176849365234375,
-0.0172576904296875,
0.044464111328125,
-0.0352783203125,
0.03314208984375,
-0.006183624267578125,
0.04443359375,
0.05462646484375,
0.013824462890625,
-0.016815185546875,
-0.00980377197265625,
-0.03662109375,
-0.00495147705078125,
-0.009368896484375,
-0.0277252197265625,
-0.007213592529296875,
-0.067138671875,
0.0153656005859375,
0.0023784637451171875,
0.009552001953125,
-0.00701904296875,
-0.04412841796875,
-0.01457977294921875,
-0.0129852294921875,
-0.114990234375,
-0.08587646484375,
-0.058807373046875,
-0.04522705078125,
0.0171661376953125,
0.0191497802734375,
-0.0050201416015625,
0.00867462158203125,
0.05126953125,
0.01165008544921875,
-0.0233917236328125,
-0.0419921875,
-0.0648193359375,
-0.08685302734375,
-0.08807373046875,
-0.020660400390625,
-0.0038776397705078125,
0.007663726806640625,
0.002826690673828125,
-0.0149993896484375,
0.01062774658203125,
-0.00640869140625,
0.0291748046875,
0.10369873046875,
0.02178955078125,
-0.031402587890625,
-0.009063720703125,
-0.03436279296875,
-0.0300140380859375,
-0.01363372802734375,
0.055389404296875,
0.0095367431640625,
-0.017852783203125,
0.022125244140625,
0.01482391357421875,
-0.005023956298828125,
0.0270233154296875,
0.008331298828125,
-0.0004930496215820312,
0.009765625,
0.041107177734375,
-0.03369140625,
-0.0035457611083984375,
-0.045562744140625,
-0.042694091796875,
0.0955810546875,
0.0213165283203125,
0.0043487548828125,
0.03204345703125,
0.009674072265625,
-0.0037822723388671875,
-0.0007081031799316406,
0.0467529296875,
-0.05169677734375,
0.051727294921875,
-0.01233673095703125,
-0.0028076171875,
-0.042022705078125,
0.054168701171875,
0.0170440673828125,
-0.0269317626953125,
0.0200042724609375,
0.01354217529296875,
-0.01483154296875,
-0.00823974609375,
-0.05340576171875,
-0.0108795166015625,
0.01064300537109375,
-0.0469970703125,
0.0214691162109375,
-0.050537109375,
-0.007488250732421875,
-0.0382080078125,
0.041717529296875,
-0.05987548828125,
-0.030120849609375,
0.007579803466796875,
0.03643798828125,
-0.030670166015625,
-0.061492919921875,
-0.0450439453125,
-0.0196380615234375,
-0.08099365234375,
-0.006622314453125,
-0.006572723388671875,
-0.04840087890625,
0.02886962890625,
-0.0169677734375,
-0.0206298828125,
-0.051513671875,
0.01010894775390625,
-0.00644683837890625,
-0.006313323974609375,
-0.0163116455078125,
-0.0005564689636230469,
-0.039459228515625,
0.0125885009765625,
-0.021270751953125,
-0.06591796875,
-0.0274200439453125,
-0.0084228515625,
0.063232421875,
0.01385498046875,
-0.019622802734375,
-0.032135009765625,
0.048614501953125,
-0.02117919921875,
0.04180908203125,
-0.006557464599609375,
0.029144287109375,
-0.00966644287109375,
-0.0080718994140625,
0.0182952880859375,
-0.0246124267578125,
-0.0087127685546875,
-0.03350830078125,
-0.034881591796875,
-0.0341796875,
-0.01078033447265625,
-0.030242919921875,
0.02056884765625,
-0.01210784912109375,
-0.0078887939453125,
-0.0175323486328125,
-0.005168914794921875,
-0.0179290771484375,
-0.000042378902435302734,
-0.02642822265625,
-0.01024627685546875,
0.0186614990234375,
0.020660400390625,
0.031402587890625,
-0.026153564453125,
0.0058441162109375,
0.027313232421875,
0.021575927734375,
-0.040313720703125,
-0.01467132568359375,
0.0235595703125,
0.025909423828125,
0.01209259033203125,
0.03948974609375,
0.016387939453125,
-0.005496978759765625,
0.0302276611328125,
0.0007948875427246094,
0.056640625,
-0.0174102783203125,
0.01288604736328125,
0.014312744140625,
-0.0088348388671875,
0.0263519287109375,
0.028961181640625,
-0.033355712890625,
0.048675537109375,
-0.0219268798828125,
0.019927978515625,
-0.061737060546875,
-0.004001617431640625,
-0.003265380859375,
0.020660400390625,
-0.026611328125,
-0.065185546875,
0.0274505615234375,
-0.00650787353515625,
0.0288848876953125,
0.03155517578125,
-0.0167236328125,
0.044219970703125,
0.01904296875,
0.01018524169921875,
0.034423828125,
0.043792724609375,
-0.017547607421875,
0.051239013671875,
0.01122283935546875,
-0.019622802734375,
0.007537841796875,
0.00693511962890625,
0.038330078125,
-0.01165771484375,
0.01434326171875,
-0.055023193359375,
-0.014617919921875,
0.000827789306640625,
0.00905609130859375,
0.00232696533203125,
0.0007290840148925781,
0.0106658935546875,
-0.0270843505859375,
-0.0120849609375,
-0.003173828125,
-0.0083465576171875,
-0.0196380615234375,
0.0239715576171875,
-0.006046295166015625,
0.0004508495330810547,
-0.0223541259765625,
0.06573486328125,
-0.0112152099609375,
0.016510009765625,
0.0028591156005859375,
-0.017791748046875,
-0.005435943603515625,
0.045318603515625,
0.022064208984375,
-0.02783203125,
-0.005519866943359375,
0.0227813720703125,
0.032440185546875,
-0.044281005859375,
0.0123138427734375,
0.0277252197265625,
0.056793212890625,
0.00928497314453125,
-0.035186767578125,
-0.01482391357421875,
-0.034393310546875,
-0.03875732421875,
0.06732177734375,
-0.0212554931640625,
-0.051300048828125,
-0.06719970703125,
0.0096282958984375,
0.0755615234375,
-0.00922393798828125,
-0.03692626953125,
-0.004817962646484375,
-0.02587890625,
0.016632080078125,
-0.0439453125,
-0.05126953125,
0.0274505615234375,
0.040740966796875,
-0.00937652587890625,
-0.0301666259765625,
0.0010023117065429688,
-0.0220184326171875,
0.00611114501953125,
-0.03485107421875,
-0.0233612060546875,
0.031280517578125,
-0.0335693359375,
0.026275634765625,
-0.03759765625,
0.0029697418212890625,
-0.042633056640625,
-0.0002894401550292969,
0.0472412109375,
0.03375244140625,
-0.07659912109375,
0.033905029296875,
-0.038665771484375,
0.01251983642578125,
0.048828125,
-0.025177001953125,
-0.044158935546875,
-0.0416259765625,
-0.0170745849609375,
0.006099700927734375,
-0.016204833984375,
0.0037021636962890625,
0.01474761962890625,
0.0284423828125,
-0.0066986083984375,
0.0325927734375,
-0.038970947265625,
0.02362060546875,
0.0208587646484375,
0.0241851806640625,
0.00685882568359375,
0.0033092498779296875,
0.0226898193359375,
-0.01837158203125,
-0.0104217529296875,
-0.0307464599609375,
-0.00679779052734375,
-0.0089263916015625,
0.031890869140625,
0.0227508544921875,
0.03155517578125,
0.01232147216796875,
0.00701141357421875,
0.01206207275390625,
0.0005526542663574219,
-0.040802001953125,
0.0005807876586914062,
-0.004947662353515625,
0.03326416015625,
-0.0377197265625,
-0.01959228515625,
0.01268768310546875,
0.0033054351806640625,
-0.008270263671875,
0.0137939453125,
-0.007083892822265625,
-0.005054473876953125,
0.048797607421875,
-0.0266265869140625,
0.0250701904296875,
0.07135009765625,
0.01181793212890625,
0.05853271484375,
0.0217437744140625,
0.0134735107421875,
0.025177001953125,
0.01531219482421875,
0.04986572265625,
-0.004169464111328125,
0.0888671875,
-0.000766754150390625,
-0.0202178955078125,
0.044464111328125,
-0.043304443359375,
-0.0080413818359375,
-0.00565338134765625,
0.015472412109375,
-0.021484375,
0.0118560791015625,
-0.00844573974609375,
0.0089569091796875,
0.0273284912109375,
0.002445220947265625,
-0.00812530517578125,
0.01074981689453125,
-0.00464630126953125,
-0.006275177001953125,
-0.013702392578125,
0.005207061767578125,
0.031982421875,
0.003742218017578125,
0.0218048095703125,
0.0234375,
0.00775909423828125,
-0.035919189453125,
-0.048370361328125,
0.0269317626953125,
-0.010711669921875,
0.0010404586791992188,
0.0021648406982421875,
0.00848388671875,
-0.03179931640625,
-0.0118865966796875,
0.018096923828125,
-0.005771636962890625,
-0.0184173583984375,
-0.035247802734375,
-0.02044677734375,
0.062408447265625,
0.024322509765625,
0.00003606081008911133,
-0.042205810546875,
0.0312347412109375,
-0.0203094482421875,
0.09222412109375,
0.02337646484375,
0.004364013671875,
0.0321044921875,
-0.06109619140625,
-0.0211639404296875,
-0.022796630859375,
0.06536865234375,
-0.025299072265625,
-0.00862884521484375,
0.08837890625,
-0.01495361328125,
-0.023406982421875,
0.0039043426513671875,
0.058868408203125,
0.0035419464111328125,
-0.02020263671875,
0.0367431640625,
-0.07916259765625,
-0.05084228515625,
0.01129150390625,
-0.0244293212890625,
0.004344940185546875,
-0.0236053466796875,
-0.046295166015625,
0.08697509765625,
-0.00658416748046875,
0.054107666015625,
0.03778076171875,
0.034912109375,
-0.0064239501953125,
0.004184722900390625,
0.0096588134765625,
0.008209228515625,
-0.032867431640625,
0.000005841255187988281,
-0.0189971923828125,
0.00007361173629760742,
-0.0160980224609375,
0.052459716796875,
0.0273895263671875,
0.0194549560546875,
-0.06866455078125,
0.00443267822265625,
0.0460205078125,
0.0279998779296875,
0.01413726806640625,
0.058380126953125,
0.038665771484375,
0.041351318359375,
0.06536865234375,
-0.0185699462890625,
0.046234130859375,
-0.02825927734375,
0.0292205810546875,
0.052764892578125,
0.00957489013671875,
-0.0013704299926757812,
-0.029998779296875,
-0.03570556640625,
-0.045989990234375,
-0.0009551048278808594,
0.0176544189453125,
-0.0183258056640625,
0.005596160888671875,
0.0265960693359375,
0.0276641845703125,
-0.0107421875,
-0.0234832763671875,
-0.00452423095703125,
0.03509521484375,
0.00031113624572753906,
-0.0244140625,
0.03253173828125,
0.017669677734375,
-0.0032901763916015625,
-0.0082244873046875,
-0.027496337890625,
0.0128021240234375,
0.0196380615234375,
0.02178955078125,
0.0190582275390625,
0.0236358642578125,
-0.032745361328125,
-0.023773193359375,
0.044281005859375,
0.03643798828125,
-0.0121612548828125,
-0.0465087890625,
-0.001567840576171875,
0.0010833740234375,
0.01226043701171875,
0.03424072265625,
0.038177490234375,
0.004726409912109375,
0.00205230712890625,
-0.01079559326171875,
-0.02935791015625,
0.016815185546875,
0.035491943359375,
0.006450653076171875,
-0.05548095703125,
-0.01230621337890625,
-0.0204315185546875,
-0.0176544189453125,
-0.0010862350463867188,
0.00823974609375,
0.0196533203125,
-0.01678466796875,
0.060638427734375,
-0.0192108154296875,
-0.004123687744140625,
-0.0145416259765625,
0.08026123046875,
-0.00887298583984375,
0.00943756103515625,
-0.043426513671875,
-0.071044921875,
0.027801513671875,
0.0232391357421875,
0.0205230712890625,
0.059600830078125,
0.0640869140625,
0.0220184326171875,
-0.0203094482421875,
0.0251312255859375,
0.052001953125,
-0.0166473388671875,
0.07110595703125,
-0.04071044921875,
0.0209197998046875,
-0.0301666259765625,
-0.0235595703125,
-0.035247802734375,
-0.0130157470703125,
0.032501220703125,
-0.0267791748046875,
0.0428466796875,
-0.01418304443359375,
0.002094268798828125,
0.0151519775390625,
-0.043792724609375,
0.037872314453125,
-0.0259857177734375,
-0.018218994140625,
-0.0002294778823852539,
-0.0242156982421875,
-0.0252838134765625,
-0.00885772705078125,
0.03082275390625,
-0.0018930435180664062,
0.03375244140625,
-0.0102386474609375,
-0.007007598876953125,
0.011749267578125,
-0.0055084228515625,
-0.006072998046875,
-0.0006117820739746094,
0.00844573974609375,
-0.0011005401611328125,
-0.0023517608642578125,
0.0010547637939453125,
-0.042236328125,
0.0323486328125,
0.039031982421875,
0.10064697265625,
-0.06683349609375,
0.054107666015625,
0.041595458984375,
-0.034881591796875,
-0.01412200927734375,
0.00710296630859375,
-0.0155792236328125,
-0.068359375,
-0.01348876953125,
0.0166473388671875,
-0.0277862548828125,
-0.00208282470703125,
0.032501220703125,
-0.0294189453125,
-0.00611114501953125,
-0.015533447265625,
0.026947021484375,
0.0182342529296875,
0.035614013671875,
-0.0192108154296875,
-0.035491943359375,
-0.06781005859375,
-0.0087890625,
0.062255859375,
0.06231689453125,
-0.00009274482727050781,
0.030029296875,
0.046112060546875,
0.00765228271484375,
0.021209716796875,
-0.0021457672119140625,
0.0499267578125,
0.037109375,
-0.03955078125,
-0.06707763671875,
-0.004444122314453125,
-0.0054779052734375,
-0.017578125,
-0.0024967193603515625,
0.08087158203125,
-0.0203094482421875,
-0.006622314453125,
0.01326751708984375,
0.006557464599609375,
0.002483367919921875,
-0.0251922607421875,
0.002384185791015625,
0.05120849609375,
-0.0161590576171875,
-0.03326416015625,
-0.047698974609375,
-0.0075531005859375,
-0.06793212890625,
0.0034160614013671875,
0.00611114501953125,
-0.03277587890625,
-0.0245513916015625,
0.025238037109375,
-0.005161285400390625,
0.02001953125,
0.0186309814453125,
-0.0836181640625,
0.00917816162109375,
0.0058135986328125,
0.056243896484375,
-0.005664825439453125,
-0.0146636962890625,
-0.0108642578125,
0.010833740234375,
-0.0225372314453125,
-0.00986480712890625,
-0.04693603515625,
0.018768310546875,
-0.0208740234375,
0.023590087890625,
0.032867431640625,
-0.0242919921875,
-0.01995849609375,
0.0276031494140625,
0.016754150390625,
0.08441162109375,
-0.038330078125,
-0.033935546875,
-0.00860595703125,
-0.0020923614501953125,
-0.0228729248046875,
0.0012140274047851562,
0.0197906494140625,
-0.050689697265625,
-0.0281829833984375,
-0.006526947021484375,
0.00830841064453125,
0.01849365234375,
-0.035919189453125,
-0.03704833984375,
0.0458984375,
-0.006256103515625,
-0.028778076171875,
-0.0163726806640625,
-0.010833740234375,
-0.0037746429443359375,
0.06976318359375,
0.01338958740234375,
-0.045440673828125,
-0.0438232421875,
0.008148193359375,
0.034088134765625,
-0.0005979537963867188,
0.0147857666015625,
0.0242462158203125,
-0.0184326171875,
0.0499267578125,
0.048187255859375,
0.0009427070617675781,
0.0032176971435546875,
-0.0237579345703125,
0.05084228515625,
0.051177978515625,
-0.00603485107421875,
0.0106201171875,
0.048797607421875,
-0.0185089111328125,
-0.0258026123046875,
-0.028717041015625,
0.0019464492797851562,
0.014007568359375,
0.07989501953125,
0.01873779296875,
0.0165252685546875,
-0.048553466796875,
-0.037567138671875,
-0.0362548828125,
0.0008478164672851562,
-0.01226043701171875,
0.0214996337890625,
-0.06280517578125,
0.0080108642578125,
-0.002166748046875,
-0.021209716796875,
-0.005207061767578125,
0.0007495880126953125,
-0.036163330078125,
0.0003859996795654297,
0.001522064208984375,
-0.0284881591796875,
0.01483154296875,
-0.019866943359375,
0.03399658203125,
-0.03143310546875,
-0.005847930908203125,
-0.0082550048828125,
0.0261383056640625,
0.00765228271484375,
-0.0022411346435546875,
0.0097198486328125,
0.0474853515625,
-0.046844482421875,
-0.014251708984375,
0.0187530517578125,
0.0305938720703125,
-0.0003247261047363281,
-0.0239715576171875,
-0.030059814453125,
0.019744873046875,
-0.02264404296875,
0.01517486572265625,
0.0142822265625,
0.033050537109375,
0.0097198486328125,
0.1119384765625,
-0.0255889892578125,
0.016998291015625,
-0.0178985595703125,
0.0252227783203125,
0.0021800994873046875,
-0.015838623046875,
0.037872314453125,
-0.031341552734375,
-0.00794219970703125,
0.04754638671875,
-0.037750244140625,
-0.04522705078125,
0.0190582275390625,
-0.034027099609375,
0.0190582275390625,
0.007442474365234375
] |
226f145d4a047d30ebc1d48a5b39ef789f7789f6
|
Wordpress Stackexchange
Q: Add default Backgrounds Is there code or a plugin that would make it possible to add default backgrounds, like you can with default headers in Twenty ten. Seems like the same frame work for backgrounds and headers.
A: There's no default way to do that yet, though there is a Trac ticket. I found this (untested) that may work for you: http://www.devblog.fr/2011/05/16/plusieurs-fonds-personnalises-wordpress-add_custom_background/
It's also worth noting the 3.4's new way of defining a default background (still just one, though).
Edit
Here's the code:
<?php
function wpse48332_setup_theme() {
// Add support for custom backgrounds
add_theme_support( 'custom-background', array(
// Background color default
'default-color' => '000',
// Background image default
'default-image' => get_template_directory_uri() . '/images/background.jpg'
) );
}
add_action( 'after_setup_theme', 'wpse48332_setup_theme' );
?>
(Note that you can also define front end, admin, and preview style callbacks, as well.)
|
Q: Add default Backgrounds Is there code or a plugin that would make it possible to add default backgrounds, like you can with default headers in Twenty ten. Seems like the same frame work for backgrounds and headers.
A: There's no default way to do that yet, though there is a Trac ticket. I found this (untested) that may work for you: http://www.devblog.fr/2011/05/16/plusieurs-fonds-personnalises-wordpress-add_custom_background/
It's also worth noting the 3.4's new way of defining a default background (still just one, though).
Edit
Here's the code:
<?php
function wpse48332_setup_theme() {
// Add support for custom backgrounds
add_theme_support( 'custom-background', array(
// Background color default
'default-color' => '000',
// Background image default
'default-image' => get_template_directory_uri() . '/images/background.jpg'
) );
}
add_action( 'after_setup_theme', 'wpse48332_setup_theme' );
?>
(Note that you can also define front end, admin, and preview style callbacks, as well.)
A: If you can, add this snippet to your theme functions.php file, if you're using version under WP 3.4:
add_action( 'after_setup_theme', 'add_custom_background' );
Or if you have setup function for your theme, just add this call to it:
add_custom_background();
After you added it, new menu item "Background" will appear in your admin panel. At this page you can select custom background image or set background color:
|
wordpress
|
{
"language": "en",
"length": 202,
"provenance": "stackexchange_00019.jsonl.gz:418863",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48332"
}
|
[
0.06817626953125,
0.00010907649993896484,
0.040252685546875,
-0.06744384765625,
0.00579071044921875,
0.0034637451171875,
0.01358795166015625,
-0.023651123046875,
-0.034423828125,
0.009002685546875,
-0.07672119140625,
0.0246124267578125,
-0.06427001953125,
-0.00185394287109375,
-0.01261138916015625,
-0.06610107421875,
0.04547119140625,
-0.0065765380859375,
0.07110595703125,
-0.0009756088256835938,
0.0218658447265625,
0.031951904296875,
0.04119873046875,
0.06781005859375,
0.02508544921875,
-0.046051025390625,
0.05218505859375,
-0.0152435302734375,
0.00543975830078125,
-0.016204833984375,
0.0203094482421875,
-0.0008687973022460938,
0.0052642822265625,
0.035736083984375,
-0.0022983551025390625,
0.02862548828125,
-0.005977630615234375,
0.01552581787109375,
0.0129241943359375,
0.0160980224609375,
0.01497650146484375,
-0.007137298583984375,
0.0127410888671875,
0.033294677734375,
-0.0092315673828125,
-0.0611572265625,
0.045135498046875,
-0.033843994140625,
0.01340484619140625,
0.003326416015625,
-0.00690460205078125,
0.0167083740234375,
0.01023101806640625,
-0.028778076171875,
-0.0094757080078125,
-0.01995849609375,
-0.0213623046875,
0.0100860595703125,
0.04156494140625,
-0.00998687744140625,
-0.03350830078125,
-0.0518798828125,
0.03759765625,
-0.0213623046875,
0.025787353515625,
-0.00334930419921875,
-0.01019287109375,
0.023345947265625,
-0.03302001953125,
0.01788330078125,
0.023040771484375,
-0.038482666015625,
-0.00463104248046875,
-0.0518798828125,
-0.0208740234375,
0.0266571044921875,
-0.0147552490234375,
-0.03387451171875,
0.0179443359375,
-0.01184844970703125,
0.0207977294921875,
-0.03759765625,
0.0002231597900390625,
-0.044921875,
0.055450439453125,
-0.0027370452880859375,
0.0082244873046875,
-0.01544189453125,
-0.032989501953125,
-0.01447296142578125,
-0.018890380859375,
-0.053802490234375,
0.00017213821411132812,
-0.0071258544921875,
-0.0162200927734375,
-0.02532958984375,
0.017852783203125,
0.032958984375,
-0.0249481201171875,
0.0323486328125,
-0.0038700103759765625,
-0.034942626953125,
0.0623779296875,
-0.04571533203125,
-0.0186004638671875,
-0.01296234130859375,
0.00403594970703125,
-0.0236053466796875,
-0.013671875,
0.037261962890625,
-0.03759765625,
-0.017669677734375,
0.007110595703125,
-0.0266571044921875,
-0.01290130615234375,
0.0035858154296875,
-0.0325927734375,
-0.00008887052536010742,
0.0034770965576171875,
-0.031890869140625,
0.0027561187744140625,
0.0030364990234375,
-0.0038356781005859375,
-0.0048828125,
-0.00644683837890625,
-0.014617919921875,
-0.0290069580078125,
-0.0211334228515625,
-0.03155517578125,
-0.0265655517578125,
-0.0266876220703125,
0.052154541015625,
0.092529296875,
0.029876708984375,
0.001407623291015625,
0.0009245872497558594,
0.04296875,
0.0024585723876953125,
-0.0188140869140625,
0.025787353515625,
-0.018157958984375,
-0.030853271484375,
-0.014984130859375,
-0.02215576171875,
0.0178985595703125,
-0.0053558349609375,
0.008331298828125,
0.035400390625,
0.00566864013671875,
-0.05426025390625,
0.056121826171875,
-0.037506103515625,
0.00528717041015625,
0.007457733154296875,
0.006511688232421875,
0.0214385986328125,
-0.00302886962890625,
0.0258026123046875,
-0.01432037353515625,
0.004131317138671875,
0.00081634521484375,
-0.00801849365234375,
-0.01183319091796875,
-0.0191802978515625,
-0.01861572265625,
0.0115814208984375,
-0.00640106201171875,
0.01427459716796875,
0.020904541015625,
-0.021026611328125,
-0.004512786865234375,
0.024627685546875,
0.016204833984375,
0.0213775634765625,
0.019012451171875,
0.029693603515625,
0.03680419921875,
-0.01390838623046875,
0.0049896240234375,
0.044219970703125,
-0.01259613037109375,
-0.03302001953125,
0.041107177734375,
-0.034942626953125,
-0.055999755859375,
0.0186309814453125,
-0.01078033447265625,
0.052337646484375,
0.057098388671875,
0.0049285888671875,
-0.00012564659118652344,
-0.037933349609375,
-0.024932861328125,
-0.0250244140625,
-0.0065765380859375,
-0.00811004638671875,
-0.039398193359375,
-0.0206146240234375,
-0.0119476318359375,
0.031890869140625,
0.01213836669921875,
-0.017120361328125,
0.0279998779296875,
0.00957489013671875,
0.026336669921875,
-0.008819580078125,
-0.0033817291259765625,
-0.0007348060607910156,
0.022369384765625,
-0.01309967041015625,
0.00015234947204589844,
-0.040313720703125,
0.041107177734375,
-0.10150146484375,
-0.0733642578125,
0.0232391357421875,
-0.01702880859375,
0.0171966552734375,
0.01416015625,
0.02618408203125,
0.047454833984375,
-0.027191162109375,
0.039337158203125,
0.01491546630859375,
0.0237274169921875,
-0.0023632049560546875,
-0.01381683349609375,
-0.0173187255859375,
0.0281524658203125,
-0.00298309326171875,
-0.00490570068359375,
0.038360595703125,
-0.00812530517578125,
0.007106781005859375,
-0.005535125732421875,
-0.0026912689208984375,
0.008056640625,
-0.0799560546875,
0.005084991455078125,
0.047027587890625,
0.031707763671875,
0.0245819091796875,
-0.0043792724609375,
-0.0078125,
0.08795166015625,
0.0174102783203125,
0.01036834716796875,
-0.0162200927734375,
0.037506103515625,
0.0241241455078125,
-0.01300048828125,
-0.0202178955078125,
0.03533935546875,
-0.070556640625,
0.049102783203125,
0.017333984375,
-0.0247802734375,
-0.045135498046875,
0.0116424560546875,
-0.00643157958984375,
0.0195465087890625,
-0.01149749755859375,
-0.0270843505859375,
-0.0019512176513671875,
0.02581787109375,
-0.021697998046875,
0.01898193359375,
-0.0016393661499023438,
-0.0108489990234375,
0.0048675537109375,
0.01183319091796875,
-0.058685302734375,
0.00311279296875,
0.039520263671875,
0.011505126953125,
0.004730224609375,
-0.0262908935546875,
-0.01004791259765625,
0.00244140625,
0.011444091796875,
-0.0072174072265625,
0.00629425048828125,
-0.05242919921875,
-0.01192474365234375,
0.0018157958984375,
-0.061981201171875,
-0.0012388229370117188,
0.0294036865234375,
-0.0078277587890625,
-0.0302581787109375,
0.003875732421875,
0.0243377685546875,
-0.0299530029296875,
0.020172119140625,
0.04638671875,
-0.02178955078125,
-0.01352691650390625,
-0.043182373046875,
0.05316162109375,
-0.0693359375,
-0.007843017578125,
0.049072265625,
-0.046142578125,
0.0270843505859375,
-0.010650634765625,
0.034271240234375,
0.016021728515625,
0.005619049072265625,
-0.0162811279296875,
-0.01081085205078125,
-0.04931640625,
-0.055450439453125,
0.006622314453125,
0.014434814453125,
-0.0177764892578125,
-0.043914794921875,
-0.0272369384765625,
-0.003871917724609375,
-0.031524658203125,
-0.0201263427734375,
0.022705078125,
-0.042266845703125,
-0.043975830078125,
-0.0285186767578125,
-0.030517578125,
0.01110076904296875,
-0.0220947265625,
-0.0182647705078125,
-0.01442718505859375,
-0.03240966796875,
-0.00588226318359375,
-0.0716552734375,
-0.06951904296875,
-0.0909423828125,
0.01326751708984375,
0.0142669677734375,
0.0029964447021484375,
0.033477783203125,
-0.000736236572265625,
-0.0275421142578125,
-0.0016946792602539062,
-0.004795074462890625,
0.00490570068359375,
0.006763458251953125,
0.01418304443359375,
-0.011199951171875,
0.007808685302734375,
0.00536346435546875,
-0.0182952880859375,
0.044647216796875,
-0.0263671875,
-0.0170440673828125,
-0.051422119140625,
-0.0206756591796875,
-0.0791015625,
0.0921630859375,
0.0970458984375,
-0.07550048828125,
-0.033294677734375,
-0.08343505859375,
-0.0215911865234375,
0.0089569091796875,
-0.04052734375,
0.0275726318359375,
-0.00547027587890625,
-0.00746917724609375,
0.0088348388671875,
0.025634765625,
-0.020843505859375,
-0.01445770263671875,
0.00395965576171875,
-0.0178070068359375,
-0.005748748779296875,
-0.01041412353515625,
-0.0168609619140625,
0.0140533447265625,
-0.018890380859375,
-0.0328369140625,
0.006256103515625,
-0.0173492431640625,
0.02679443359375,
0.0016994476318359375,
0.0247344970703125,
-0.0266876220703125,
-0.07757568359375,
0.049163818359375,
-0.0286102294921875,
0.0080718994140625,
-0.058929443359375,
-0.0198516845703125,
-0.0183258056640625,
0.086181640625,
-0.052642822265625,
-0.016845703125,
0.0156402587890625,
0.040130615234375,
-0.045166015625,
-0.0285491943359375,
-0.022918701171875,
-0.0185394287109375,
-0.10650634765625,
0.0301055908203125,
-0.01218414306640625,
-0.03497314453125,
-0.007778167724609375,
-0.01264190673828125,
-0.046844482421875,
-0.0556640625,
0.004878997802734375,
0.032928466796875,
-0.00505828857421875,
0.0038051605224609375,
-0.0150299072265625,
0.00469970703125,
0.0355224609375,
-0.0189971923828125,
-0.08172607421875,
-0.0218658447265625,
-0.003925323486328125,
0.0487060546875,
0.0058746337890625,
-0.0010967254638671875,
-0.0264739990234375,
0.0450439453125,
0.0242462158203125,
0.055755615234375,
0.0168304443359375,
0.018341064453125,
0.0117950439453125,
-0.05938720703125,
0.0169830322265625,
-0.049468994140625,
0.0015583038330078125,
0.0013837814331054688,
-0.016448974609375,
0.0170440673828125,
-0.0210418701171875,
0.02349853515625,
0.01016998291015625,
-0.03948974609375,
0.04052734375,
-0.001678466796875,
-0.002719879150390625,
0.042327880859375,
-0.0200042724609375,
0.0218505859375,
-0.016693115234375,
0.01885986328125,
0.03228759765625,
-0.00463104248046875,
-0.0013666152954101562,
0.0061798095703125,
0.046630859375,
0.017578125,
-0.00998687744140625,
-0.0213775634765625,
-0.0031299591064453125,
0.023101806640625,
0.005252838134765625,
-0.0017080307006835938,
-0.036590576171875,
-0.045806884765625,
0.11663818359375,
-0.016387939453125,
-0.006694793701171875,
-0.024078369140625,
0.064697265625,
-0.027435302734375,
-0.0567626953125,
0.04962158203125,
-0.0161895751953125,
0.004657745361328125,
-0.0113067626953125,
-0.00325775146484375,
0.00151824951171875,
0.0177764892578125,
0.007053375244140625,
0.0205535888671875,
-0.04119873046875,
-0.041107177734375,
-0.00864410400390625,
-0.01511383056640625,
-0.0202178955078125,
0.024566650390625,
0.032623291015625,
-0.006622314453125,
0.0050201416015625,
0.0131683349609375,
0.006999969482421875,
-0.006191253662109375,
0.01084136962890625,
0.0141143798828125,
0.0294952392578125,
0.0237274169921875,
0.01262664794921875,
-0.0243682861328125,
-0.0280609130859375,
0.11138916015625,
0.0106964111328125,
-0.041351318359375,
-0.01554107666015625,
-0.025146484375,
0.056549072265625,
-0.0005931854248046875,
0.019805908203125,
0.0625,
0.01032257080078125,
-0.0033111572265625,
-0.03607177734375,
-0.04644775390625,
0.0017786026000976562,
-0.07879638671875,
0.044158935546875,
0.03936767578125,
-0.021087646484375,
0.046875,
-0.0009255409240722656,
0.05438232421875,
-0.00644683837890625,
-0.0200653076171875,
-0.0162506103515625,
-0.010833740234375,
0.0137176513671875,
-0.00986480712890625,
0.037811279296875,
0.00018012523651123047,
0.005645751953125,
0.07110595703125,
-0.0419921875,
0.0312042236328125,
0.0003135204315185547,
0.0634765625,
-0.0289459228515625,
-0.06903076171875,
0.03955078125,
-0.060760498046875,
0.007049560546875,
-0.0161590576171875,
-0.0301513671875,
-0.025421142578125,
-0.00710296630859375,
0.03594970703125,
0.04254150390625,
-0.01012420654296875,
-0.048431396484375,
0.02288818359375,
-0.02191162109375,
0.0207672119140625,
0.0443115234375,
-0.033538818359375,
0.0428466796875,
0.026336669921875,
-0.050537109375,
-0.034393310546875,
-0.01488494873046875,
-0.0279083251953125,
0.014404296875,
-0.0199432373046875,
-0.041290283203125,
0.0245208740234375,
-0.025238037109375,
0.03399658203125,
0.0006327629089355469,
-0.033905029296875,
0.0003941059112548828,
0.01285552978515625,
0.0313720703125,
0.00110626220703125,
0.00678253173828125,
-0.03009033203125,
-0.060882568359375,
-0.040679931640625,
-0.04425048828125,
-0.034423828125,
-0.034393310546875,
0.015655517578125,
0.0259552001953125,
0.01078033447265625,
0.0063934326171875,
-0.0447998046875,
-0.0484619140625,
0.05548095703125,
0.062255859375,
0.0550537109375,
-0.00701141357421875,
0.014190673828125,
0.018218994140625,
0.00004369020462036133,
0.012542724609375,
0.0027008056640625,
-0.00603485107421875,
-0.024688720703125,
0.00978851318359375,
-0.0263671875,
-0.005786895751953125,
-0.0103607177734375,
-0.0177764892578125,
0.01050567626953125,
0.062164306640625,
0.01617431640625,
0.0155181884765625,
-0.01910400390625,
-0.004566192626953125,
-0.0153961181640625,
0.033721923828125,
-0.023406982421875,
-0.024627685546875,
0.016998291015625,
0.0025348663330078125,
0.032562255859375,
-0.04986572265625,
0.0023345947265625,
0.01177215576171875,
-0.01904296875,
0.01291656494140625,
0.01003265380859375,
-0.089599609375,
0.058746337890625,
0.059234619140625,
0.033721923828125,
0.041717529296875,
-0.01284027099609375,
0.0084228515625,
0.0095977783203125,
-0.000003337860107421875,
-0.037750244140625,
-0.036651611328125,
0.038330078125,
0.016754150390625,
-0.0153045654296875,
0.04791259765625,
-0.0173187255859375,
0.0211944580078125,
0.030670166015625,
0.045501708984375,
-0.051544189453125,
0.01497650146484375,
-0.01033782958984375,
0.00390625,
0.079833984375,
0.0139312744140625,
-0.01142120361328125,
-0.01153564453125,
0.060760498046875,
-0.020233154296875,
0.01357269287109375,
0.043121337890625,
0.0101165771484375,
-0.021270751953125,
-0.007167816162109375,
-0.0134429931640625,
-0.00911712646484375,
-0.0225677490234375,
-0.00852203369140625,
0.01296234130859375,
-0.039764404296875,
0.004413604736328125,
0.0147705078125,
-0.0261993408203125,
-0.02178955078125,
-0.052734375,
-0.0203704833984375,
-0.021392822265625,
-0.03009033203125,
0.01355743408203125,
0.0002161264419555664,
0.0162811279296875,
0.051971435546875,
-0.0210113525390625,
0.0252838134765625,
0.014129638671875,
-0.005939483642578125,
0.0340576171875,
0.01013946533203125,
0.06512451171875,
0.0008115768432617188,
-0.061004638671875,
0.020721435546875,
-0.03460693359375,
-0.01568603515625,
0.00007778406143188477,
-0.01119232177734375,
0.070068359375,
-0.04901123046875,
-0.003040313720703125,
0.032196044921875,
0.01947021484375,
-0.01366424560546875,
0.0020580291748046875,
0.03839111328125,
-0.049896240234375,
-0.0270233154296875,
0.021331787109375,
-0.0178375244140625,
0.018280029296875,
0.0130615234375,
-0.040924072265625,
0.04559326171875,
-0.0256195068359375,
0.005809783935546875,
-0.00328826904296875,
0.018585205078125,
0.01074981689453125,
0.00304412841796875,
-0.028961181640625,
0.060394287109375,
-0.007602691650390625,
0.017059326171875,
-0.0341796875,
0.01227569580078125,
-0.01055908203125,
0.008026123046875,
0.04052734375,
0.009613037109375,
0.03558349609375,
0.0183563232421875,
0.04522705078125,
0.00585174560546875,
-0.0389404296875,
0.000774383544921875,
-0.0019931793212890625,
-0.0299072265625,
-0.01702880859375,
0.01116180419921875,
0.03924560546875,
-0.0726318359375,
-0.0196990966796875,
0.0083160400390625,
0.0086822509765625,
0.01593017578125,
0.0298309326171875,
0.0282745361328125,
-0.0306549072265625,
0.00881195068359375,
0.04034423828125,
-0.060272216796875,
-0.01049041748046875,
0.07550048828125,
0.020050048828125,
0.02593994140625,
-0.036590576171875,
-0.0162353515625,
0.047119140625,
0.0012922286987304688,
0.005863189697265625,
0.046630859375,
0.0239105224609375,
-0.0255126953125,
-0.0179901123046875,
0.00969696044921875,
-0.0000756382942199707,
-0.0257720947265625,
0.0230712890625,
-0.005001068115234375,
0.006626129150390625,
-0.061004638671875,
-0.009735107421875,
0.01255035400390625,
0.036407470703125,
-0.036346435546875,
-0.017303466796875,
0.0025844573974609375,
-0.0175933837890625,
0.040008544921875,
-0.0281982421875,
0.04852294921875,
-0.05816650390625,
-0.05999755859375,
-0.046234130859375,
-0.007472991943359375,
0.01406097412109375,
0.004940032958984375,
-0.0165252685546875,
-0.01351165771484375,
0.0169677734375,
0.005870819091796875,
-0.004367828369140625,
0.00824737548828125,
-0.0091705322265625,
-0.0018367767333984375,
-0.00783538818359375,
0.0244903564453125,
0.01316070556640625,
0.0206146240234375,
0.005840301513671875,
0.043182373046875,
0.0325927734375,
-0.01059722900390625,
0.029296875,
0.0013275146484375,
-0.0242919921875,
-0.004619598388671875,
-0.0030574798583984375,
-0.01323699951171875,
0.037811279296875,
0.0018978118896484375,
-0.06500244140625,
-0.0220794677734375,
-0.017364501953125,
-0.038604736328125,
-0.0044097900390625,
-0.054290771484375,
0.04638671875,
0.02862548828125,
0.0136260986328125,
0.015625,
-0.0145111083984375,
0.06793212890625,
-0.02484130859375,
0.007511138916015625,
0.0141143798828125,
-0.039764404296875,
0.033477783203125,
0.0128631591796875,
0.049896240234375,
-0.0086822509765625,
-0.096923828125,
-0.011505126953125,
0.0005288124084472656,
-0.045318603515625,
0.018829345703125,
0.03338623046875,
-0.044036865234375,
0.0330810546875,
0.008392333984375,
0.0035457611083984375,
0.00872802734375,
-0.01702880859375,
0.00983428955078125,
-0.0174407958984375,
0.0156707763671875,
-0.00879669189453125,
-0.0745849609375,
-0.039093017578125,
-0.046142578125,
0.035369873046875,
0.0178070068359375,
0.05450439453125,
-0.0185089111328125,
0.020263671875,
0.0133056640625,
0.0250701904296875,
0.00896453857421875,
0.01383209228515625,
-0.009765625,
0.0297393798828125,
0.0265045166015625,
-0.0218505859375,
-0.0173492431640625,
0.005023956298828125,
0.028411865234375,
-0.036376953125,
-0.00441741943359375,
-0.00464630126953125,
0.02325439453125,
-0.0086212158203125,
0.032257080078125,
-0.0241241455078125,
-0.046051025390625,
-0.0616455078125,
0.00750732421875,
0.006076812744140625,
0.01076507568359375,
-0.041168212890625,
0.033966064453125,
0.0027599334716796875,
0.00890350341796875,
0.01555633544921875,
-0.00531005859375,
0.036102294921875,
0.039947509765625,
-0.033233642578125,
-0.05859375,
0.00283050537109375,
-0.00228118896484375,
-0.021484375,
0.00795745849609375,
0.04705810546875,
-0.00543975830078125,
-0.02203369140625,
0.06341552734375,
0.040191650390625,
0.059173583984375,
-0.043670654296875,
0.0048370361328125,
0.05682373046875,
0.0025310516357421875,
-0.0026950836181640625,
-0.0286865234375,
-0.015777587890625,
-0.0178375244140625,
-0.0017957687377929688,
0.015838623046875,
-0.00955963134765625,
-0.021331787109375,
-0.040069580078125,
0.0250244140625,
0.0125732421875,
0.004184722900390625,
-0.07012939453125,
0.05352783203125,
-0.0279541015625,
0.03985595703125,
-0.0173187255859375,
0.01776123046875,
-0.01058197021484375,
-0.038787841796875,
-0.029205322265625,
-0.01080322265625,
-0.0386962890625,
0.04290771484375,
-0.006977081298828125,
-0.0027217864990234375,
0.045257568359375,
-0.0085601806640625,
0.0175018310546875,
-0.01776123046875,
-0.0224456787109375,
0.049591064453125,
-0.0711669921875,
-0.02606201171875,
0.00495147705078125,
-0.005340576171875,
-0.0300140380859375,
-0.034698486328125,
0.0280303955078125,
-0.059661865234375,
-0.0345458984375,
-0.046478271484375,
0.0117340087890625,
0.032135009765625,
-0.034942626953125,
-0.062408447265625,
0.04144287109375,
-0.01548004150390625,
-0.0302734375,
-0.00955963134765625,
0.038116455078125,
-0.01482391357421875,
-0.0089874267578125,
0.008880615234375,
-0.018310546875,
0.04364013671875,
0.0164947509765625,
-0.005954742431640625,
-0.015777587890625,
0.0006532669067382812,
-0.00832366943359375,
-0.05413818359375,
0.0011777877807617188,
0.0161590576171875,
-0.0270538330078125,
0.034576416015625,
-0.0222015380859375,
0.01030731201171875,
0.040283203125,
-0.045013427734375,
-0.039703369140625,
-0.03717041015625,
-0.0299835205078125,
-0.0292205810546875,
-0.0396728515625,
0.004558563232421875,
0.00955963134765625,
0.050384521484375,
0.01482391357421875,
0.00008761882781982422,
-0.0250244140625,
-0.018341064453125,
-0.001987457275390625,
0.01055908203125,
0.005428314208984375,
0.0015125274658203125,
-0.020751953125,
-0.006557464599609375,
-0.0021533966064453125,
-0.0270538330078125,
-0.0221099853515625,
0.006504058837890625,
-0.03875732421875,
0.005992889404296875,
0.006969451904296875,
-0.00489044189453125,
-0.0616455078125,
-0.01177978515625,
0.052978515625,
-0.018646240234375,
0.02978515625,
-0.0191802978515625,
0.019439697265625,
0.038482666015625,
0.0102996826171875,
0.01070404052734375,
0.019134521484375,
-0.00975799560546875,
0.004364013671875,
0.0159759521484375,
0.01529693603515625,
-0.0301361083984375,
-0.013153076171875,
-0.014923095703125,
0.0169677734375,
0.0135040283203125,
0.0301513671875,
-0.01169586181640625,
0.0301361083984375,
0.0097503662109375,
0.00628662109375,
-0.020416259765625,
-0.0299530029296875,
-0.02490234375,
0.0187835693359375,
-0.043487548828125,
0.01934814453125,
0.00665283203125,
-0.02630615234375,
0.00342559814453125,
0.0011682510375976562,
0.007328033447265625,
-0.0457763671875,
0.0472412109375,
-0.047149658203125,
0.0019512176513671875,
0.0204010009765625
] |
0308684c1d045e0493ff478c5bf18fadf9a93d03
|
Wordpress Stackexchange
Q: Show Previous/Next Posts navigation only inside the same category Is it possible to force previous/next navigation to browse through the posts (back and forth) that are only inside the same category (and to exclude other categories)?
A: The functions accept an $in_same_cat argument, the default value of which is false. Just set that to true.
previous_post_link($format, $link, true);
next_post_link($format, $link, true);
|
Q: Show Previous/Next Posts navigation only inside the same category Is it possible to force previous/next navigation to browse through the posts (back and forth) that are only inside the same category (and to exclude other categories)?
A: The functions accept an $in_same_cat argument, the default value of which is false. Just set that to true.
previous_post_link($format, $link, true);
next_post_link($format, $link, true);
A: You can use the following code in single.php loop to display nex/pre links in same category
<?php
get_template_part( 'content', get_post_format() );
// Previous/next post navigation.
previous_post_link('%link', 'Before', true );
next_post_link( '%link', 'Next', true );
?>
|
wordpress
|
{
"language": "en",
"length": 98,
"provenance": "stackexchange_00019.jsonl.gz:418864",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48334"
}
|
[
0.0921630859375,
-0.01047515869140625,
0.042999267578125,
-0.03216552734375,
0.023468017578125,
-0.0274200439453125,
0.06268310546875,
-0.042510986328125,
0.01137542724609375,
0.0008687973022460938,
-0.055877685546875,
-0.0022563934326171875,
-0.0130462646484375,
-0.015045166015625,
-0.0164794921875,
-0.058013916015625,
0.0286102294921875,
-0.02020263671875,
0.024139404296875,
-0.019561767578125,
0.00414276123046875,
0.00235748291015625,
0.047393798828125,
0.045562744140625,
0.014434814453125,
0.01541900634765625,
0.031982421875,
-0.01523590087890625,
0.00023865699768066406,
-0.020263671875,
0.02215576171875,
-0.0107421875,
-0.0083160400390625,
0.039276123046875,
-0.01285552978515625,
-0.0218505859375,
-0.029510498046875,
0.03662109375,
0.0261077880859375,
-0.00713348388671875,
0.002269744873046875,
0.00307464599609375,
0.0016927719116210938,
-0.0310821533203125,
-0.0305328369140625,
-0.0160980224609375,
-0.006900787353515625,
-0.0313720703125,
0.0170745849609375,
-0.039794921875,
0.00698089599609375,
-0.02215576171875,
0.01020050048828125,
0.0145416259765625,
-0.03485107421875,
-0.0308990478515625,
0.0001169443130493164,
-0.05572509765625,
0.048583984375,
0.004550933837890625,
-0.0215911865234375,
-0.044677734375,
0.01508331298828125,
-0.052459716796875,
0.0166168212890625,
-0.00543975830078125,
0.04180908203125,
0.02435302734375,
-0.0440673828125,
0.0171051025390625,
0.0562744140625,
-0.0247039794921875,
-0.00647735595703125,
0.0011749267578125,
-0.044342041015625,
-0.0008749961853027344,
0.0313720703125,
-0.001964569091796875,
0.0026950836181640625,
0.00289154052734375,
-0.05633544921875,
0.033447265625,
-0.07989501953125,
-0.0657958984375,
0.00989532470703125,
-0.017791748046875,
-0.0350341796875,
0.0103302001953125,
-0.020477294921875,
-0.018096923828125,
-0.02105712890625,
-0.0112152099609375,
-0.020721435546875,
0.00228118896484375,
-0.0146636962890625,
-0.0136260986328125,
0.043670654296875,
0.060333251953125,
-0.02447509765625,
-0.005336761474609375,
-0.035125732421875,
-0.009735107421875,
-0.028228759765625,
-0.034027099609375,
0.031280517578125,
0.0212249755859375,
-0.026824951171875,
0.00884246826171875,
0.07867431640625,
0.042724609375,
0.0129241943359375,
0.05712890625,
-0.004917144775390625,
-0.000040650367736816406,
-0.033843994140625,
0.01318359375,
-0.036468505859375,
0.016021728515625,
-0.0003788471221923828,
0.0232696533203125,
-0.0156097412109375,
0.0213775634765625,
-0.004695892333984375,
-0.01357269287109375,
0.01248931884765625,
0.01334381103515625,
0.0013360977172851562,
-0.042022705078125,
0.030059814453125,
0.03131103515625,
-0.040863037109375,
-0.0194244384765625,
0.038360595703125,
0.0367431640625,
0.024169921875,
-0.0233154296875,
-0.013641357421875,
-0.036956787109375,
-0.008392333984375,
0.00394439697265625,
-0.032806396484375,
-0.01904296875,
0.010528564453125,
-0.0299072265625,
0.0302276611328125,
0.015289306640625,
0.011627197265625,
0.01299285888671875,
0.0112762451171875,
-0.04559326171875,
0.036468505859375,
-0.02923583984375,
0.018524169921875,
0.0026912689208984375,
-0.036590576171875,
-0.011260986328125,
-0.0242767333984375,
0.007232666015625,
-0.01003265380859375,
-0.0226593017578125,
0.0355224609375,
0.010345458984375,
0.0268402099609375,
-0.07745361328125,
-0.1051025390625,
-0.02069091796875,
-0.1002197265625,
-0.030120849609375,
0.0202789306640625,
0.05865478515625,
0.005107879638671875,
0.0039005279541015625,
-0.017913818359375,
-0.0077056884765625,
-0.01184844970703125,
-0.026092529296875,
-0.00586700439453125,
-0.035797119140625,
0.0020389556884765625,
0.0960693359375,
0.008209228515625,
-0.044036865234375,
-0.037353515625,
0.01207733154296875,
-0.04071044921875,
0.028228759765625,
0.01702880859375,
0.06512451171875,
0.01271820068359375,
0.0250701904296875,
0.036376953125,
-0.0021209716796875,
-0.0252685546875,
-0.00890350341796875,
-0.01145172119140625,
-0.0211334228515625,
0.0194091796875,
0.0101776123046875,
-0.0137786865234375,
0.00012242794036865234,
0.0084075927734375,
0.0305633544921875,
-0.026519775390625,
-0.0005345344543457031,
-0.05010986328125,
0.00011050701141357422,
-0.0147552490234375,
0.03533935546875,
-0.024261474609375,
0.03411865234375,
0.0234222412109375,
0.0008153915405273438,
-0.006816864013671875,
-0.0400390625,
-0.0027980804443359375,
0.00328826904296875,
-0.00241851806640625,
-0.0259552001953125,
0.00007641315460205078,
-0.006694793701171875,
-0.01357269287109375,
0.02166748046875,
-0.030364990234375,
0.003063201904296875,
0.052764892578125,
-0.03076171875,
-0.006389617919921875,
-0.031707763671875,
0.0036525726318359375,
0.022796630859375,
-0.11297607421875,
0.0243072509765625,
0.059295654296875,
0.022308349609375,
-0.03216552734375,
0.033050537109375,
0.052215576171875,
-0.00003159046173095703,
-0.00879669189453125,
0.0204315185546875,
0.0233154296875,
0.0209197998046875,
-0.025665283203125,
-0.01251983642578125,
0.021392822265625,
-0.039215087890625,
0.01052093505859375,
-0.004039764404296875,
-0.016571044921875,
0.01308441162109375,
0.0124053955078125,
0.0303192138671875,
0.0261688232421875,
0.05804443359375,
0.00887298583984375,
0.027099609375,
0.02294921875,
-0.0020542144775390625,
-0.00897979736328125,
0.00586700439453125,
0.00812530517578125,
0.006866455078125,
-0.049591064453125,
0.021453857421875,
0.0181121826171875,
-0.050384521484375,
0.0207977294921875,
-0.00196075439453125,
0.0137939453125,
-0.057861328125,
0.0178680419921875,
-0.00862884521484375,
0.015716552734375,
0.034698486328125,
0.013519287109375,
0.00927734375,
-0.02069091796875,
-0.0241546630859375,
0.02899169921875,
0.00592803955078125,
-0.01678466796875,
0.010101318359375,
0.02557373046875,
-0.00762939453125,
0.00043773651123046875,
-0.0572509765625,
0.031768798828125,
0.005100250244140625,
-0.01364898681640625,
-0.012664794921875,
0.006927490234375,
0.028594970703125,
-0.037933349609375,
0.048919677734375,
-0.0159149169921875,
-0.007358551025390625,
-0.0721435546875,
-0.046417236328125,
0.0389404296875,
-0.041534423828125,
0.00566864013671875,
0.0657958984375,
0.02337646484375,
0.01511383056640625,
0.0167083740234375,
0.01287078857421875,
0.043304443359375,
0.00250244140625,
-0.011993408203125,
0.004619598388671875,
-0.07037353515625,
-0.045867919921875,
0.022308349609375,
-0.00927734375,
0.033050537109375,
-0.01154327392578125,
0.00365447998046875,
0.0168609619140625,
-0.03692626953125,
-0.016021728515625,
-0.01381683349609375,
-0.024383544921875,
0.00868988037109375,
0.046722412109375,
0.0032634735107421875,
-0.027191162109375,
0.06805419921875,
0.00408935546875,
0.018463134765625,
-0.063232421875,
-0.0574951171875,
-0.0670166015625,
-0.053619384765625,
0.030914306640625,
0.00766754150390625,
-0.00075531005859375,
0.0026645660400390625,
0.07073974609375,
0.00666046142578125,
-0.078369140625,
0.0013904571533203125,
-0.001842498779296875,
-0.04193115234375,
0.033294677734375,
-0.021942138671875,
0.0300140380859375,
0.004505157470703125,
0.017181396484375,
0.027008056640625,
0.02911376953125,
-0.0325927734375,
-0.001628875732421875,
-0.0032176971435546875,
0.03265380859375,
0.0292510986328125,
-0.0006318092346191406,
-0.00829315185546875,
0.0645751953125,
0.048492431640625,
0.0105438232421875,
-0.0210723876953125,
-0.0036487579345703125,
-0.05450439453125,
-0.0552978515625,
0.0245208740234375,
-0.00007998943328857422,
-0.0261077880859375,
-0.0165252685546875,
-0.0053863525390625,
-0.0033588409423828125,
-0.03167724609375,
-0.028167724609375,
0.040130615234375,
0.0014982223510742188,
0.02532958984375,
0.0158233642578125,
0.006420135498046875,
-0.038665771484375,
0.01187896728515625,
-0.0234832763671875,
-0.003589630126953125,
-0.01107025146484375,
0.023895263671875,
-0.0118560791015625,
-0.021453857421875,
0.016754150390625,
-0.033599853515625,
0.036041259765625,
-0.0255126953125,
-0.020660400390625,
-0.007305145263671875,
0.08331298828125,
-0.0762939453125,
-0.0230712890625,
0.0012731552124023438,
0.01308441162109375,
0.00848388671875,
-0.0290374755859375,
-0.04339599609375,
-0.02410888671875,
-0.0517578125,
0.0196380615234375,
-0.020751953125,
-0.011871337890625,
-0.0115814208984375,
-0.0022449493408203125,
-0.040863037109375,
-0.0301971435546875,
0.020416259765625,
0.0102386474609375,
0.0026721954345703125,
-0.01012420654296875,
-0.0038738250732421875,
-0.0222625732421875,
0.0003268718719482422,
-0.0165863037109375,
-0.07232666015625,
-0.00897979736328125,
-0.0095062255859375,
0.048370361328125,
0.0139007568359375,
-0.00844573974609375,
-0.026031494140625,
0.032989501953125,
0.0232391357421875,
0.00437164306640625,
0.0309295654296875,
-0.00989532470703125,
0.05743408203125,
-0.016082763671875,
-0.00034880638122558594,
-0.0282440185546875,
0.0007929801940917969,
-0.04193115234375,
-0.0118408203125,
0.0058746337890625,
-0.042083740234375,
0.0017766952514648438,
-0.057373046875,
-0.00786590576171875,
-0.061279296875,
-0.035125732421875,
-0.0016469955444335938,
0.0291290283203125,
-0.02215576171875,
0.01520538330078125,
-0.0428466796875,
-0.058013916015625,
0.0228729248046875,
0.02587890625,
-0.046173095703125,
-0.00931549072265625,
0.03094482421875,
0.0275421142578125,
-0.0267486572265625,
0.01183319091796875,
-0.0252685546875,
0.0193939208984375,
0.00943756103515625,
0.0428466796875,
0.00081634521484375,
-0.01479339599609375,
0.08563232421875,
-0.00510406494140625,
0.00482940673828125,
-0.031585693359375,
0.08575439453125,
-0.0028171539306640625,
-0.01568603515625,
0.02630615234375,
-0.02484130859375,
0.01320648193359375,
0.033843994140625,
-0.0172882080078125,
-0.017059326171875,
-0.0253143310546875,
0.041229248046875,
-0.0022716522216796875,
0.002079010009765625,
-0.0438232421875,
0.02685546875,
-0.02008056640625,
0.059295654296875,
0.0726318359375,
0.06439208984375,
-0.004955291748046875,
0.02587890625,
0.03765869140625,
0.0068511962890625,
0.0023250579833984375,
0.01983642578125,
-0.01459503173828125,
0.0264129638671875,
0.00457000732421875,
-0.0064239501953125,
-0.00702667236328125,
0.0090484619140625,
0.01119232177734375,
0.006500244140625,
-0.01239776611328125,
-0.040374755859375,
0.01256561279296875,
0.032501220703125,
0.002716064453125,
-0.0036716461181640625,
0.03131103515625,
-0.00531005859375,
-0.01070404052734375,
0.0007796287536621094,
-0.01318359375,
-0.0229339599609375,
-0.04290771484375,
-0.003376007080078125,
-0.0036296844482421875,
0.00289154052734375,
0.0382080078125,
0.0584716796875,
-0.0288848876953125,
0.0673828125,
-0.030517578125,
-0.002239227294921875,
-0.0037250518798828125,
0.0012187957763671875,
0.0188751220703125,
0.00463104248046875,
0.0192718505859375,
-0.037506103515625,
0.0474853515625,
-0.01739501953125,
-0.0221099853515625,
0.008636474609375,
0.01540374755859375,
0.0244293212890625,
0.0187835693359375,
0.0260162353515625,
0.0276947021484375,
-0.019500732421875,
0.046234130859375,
0.04107666015625,
-0.03131103515625,
-0.01091766357421875,
0.0275115966796875,
0.0239715576171875,
0.0010385513305664062,
-0.0227508544921875,
-0.00955963134765625,
-0.04840087890625,
0.01467132568359375,
-0.0175323486328125,
-0.0087890625,
0.0018310546875,
-0.010101318359375,
-0.00714111328125,
-0.014495849609375,
0.008392333984375,
0.0262451171875,
0.0177764892578125,
-0.0280303955078125,
-0.029449462890625,
0.0294342041015625,
0.016845703125,
0.0626220703125,
-0.053497314453125,
-0.0255889892578125,
-0.03619384765625,
-0.005596160888671875,
0.044769287109375,
0.019866943359375,
-0.045684814453125,
0.020416259765625,
-0.04962158203125,
-0.0295867919921875,
-0.056976318359375,
-0.057098388671875,
-0.04791259765625,
-0.00826263427734375,
0.037994384765625,
0.0175933837890625,
0.0095977783203125,
-0.0272979736328125,
-0.03778076171875,
0.0159759521484375,
0.03759765625,
0.03680419921875,
-0.02581787109375,
0.07147216796875,
0.0233306884765625,
0.05224609375,
0.00850677490234375,
0.00765228271484375,
-0.057708740234375,
0.00820159912109375,
0.005352020263671875,
-0.06781005859375,
-0.0271148681640625,
-0.001407623291015625,
-0.012237548828125,
0.0262908935546875,
0.0253448486328125,
-0.0015392303466796875,
0.0231475830078125,
-0.015594482421875,
0.0087890625,
-0.007114410400390625,
-0.01436614990234375,
-0.0034656524658203125,
-0.0130615234375,
0.05621337890625,
0.031158447265625,
0.00986480712890625,
-0.022125244140625,
-0.03790283203125,
-0.02203369140625,
0.041717529296875,
-0.00537109375,
-0.02606201171875,
-0.055572509765625,
0.00787353515625,
0.042938232421875,
0.040252685546875,
0.060302734375,
0.0103302001953125,
0.050323486328125,
0.036956787109375,
-0.034088134765625,
0.0303802490234375,
0.037933349609375,
0.042205810546875,
-0.01806640625,
0.0217437744140625,
0.03265380859375,
-0.0261077880859375,
-0.033111572265625,
0.003597259521484375,
0.0232696533203125,
-0.028564453125,
-0.003833770751953125,
0.00608062744140625,
0.0036602020263671875,
-0.02215576171875,
0.018585205078125,
-0.0026378631591796875,
0.01314544677734375,
-0.0196380615234375,
-0.0179901123046875,
-0.013458251953125,
-0.0021762847900390625,
-0.00189208984375,
0.00843048095703125,
-0.0078277587890625,
0.029205322265625,
0.0162200927734375,
-0.03375244140625,
-0.04852294921875,
0.031982421875,
-0.031890869140625,
-0.05316162109375,
-0.0103759765625,
0.00788116455078125,
-0.03533935546875,
-0.0880126953125,
0.00391387939453125,
0.0037326812744140625,
0.0177764892578125,
0.0369873046875,
-0.023345947265625,
0.0291290283203125,
0.032196044921875,
-0.0216522216796875,
0.0241241455078125,
-0.0098114013671875,
-0.0146636962890625,
-0.0005788803100585938,
-0.018829345703125,
0.0155029296875,
0.042755126953125,
-0.03900146484375,
0.016265869140625,
-0.005741119384765625,
-0.0199127197265625,
-0.03900146484375,
-0.0175018310546875,
0.089599609375,
-0.0063323974609375,
-0.032806396484375,
0.018646240234375,
0.035888671875,
-0.016265869140625,
-0.01094818115234375,
0.0164337158203125,
-0.0265350341796875,
0.00699615478515625,
-0.0171661376953125,
-0.01357269287109375,
-0.002460479736328125,
-0.03460693359375,
-0.077880859375,
0.0572509765625,
-0.045379638671875,
0.08477783203125,
0.02899169921875,
-0.02294921875,
0.0184783935546875,
-0.01806640625,
-0.030181884765625,
0.048736572265625,
0.010223388671875,
0.039947509765625,
-0.051239013671875,
-0.028228759765625,
-0.002960205078125,
0.0697021484375,
0.0102386474609375,
-0.0004036426544189453,
0.005802154541015625,
-0.0030727386474609375,
0.04833984375,
0.04449462890625,
-0.00444793701171875,
0.0050201416015625,
-0.0019016265869140625,
0.0034542083740234375,
0.04705810546875,
-0.031890869140625,
0.03363037109375,
0.01593017578125,
0.006320953369140625,
0.00894927978515625,
0.024627685546875,
0.044189453125,
-0.0117034912109375,
0.0250396728515625,
-0.0179443359375,
-0.003841400146484375,
0.0103759765625,
-0.0083160400390625,
0.0218963623046875,
0.042327880859375,
0.052947998046875,
-0.04791259765625,
0.0023784637451171875,
-0.035980224609375,
0.0535888671875,
0.01129150390625,
0.0233917236328125,
0.0400390625,
0.01381683349609375,
0.061614990234375,
-0.0159759521484375,
0.01776123046875,
-0.01110076904296875,
0.0020389556884765625,
0.075439453125,
0.04815673828125,
0.041046142578125,
-0.0330810546875,
-0.03936767578125,
0.04461669921875,
0.10028076171875,
-0.039825439453125,
-0.047271728515625,
-0.0010499954223632812,
-0.0218353271484375,
-0.005779266357421875,
0.0020427703857421875,
-0.009735107421875,
0.008544921875,
0.031280517578125,
-0.05718994140625,
-0.0148162841796875,
0.03857421875,
0.030548095703125,
0.01172637939453125,
0.0182952880859375,
-0.045013427734375,
-0.04779052734375,
-0.0531005859375,
0.039398193359375,
0.03759765625,
0.0389404296875,
0.002471923828125,
0.033477783203125,
-0.0020923614501953125,
0.0012416839599609375,
0.0177001953125,
0.0367431640625,
-0.0533447265625,
-0.005870819091796875,
-0.01329803466796875,
-0.053466796875,
-0.04833984375,
0.0251312255859375,
0.0211944580078125,
0.040374755859375,
0.0210418701171875,
0.03564453125,
0.05096435546875,
0.006999969482421875,
0.0347900390625,
0.0012187957763671875,
-0.0166168212890625,
-0.0428466796875,
0.034332275390625,
0.0301513671875,
0.01690673828125,
0.002941131591796875,
-0.0018262863159179688,
0.056182861328125,
0.018798828125,
0.0160980224609375,
0.01209259033203125,
-0.0026721954345703125,
0.0323486328125,
0.0230712890625,
0.03948974609375,
0.05218505859375,
-0.03125,
0.0033626556396484375,
-0.0301513671875,
-0.0225677490234375,
0.0143585205078125,
0.01776123046875,
-0.0321044921875,
0.05389404296875,
0.04620361328125,
-0.03778076171875,
-0.02215576171875,
0.0181732177734375,
0.055145263671875,
0.005893707275390625,
-0.015625,
0.0297088623046875,
-0.032440185546875,
-0.0013523101806640625,
0.006927490234375,
0.0170745849609375,
0.03375244140625,
-0.024749755859375,
0.041015625,
0.0352783203125,
0.01166534423828125,
0.0704345703125,
-0.0537109375,
-0.0220184326171875,
0.0679931640625,
-0.021575927734375,
0.016815185546875,
-0.0028171539306640625,
-0.026641845703125,
-0.00433349609375,
0.03680419921875,
-0.029998779296875,
0.0267791748046875,
-0.056243896484375,
0.015777587890625,
-0.03997802734375,
0.0194091796875,
-0.0100250244140625,
0.019287109375,
-0.0193939208984375,
-0.0391845703125,
0.052734375,
0.0108795166015625,
-0.0252838134765625,
-0.0015621185302734375,
-0.006443023681640625,
-0.0584716796875,
0.021881103515625,
-0.00933074951171875,
0.0247039794921875,
0.034515380859375,
0.007549285888671875,
0.06671142578125,
-0.01395416259765625,
-0.0188140869140625,
0.0181732177734375,
0.0199432373046875,
-0.0838623046875,
0.0006833076477050781,
-0.033538818359375,
-0.021392822265625,
0.0401611328125,
0.03680419921875,
-0.01788330078125,
0.0229949951171875,
0.011810302734375,
-0.018341064453125,
0.0165252685546875,
-0.034332275390625,
-0.0267486572265625,
-0.042510986328125,
-0.0021572113037109375,
0.02581787109375,
-0.0266571044921875,
-0.035064697265625,
-0.06646728515625,
0.0227203369140625,
0.046905517578125,
0.00627899169921875,
-0.044586181640625,
0.032806396484375,
-0.04150390625,
0.03253173828125,
-0.0007433891296386719,
-0.0222625732421875,
0.0007185935974121094,
0.0051116943359375,
-0.0271453857421875,
0.01125335693359375,
-0.0302734375,
-0.0153350830078125,
-0.01210784912109375,
0.006694793701171875,
-0.003814697265625,
-0.0223236083984375,
0.0015840530395507812,
0.007740020751953125,
0.007228851318359375,
0.052001953125,
0.06219482421875,
-0.01393890380859375,
-0.01457977294921875,
0.0229034423828125,
-0.029052734375,
0.0009369850158691406,
0.03619384765625,
-0.0085296630859375,
-0.057373046875,
0.0245819091796875,
-0.050628662109375,
-0.03131103515625,
-0.04376220703125,
-0.07159423828125,
0.0293121337890625,
0.0090484619140625,
-0.043975830078125,
-0.03106689453125,
0.0230560302734375,
-0.0076446533203125,
0.0175933837890625,
-0.005840301513671875,
-0.01244354248046875,
-0.013641357421875,
0.01497650146484375,
0.033477783203125,
0.06573486328125,
-0.00872802734375,
0.0208892822265625,
0.010833740234375,
0.050750732421875,
0.0223846435546875,
0.048370361328125,
-0.006855010986328125,
0.038604736328125,
-0.0345458984375,
0.0098114013671875,
-0.054931640625,
-0.0101318359375,
-0.034576416015625,
0.030029296875,
0.01001739501953125,
0.002918243408203125,
-0.040313720703125,
-0.024078369140625,
0.01215362548828125,
0.048553466796875,
0.0118560791015625,
-0.01129913330078125,
-0.01308441162109375,
-0.032135009765625,
-0.0126800537109375,
-0.0097808837890625,
0.0250701904296875,
-0.061309814453125,
-0.0019931793212890625,
0.00957489013671875,
0.01202392578125,
-0.0130615234375,
-0.006809234619140625,
-0.0301055908203125,
-0.0225830078125,
0.0118560791015625,
0.03173828125,
-0.0655517578125,
0.0655517578125,
-0.01104736328125,
-0.0268402099609375,
-0.040618896484375,
-0.0025787353515625,
-0.0277252197265625,
-0.0390625,
-0.01055908203125,
0.005859375,
0.0248565673828125,
-0.0204315185546875,
-0.015655517578125,
0.0243682861328125,
0.01165771484375,
0.01197052001953125,
-0.003177642822265625,
-0.03509521484375,
0.0092010498046875,
0.0229034423828125,
0.0090484619140625,
-0.0313720703125,
0.0011749267578125,
0.02899169921875,
0.0189056396484375,
0.0142974853515625,
0.012451171875,
0.0289764404296875,
0.0240936279296875,
-0.019317626953125,
-0.025238037109375,
0.01142120361328125,
-0.05584716796875,
-0.0169219970703125,
0.0019369125366210938,
-0.0292816162109375,
-0.0377197265625,
0.0306243896484375,
0.037872314453125,
-0.00894927978515625,
0.0184173583984375
] |
fb5a3b8169d6117cc29a59a4a3e8c855b872a741
|
Wordpress Stackexchange
Q: How to enqueue script if widget is displayed on page? I created a widget that uses a jquery plugin, and I used is_active_widget to enqueue the script, it's working fine but it's also including the script even on pages that doesn't show this widget.
so is there a way to only enqueue the script if this widget is showing ?
thanks in advance.
A: If the script needs to go in the <head> section:
class Your_Widget extends WP_Widget{
protected static $did_script = false;
function __construct(){
// parent::__construct() ...
add_action('wp_enqueue_scripts', array($this, 'scripts'));
}
function scripts(){
if(!self::$did_script && is_active_widget(false, false, $this->id_base, true)){
wp_enqueue_script('your-script');
self::$did_script = true;
}
}
}
Otherwise, Chip Bennett's solution will work for queuing it in the footer.
The $did_script static variable is not required, I used it just to avoid further unnecessary calls to wp_enqueue_script if there are multiple widget instances on the page...
|
Q: How to enqueue script if widget is displayed on page? I created a widget that uses a jquery plugin, and I used is_active_widget to enqueue the script, it's working fine but it's also including the script even on pages that doesn't show this widget.
so is there a way to only enqueue the script if this widget is showing ?
thanks in advance.
A: If the script needs to go in the <head> section:
class Your_Widget extends WP_Widget{
protected static $did_script = false;
function __construct(){
// parent::__construct() ...
add_action('wp_enqueue_scripts', array($this, 'scripts'));
}
function scripts(){
if(!self::$did_script && is_active_widget(false, false, $this->id_base, true)){
wp_enqueue_script('your-script');
self::$did_script = true;
}
}
}
Otherwise, Chip Bennett's solution will work for queuing it in the footer.
The $did_script static variable is not required, I used it just to avoid further unnecessary calls to wp_enqueue_script if there are multiple widget instances on the page...
A: Pierre,
The way I handle this is with wp_enqueue_script and wp_dequeue_script, and use a instance variable $is_active in the Your_Widget class
So do the wp_enqueue_script based on is_active_widget which enqueues the script on all pages but with the footer parameter set to true. Note the dequeue is run at a priority to make sure it runs before the scripts are output.
function enqueue_scripts() {
if ( is_active_widget( false, $this->id, $this->id_base, true ) ) {
wp_enqueue_script( 'your-script-handle', 'your-script-url', array(), '1.0', true );
add_action( 'wp_footer', array($this,'dequeue_redundant_scripts'), 1 );
}
}
Then in the widget function indicate if the widget is active on that page
function widget( $args, $instance ) {
// outputs the content of the widget
$this->is_active = true;
}
Then in the footer dequeue the script if the widget is not active on that page
function dequeue_redundant_scripts() {
if (! $this->is_active) {
wp_dequeue_script('your-script-handle');
}
}
This approach of enqueue then dequeueing if unused also works well for plugins that define shortcodes which require scripts
A: You should be able to call wp_enqueue_script() as part of your Widget output.
Edit
Quick-and-dirty, using the bare-bones Widgets API class example:
<?php
class wpse48337_Widget extends WP_Widget {
public function __construct() {
// widget actual processes
}
public function form( $instance ) {
// outputs the options form on admin
}
public function update( $new_instance, $old_instance ) {
// processes widget options to be saved
}
public function widget( $args, $instance ) {
// outputs the content of the widget
}
}
register_widget( 'wpse48337_Widget' );
?>
Add your wp_enqueue_script() call inline, within your Widget's output - i.e. within the public function widget():
<?php
public function widget( $args, $instance ) {
// outputs the content of the widget
// Enqueue a script needed for
// the Widget's output
wp_enqueue_script( 'jquery-pluginname', $path, $deps );
// Rest of widget output goes here...
}
?>
A: I considered 'wp_footer' hook because this hook is executed at footer,and is probably the best way to add scripts only where the widget is used.
class Your_Widget extends WP_Widget{
function widget( $args, $instance ) {
add_action('wp_footer',array($this,'front_end_scripts'));
}
function front_end_scripts(){
?><script type="text/javascript">
console.log('this works!');
/*
Or if you need external scripts then you may use
$.getScript([your-script-url] );
*/
</script> <?php
}
}
|
wordpress
|
{
"language": "en",
"length": 516,
"provenance": "stackexchange_00019.jsonl.gz:418865",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48337"
}
|
[
0.05743408203125,
0.005222320556640625,
0.0038242340087890625,
-0.0232696533203125,
0.0169830322265625,
-0.0413818359375,
0.04132080078125,
-0.0238494873046875,
0.01328277587890625,
0.00897216796875,
-0.050537109375,
0.00408172607421875,
-0.05255126953125,
0.00568389892578125,
-0.0310211181640625,
-0.0675048828125,
0.043548583984375,
-0.0140533447265625,
0.01263427734375,
-0.00893402099609375,
0.01120758056640625,
0.0213775634765625,
0.0028553009033203125,
0.10101318359375,
0.00988006591796875,
-0.058074951171875,
0.115966796875,
0.0154571533203125,
-0.006534576416015625,
-0.021484375,
0.026153564453125,
-0.0023593902587890625,
0.01132965087890625,
0.0230255126953125,
-0.005733489990234375,
0.00664520263671875,
0.007282257080078125,
0.0080108642578125,
0.0262908935546875,
0.02789306640625,
0.024139404296875,
-0.0175018310546875,
-0.01317596435546875,
0.0109710693359375,
-0.02008056640625,
-0.0175323486328125,
0.0031032562255859375,
-0.036468505859375,
0.0003502368927001953,
0.0501708984375,
0.0191192626953125,
-0.0131988525390625,
0.019439697265625,
0.0015096664428710938,
0.0004730224609375,
0.0023746490478515625,
-0.00461578369140625,
-0.05340576171875,
0.0297393798828125,
0.034027099609375,
-0.0037822723388671875,
-0.0234375,
0.0200347900390625,
-0.0341796875,
-0.0248565673828125,
-0.0194091796875,
-0.037689208984375,
0.002681732177734375,
-0.0105743408203125,
-0.0227508544921875,
0.0394287109375,
-0.0103302001953125,
0.0019855499267578125,
0.013946533203125,
-0.029815673828125,
-0.0114898681640625,
0.0008077621459960938,
0.0011301040649414062,
0.0313720703125,
-0.00726318359375,
0.02215576171875,
0.0197296142578125,
-0.006244659423828125,
0.0008835792541503906,
-0.005130767822265625,
0.021087646484375,
-0.014312744140625,
-0.015716552734375,
-0.0034885406494140625,
-0.00994873046875,
-0.0258331298828125,
-0.01425933837890625,
0.02813720703125,
-0.0124969482421875,
-0.029632568359375,
-0.0085601806640625,
0.05169677734375,
0.07794189453125,
-0.01849365234375,
0.037445068359375,
0.0036220550537109375,
-0.05267333984375,
0.05731201171875,
-0.0679931640625,
-0.003063201904296875,
0.04400634765625,
-0.004413604736328125,
0.0008444786071777344,
0.005077362060546875,
0.01959228515625,
0.0182037353515625,
-0.027191162109375,
0.034393310546875,
-0.00571441650390625,
-0.0169525146484375,
-0.033233642578125,
-0.0176239013671875,
0.0222930908203125,
0.000911712646484375,
0.0015707015991210938,
0.0259857177734375,
0.035552978515625,
0.01192474365234375,
-0.037689208984375,
-0.005344390869140625,
0.002025604248046875,
-0.005893707275390625,
-0.06097412109375,
0.00669097900390625,
0.0012083053588867188,
-0.01554107666015625,
-0.00836181640625,
0.042724609375,
0.0421142578125,
0.0070343017578125,
-0.01116180419921875,
0.047332763671875,
-0.00342559814453125,
-0.00034546852111816406,
-0.0034084320068359375,
-0.0162506103515625,
-0.026824951171875,
-0.0102996826171875,
-0.026611328125,
-0.01181793212890625,
0.03399658203125,
0.01445770263671875,
-0.0081939697265625,
-0.0137481689453125,
-0.029998779296875,
-0.007137298583984375,
-0.044342041015625,
0.0303192138671875,
0.00841522216796875,
0.014495849609375,
-0.011383056640625,
0.046539306640625,
-0.0257568359375,
-0.017822265625,
-0.02276611328125,
-0.0264739990234375,
0.0194854736328125,
0.0159454345703125,
-0.038818359375,
-0.01308441162109375,
-0.04132080078125,
0.017242431640625,
0.0140380859375,
0.020751953125,
0.01007843017578125,
-0.0357666015625,
-0.0162200927734375,
0.040679931640625,
0.025848388671875,
-0.00849151611328125,
0.04620361328125,
-0.01102447509765625,
0.037811279296875,
0.042724609375,
-0.049957275390625,
-0.037841796875,
-0.036376953125,
0.072265625,
-0.02569580078125,
-0.057891845703125,
0.0284881591796875,
0.0114593505859375,
0.056793212890625,
-0.004047393798828125,
0.0118255615234375,
0.0703125,
0.01300048828125,
-0.03302001953125,
-0.026153564453125,
0.024078369140625,
0.0182647705078125,
-0.0042572021484375,
-0.001895904541015625,
0.0221710205078125,
-0.0237884521484375,
0.04534912109375,
-0.0179443359375,
0.027984619140625,
-0.0308074951171875,
-0.04364013671875,
-0.0024127960205078125,
-0.021820068359375,
0.032196044921875,
0.00960540771484375,
0.03167724609375,
-0.0008769035339355469,
0.027252197265625,
-0.01436614990234375,
-0.0277252197265625,
-0.0252532958984375,
-0.00365447998046875,
-0.00494384765625,
0.1104736328125,
0.007793426513671875,
0.03155517578125,
-0.0009064674377441406,
-0.07550048828125,
0.0214691162109375,
0.00896453857421875,
0.0292205810546875,
-0.01012420654296875,
-0.02923583984375,
-0.03021240234375,
0.00992584228515625,
0.002605438232421875,
-0.028350830078125,
0.06365966796875,
-0.0013399124145507812,
0.04925537109375,
-0.0208587646484375,
-0.0264129638671875,
-0.0377197265625,
-0.017913818359375,
0.0194549560546875,
0.0311279296875,
0.030853271484375,
0.0374755859375,
-0.006259918212890625,
0.021759033203125,
-0.0001189112663269043,
-0.11553955078125,
-0.01081085205078125,
0.012939453125,
-0.0011615753173828125,
0.02410888671875,
-0.02716064453125,
0.031951904296875,
0.04205322265625,
-0.03228759765625,
-0.02288818359375,
0.0802001953125,
0.009521484375,
0.047943115234375,
-0.0159454345703125,
-0.0109405517578125,
0.01221466064453125,
-0.0013799667358398438,
-0.01506805419921875,
-0.0035190582275390625,
0.021942138671875,
-0.0012187957763671875,
0.0210723876953125,
0.019073486328125,
-0.0039043426513671875,
-0.00577545166015625,
0.005062103271484375,
-0.0260162353515625,
0.00353240966796875,
0.0084381103515625,
0.032012939453125,
-0.0014524459838867188,
-0.0260009765625,
-0.0169677734375,
0.01348876953125,
0.0029239654541015625,
0.0022487640380859375,
-0.000720977783203125,
-0.027191162109375,
-0.0061798095703125,
0.00734710693359375,
-0.01264190673828125,
0.017181396484375,
0.01480865478515625,
0.05474853515625,
-0.0006399154663085938,
0.03326416015625,
0.0193023681640625,
0.00919342041015625,
0.0362548828125,
0.05609130859375,
-0.05267333984375,
0.060028076171875,
0.0155487060546875,
0.021453857421875,
-0.0113677978515625,
0.032623291015625,
0.042266845703125,
-0.016632080078125,
0.0064544677734375,
-0.01064300537109375,
0.01360321044921875,
-0.01200103759765625,
0.007534027099609375,
-0.006198883056640625,
0.005779266357421875,
-0.072509765625,
0.012359619140625,
0.021392822265625,
0.08941650390625,
0.0058441162109375,
-0.045196533203125,
0.0158538818359375,
0.038055419921875,
-0.072021484375,
-0.119140625,
0.00814056396484375,
-0.05615234375,
0.049774169921875,
-0.005401611328125,
-0.002521514892578125,
-0.0316162109375,
0.03338623046875,
0.0234222412109375,
-0.052886962890625,
-0.0080718994140625,
-0.048248291015625,
-0.04766845703125,
-0.0262603759765625,
0.06439208984375,
-0.0203704833984375,
0.006237030029296875,
0.01062774658203125,
0.03375244140625,
0.0081787109375,
-0.036102294921875,
0.038665771484375,
0.0091400146484375,
-0.01007080078125,
0.02581787109375,
0.0217437744140625,
-0.08197021484375,
-0.01824951171875,
0.0010328292846679688,
-0.0264892578125,
-0.0160064697265625,
0.034759521484375,
-0.002655029296875,
-0.0006527900695800781,
-0.0263824462890625,
0.037567138671875,
0.031402587890625,
-0.0289459228515625,
-0.0164642333984375,
0.04656982421875,
-0.04248046875,
0.012115478515625,
0.014007568359375,
-0.007503509521484375,
-0.028717041015625,
-0.0262603759765625,
-0.0261993408203125,
0.0070037841796875,
-0.005878448486328125,
0.032379150390625,
0.00009590387344360352,
-0.0345458984375,
-0.0026454925537109375,
0.0732421875,
0.0162811279296875,
0.060516357421875,
-0.017791748046875,
0.021087646484375,
-0.033203125,
0.01486968994140625,
-0.01288604736328125,
-0.004657745361328125,
-0.019805908203125,
-0.0037136077880859375,
-0.05780029296875,
0.046173095703125,
-0.0099029541015625,
-0.028472900390625,
0.032867431640625,
0.01076507568359375,
0.02081298828125,
0.011749267578125,
0.0291748046875,
-0.0810546875,
-0.00600433349609375,
-0.0173797607421875,
0.031646728515625,
-0.06890869140625,
-0.07415771484375,
-0.035400390625,
-0.008331298828125,
-0.0740966796875,
0.013763427734375,
-0.01102447509765625,
-0.032684326171875,
-0.0249481201171875,
-0.01322174072265625,
-0.05908203125,
-0.039581298828125,
0.03717041015625,
-0.0966796875,
0.032257080078125,
0.0207672119140625,
0.002429962158203125,
-0.01093292236328125,
-0.01265716552734375,
-0.0748291015625,
-0.053192138671875,
0.00653076171875,
-0.06939697265625,
0.05157470703125,
0.050384521484375,
-0.01824951171875,
-0.01079559326171875,
0.0082550048828125,
-0.0092010498046875,
0.0239105224609375,
0.025054931640625,
0.0168609619140625,
0.0148468017578125,
0.0194091796875,
0.0171661376953125,
-0.01580810546875,
0.0023403167724609375,
-0.0059814453125,
-0.06634521484375,
-0.053985595703125,
-0.0264739990234375,
-0.0252685546875,
0.0382080078125,
-0.053375244140625,
0.006439208984375,
-0.006103515625,
-0.00856781005859375,
0.009185791015625,
-0.02691650390625,
0.007450103759765625,
-0.005191802978515625,
-0.014801025390625,
-0.005016326904296875,
-0.053558349609375,
-0.006103515625,
0.030029296875,
0.050994873046875,
0.025146484375,
-0.0025768280029296875,
-0.01532745361328125,
0.01490020751953125,
0.011749267578125,
0.0298614501953125,
0.0379638671875,
0.006381988525390625,
-0.0016345977783203125,
0.00044465065002441406,
0.0161285400390625,
-0.00933074951171875,
0.0325927734375,
0.056732177734375,
0.042205810546875,
0.0006222724914550781,
-0.0166015625,
0.0390625,
-0.070068359375,
0.010467529296875,
-0.007171630859375,
0.00522613525390625,
0.031890869140625,
0.00029969215393066406,
-0.0208587646484375,
-0.0036106109619140625,
-0.0179443359375,
-0.006229400634765625,
-0.01126861572265625,
-0.0131683349609375,
0.06341552734375,
0.0277252197265625,
0.01031494140625,
0.0208282470703125,
0.06195068359375,
-0.00400543212890625,
0.0579833984375,
0.03692626953125,
0.00270843505859375,
0.034210205078125,
0.03253173828125,
-0.01496124267578125,
0.00487518310546875,
-0.000576019287109375,
0.0167694091796875,
-0.00852203369140625,
-0.036346435546875,
-0.0200958251953125,
-0.0021190643310546875,
0.034515380859375,
0.0111236572265625,
0.04071044921875,
0.0265350341796875,
0.01512908935546875,
-0.020965576171875,
-0.018798828125,
0.03240966796875,
0.024383544921875,
-0.03173828125,
-0.0167236328125,
-0.0155792236328125,
-0.007289886474609375,
-0.0209808349609375,
0.028594970703125,
-0.0191802978515625,
0.0159759521484375,
-0.01092529296875,
0.033966064453125,
0.007007598876953125,
0.043914794921875,
0.0308074951171875,
-0.037994384765625,
-0.0048980712890625,
0.022674560546875,
-0.0211944580078125,
-0.034820556640625,
0.00742340087890625,
0.0170440673828125,
0.0178070068359375,
0.0017080307006835938,
-0.007251739501953125,
0.043487548828125,
0.007587432861328125,
-0.031280517578125,
0.06072998046875,
0.036102294921875,
-0.01468658447265625,
-0.0531005859375,
-0.03741455078125,
0.061981201171875,
0.032684326171875,
0.0014972686767578125,
0.0174102783203125,
-0.0183258056640625,
0.0194244384765625,
-0.00945281982421875,
-0.005435943603515625,
-0.005733489990234375,
0.004077911376953125,
-0.025848388671875,
-0.0028896331787109375,
0.01177215576171875,
-0.0670166015625,
-0.04852294921875,
0.004947662353515625,
-0.01482391357421875,
-0.0021152496337890625,
-0.015289306640625,
0.038970947265625,
-0.02545166015625,
-0.01284027099609375,
0.0013856887817382812,
0.032684326171875,
-0.009033203125,
-0.007404327392578125,
-0.047515869140625,
-0.032012939453125,
-0.0723876953125,
-0.0120391845703125,
-0.05596923828125,
-0.0657958984375,
-0.00774383544921875,
0.005451202392578125,
0.0186920166015625,
0.03802490234375,
-0.02679443359375,
-0.07012939453125,
0.00707244873046875,
-0.0183258056640625,
0.009002685546875,
0.019622802734375,
-0.037628173828125,
0.0738525390625,
0.01099395751953125,
0.049591064453125,
-0.004306793212890625,
0.02655029296875,
0.001537322998046875,
-0.0123748779296875,
0.0200347900390625,
-0.061065673828125,
0.01357269287109375,
-0.0176849365234375,
0.001956939697265625,
-0.04718017578125,
-0.0276947021484375,
-0.0065765380859375,
0.037078857421875,
0.006366729736328125,
0.0068206787109375,
-0.0006699562072753906,
-0.0105133056640625,
0.00597381591796875,
0.01434326171875,
0.05059814453125,
-0.0277099609375,
-0.031982421875,
0.0037517547607421875,
0.00482177734375,
0.027374267578125,
-0.0144195556640625,
0.0086822509765625,
-0.02001953125,
-0.0823974609375,
0.08123779296875,
0.060089111328125,
0.0126190185546875,
0.037811279296875,
-0.005321502685546875,
0.0145721435546875,
0.02978515625,
-0.0023956298828125,
-0.042572021484375,
-0.04266357421875,
0.00919342041015625,
-0.02734375,
-0.00724029541015625,
0.0014276504516601562,
0.0033512115478515625,
-0.01190948486328125,
0.01174163818359375,
0.03265380859375,
-0.044097900390625,
0.01824951171875,
0.0064544677734375,
-0.006328582763671875,
-0.03448486328125,
-0.011138916015625,
0.039581298828125,
0.0147552490234375,
0.06622314453125,
0.0614013671875,
0.01232147216796875,
0.06878662109375,
-0.003971099853515625,
-0.019287109375,
-0.045806884765625,
-0.0330810546875,
0.0169677734375,
-0.0169830322265625,
0.04766845703125,
0.0260009765625,
0.0287017822265625,
-0.005611419677734375,
-0.014373779296875,
-0.0001894235610961914,
-0.0174560546875,
-0.04449462890625,
0.00917816162109375,
-0.0545654296875,
-0.002964019775390625,
0.00699615478515625,
-0.0084991455078125,
0.032196044921875,
0.043426513671875,
-0.0027217864990234375,
0.01226806640625,
0.01201629638671875,
0.01033782958984375,
-0.02593994140625,
-0.0133819580078125,
0.0254364013671875,
0.04730224609375,
-0.0438232421875,
0.0260772705078125,
-0.0211944580078125,
-0.0103759765625,
-0.0167999267578125,
-0.0289459228515625,
0.0556640625,
-0.049652099609375,
0.001148223876953125,
-0.0147857666015625,
0.046844482421875,
0.0242767333984375,
-0.018218994140625,
0.0533447265625,
-0.071044921875,
-0.05462646484375,
0.01285552978515625,
-0.0633544921875,
-0.048919677734375,
-0.049072265625,
-0.0182037353515625,
0.0982666015625,
0.0204925537109375,
-0.01317596435546875,
0.0174102783203125,
0.049285888671875,
-0.023895263671875,
0.0338134765625,
-0.0285491943359375,
0.04150390625,
-0.0216064453125,
0.054107666015625,
-0.0022373199462890625,
0.01043701171875,
0.04693603515625,
0.0026950836181640625,
-0.004047393798828125,
-0.0113067626953125,
0.030242919921875,
0.012725830078125,
0.037994384765625,
0.056854248046875,
0.0173187255859375,
-0.0279083251953125,
0.003528594970703125,
0.00748443603515625,
-0.027191162109375,
-0.0169219970703125,
0.021697998046875,
-0.069091796875,
-0.030548095703125,
0.035888671875,
0.0189361572265625,
0.024383544921875,
-0.0290374755859375,
0.0011034011840820312,
-0.0095672607421875,
-0.0171966552734375,
0.0011892318725585938,
0.034881591796875,
-0.0282440185546875,
0.06610107421875,
0.00540924072265625,
0.0014495849609375,
-0.059844970703125,
-0.01611328125,
0.0089874267578125,
-0.023590087890625,
-0.00665283203125,
0.0231781005859375,
0.00702667236328125,
-0.0150299072265625,
0.021820068359375,
0.005054473876953125,
0.03411865234375,
-0.0193634033203125,
0.02783203125,
0.0312347412109375,
0.0362548828125,
-0.0029392242431640625,
0.01071929931640625,
-0.005405426025390625,
0.014251708984375,
-0.034088134765625,
-0.0147705078125,
0.01279449462890625,
0.0126190185546875,
0.0012121200561523438,
-0.0252685546875,
-0.005756378173828125,
-0.005550384521484375,
0.0372314453125,
0.0059967041015625,
-0.0028858184814453125,
0.003856658935546875,
-0.005924224853515625,
0.00008106231689453125,
-0.0171661376953125,
-0.0208740234375,
0.0284881591796875,
-0.052978515625,
0.0117034912109375,
0.01021575927734375,
0.0966796875,
0.039276123046875,
0.0323486328125,
-0.03997802734375,
-0.053192138671875,
-0.014984130859375,
0.040557861328125,
-0.011138916015625,
0.033447265625,
-0.054534912109375,
-0.0318603515625,
0.0018520355224609375,
0.048553466796875,
0.0231475830078125,
0.0017642974853515625,
0.0213775634765625,
0.0223388671875,
-0.0088958740234375,
0.01093292236328125,
0.063232421875,
0.0010280609130859375,
0.04620361328125,
0.0231170654296875,
-0.00780487060546875,
0.002651214599609375,
-0.04534912109375,
-0.038970947265625,
0.057769775390625,
0.0154876708984375,
-0.0171356201171875,
0.0164794921875,
0.002941131591796875,
-0.025909423828125,
0.028594970703125,
0.01248931884765625,
0.0635986328125,
0.009674072265625,
-0.045989990234375,
-0.0284271240234375,
0.016998291015625,
-0.0243377685546875,
0.0029296875,
0.041351318359375,
-0.021697998046875,
0.01305389404296875,
0.0650634765625,
0.01306915283203125,
-0.0229339599609375,
0.0086517333984375,
0.020751953125,
-0.0226287841796875,
0.0360107421875,
0.0386962890625,
-0.0166778564453125,
-0.0072021484375,
0.0178070068359375,
0.0184173583984375,
0.0167999267578125,
-0.0222015380859375,
0.0164337158203125,
0.01129150390625,
0.057891845703125,
-0.01415252685546875,
0.034271240234375,
0.0214691162109375,
0.034210205078125,
-0.029571533203125,
-0.01294708251953125,
-0.021209716796875,
-0.0576171875,
0.0256195068359375,
0.01000213623046875,
0.03094482421875,
0.0279693603515625,
-0.039764404296875,
0.0304412841796875,
0.0197601318359375,
0.01288604736328125,
-0.036529541015625,
-0.004886627197265625,
-0.00736236572265625,
-0.0017709732055664062,
0.0173187255859375,
-0.0110931396484375,
-0.005176544189453125,
-0.026580810546875,
0.0125885009765625,
-0.049468994140625,
0.0041046142578125,
0.0240020751953125,
-0.022247314453125,
0.0230255126953125,
0.03240966796875,
-0.01084136962890625,
0.001995086669921875,
-0.013275146484375,
0.0283050537109375,
-0.0046234130859375,
0.0406494140625,
-0.006072998046875,
-0.004550933837890625,
0.00714874267578125,
0.0177154541015625,
0.005535125732421875,
-0.0226287841796875,
0.01424407958984375,
0.0433349609375,
-0.017547607421875,
-0.0299530029296875,
-0.037994384765625,
-0.0167999267578125,
-0.038909912109375,
-0.003772735595703125,
0.00823211669921875,
-0.00754547119140625,
-0.041717529296875,
-0.0206451416015625,
0.020782470703125,
0.022979736328125,
0.0135040283203125,
-0.0665283203125,
0.050506591796875,
-0.05401611328125,
0.03173828125,
-0.021484375,
0.05218505859375,
-0.00673675537109375,
0.00885772705078125,
-0.0740966796875,
0.0002090930938720703,
-0.02630615234375,
0.0124664306640625,
0.005954742431640625,
0.0230255126953125,
0.03759765625,
-0.02728271484375,
0.01390838623046875,
0.0179443359375,
0.01251983642578125,
0.07342529296875,
0.002765655517578125,
0.0007023811340332031,
0.01525115966796875,
0.0301513671875,
-0.027099609375,
-0.037139892578125,
0.018280029296875,
0.0203704833984375,
0.00351715087890625,
0.01477813720703125,
-0.00823974609375,
0.00580596923828125,
-0.03350830078125,
-0.06591796875,
0.08251953125,
-0.00518035888671875,
-0.01885986328125,
-0.06243896484375,
0.01184844970703125,
0.00783538818359375,
-0.006732940673828125,
-0.012298583984375,
-0.055999755859375,
-0.031646728515625,
0.032928466796875,
0.0177459716796875,
0.009674072265625,
0.049957275390625,
0.00621795654296875,
-0.0670166015625,
-0.0291748046875,
-0.052520751953125,
0.01495361328125,
-0.0382080078125,
0.01169586181640625,
-0.003509521484375,
0.0291900634765625,
-0.011505126953125,
-0.021881103515625,
0.00846099853515625,
-0.0244140625,
-0.0058746337890625,
-0.0243377685546875,
-0.032867431640625,
-0.014923095703125,
0.07281494140625,
0.00975799560546875,
0.0164642333984375,
-0.0110931396484375,
-0.0238494873046875,
-0.0289459228515625,
-0.058380126953125,
-0.00235748291015625,
0.030914306640625,
-0.0496826171875,
0.032745361328125,
-0.003032684326171875,
-0.00766754150390625,
-0.006221771240234375,
-0.019561767578125,
-0.03436279296875,
-0.00647735595703125,
0.028900146484375,
0.03802490234375,
-0.019317626953125,
-0.018035888671875,
0.05096435546875,
-0.0169525146484375,
0.03857421875,
-0.0032787322998046875,
0.02227783203125,
0.055267333984375,
0.0216827392578125,
-0.019073486328125,
0.013427734375,
-0.04046630859375,
0.016021728515625,
-0.011199951171875,
0.01137542724609375,
-0.03509521484375,
0.01751708984375,
-0.0043792724609375,
0.0301513671875,
0.0035686492919921875,
0.03143310546875,
-0.0015745162963867188,
0.006809234619140625,
0.00583648681640625,
-0.0174560546875,
-0.06756591796875,
0.04144287109375,
-0.0258941650390625,
0.0037631988525390625,
0.0174560546875,
0.03924560546875,
0.06549072265625,
-0.0035762786865234375,
-0.0007839202880859375,
0.0265350341796875,
-0.02081298828125,
-0.030181884765625,
0.0233306884765625,
-0.0426025390625,
0.00783538818359375,
0.0019054412841796875
] |
66839009360a69a47289f9227a09da5a2773c130
|
Wordpress Stackexchange
Q: Does Wordpress have a "Form API"? I do most of my development in Drupal. However I'm working on a Wordpress site and I need to make a form.
Which got me thinking: Is there something like a Form API for WordPress like there is in Drupal? Is there a way to add a standardized form by using PHP?
A: No, but it should ;)
There are several custom field class's (backend).
*
*wpAlchemy : https://github.com/farinspace/wpalchemy
*Meta Box Script: https://github.com/rilwis/meta-box
*My-Meta-Box: https://github.com/bainternet/My-Meta-Box
*meta-box-class: https://github.com/corycrowley/meta-box-class
*Meta Boxes Class: https://github.com/Bakke/Wordpress-Custom-Meta-Boxes-Class
For front-end forms, you probably best off with a plugin in Eugene Manuilov's link.
|
Q: Does Wordpress have a "Form API"? I do most of my development in Drupal. However I'm working on a Wordpress site and I need to make a form.
Which got me thinking: Is there something like a Form API for WordPress like there is in Drupal? Is there a way to add a standardized form by using PHP?
A: No, but it should ;)
There are several custom field class's (backend).
*
*wpAlchemy : https://github.com/farinspace/wpalchemy
*Meta Box Script: https://github.com/rilwis/meta-box
*My-Meta-Box: https://github.com/bainternet/My-Meta-Box
*meta-box-class: https://github.com/corycrowley/meta-box-class
*Meta Boxes Class: https://github.com/Bakke/Wordpress-Custom-Meta-Boxes-Class
For front-end forms, you probably best off with a plugin in Eugene Manuilov's link.
A: There is no Form API. Try to use plugin for it. Find it here: wordpress.org/extend/plugins/search.php?q=form
A: Another custom field library:
Custom Metaboxes and Fields for WordPress
https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
A lot of the 'free' form plugins in the repo are very limited in functionality, but there are options:
GravityForms
http://www.gravityforms.com/
NinjaForms
http://wpninjas.net/plugins/ninja-forms/
A: I might as well throw my hat into this ring. This plugin provides an API very similar to the Drupal forms API, and is great for general purposes form generation and processing.
https://github.com/oomphinc/WP-Forms-API
A: You can also see:
WP Forms API
https://github.com/jbrinley/wp-forms
Momtaz Nmwdhj
http://wordpress.org/plugins/momtaz-nmwdhj/
A: As of May 2017, there is no formal Forms API in the wordpress core.
There is the Fields API proposal that is working towards having a standard library for defining form fields.
The repo for the library can be found here:
https://github.com/sc0ttkclark/wordpress-fields-api
Although this library is in an alpha state, and not recommended for production.
There is a discussion of the issues here:https://torquemag.io/2016/02/wordpress-needs-fields-api-use/
Now wordpress is moving towards a more REST API driven admin area, I think that this Fields API is an important step to standardising the Wordpress back end, which to be honest desperately needs it.
Until then the best option is to use one of the plugins mentioned in the other answers.
|
wordpress
|
{
"language": "en",
"length": 315,
"provenance": "stackexchange_00019.jsonl.gz:418867",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48343"
}
|
[
0.00437164306640625,
0.0029582977294921875,
-0.039398193359375,
-0.030364990234375,
-0.005321502685546875,
-0.0280303955078125,
0.0176849365234375,
0.016387939453125,
0.01132965087890625,
0.004791259765625,
-0.0313720703125,
-0.0241851806640625,
-0.01435089111328125,
-0.0278778076171875,
-0.00685882568359375,
-0.059814453125,
0.0245208740234375,
-0.01153564453125,
0.026275634765625,
-0.0276641845703125,
0.005764007568359375,
-0.0239410400390625,
0.0290679931640625,
0.009613037109375,
0.01506805419921875,
-0.02606201171875,
0.0350341796875,
-0.0194854736328125,
-0.0018205642700195312,
-0.01137542724609375,
0.017181396484375,
0.0037097930908203125,
-0.0010042190551757812,
0.0372314453125,
0.003711700439453125,
0.0157928466796875,
0.033599853515625,
0.01143646240234375,
0.0248565673828125,
0.037506103515625,
0.0159454345703125,
-0.0240325927734375,
-0.006885528564453125,
0.00737762451171875,
-0.00624847412109375,
-0.052581787109375,
0.044158935546875,
-0.036346435546875,
0.0210113525390625,
-0.0030059814453125,
0.005252838134765625,
-0.031219482421875,
0.021575927734375,
-0.006778717041015625,
-0.0165557861328125,
-0.012420654296875,
0.0292510986328125,
-0.026458740234375,
0.0472412109375,
-0.04583740234375,
-0.038970947265625,
-0.04766845703125,
0.042083740234375,
0.006954193115234375,
-0.006679534912109375,
0.0023956298828125,
-0.05133056640625,
0.01788330078125,
0.01837158203125,
0.007534027099609375,
-0.00682830810546875,
-0.035247802734375,
-0.01538848876953125,
-0.00534820556640625,
0.0174102783203125,
-0.020751953125,
0.0147705078125,
-0.0007419586181640625,
-0.00371551513671875,
0.0401611328125,
-0.00400543212890625,
0.01434326171875,
-0.042755126953125,
-0.03973388671875,
0.0301666259765625,
0.028839111328125,
-0.0182342529296875,
-0.013519287109375,
-0.0222930908203125,
-0.061859130859375,
-0.0198211669921875,
-0.123779296875,
-0.0716552734375,
0.0406494140625,
0.02142333984375,
-0.0411376953125,
0.018798828125,
-0.041717529296875,
0.028900146484375,
0.0190277099609375,
0.0660400390625,
-0.07122802734375,
0.085205078125,
0.0017671585083007812,
-0.0157470703125,
0.0201263427734375,
0.007465362548828125,
0.004688262939453125,
-0.00627899169921875,
0.01175689697265625,
-0.0088653564453125,
-0.0357666015625,
0.0253753662109375,
-0.004138946533203125,
-0.0230255126953125,
-0.020782470703125,
-0.0089263916015625,
0.003566741943359375,
-0.0086212158203125,
-0.021026611328125,
-0.0220489501953125,
0.0019664764404296875,
0.057830810546875,
-0.0212554931640625,
0.00951385498046875,
0.0031108856201171875,
-0.0169677734375,
-0.043701171875,
0.006580352783203125,
0.0123138427734375,
-0.0266876220703125,
0.0134429931640625,
0.051605224609375,
0.02069091796875,
-0.0012054443359375,
-0.0134124755859375,
0.0168914794921875,
-0.04461669921875,
-0.00817108154296875,
0.015533447265625,
-0.00455474853515625,
-0.02874755859375,
0.004215240478515625,
-0.0019626617431640625,
0.016387939453125,
0.02325439453125,
0.0293426513671875,
0.01690673828125,
0.0048980712890625,
-0.044158935546875,
0.022705078125,
-0.00359344482421875,
-0.0022907257080078125,
0.0499267578125,
0.0242156982421875,
0.04888916015625,
0.06768798828125,
-0.019378662109375,
-0.031036376953125,
-0.0037708282470703125,
0.005767822265625,
-0.0225067138671875,
0.0171356201171875,
-0.009979248046875,
-0.005550384521484375,
0.007488250732421875,
-0.0285491943359375,
-0.0097808837890625,
0.01557159423828125,
0.01509857177734375,
0.021514892578125,
0.0248870849609375,
0.0086669921875,
-0.01031494140625,
-0.020416259765625,
-0.0203399658203125,
-0.0004100799560546875,
0.056610107421875,
0.02001953125,
0.0239105224609375,
0.00402069091796875,
-0.033905029296875,
0.08099365234375,
-0.028778076171875,
-0.046905517578125,
0.07403564453125,
0.01064300537109375,
0.054901123046875,
-0.0343017578125,
0.002124786376953125,
0.041900634765625,
0.06988525390625,
-0.007396697998046875,
0.02899169921875,
-0.030853271484375,
-0.042205810546875,
-0.00345611572265625,
0.00530242919921875,
-0.0279083251953125,
0.0264434814453125,
-0.04278564453125,
0.0014142990112304688,
-0.0175323486328125,
0.0311279296875,
0.005214691162109375,
-0.0033435821533203125,
-0.004589080810546875,
0.00997161865234375,
-0.042083740234375,
-0.0028629302978515625,
0.01580810546875,
-0.027069091796875,
-0.027191162109375,
0.0278778076171875,
0.0067291259765625,
0.0038623809814453125,
0.01363372802734375,
0.040252685546875,
0.006099700927734375,
0.015655517578125,
0.0007448196411132812,
-0.0211944580078125,
0.0031986236572265625,
0.01000213623046875,
0.029876708984375,
-0.0035800933837890625,
-0.0224151611328125,
-0.0211181640625,
0.0230560302734375,
-0.002643585205078125,
0.01468658447265625,
0.0298614501953125,
0.0222625732421875,
0.01824951171875,
-0.0259857177734375,
-0.027008056640625,
-0.026641845703125,
-0.09222412109375,
0.00016736984252929688,
0.06451416015625,
0.0132904052734375,
0.057769775390625,
0.01013946533203125,
0.06878662109375,
0.04876708984375,
-0.006725311279296875,
0.0136871337890625,
0.0186614990234375,
-0.00439453125,
0.021728515625,
-0.049774169921875,
0.0084075927734375,
0.03094482421875,
-0.043487548828125,
-0.00551605224609375,
0.02783203125,
-0.0220489501953125,
-0.0275421142578125,
0.00008046627044677734,
-0.01326751708984375,
0.016632080078125,
-0.056304931640625,
-0.057098388671875,
-0.011474609375,
0.02423095703125,
0.0212249755859375,
0.05609130859375,
0.05035400390625,
0.00682830810546875,
-0.0147857666015625,
-0.004486083984375,
0.006099700927734375,
0.0007214546203613281,
0.0213470458984375,
0.01416778564453125,
0.045196533203125,
-0.029510498046875,
-0.00823974609375,
0.0234527587890625,
0.01230621337890625,
-0.038818359375,
-0.002765655517578125,
-0.051177978515625,
-0.0165863037109375,
-0.00302886962890625,
-0.0694580078125,
0.0012216567993164062,
-0.0025348663330078125,
0.034423828125,
0.00464630126953125,
0.034088134765625,
-0.002674102783203125,
-0.042694091796875,
0.041259765625,
0.033905029296875,
-0.04241943359375,
-0.02301025390625,
-0.0013036727905273438,
0.03155517578125,
-0.026824951171875,
0.00786590576171875,
0.04864501953125,
-0.043365478515625,
0.037811279296875,
0.0013713836669921875,
-0.015899658203125,
-0.023773193359375,
0.03955078125,
0.010009765625,
-0.050567626953125,
-0.025726318359375,
-0.0248565673828125,
0.0139007568359375,
0.0285491943359375,
0.00968170166015625,
-0.0361328125,
-0.00826263427734375,
0.0297698974609375,
-0.058868408203125,
-0.04400634765625,
0.0206298828125,
-0.04180908203125,
-0.014068603515625,
-0.019989013671875,
-0.03460693359375,
0.0024509429931640625,
0.00559234619140625,
-0.0010347366333007812,
0.0007710456848144531,
-0.020111083984375,
-0.04150390625,
-0.052459716796875,
-0.07958984375,
-0.054290771484375,
0.0059967041015625,
0.004238128662109375,
0.0005564689636230469,
0.03240966796875,
-0.0016460418701171875,
-0.07000732421875,
-0.0209503173828125,
0.037506103515625,
0.006317138671875,
0.0092315673828125,
0.0201263427734375,
-0.04437255859375,
0.0325927734375,
-0.01319122314453125,
0.0195770263671875,
0.040618896484375,
-0.0217437744140625,
0.007289886474609375,
-0.0127410888671875,
-0.022613525390625,
-0.033447265625,
0.04412841796875,
0.0276947021484375,
-0.04803466796875,
-0.007778167724609375,
-0.076904296875,
-0.0018033981323242188,
0.0242767333984375,
-0.0033245086669921875,
0.002002716064453125,
-0.03375244140625,
-0.0284271240234375,
0.01214599609375,
0.0226898193359375,
-0.01372528076171875,
-0.00589752197265625,
-0.024322509765625,
-0.0142822265625,
0.0261993408203125,
-0.00525665283203125,
-0.01262664794921875,
0.0197601318359375,
-0.00019884109497070312,
-0.03302001953125,
0.017059326171875,
-0.005252838134765625,
-0.031280517578125,
-0.023681640625,
0.0017004013061523438,
-0.0241241455078125,
-0.09466552734375,
0.06005859375,
-0.03900146484375,
0.013580322265625,
-0.063232421875,
-0.032440185546875,
0.01708984375,
0.1400146484375,
-0.01702880859375,
-0.018035888671875,
-0.006988525390625,
0.0205535888671875,
-0.047882080078125,
-0.03424072265625,
-0.036712646484375,
0.001155853271484375,
-0.02081298828125,
0.003490447998046875,
0.01885986328125,
-0.025604248046875,
-0.0186920166015625,
0.02911376953125,
-0.0113372802734375,
-0.0026111602783203125,
0.016204833984375,
-0.045989990234375,
0.01415252685546875,
0.0196533203125,
0.032470703125,
-0.03485107421875,
0.0259857177734375,
-0.05804443359375,
-0.076904296875,
-0.01352691650390625,
-0.01172637939453125,
0.049468994140625,
0.013031005859375,
-0.04132080078125,
0.003971099853515625,
0.0504150390625,
0.00159454345703125,
0.00823974609375,
0.0208587646484375,
0.0261993408203125,
-0.004199981689453125,
-0.019683837890625,
0.0153961181640625,
-0.03277587890625,
-0.030792236328125,
-0.0272064208984375,
-0.004817962646484375,
0.0225067138671875,
-0.00833892822265625,
0.0003910064697265625,
0.00955963134765625,
-0.015777587890625,
0.024810791015625,
-0.059234619140625,
-0.060699462890625,
0.00925445556640625,
-0.045166015625,
0.0106048583984375,
-0.035675048828125,
-0.001316070556640625,
-0.0230865478515625,
-0.0035953521728515625,
-0.0218963623046875,
0.028839111328125,
0.049468994140625,
0.0214996337890625,
-0.00020384788513183594,
-0.09423828125,
-0.0307159423828125,
0.019195556640625,
0.00626373291015625,
0.0184783935546875,
-0.0020084381103515625,
-0.02679443359375,
0.05950927734375,
0.00701904296875,
-0.001079559326171875,
0.0025234222412109375,
0.028167724609375,
0.00708770751953125,
-0.031494140625,
0.029327392578125,
0.01096343994140625,
-0.011322021484375,
-0.019012451171875,
-0.01273345947265625,
-0.0162811279296875,
0.006237030029296875,
0.026947021484375,
-0.008575439453125,
0.036346435546875,
-0.0086517333984375,
-0.01416778564453125,
-0.008758544921875,
-0.00763702392578125,
0.00959014892578125,
0.0143890380859375,
0.0102386474609375,
-0.01654052734375,
-0.000518798828125,
0.01116943359375,
-0.0222320556640625,
-0.0164794921875,
-0.01611328125,
0.01058197021484375,
-0.00339508056640625,
0.0030651092529296875,
-0.017822265625,
-0.01788330078125,
0.07928466796875,
0.03216552734375,
-0.0467529296875,
0.033447265625,
-0.017578125,
0.0298614501953125,
0.00614166259765625,
-0.016815185546875,
0.01169586181640625,
0.01512908935546875,
-0.027801513671875,
0.0057525634765625,
0.00272369384765625,
-0.0223541259765625,
-0.034912109375,
0.012176513671875,
0.0012922286987304688,
-0.010955810546875,
0.00814056396484375,
0.03265380859375,
-0.0285797119140625,
0.033660888671875,
0.00919342041015625,
0.0236053466796875,
0.0160675048828125,
0.061431884765625,
0.0268402099609375,
-0.049530029296875,
0.0211181640625,
-0.0029392242431640625,
-0.01215362548828125,
-0.043487548828125,
-0.031982421875,
0.0262908935546875,
0.039520263671875,
0.0160064697265625,
-0.0011854171752929688,
-0.01004791259765625,
-0.01372528076171875,
-0.0232391357421875,
-0.044891357421875,
-0.038909912109375,
-0.017669677734375,
0.0076904296875,
0.0254364013671875,
-0.017669677734375,
0.00972747802734375,
-0.0092315673828125,
0.0027332305908203125,
0.007564544677734375,
-0.0028476715087890625,
-0.006927490234375,
-0.033477783203125,
0.004962921142578125,
0.007843017578125,
0.0010204315185546875,
-0.015899658203125,
-0.0121002197265625,
-0.040771484375,
0.002834320068359375,
-0.035614013671875,
-0.016357421875,
0.052520751953125,
-0.030487060546875,
0.01436614990234375,
-0.045196533203125,
0.03887939453125,
-0.062255859375,
0.004718780517578125,
0.026336669921875,
0.0230712890625,
0.008514404296875,
-0.0284576416015625,
-0.036285400390625,
-0.043121337890625,
-0.03369140625,
-0.0094146728515625,
-0.0289154052734375,
0.0085296630859375,
-0.0072174072265625,
0.0262908935546875,
-0.005382537841796875,
-0.006107330322265625,
0.0120086669921875,
0.0018138885498046875,
-0.0241546630859375,
0.01544952392578125,
0.0017223358154296875,
0.051788330078125,
-0.0287628173828125,
0.0716552734375,
0.01000213623046875,
0.019287109375,
-0.0189208984375,
-0.020263671875,
0.002956390380859375,
-0.076904296875,
-0.0546875,
-0.01291656494140625,
-0.041107177734375,
0.10302734375,
0.05865478515625,
-0.0024051666259765625,
0.01291656494140625,
-0.017425537109375,
0.006580352783203125,
-0.01152801513671875,
0.041778564453125,
-0.0222625732421875,
-0.0222015380859375,
0.0214996337890625,
-0.01264190673828125,
-0.00969696044921875,
-0.0281219482421875,
-0.01145172119140625,
0.0377197265625,
0.0118560791015625,
0.02886962890625,
0.00457763671875,
-0.03582763671875,
0.065185546875,
0.06805419921875,
0.0174560546875,
0.04669189453125,
0.01555633544921875,
0.007778167724609375,
0.0066375732421875,
0.01287841796875,
-0.0330810546875,
-0.0280609130859375,
0.03631591796875,
0.00949859619140625,
-0.02801513671875,
0.032806396484375,
-0.019073486328125,
0.043701171875,
0.037445068359375,
0.0867919921875,
-0.0634765625,
0.028533935546875,
0.0006237030029296875,
-0.039031982421875,
0.033050537109375,
-0.0102386474609375,
-0.000843048095703125,
-0.0183868408203125,
0.03314208984375,
0.02557373046875,
-0.017608642578125,
0.03338623046875,
0.012237548828125,
-0.0015659332275390625,
-0.045623779296875,
0.020172119140625,
0.004364013671875,
0.04351806640625,
0.00970458984375,
-0.026123046875,
0.049896240234375,
-0.049163818359375,
-0.0011968612670898438,
0.0179290771484375,
-0.0284881591796875,
-0.07171630859375,
0.01279449462890625,
0.01303863525390625,
0.01195526123046875,
0.01617431640625,
0.017120361328125,
0.061309814453125,
0.050628662109375,
0.0018167495727539062,
-0.0159759521484375,
0.01523590087890625,
0.0236358642578125,
-0.0237274169921875,
-0.048095703125,
0.00814056396484375,
0.0175933837890625,
-0.07440185546875,
0.0304718017578125,
-0.0251922607421875,
-0.0099334716796875,
0.00945281982421875,
0.00446319580078125,
0.0765380859375,
-0.0230865478515625,
-0.029510498046875,
0.02923583984375,
-0.0394287109375,
-0.01343536376953125,
-0.01294708251953125,
-0.022064208984375,
-0.039093017578125,
-0.0147857666015625,
-0.01491546630859375,
-0.0435791015625,
0.059783935546875,
-0.0272216796875,
-0.045654296875,
0.06658935546875,
0.04840087890625,
-0.0127105712890625,
0.0022869110107421875,
0.02764892578125,
-0.051422119140625,
0.0013246536254882812,
-0.01258087158203125,
0.0205230712890625,
0.01123046875,
-0.033203125,
-0.005611419677734375,
-0.00594329833984375,
-0.0222625732421875,
0.02825927734375,
0.04248046875,
-0.0014972686767578125,
0.02117919921875,
-0.0165863037109375,
0.035064697265625,
0.04144287109375,
-0.009857177734375,
-0.00531005859375,
0.007030487060546875,
0.01168060302734375,
0.051788330078125,
-0.0185546875,
0.03631591796875,
-0.035797119140625,
0.0097503662109375,
0.01861572265625,
0.004749298095703125,
-0.00014221668243408203,
-0.0138702392578125,
0.0234527587890625,
-0.0017156600952148438,
-0.02398681640625,
-0.005832672119140625,
-0.003292083740234375,
-0.024932861328125,
0.02880859375,
-0.027679443359375,
0.0083465576171875,
0.0057373046875,
-0.032623291015625,
0.0264892578125,
-0.01200103759765625,
0.045806884765625,
0.03338623046875,
0.0282745361328125,
0.053955078125,
0.0060272216796875,
0.039398193359375,
0.01971435546875,
-0.044281005859375,
0.057647705078125,
-0.01739501953125,
-0.00023925304412841797,
-0.08514404296875,
-0.015777587890625,
0.032623291015625,
0.0765380859375,
-0.055084228515625,
-0.05670166015625,
-0.00782012939453125,
0.01087188720703125,
0.0557861328125,
0.0200653076171875,
0.0736083984375,
-0.01824951171875,
0.0007576942443847656,
-0.01416778564453125,
-0.0112457275390625,
0.01139068603515625,
0.01593017578125,
0.0091705322265625,
0.0236663818359375,
-0.004058837890625,
-0.024017333984375,
-0.0222625732421875,
-0.0027370452880859375,
-0.0182037353515625,
0.058074951171875,
0.003330230712890625,
0.058013916015625,
-0.06280517578125,
-0.0165252685546875,
-0.01409912109375,
0.064697265625,
0.0288238525390625,
-0.008209228515625,
0.01163482666015625,
-0.0003421306610107422,
0.01374053955078125,
-0.022705078125,
0.024200439453125,
0.07568359375,
0.06317138671875,
0.034271240234375,
0.004024505615234375,
0.0007672309875488281,
0.0272979736328125,
-0.024017333984375,
-0.043212890625,
-0.049591064453125,
-0.001682281494140625,
0.039459228515625,
0.0189666748046875,
0.023162841796875,
-0.00989532470703125,
0.050628662109375,
-0.0174102783203125,
0.019989013671875,
-0.001438140869140625,
-0.032501220703125,
0.05902099609375,
0.001861572265625,
0.0762939453125,
0.0138092041015625,
-0.09161376953125,
-0.0178985595703125,
-0.017974853515625,
-0.05157470703125,
0.029541015625,
0.050506591796875,
-0.0164794921875,
0.005260467529296875,
0.01641845703125,
-0.0216522216796875,
0.0276031494140625,
0.0013456344604492188,
0.01499176025390625,
0.008697509765625,
0.02044677734375,
-0.01381683349609375,
-0.0703125,
-0.0291900634765625,
-0.031951904296875,
0.021240234375,
0.001743316650390625,
0.08062744140625,
-0.0018749237060546875,
0.0129241943359375,
-0.040771484375,
0.00878143310546875,
-0.01239013671875,
-0.0439453125,
0.045166015625,
0.033721923828125,
-0.00838470458984375,
-0.01169586181640625,
-0.039947509765625,
-0.005527496337890625,
0.0164031982421875,
-0.05499267578125,
0.00769805908203125,
-0.00424957275390625,
0.0187530517578125,
-0.0181121826171875,
-0.007472991943359375,
-0.02685546875,
-0.036834716796875,
0.01555633544921875,
0.02191162109375,
-0.00881195068359375,
0.039215087890625,
0.0168609619140625,
0.0242767333984375,
-0.023712158203125,
-0.0108489990234375,
0.0014019012451171875,
-0.032989501953125,
-0.0022411346435546875,
0.0270233154296875,
-0.0225372314453125,
0.007659912109375,
-0.033233642578125,
-0.02545166015625,
0.01032257080078125,
-0.00047397613525390625,
-0.01097869873046875,
-0.00917816162109375,
-0.01204681396484375,
0.003246307373046875,
0.00586700439453125,
0.0258941650390625,
-0.0107574462890625,
0.01038360595703125,
0.0162811279296875,
-0.01500701904296875,
0.01241302490234375,
-0.0234375,
-0.017486572265625,
-0.039703369140625,
0.01560211181640625,
0.0249481201171875,
0.004970550537109375,
0.005733489990234375,
-0.0310211181640625,
0.004886627197265625,
-0.00467681884765625,
-0.0201263427734375,
-0.0201568603515625,
-0.0157318115234375,
-0.024200439453125,
0.040771484375,
-0.0283660888671875,
-0.00426483154296875,
0.0246429443359375,
0.057647705078125,
-0.029876708984375,
-0.01511383056640625,
-0.0265045166015625,
0.00206756591796875,
-0.0178070068359375,
0.0308380126953125,
0.03692626953125,
-0.04998779296875,
0.00829315185546875,
0.0200958251953125,
0.052459716796875,
0.07025146484375,
0.06549072265625,
-0.041107177734375,
0.0045623779296875,
0.0014743804931640625,
0.03143310546875,
-0.018341064453125,
-0.01100921630859375,
-0.03533935546875,
0.014434814453125,
-0.03179931640625,
0.01165008544921875,
0.0177459716796875,
-0.05462646484375,
-0.1524658203125,
0.01349639892578125,
-0.03497314453125,
-0.06268310546875,
-0.04241943359375,
0.01291656494140625,
0.02655029296875,
-0.00159454345703125,
-0.0199127197265625,
-0.01071929931640625,
-0.0286865234375,
-0.0075225830078125,
0.01136016845703125,
0.0004634857177734375,
0.025360107421875,
0.0224761962890625,
-0.06842041015625,
0.0129241943359375,
0.003143310546875,
-0.00846099853515625,
0.0335693359375,
-0.023468017578125,
0.036285400390625,
0.047882080078125,
-0.042327880859375,
-0.0247802734375,
-0.01776123046875,
-0.006427764892578125,
-0.01434326171875,
-0.01322174072265625,
-0.0254058837890625,
-0.020416259765625,
0.05914306640625,
0.04925537109375,
0.016357421875,
-0.01837158203125,
0.0062103271484375,
0.033905029296875,
-0.00624847412109375,
-0.018768310546875,
0.00266265869140625,
-0.0433349609375,
-0.035369873046875,
-0.024444580078125,
-0.0019321441650390625,
0.002124786376953125,
0.0001569986343383789,
-0.005046844482421875,
0.015838623046875,
0.06573486328125,
-0.0012369155883789062,
0.004878997802734375,
-0.056121826171875,
0.061248779296875,
-0.042205810546875,
-0.0108489990234375,
0.013458251953125,
0.033721923828125,
0.0205230712890625,
0.028167724609375,
0.01207733154296875,
0.0103759765625,
-0.00930023193359375,
0.02008056640625,
0.01143646240234375,
0.03515625,
-0.0222625732421875,
-0.004436492919921875,
-0.038055419921875,
0.041351318359375,
0.0302581787109375,
0.052276611328125,
-0.07989501953125,
0.0662841796875,
0.0469970703125,
0.032989501953125,
-0.0228271484375,
-0.0684814453125,
-0.03759765625,
0.006351470947265625,
-0.02386474609375,
0.01287841796875,
0.02471923828125,
-0.033843994140625,
0.0226287841796875,
-0.01203155517578125,
0.025054931640625,
-0.0195770263671875,
0.004627227783203125,
0.0277099609375,
-0.00958251953125,
0.0191192626953125
] |
17c251fc2427f148bcbc939fc7c501ef0ddeb43b
|
Wordpress Stackexchange
Q: Sanitation needed for WP_Query or get_posts calls? Just wanted to get a straight answer on this: when submitting query_vars to a call to get_posts or WP_Query, is sanitation needed or does WordPress already take care of that?
A: No. Parameters given to the WP_Query object only need to be escaped for the database query - this is handled by WordPress.
|
Q: Sanitation needed for WP_Query or get_posts calls? Just wanted to get a straight answer on this: when submitting query_vars to a call to get_posts or WP_Query, is sanitation needed or does WordPress already take care of that?
A: No. Parameters given to the WP_Query object only need to be escaped for the database query - this is handled by WordPress.
|
wordpress
|
{
"language": "en",
"length": 61,
"provenance": "stackexchange_00019.jsonl.gz:418880",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48396"
}
|
[
0.09857177734375,
0.006832122802734375,
-0.0045928955078125,
-0.088134765625,
0.03118896484375,
-0.0236968994140625,
0.0257568359375,
0.01511383056640625,
0.017425537109375,
0.044586181640625,
-0.042327880859375,
-0.033416748046875,
0.0325927734375,
-0.0109405517578125,
-0.027557373046875,
-0.034088134765625,
0.0297698974609375,
-0.04925537109375,
-0.01947021484375,
-0.038818359375,
0.021026611328125,
-0.025421142578125,
0.02239990234375,
0.065673828125,
0.0223388671875,
0.0241241455078125,
0.02508544921875,
-0.004276275634765625,
0.0016698837280273438,
-0.01421356201171875,
0.0128326416015625,
-0.0102691650390625,
0.0269317626953125,
0.0252532958984375,
-0.014373779296875,
0.045989990234375,
0.01284027099609375,
0.0180511474609375,
0.0158538818359375,
0.0134735107421875,
0.0228271484375,
-0.01216888427734375,
-0.001956939697265625,
-0.020233154296875,
-0.0224761962890625,
0.0029048919677734375,
0.01154327392578125,
0.0028972625732421875,
0.0176544189453125,
-0.0204315185546875,
-0.0009965896606445312,
-0.00836181640625,
0.0194091796875,
-0.031829833984375,
-0.033111572265625,
-0.00946807861328125,
0.036651611328125,
-0.062103271484375,
0.0308990478515625,
-0.029876708984375,
-0.03521728515625,
-0.0380859375,
0.03851318359375,
-0.01097869873046875,
0.0220794677734375,
0.00922393798828125,
0.030914306640625,
0.013641357421875,
-0.07183837890625,
0.0047607421875,
0.045562744140625,
-0.049591064453125,
-0.0160980224609375,
0.0241241455078125,
0.0345458984375,
-0.049957275390625,
0.004726409912109375,
-0.0235595703125,
-0.00438690185546875,
0.07666015625,
-0.030792236328125,
-0.0655517578125,
-0.082275390625,
0.023712158203125,
-0.011810302734375,
0.034027099609375,
-0.0157318115234375,
0.005496978759765625,
-0.0200653076171875,
-0.040374755859375,
-0.01457977294921875,
-0.05731201171875,
-0.05596923828125,
0.0113677978515625,
0.01495361328125,
-0.051605224609375,
0.0082855224609375,
0.036468505859375,
-0.0160980224609375,
0.0299530029296875,
0.01161956787109375,
-0.041107177734375,
0.03424072265625,
-0.0330810546875,
0.0089569091796875,
-0.01029205322265625,
-0.01837158203125,
0.03631591796875,
0.05816650390625,
0.048370361328125,
0.0031986236572265625,
0.029388427734375,
0.01629638671875,
-0.0149078369140625,
-0.0457763671875,
0.0076751708984375,
0.01947021484375,
-0.03521728515625,
-0.002216339111328125,
-0.054290771484375,
0.00457763671875,
0.018768310546875,
-0.0232086181640625,
-0.003139495849609375,
0.0230255126953125,
0.0109100341796875,
-0.007198333740234375,
0.0014715194702148438,
-0.01806640625,
0.047149658203125,
-0.0139312744140625,
0.007404327392578125,
0.006694793701171875,
0.0027027130126953125,
-0.032073974609375,
-0.030487060546875,
0.0201263427734375,
-0.03594970703125,
-0.01202392578125,
0.0235748291015625,
-0.01361083984375,
-0.01503753662109375,
0.03082275390625,
-0.006313323974609375,
0.0266265869140625,
0.036468505859375,
0.0225830078125,
-0.011077880859375,
0.007015228271484375,
-0.0198516845703125,
-0.0230560302734375,
0.0061492919921875,
-0.0004851818084716797,
0.023162841796875,
-0.0184783935546875,
0.0157928466796875,
-0.030853271484375,
-0.001354217529296875,
-0.00356292724609375,
0.0106964111328125,
-0.0004897117614746094,
0.023590087890625,
0.06292724609375,
0.04296875,
0.0293426513671875,
-0.037109375,
-0.00856781005859375,
-0.01334381103515625,
0.0058746337890625,
0.048065185546875,
0.013427734375,
-0.022308349609375,
-0.00927734375,
-0.0008082389831542969,
-0.0231475830078125,
-0.01114654541015625,
0.0197906494140625,
-0.0009765625,
0.034576416015625,
0.002277374267578125,
-0.032745361328125,
-0.034027099609375,
0.062103271484375,
-0.045379638671875,
-0.0390625,
0.023956298828125,
0.01248931884765625,
0.058135986328125,
0.01507568359375,
0.0166015625,
0.0255126953125,
0.0120849609375,
-0.0235137939453125,
0.04345703125,
0.00418853759765625,
-0.04437255859375,
0.01374053955078125,
-0.0180511474609375,
0.00835418701171875,
-0.01236724853515625,
0.005603790283203125,
-0.022918701171875,
0.0165863037109375,
0.007717132568359375,
-0.039337158203125,
0.007152557373046875,
-0.031219482421875,
0.0222015380859375,
-0.016754150390625,
0.031707763671875,
0.0282440185546875,
0.041534423828125,
-0.061370849609375,
0.02587890625,
-0.008575439453125,
-0.00659942626953125,
-0.00420379638671875,
0.037628173828125,
-0.01209259033203125,
0.019500732421875,
-0.0118255615234375,
-0.041015625,
-0.0016126632690429688,
0.0322265625,
0.026885986328125,
0.0026721954345703125,
0.0035228729248046875,
0.001064300537109375,
0.048797607421875,
0.0037670135498046875,
0.0528564453125,
-0.00820159912109375,
0.07061767578125,
0.074951171875,
0.0303497314453125,
0.0003504753112792969,
0.04156494140625,
-0.07757568359375,
0.0092926025390625,
0.035858154296875,
0.01012420654296875,
0.0225677490234375,
-0.025726318359375,
0.00872802734375,
0.01418304443359375,
-0.009246826171875,
0.0197601318359375,
0.0001920461654663086,
0.0184478759765625,
0.057861328125,
0.029052734375,
-0.0247802734375,
-0.0107879638671875,
-0.0733642578125,
-0.004779815673828125,
0.0021305084228515625,
-0.01325225830078125,
0.0100250244140625,
0.007297515869140625,
-0.0198211669921875,
-0.0021114349365234375,
-0.014373779296875,
0.0037078857421875,
-0.013031005859375,
0.02862548828125,
-0.0225677490234375,
-0.00865936279296875,
-0.0164337158203125,
-0.0004794597625732422,
-0.0003409385681152344,
0.00887298583984375,
-0.0518798828125,
-0.0226898193359375,
0.03546142578125,
0.0257110595703125,
0.00411224365234375,
0.002994537353515625,
-0.00611114501953125,
-0.0325927734375,
0.0015172958374023438,
0.004474639892578125,
0.031768798828125,
0.04217529296875,
-0.01383209228515625,
-0.015411376953125,
-0.00142669677734375,
0.044830322265625,
0.0025730133056640625,
0.044647216796875,
-0.0051422119140625,
0.0192413330078125,
0.0118560791015625,
-0.036163330078125,
0.08721923828125,
0.002452850341796875,
-0.03857421875,
0.00455474853515625,
-0.0106353759765625,
0.0029659271240234375,
-0.002735137939453125,
0.00891876220703125,
0.05078125,
0.01520538330078125,
-0.015777587890625,
0.020172119140625,
0.008026123046875,
0.02081298828125,
0.00991058349609375,
-0.0028247833251953125,
0.0133819580078125,
-0.060577392578125,
-0.01291656494140625,
0.004505157470703125,
0.00836181640625,
-0.00830841064453125,
-0.051971435546875,
-0.008697509765625,
0.0025501251220703125,
-0.05035400390625,
-0.0280914306640625,
-0.006046295166015625,
-0.0247039794921875,
-0.02227783203125,
-0.01374053955078125,
0.007312774658203125,
0.017730712890625,
-0.02435302734375,
-0.0084381103515625,
-0.010040283203125,
0.0038967132568359375,
-0.09503173828125,
-0.06732177734375,
-0.082763671875,
0.0243377685546875,
-0.0102386474609375,
0.04156494140625,
-0.0108795166015625,
0.1053466796875,
0.0023479461669921875,
-0.084228515625,
-0.0416259765625,
0.000762939453125,
-0.03302001953125,
-0.0028133392333984375,
-0.005352020263671875,
0.033416748046875,
0.0179443359375,
-0.00945281982421875,
0.01953125,
0.044677734375,
-0.044891357421875,
0.0013322830200195312,
-0.00998687744140625,
-0.0304718017578125,
0.006683349609375,
0.031402587890625,
0.004306793212890625,
-0.0029087066650390625,
0.055084228515625,
-0.032470703125,
-0.0157623291015625,
-0.00830841064453125,
-0.0188446044921875,
-0.027313232421875,
-0.0157928466796875,
-0.004489898681640625,
-0.0235748291015625,
0.0301666259765625,
0.0110931396484375,
0.0005879402160644531,
-0.0005869865417480469,
-0.0257720947265625,
0.029937744140625,
0.0099029541015625,
0.031768798828125,
-0.002719879150390625,
-0.03411865234375,
-0.056060791015625,
0.021087646484375,
-0.033905029296875,
-0.035736083984375,
-0.02130126953125,
0.01070404052734375,
-0.007480621337890625,
-0.0169525146484375,
0.03692626953125,
0.01116943359375,
0.01177215576171875,
0.0031528472900390625,
-0.0280914306640625,
0.000972747802734375,
0.06610107421875,
0.01059722900390625,
-0.0210723876953125,
-0.034393310546875,
0.02044677734375,
-0.0654296875,
-0.08172607421875,
0.023040771484375,
-0.005615234375,
-0.026947021484375,
-0.0157928466796875,
-0.019744873046875,
-0.01439666748046875,
-0.0021152496337890625,
0.0191650390625,
0.01035308837890625,
-0.02630615234375,
0.038787841796875,
-0.054840087890625,
0.027587890625,
-0.01416778564453125,
0.0195465087890625,
-0.048919677734375,
-0.0295257568359375,
-0.01654052734375,
-0.1153564453125,
-0.0382080078125,
0.0325927734375,
0.0880126953125,
0.0155181884765625,
-0.062255859375,
0.00811004638671875,
0.0841064453125,
-0.0277099609375,
-0.0184783935546875,
0.00989532470703125,
0.033111572265625,
-0.05377197265625,
-0.0006198883056640625,
-0.006458282470703125,
-0.0289154052734375,
-0.00717926025390625,
-0.022003173828125,
-0.0087127685546875,
-0.034332275390625,
-0.036529541015625,
-0.033599853515625,
-0.026611328125,
-0.007221221923828125,
-0.043853759765625,
-0.01092529296875,
0.0210113525390625,
-0.003692626953125,
0.00821685791015625,
-0.01357269287109375,
0.0103759765625,
-0.01221466064453125,
0.038177490234375,
0.0369873046875,
-0.0011796951293945312,
-0.0005846023559570312,
0.0256195068359375,
0.022674560546875,
-0.03985595703125,
-0.038726806640625,
-0.0290069580078125,
0.00469970703125,
0.0082550048828125,
0.059539794921875,
0.040618896484375,
0.0014886856079101562,
0.00009202957153320312,
0.00424957275390625,
0.01192474365234375,
-0.0264892578125,
0.0254364013671875,
-0.005603790283203125,
0.00485992431640625,
0.01129913330078125,
-0.011566162109375,
0.038421630859375,
0.06964111328125,
-0.0054931640625,
-0.019134521484375,
0.00507354736328125,
0.0162811279296875,
-0.056365966796875,
0.0233612060546875,
-0.0026683807373046875,
-0.03192138671875,
0.018310546875,
-0.01044464111328125,
0.01128387451171875,
0.01317596435546875,
-0.006725311279296875,
-0.01128387451171875,
-0.0181884765625,
0.0234527587890625,
0.012359619140625,
0.01438140869140625,
-0.011260986328125,
0.057830810546875,
-0.01000213623046875,
0.01800537109375,
0.005420684814453125,
-0.007564544677734375,
0.043304443359375,
-0.017852783203125,
-0.0557861328125,
0.017333984375,
-0.00963592529296875,
0.035003662109375,
0.029510498046875,
-0.00765228271484375,
0.028839111328125,
0.00864410400390625,
-0.01470947265625,
0.0029735565185546875,
0.0171051025390625,
-0.04754638671875,
-0.0252227783203125,
0.0059661865234375,
-0.00047278404235839844,
0.00258636474609375,
0.01152801513671875,
0.0548095703125,
-0.031097412109375,
0.04534912109375,
-0.016571044921875,
-0.01015472412109375,
-0.015899658203125,
0.01396942138671875,
0.019561767578125,
-0.00128936767578125,
0.032379150390625,
-0.013671875,
0.039093017578125,
-0.0219879150390625,
-0.0081787109375,
0.0050201416015625,
-0.001224517822265625,
0.005214691162109375,
0.00206756591796875,
0.031463623046875,
0.023101806640625,
-0.0233612060546875,
0.0020236968994140625,
0.012847900390625,
-0.004150390625,
-0.03857421875,
-0.01551055908203125,
0.0281829833984375,
0.02801513671875,
-0.011474609375,
0.0254974365234375,
-0.02227783203125,
0.052001953125,
-0.0162506103515625,
0.031494140625,
-0.003833770751953125,
-0.009918212890625,
0.048370361328125,
-0.022552490234375,
-0.0211334228515625,
0.022613525390625,
0.05059814453125,
-0.04931640625,
-0.0258941650390625,
0.062744140625,
-0.004810333251953125,
0.039215087890625,
-0.0302581787109375,
-0.0172576904296875,
0.02874755859375,
-0.007167816162109375,
0.05548095703125,
0.0207061767578125,
-0.0081787109375,
-0.02001953125,
-0.050201416015625,
-0.036834716796875,
0.0167236328125,
0.00608062744140625,
-0.0119476318359375,
-0.005077362060546875,
-0.00698089599609375,
0.0243682861328125,
0.0167388916015625,
-0.00045108795166015625,
-0.0171051025390625,
-0.0010480880737304688,
-0.00827789306640625,
0.0181121826171875,
-0.006893157958984375,
0.0170745849609375,
0.0015344619750976562,
-0.005130767822265625,
0.0138397216796875,
0.0228424072265625,
0.005031585693359375,
-0.017120361328125,
-0.01064300537109375,
-0.08935546875,
-0.00330352783203125,
0.023956298828125,
0.008819580078125,
0.03076171875,
-0.0192108154296875,
0.01288604736328125,
0.0606689453125,
-0.01678466796875,
0.0008425712585449219,
-0.0015783309936523438,
-0.02899169921875,
-0.0604248046875,
0.026947021484375,
0.01230621337890625,
-0.04083251953125,
-0.001003265380859375,
-0.014312744140625,
0.0290985107421875,
0.015777587890625,
-0.051666259765625,
0.006252288818359375,
0.04315185546875,
0.00666046142578125,
0.0198822021484375,
0.058319091796875,
0.008880615234375,
0.037933349609375,
0.0086669921875,
0.0027370452880859375,
0.0024127960205078125,
0.022491455078125,
-0.023101806640625,
-0.03485107421875,
0.00550079345703125,
-0.01232147216796875,
-0.01153564453125,
-0.007495880126953125,
-0.0117034912109375,
0.04754638671875,
0.043212890625,
0.08990478515625,
-0.06622314453125,
0.0194091796875,
0.037322998046875,
-0.043060302734375,
0.00717926025390625,
-0.00733184814453125,
0.0126953125,
-0.00948333740234375,
-0.0014486312866210938,
0.00305938720703125,
-0.0183868408203125,
-0.0047454833984375,
-0.01094818115234375,
0.002716064453125,
-0.0158233642578125,
0.05682373046875,
-0.0125579833984375,
-0.055999755859375,
0.0059967041015625,
0.0254669189453125,
-0.0196380615234375,
0.002655029296875,
0.0187225341796875,
-0.006809234619140625,
-0.032470703125,
-0.046600341796875,
0.0140838623046875,
-0.01026153564453125,
-0.0311431884765625,
-0.0248870849609375,
0.03057861328125,
0.038665771484375,
0.0301055908203125,
0.0172882080078125,
-0.03179931640625,
-0.01361846923828125,
0.013031005859375,
0.003631591796875,
-0.0194091796875,
0.0311126708984375,
0.061798095703125,
-0.057830810546875,
0.0254058837890625,
-0.00972747802734375,
0.00286865234375,
-0.011322021484375,
-0.021759033203125,
0.067626953125,
-0.01995849609375,
-0.00936126708984375,
0.02996826171875,
0.0169677734375,
-0.0188446044921875,
-0.002201080322265625,
0.0147552490234375,
-0.02923583984375,
-0.006622314453125,
-0.00296783447265625,
-0.044342041015625,
-0.00478363037109375,
-0.0335693359375,
-0.0643310546875,
0.086181640625,
0.038055419921875,
0.02789306640625,
0.0190582275390625,
0.0218048095703125,
-0.03802490234375,
-0.00989532470703125,
-0.04925537109375,
0.06414794921875,
0.054931640625,
0.06378173828125,
-0.06011962890625,
-0.03155517578125,
0.031890869140625,
0.032989501953125,
0.0009641647338867188,
-0.01898193359375,
-0.0077667236328125,
-0.0185546875,
0.0416259765625,
0.073486328125,
0.031982421875,
-0.017852783203125,
0.025360107421875,
0.06781005859375,
0.1060791015625,
-0.046173095703125,
0.0386962890625,
0.0044708251953125,
0.0374755859375,
0.04876708984375,
-0.0015630722045898438,
-0.01332855224609375,
-0.01593017578125,
0.0005393028259277344,
-0.020965576171875,
-0.015411376953125,
0.00970458984375,
-0.00998687744140625,
0.00730133056640625,
0.022064208984375,
0.0280609130859375,
-0.045684814453125,
0.0012273788452148438,
-0.0294189453125,
0.04388427734375,
-0.006885528564453125,
0.031402587890625,
0.0662841796875,
0.01032257080078125,
0.11981201171875,
0.006107330322265625,
0.029510498046875,
0.00226593017578125,
0.0251922607421875,
0.06903076171875,
0.0247802734375,
0.029449462890625,
-0.0243072509765625,
0.031524658203125,
0.0194854736328125,
0.0775146484375,
-0.05828857421875,
-0.00429534912109375,
0.006587982177734375,
0.00334930419921875,
-0.0010099411010742188,
-0.00174713134765625,
0.03814697265625,
0.041473388671875,
0.0184783935546875,
-0.01285552978515625,
0.01366424560546875,
0.04400634765625,
-0.026824951171875,
-0.003009796142578125,
0.0251007080078125,
-0.0162811279296875,
0.039459228515625,
0.0004856586456298828,
-0.03143310546875,
-0.012359619140625,
0.07464599609375,
0.034454345703125,
0.0341796875,
-0.08563232421875,
-0.028533935546875,
-0.036163330078125,
0.03106689453125,
0.0261077880859375,
0.0306549072265625,
-0.017852783203125,
0.01488494873046875,
0.01549530029296875,
0.0216217041015625,
0.035614013671875,
0.047027587890625,
0.051605224609375,
0.02178955078125,
-0.00429534912109375,
0.0014448165893554688,
0.01380157470703125,
-0.032257080078125,
0.0249176025390625,
-0.0166473388671875,
-0.00592803955078125,
-0.0171661376953125,
-0.0266571044921875,
-0.03509521484375,
0.01342010498046875,
0.00439453125,
-0.0029811859130859375,
0.032501220703125,
-0.00019729137420654297,
-0.0266571044921875,
0.0372314453125,
-0.01861572265625,
0.07464599609375,
0.0223541259765625,
-0.025299072265625,
-0.0243682861328125,
-0.0022945404052734375,
-0.005840301513671875,
-0.0032138824462890625,
0.0230255126953125,
0.028106689453125,
-0.0203704833984375,
0.01026153564453125,
-0.04119873046875,
0.01554107666015625,
0.025970458984375,
0.01383209228515625,
-0.01299285888671875,
0.00009936094284057617,
-0.0201416015625,
-0.052276611328125,
-0.03802490234375,
-0.0004355907440185547,
0.01959228515625,
-0.03948974609375,
0.07757568359375,
-0.02496337890625,
-0.00885772705078125,
0.01267242431640625,
0.01490020751953125,
-0.0229949951171875,
0.032073974609375,
-0.0284576416015625,
-0.038360595703125,
-0.005825042724609375,
0.01096343994140625,
-0.0215911865234375,
-0.00592041015625,
0.041595458984375,
-0.044830322265625,
0.02911376953125,
-0.028076171875,
0.0091705322265625,
-0.061279296875,
0.047393798828125,
-0.02032470703125,
-0.0103607177734375,
0.006328582763671875,
-0.0084686279296875,
0.0283355712890625,
0.006855010986328125,
-0.0183258056640625,
0.0216217041015625,
0.0022525787353515625,
-0.0075531005859375,
0.036712646484375,
-0.049652099609375,
0.055755615234375,
0.037261962890625,
-0.029022216796875,
0.0457763671875,
-0.0189208984375,
-0.0262908935546875,
0.0238037109375,
0.0195770263671875,
-0.023834228515625,
-0.01165771484375,
0.044158935546875,
-0.0897216796875,
-0.041717529296875,
0.026702880859375,
0.0159454345703125,
0.016876220703125,
-0.08074951171875,
0.0027332305908203125,
-0.033660888671875,
0.01490020751953125,
-0.009918212890625,
0.0102386474609375,
-0.040252685546875,
0.0007419586181640625,
-0.00856781005859375,
-0.0750732421875,
-0.048828125,
-0.017852783203125,
0.00365447998046875,
0.0156707763671875,
-0.05841064453125,
0.0193634033203125,
0.0119476318359375,
0.00835418701171875,
-0.01023101806640625,
-0.004665374755859375,
0.0038738250732421875,
0.0212249755859375,
-0.036651611328125,
-0.020965576171875,
-0.0157623291015625,
0.00849151611328125,
0.00579071044921875,
0.03253173828125,
0.0272369384765625,
-0.048004150390625,
0.0058441162109375,
0.04876708984375,
0.050262451171875,
0.09344482421875,
0.043304443359375,
-0.01053619384765625,
0.0198822021484375,
0.0084075927734375,
-0.0239410400390625,
-0.05889892578125,
-0.00510406494140625,
-0.0489501953125,
0.0265960693359375,
-0.002285003662109375,
-0.004657745361328125,
0.005138397216796875,
-0.04925537109375,
-0.110107421875,
0.07330322265625,
-0.025909423828125,
-0.036712646484375,
-0.0144195556640625,
-0.0123443603515625,
0.00916290283203125,
-0.03662109375,
-0.0066070556640625,
-0.01593017578125,
-0.045684814453125,
-0.00589752197265625,
0.0279541015625,
-0.0152435302734375,
0.052154541015625,
-0.004886627197265625,
-0.055938720703125,
-0.0030574798583984375,
-0.0196075439453125,
0.0228271484375,
-0.01300811767578125,
0.01360321044921875,
0.026702880859375,
0.052001953125,
-0.005626678466796875,
0.0230865478515625,
-0.0028438568115234375,
-0.0250396728515625,
-0.0165252685546875,
0.0017194747924804688,
0.0004165172576904297,
0.0323486328125,
0.064208984375,
0.05218505859375,
0.00955963134765625,
-0.05267333984375,
-0.0019931793212890625,
-0.035552978515625,
0.01158905029296875,
0.007747650146484375,
0.0047454833984375,
-0.0313720703125,
0.006839752197265625,
0.0203399658203125,
0.0099029541015625,
-0.005588531494140625,
-0.0172882080078125,
0.01568603515625,
-0.0254058837890625,
0.0192718505859375,
-0.019927978515625,
0.0523681640625,
-0.038055419921875,
0.004093170166015625,
-0.0033111572265625,
-0.0229339599609375,
-0.003391265869140625,
0.03802490234375,
-0.032562255859375,
0.0179443359375,
-0.006717681884765625,
-0.0013532638549804688,
-0.0017757415771484375,
0.01386260986328125,
0.004856109619140625,
0.005443572998046875,
0.01093292236328125,
-0.004474639892578125,
-0.0032863616943359375,
0.03216552734375,
0.01983642578125,
0.048675537109375,
-0.03179931640625,
0.03912353515625,
0.01483154296875,
0.0325927734375,
-0.021728515625,
0.0266265869140625,
0.0097503662109375,
0.01168060302734375,
0.01100921630859375,
-0.0050201416015625,
0.0799560546875,
-0.058074951171875,
0.0036830902099609375,
-0.004421234130859375,
-0.01126861572265625,
-0.05712890625,
0.003223419189453125,
0.0270843505859375,
0.0015268325805664062,
0.0287017822265625
] |
b3e8e48c2cc0328ad4c5225734cff3d333951e41
|
Wordpress Stackexchange
Q: How to retrieve $_GET variables from rewritten URLs? I need to receive some special $_GET parameters for a custom page I'm making, i know how to receive this through a simple $_GET like mysite.net/products/?id=1 , but I wanted to use the URL style of my WordPress like mysite.net/products/1.
How to retrieve $_GET variables from rewritten URLs?
A: To be added on init:
To register your custom variable ('id' in the question)
add_rewrite_tag('%mycustomvar%','([^&]+)');
To create a re-write rule:
add_rewrite_rule('^product/([0-9]{1,})/?','index.php?p=4&mycustomvar=$matches[1]','top')
4 is the id of the 'product' page. You will need to flush rewrite rules once after adding these (go to Permalink settings page)
You can get the value of mycustomvar: get_query_var( 'mycustomvar' ).
See Codex for:
*
*add_rewrite_tag
*add_rewrite_rule
|
Q: How to retrieve $_GET variables from rewritten URLs? I need to receive some special $_GET parameters for a custom page I'm making, i know how to receive this through a simple $_GET like mysite.net/products/?id=1 , but I wanted to use the URL style of my WordPress like mysite.net/products/1.
How to retrieve $_GET variables from rewritten URLs?
A: To be added on init:
To register your custom variable ('id' in the question)
add_rewrite_tag('%mycustomvar%','([^&]+)');
To create a re-write rule:
add_rewrite_rule('^product/([0-9]{1,})/?','index.php?p=4&mycustomvar=$matches[1]','top')
4 is the id of the 'product' page. You will need to flush rewrite rules once after adding these (go to Permalink settings page)
You can get the value of mycustomvar: get_query_var( 'mycustomvar' ).
See Codex for:
*
*add_rewrite_tag
*add_rewrite_rule
|
wordpress
|
{
"language": "en",
"length": 119,
"provenance": "stackexchange_00019.jsonl.gz:418912",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48487"
}
|
[
0.0175323486328125,
-0.032806396484375,
-0.01155853271484375,
-0.051605224609375,
-0.0176544189453125,
0.005420684814453125,
-0.006591796875,
0.02197265625,
-0.00476837158203125,
0.004608154296875,
-0.01160430908203125,
0.01020050048828125,
-0.0330810546875,
-0.0249176025390625,
0.0157318115234375,
-0.022003173828125,
0.03558349609375,
-0.0416259765625,
0.0009889602661132812,
-0.0157318115234375,
0.01023101806640625,
0.0045318603515625,
0.0267333984375,
0.08294677734375,
0.03350830078125,
-0.0181121826171875,
0.022857666015625,
-0.00801849365234375,
0.00806427001953125,
-0.0238494873046875,
0.01218414306640625,
0.00789642333984375,
0.0275726318359375,
0.0023956298828125,
-0.007106781005859375,
0.00292205810546875,
0.0278778076171875,
-0.007171630859375,
0.00499725341796875,
0.0323486328125,
0.0291900634765625,
-0.04034423828125,
-0.007122039794921875,
0.00525665283203125,
-0.007556915283203125,
-0.0181884765625,
0.033599853515625,
-0.0335693359375,
-0.0130462646484375,
0.047271728515625,
-0.007762908935546875,
0.047821044921875,
-0.013031005859375,
0.025543212890625,
0.00481414794921875,
-0.0161590576171875,
0.0225372314453125,
-0.04302978515625,
0.00664520263671875,
-0.0157012939453125,
-0.008880615234375,
-0.0009512901306152344,
0.032257080078125,
0.02545166015625,
-0.021881103515625,
0.010589599609375,
0.02508544921875,
0.0277252197265625,
-0.056732177734375,
-0.05706787109375,
0.0188446044921875,
-0.012603759765625,
-0.0134429931640625,
-0.0177459716796875,
-0.00010061264038085938,
-0.01763916015625,
0.0243988037109375,
-0.0290985107421875,
-0.0272216796875,
0.040679931640625,
-0.0025157928466796875,
-0.047821044921875,
-0.01311492919921875,
0.0003986358642578125,
0.0163421630859375,
0.014129638671875,
-0.004596710205078125,
-0.0052032470703125,
-0.03643798828125,
-0.029937744140625,
-0.03436279296875,
-0.0236968994140625,
-0.04302978515625,
-0.00362396240234375,
-0.0290069580078125,
0.0009860992431640625,
0.035552978515625,
0.032562255859375,
0.00946044921875,
0.021881103515625,
-0.01485443115234375,
-0.046722412109375,
0.040496826171875,
-0.02880859375,
-0.003749847412109375,
0.0161590576171875,
0.04681396484375,
0.102783203125,
0.053802490234375,
-0.01451873779296875,
0.003261566162109375,
0.055023193359375,
-0.00489044189453125,
0.054443359375,
-0.06976318359375,
0.0203857421875,
-0.01404571533203125,
-0.052520751953125,
-0.043426513671875,
0.01384735107421875,
-0.01137542724609375,
0.0362548828125,
-0.029541015625,
-0.00798797607421875,
0.009521484375,
-0.007442474365234375,
0.020294189453125,
-0.028289794921875,
-0.061065673828125,
0.062286376953125,
-0.0261077880859375,
0.01021575927734375,
0.01300048828125,
0.00848388671875,
-0.020965576171875,
-0.026947021484375,
0.019378662109375,
0.003971099853515625,
-0.0152130126953125,
0.0316162109375,
-0.0169677734375,
-0.041778564453125,
-0.002735137939453125,
-0.0272369384765625,
-0.03369140625,
0.0185546875,
0.0274810791015625,
0.0200042724609375,
-0.03692626953125,
-0.057525634765625,
-0.0164337158203125,
0.00659942626953125,
0.037445068359375,
0.00804901123046875,
-0.004138946533203125,
0.0113067626953125,
0.053466796875,
-0.023590087890625,
-0.039276123046875,
-0.024139404296875,
0.02044677734375,
0.0008177757263183594,
0.0163726806640625,
0.00608062744140625,
-0.0099639892578125,
-0.033172607421875,
-0.03765869140625,
-0.00897979736328125,
0.01287841796875,
0.0457763671875,
0.02618408203125,
-0.01505279541015625,
-0.0208892822265625,
0.0166473388671875,
0.0124664306640625,
0.005352020263671875,
0.00864410400390625,
0.0253753662109375,
0.025604248046875,
0.0308074951171875,
-0.0011148452758789062,
-0.043243408203125,
0.058258056640625,
-0.038970947265625,
-0.0665283203125,
0.0950927734375,
-0.0284271240234375,
0.08856201171875,
0.014801025390625,
-0.019317626953125,
0.0303955078125,
0.0009746551513671875,
-0.0258636474609375,
0.033905029296875,
-0.00545501708984375,
-0.0016632080078125,
0.0202789306640625,
0.0338134765625,
-0.0123748779296875,
-0.0408935546875,
-0.0153961181640625,
-0.004619598388671875,
0.023956298828125,
0.038970947265625,
0.0024166107177734375,
0.0276641845703125,
-0.0141754150390625,
0.006999969482421875,
-0.019134521484375,
0.03240966796875,
0.03179931640625,
0.0335693359375,
-0.052642822265625,
0.01160430908203125,
0.0209503173828125,
0.029876708984375,
0.01398468017578125,
0.0797119140625,
0.0110321044921875,
0.0088653564453125,
0.035888671875,
-0.035797119140625,
0.041534423828125,
0.038055419921875,
0.00008535385131835938,
0.0034542083740234375,
-0.01238250732421875,
0.0087127685546875,
0.0277557373046875,
0.01398468017578125,
0.00244903564453125,
-0.0033969879150390625,
-0.01446533203125,
0.0394287109375,
-0.00029540061950683594,
0.0030670166015625,
-0.006252288818359375,
-0.052398681640625,
0.0092315673828125,
0.03448486328125,
0.04583740234375,
0.0218658447265625,
-0.0252532958984375,
-0.051513671875,
0.0242462158203125,
-0.0301361083984375,
0.0024871826171875,
-0.0340576171875,
-0.0169525146484375,
0.045318603515625,
0.01500701904296875,
-0.0048370361328125,
-0.002292633056640625,
-0.053497314453125,
-0.04376220703125,
0.03448486328125,
-0.01511383056640625,
0.0438232421875,
-0.03271484375,
0.0191650390625,
-0.04815673828125,
-0.006103515625,
0.027496337890625,
-0.0458984375,
0.033294677734375,
0.01263427734375,
0.0258941650390625,
0.0299224853515625,
-0.009246826171875,
0.00975799560546875,
-0.00930023193359375,
-0.01971435546875,
-0.02301025390625,
-0.0126800537109375,
-0.003513336181640625,
-0.06829833984375,
0.0027141571044921875,
0.052032470703125,
-0.04510498046875,
-0.04443359375,
0.0106048583984375,
0.053802490234375,
0.0004737377166748047,
-0.01335906982421875,
-0.0288543701171875,
-0.036163330078125,
-0.0018243789672851562,
0.0159149169921875,
0.0460205078125,
0.025115966796875,
0.051055908203125,
0.00650787353515625,
-0.0161590576171875,
0.040130615234375,
-0.021087646484375,
-0.032318115234375,
0.037200927734375,
-0.01806640625,
0.03729248046875,
-0.00579833984375,
0.032745361328125,
0.0570068359375,
0.006237030029296875,
-0.00438690185546875,
0.007564544677734375,
-0.00039958953857421875,
0.01027679443359375,
0.02166748046875,
0.01183319091796875,
-0.005435943603515625,
-0.06292724609375,
-0.0220794677734375,
0.0164642333984375,
0.041900634765625,
0.016143798828125,
-0.0394287109375,
0.02093505859375,
0.0275115966796875,
-0.076171875,
-0.093505859375,
0.0213775634765625,
-0.048431396484375,
-0.0261993408203125,
0.001972198486328125,
-0.032867431640625,
0.0036602020263671875,
0.022125244140625,
-0.00481414794921875,
0.01430511474609375,
0.00507354736328125,
-0.08447265625,
-0.038055419921875,
-0.09320068359375,
-0.0017719268798828125,
-0.014434814453125,
0.0201263427734375,
-0.01024627685546875,
0.002651214599609375,
-0.0123443603515625,
-0.0066375732421875,
0.01451873779296875,
-0.0267791748046875,
0.01873779296875,
-0.016693115234375,
-0.01183319091796875,
-0.03680419921875,
0.046417236328125,
-0.0209808349609375,
0.052825927734375,
0.04351806640625,
-0.01104736328125,
0.0016574859619140625,
0.00798797607421875,
0.0174407958984375,
0.0221405029296875,
0.00682830810546875,
0.00151824951171875,
0.0244293212890625,
0.0261383056640625,
-0.0364990234375,
-0.0672607421875,
0.006412506103515625,
-0.037811279296875,
0.004764556884765625,
0.034698486328125,
-0.0098724365234375,
-0.023895263671875,
0.042694091796875,
0.0229339599609375,
-0.032135009765625,
0.021759033203125,
-0.046142578125,
0.053802490234375,
0.015594482421875,
0.05322265625,
-0.03466796875,
0.07086181640625,
-0.0175628662109375,
0.01557159423828125,
0.0404052734375,
-0.0228271484375,
-0.0005750656127929688,
-0.0455322265625,
-0.035888671875,
-0.030731201171875,
0.04541015625,
-0.022857666015625,
-0.00460052490234375,
-0.0269775390625,
-0.01532745361328125,
-0.022735595703125,
0.069580078125,
0.016632080078125,
-0.012542724609375,
-0.0181121826171875,
0.006134033203125,
-0.0251007080078125,
-0.05413818359375,
-0.00952911376953125,
-0.004611968994140625,
-0.07305908203125,
0.009552001953125,
-0.00859832763671875,
-0.0309295654296875,
-0.003055572509765625,
0.00797271728515625,
-0.0239715576171875,
-0.043731689453125,
0.0272064208984375,
-0.0197601318359375,
-0.0007944107055664062,
0.0022735595703125,
0.00040340423583984375,
-0.021331787109375,
-0.0208892822265625,
-0.0037250518798828125,
-0.04754638671875,
-0.03424072265625,
0.06268310546875,
0.044219970703125,
0.0017385482788085938,
-0.046356201171875,
0.0228118896484375,
0.06951904296875,
-0.0135498046875,
-0.0285491943359375,
0.01259613037109375,
0.004123687744140625,
-0.0224151611328125,
-0.004421234130859375,
-0.011810302734375,
-0.035919189453125,
-0.00876617431640625,
-0.030548095703125,
-0.02215576171875,
-0.0189971923828125,
-0.0093841552734375,
-0.0162506103515625,
0.01369476318359375,
-0.02935791015625,
-0.08782958984375,
-0.01153564453125,
0.0197296142578125,
-0.00806427001953125,
0.04327392578125,
-0.043670654296875,
0.01290130615234375,
-0.06878662109375,
0.018707275390625,
0.0182342529296875,
-0.0226593017578125,
-0.0110321044921875,
0.00571441650390625,
0.025634765625,
-0.031402587890625,
0.06817626953125,
-0.005428314208984375,
0.0518798828125,
-0.01096343994140625,
0.01241302490234375,
0.0318603515625,
-0.0323486328125,
0.02056884765625,
0.014617919921875,
0.0089111328125,
0.001880645751953125,
0.01158905029296875,
-0.0018396377563476562,
-0.01812744140625,
0.00782012939453125,
-0.01470184326171875,
-0.0020351409912109375,
0.045196533203125,
-0.043548583984375,
-0.0241546630859375,
0.0014972686767578125,
0.047943115234375,
-0.08099365234375,
0.071533203125,
-0.02349853515625,
-0.0272979736328125,
0.0345458984375,
-0.0057220458984375,
0.06298828125,
-0.00494384765625,
0.01374053955078125,
0.031982421875,
0.0192413330078125,
0.0025386810302734375,
0.0036640167236328125,
-0.01270294189453125,
0.00885772705078125,
0.0216522216796875,
0.0016641616821289062,
-0.011505126953125,
0.0030918121337890625,
0.00878143310546875,
-0.0159912109375,
-0.0073394775390625,
-0.0252227783203125,
-0.032470703125,
0.00569915771484375,
-0.004558563232421875,
0.0177764892578125,
-0.040191650390625,
0.0300445556640625,
0.032073974609375,
-0.017303466796875,
0.0289306640625,
-0.0232086181640625,
0.006320953369140625,
-0.036163330078125,
0.0743408203125,
0.0182952880859375,
-0.00013303756713867188,
-0.03240966796875,
0.11090087890625,
-0.008087158203125,
0.03680419921875,
0.004467010498046875,
0.0208740234375,
0.03631591796875,
0.012786865234375,
0.00684356689453125,
0.0024280548095703125,
0.0193023681640625,
-0.0037078857421875,
0.02508544921875,
-0.0230255126953125,
0.007595062255859375,
0.01739501953125,
0.047210693359375,
-0.01399993896484375,
-0.0257720947265625,
0.0146331787109375,
-0.061920166015625,
-0.02569580078125,
0.00078582763671875,
-0.0166015625,
-0.02716064453125,
-0.034820556640625,
-0.0304107666015625,
0.01416015625,
0.0198974609375,
-0.0028591156005859375,
-0.0258636474609375,
-0.03265380859375,
0.0159912109375,
-0.004009246826171875,
0.0218505859375,
-0.007404327392578125,
-0.0182952880859375,
0.037506103515625,
-0.0038509368896484375,
0.01258087158203125,
-0.0482177734375,
-0.001312255859375,
-0.04095458984375,
-0.0125885009765625,
0.062164306640625,
0.0026340484619140625,
0.04583740234375,
-0.033782958984375,
-0.02239990234375,
0.032501220703125,
-0.0103759765625,
0.060546875,
-0.0007982254028320312,
0.0063018798828125,
-0.0144805908203125,
-0.03759765625,
-0.00954437255859375,
0.0239410400390625,
-0.016876220703125,
0.0265045166015625,
-0.0133056640625,
-0.00982666015625,
0.044189453125,
-0.0080718994140625,
0.00603485107421875,
-0.0199127197265625,
0.0035343170166015625,
-0.00847625732421875,
0.051361083984375,
0.031982421875,
0.0307769775390625,
-0.03216552734375,
0.044708251953125,
0.0302276611328125,
0.028228759765625,
-0.035919189453125,
-0.034423828125,
-0.01800537109375,
-0.0075531005859375,
-0.007007598876953125,
-0.0177764892578125,
0.03790283203125,
0.044158935546875,
0.08270263671875,
0.00614166259765625,
-0.0086212158203125,
-0.01605224609375,
0.00809478759765625,
-0.034454345703125,
0.0264892578125,
-0.0224456787109375,
0.002040863037109375,
-0.022369384765625,
-0.013580322265625,
0.0020885467529296875,
0.0133819580078125,
0.033782958984375,
-0.002994537353515625,
-0.00801849365234375,
0.0137176513671875,
-0.010833740234375,
-0.06732177734375,
0.039520263671875,
0.105224609375,
0.03802490234375,
0.08758544921875,
-0.0174713134765625,
0.039459228515625,
0.09234619140625,
0.022369384765625,
-0.004901885986328125,
-0.0036411285400390625,
0.017242431640625,
-0.0011882781982421875,
0.005687713623046875,
0.00769805908203125,
-0.0006613731384277344,
-0.006916046142578125,
0.045166015625,
0.050048828125,
-0.06903076171875,
0.00897216796875,
0.018768310546875,
-0.01076507568359375,
-0.0181427001953125,
0.042022705078125,
-0.036895751953125,
-0.034820556640625,
-0.0285491943359375,
-0.0294952392578125,
-0.01049041748046875,
-0.014190673828125,
0.022979736328125,
0.0015087127685546875,
-0.0244140625,
0.0274658203125,
-0.01177215576171875,
0.006603240966796875,
-0.01538848876953125,
-0.0085601806640625,
0.00238037109375,
-0.0092926025390625,
-0.018157958984375,
0.051177978515625,
-0.040679931640625,
-0.036834716796875,
0.040771484375,
-0.0250701904296875,
-0.007175445556640625,
-0.0138702392578125,
0.0160369873046875,
0.0289459228515625,
0.029815673828125,
0.01406097412109375,
-0.0269012451171875,
0.02020263671875,
-0.033477783203125,
0.06475830078125,
-0.018341064453125,
0.0023174285888671875,
-0.01163482666015625,
-0.01358795166015625,
-0.0179595947265625,
0.003021240234375,
-0.0218963623046875,
-0.01183319091796875,
0.01544952392578125,
0.047698974609375,
-0.0245361328125,
-0.013275146484375,
0.05322265625,
0.03472900390625,
-0.0174713134765625,
0.0038051605224609375,
-0.0012826919555664062,
-0.0231781005859375,
0.00682830810546875,
0.00286102294921875,
-0.020050048828125,
0.000743865966796875,
-0.00817108154296875,
-0.068115234375,
0.036102294921875,
0.01442718505859375,
0.053985595703125,
0.03955078125,
0.0013132095336914062,
-0.0169830322265625,
-0.0285491943359375,
-0.0255584716796875,
0.046783447265625,
0.00800323486328125,
0.05126953125,
-0.061676025390625,
-0.03594970703125,
0.0265350341796875,
0.0804443359375,
0.0869140625,
0.01004791259765625,
-0.0238800048828125,
-0.004154205322265625,
0.05084228515625,
0.037841796875,
-0.0146942138671875,
0.0095672607421875,
0.02093505859375,
0.049468994140625,
0.08294677734375,
-0.07550048828125,
0.01114654541015625,
-0.0021038055419921875,
0.032928466796875,
0.032012939453125,
-0.006175994873046875,
-0.0240325927734375,
-0.00396728515625,
0.01438140869140625,
-0.04742431640625,
0.0047607421875,
0.01763916015625,
-0.00832366943359375,
0.025115966796875,
0.0197296142578125,
0.02740478515625,
-0.0030670166015625,
-0.038360595703125,
-0.0084075927734375,
0.03131103515625,
0.003314971923828125,
0.0107879638671875,
0.039581298828125,
0.0178985595703125,
0.0423583984375,
0.01532745361328125,
0.005466461181640625,
0.01375579833984375,
0.0224456787109375,
0.048797607421875,
0.049072265625,
0.041351318359375,
-0.000046312808990478516,
0.0275421142578125,
0.02996826171875,
0.048553466796875,
-0.047210693359375,
-0.03302001953125,
0.0004324913024902344,
-0.0177154541015625,
0.00202178955078125,
-0.0135345458984375,
0.0023250579833984375,
0.0203857421875,
0.023345947265625,
-0.044281005859375,
0.01380157470703125,
0.042510986328125,
0.01474761962890625,
-0.00971221923828125,
0.000009715557098388672,
-0.036834716796875,
0.0181884765625,
-0.03204345703125,
-0.03314208984375,
-0.0007915496826171875,
0.05963134765625,
0.05322265625,
0.0246734619140625,
-0.030059814453125,
-0.042144775390625,
0.0093994140625,
0.039337158203125,
-0.01340484619140625,
-0.0140228271484375,
-0.0258331298828125,
-0.05487060546875,
-0.004604339599609375,
0.039276123046875,
0.053436279296875,
-0.0004601478576660156,
0.0469970703125,
0.003116607666015625,
-0.03143310546875,
0.0110321044921875,
0.02545166015625,
-0.025177001953125,
0.0517578125,
-0.040679931640625,
0.03582763671875,
-0.0230255126953125,
-0.01183319091796875,
-0.050872802734375,
0.0020046234130859375,
0.00656890869140625,
-0.033905029296875,
0.0712890625,
-0.0025424957275390625,
-0.010498046875,
0.01081085205078125,
-0.0200042724609375,
0.044403076171875,
-0.0101165771484375,
-0.017059326171875,
0.026031494140625,
-0.025970458984375,
-0.05242919921875,
-0.0165557861328125,
0.0281219482421875,
0.00592041015625,
0.00038361549377441406,
-0.004638671875,
-0.00751495361328125,
0.0052642822265625,
0.0207061767578125,
-0.02606201171875,
0.0057373046875,
0.0252685546875,
-0.006946563720703125,
-0.033599853515625,
-0.00782012939453125,
-0.0029239654541015625,
0.0088653564453125,
0.0301666259765625,
0.041595458984375,
-0.00823211669921875,
0.0099945068359375,
-0.0197601318359375,
0.04052734375,
-0.036529541015625,
-0.01493072509765625,
0.0227813720703125,
-0.01302337646484375,
0.003025054931640625,
-0.0012483596801757812,
-0.005229949951171875,
0.0572509765625,
0.010345458984375,
-0.0240631103515625,
0.0408935546875,
-0.0206451416015625,
0.004405975341796875,
-0.004245758056640625,
0.04327392578125,
-0.02813720703125,
-0.061676025390625,
-0.024749755859375,
0.008392333984375,
0.00110626220703125,
0.021331787109375,
-0.022613525390625,
0.03973388671875,
0.02313232421875,
0.032470703125,
0.0236663818359375,
-0.01169586181640625,
0.0596923828125,
0.045166015625,
-0.045745849609375,
0.0094757080078125,
-0.02069091796875,
-0.0237579345703125,
0.0272216796875,
-0.0181121826171875,
0.02911376953125,
-0.0213623046875,
0.0304718017578125,
-0.01849365234375,
-0.0462646484375,
-0.002124786376953125,
-0.01183319091796875,
-0.0195465087890625,
-0.01151275634765625,
0.010467529296875,
-0.0219573974609375,
-0.043701171875,
-0.00843048095703125,
-0.031707763671875,
0.001495361328125,
0.027008056640625,
0.0034770965576171875,
0.00717926025390625,
0.0026397705078125,
0.00600433349609375,
0.0231170654296875,
0.01078033447265625,
-0.0948486328125,
0.0458984375,
-0.0148468017578125,
0.065185546875,
-0.02703857421875,
0.004322052001953125,
0.003856658935546875,
0.0257415771484375,
-0.043182373046875,
-0.0019273757934570312,
-0.0250244140625,
-0.0095062255859375,
-0.025848388671875,
0.0207672119140625,
0.05633544921875,
-0.01000213623046875,
-0.02508544921875,
0.0089263916015625,
-0.00164031982421875,
0.06292724609375,
-0.05853271484375,
-0.0286712646484375,
0.0002046823501586914,
0.012908935546875,
-0.036956787109375,
-0.05426025390625,
0.012359619140625,
-0.060516357421875,
0.00787353515625,
0.0263519287109375,
-0.0047760009765625,
0.037506103515625,
-0.00725555419921875,
-0.055999755859375,
0.03302001953125,
0.007808685302734375,
-0.037017822265625,
-0.0241241455078125,
-0.064208984375,
-0.0169677734375,
0.034820556640625,
-0.018646240234375,
-0.00920867919921875,
-0.0718994140625,
0.0263214111328125,
0.021820068359375,
0.0229034423828125,
0.025177001953125,
0.0158233642578125,
-0.06829833984375,
-0.007595062255859375,
-0.0347900390625,
0.008087158203125,
-0.0263519287109375,
0.01256561279296875,
0.028289794921875,
0.0421142578125,
0.0221710205078125,
0.036956787109375,
0.046539306640625,
-0.0540771484375,
-0.0008301734924316406,
-0.051513671875,
-0.037261962890625,
-0.06640625,
0.033660888671875,
0.0022106170654296875,
-0.003910064697265625,
0.026763916015625,
0.0121002197265625,
0.0206451416015625,
-0.08294677734375,
-0.018218994140625,
0.059112548828125,
-0.0810546875,
-0.02716064453125,
0.00855255126953125,
0.00713348388671875,
0.0150909423828125,
-0.0160980224609375,
-0.0200347900390625,
-0.005123138427734375,
-0.02105712890625,
-0.00498199462890625,
-0.036651611328125,
0.0219879150390625,
0.03411865234375,
-0.037841796875,
-0.02880859375,
-0.00003510713577270508,
0.00423431396484375,
-0.00788116455078125,
-0.054718017578125,
-0.002254486083984375,
0.06243896484375,
-0.03289794921875,
-0.0123138427734375,
0.02020263671875,
0.0161285400390625,
-0.007904052734375,
0.005584716796875,
-0.026092529296875,
0.034088134765625,
-0.01690673828125,
0.0195465087890625,
-0.0035839080810546875,
0.021697998046875,
0.016693115234375,
0.07586669921875,
-0.0158233642578125,
-0.042510986328125,
-0.00015246868133544922,
0.005001068115234375,
-0.01434326171875,
0.0173187255859375,
0.025543212890625,
-0.03656005859375,
-0.00982666015625,
-0.0046844482421875,
-0.051849365234375,
-0.057464599609375,
0.024200439453125,
0.0240325927734375,
-0.00724029541015625,
0.02789306640625
] |
33f248c4fb4d526d1a886ad2e498cc951772dedc
|
Wordpress Stackexchange
Q: Shortcode always displaying at the top of the page I'm using a shortcode to pull in different loops via the loops-name.php. For some reason it is always at the top of the page. I googled it and using echo instead of return causes that problem but with my code I am not using echo. Here's the shortcode:
// setup the shortcode for use
function friendly_loop_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'category' => '',
'module' => ''
), $atts ) );
include(locate_template('loop-'.$module.'.php'));
}
Any idea why this is happening?
A: You can buffer the output like this:
ob_start();
include(locate_template('loop-'.$module.'.php'));
return ob_get_clean();
EDIT. I tried this, worked fine.
function friendly_loop_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'category' => '',
'module' => ''
), $atts ) );
ob_start();
include(locate_template('loop-'.$module.'.php'));
$output = ob_get_clean();
//print $output; // debug
return $output;
}
if (!is_admin()) {
add_shortcode('test', 'friendly_loop_shortcode' );
}
|
Q: Shortcode always displaying at the top of the page I'm using a shortcode to pull in different loops via the loops-name.php. For some reason it is always at the top of the page. I googled it and using echo instead of return causes that problem but with my code I am not using echo. Here's the shortcode:
// setup the shortcode for use
function friendly_loop_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'category' => '',
'module' => ''
), $atts ) );
include(locate_template('loop-'.$module.'.php'));
}
Any idea why this is happening?
A: You can buffer the output like this:
ob_start();
include(locate_template('loop-'.$module.'.php'));
return ob_get_clean();
EDIT. I tried this, worked fine.
function friendly_loop_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'category' => '',
'module' => ''
), $atts ) );
ob_start();
include(locate_template('loop-'.$module.'.php'));
$output = ob_get_clean();
//print $output; // debug
return $output;
}
if (!is_admin()) {
add_shortcode('test', 'friendly_loop_shortcode' );
}
A: Your included file is essentially echo-ing HTML. For instance
<?php
//Some PHP
echo 'test';
//Some more PHP
?>
Is the same as
<?php
//Some PHP
?>
test
<?php
//Some more PHP
?>
Both get printed immediately rather than returned. Since its printed it appears before the page content. You need to return something for it be included in the content.
As @RutwickGangurde pointed out - it's unusual to include a template file in a shortcode.
|
wordpress
|
{
"language": "en",
"length": 227,
"provenance": "stackexchange_00019.jsonl.gz:418913",
"question_score": "20",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48491"
}
|
[
0.06451416015625,
0.01158905029296875,
-0.00012755393981933594,
-0.052215576171875,
0.0286102294921875,
-0.0182037353515625,
0.025848388671875,
-0.030242919921875,
-0.01062774658203125,
0.054443359375,
0.00527191162109375,
0.002925872802734375,
-0.046356201171875,
-0.0204010009765625,
-0.062286376953125,
-0.038238525390625,
0.037322998046875,
-0.018768310546875,
0.00740814208984375,
0.00241851806640625,
-0.0013980865478515625,
0.022216796875,
-0.0172119140625,
0.0263671875,
-0.01519012451171875,
-0.00835418701171875,
0.0673828125,
-0.01503753662109375,
-0.050201416015625,
-0.04022216796875,
-0.00665283203125,
0.039520263671875,
0.031463623046875,
0.02001953125,
-0.06683349609375,
0.005352020263671875,
0.002269744873046875,
-0.00867462158203125,
-0.032684326171875,
0.0299530029296875,
0.0106201171875,
0.0058441162109375,
0.0277557373046875,
-0.01512908935546875,
-0.00989532470703125,
-0.0163726806640625,
0.00629425048828125,
-0.028106689453125,
0.01117706298828125,
0.006572723388671875,
0.025665283203125,
0.0057525634765625,
0.025604248046875,
0.0008864402770996094,
-0.005611419677734375,
0.0263671875,
-0.01309967041015625,
-0.04345703125,
0.00829315185546875,
0.03692626953125,
0.0105438232421875,
0.004901885986328125,
0.01093292236328125,
-0.052581787109375,
-0.00817108154296875,
0.0153961181640625,
0.0189208984375,
0.0048675537109375,
-0.0251312255859375,
-0.00013303756713867188,
0.0243682861328125,
-0.036102294921875,
-0.00885009765625,
0.023773193359375,
-0.041259765625,
-0.020111083984375,
-0.0180511474609375,
-0.0401611328125,
0.04180908203125,
0.002849578857421875,
-0.050750732421875,
-0.0015707015991210938,
-0.04376220703125,
-0.0081634521484375,
-0.01904296875,
0.017242431640625,
-0.032470703125,
0.006412506103515625,
-0.0006589889526367188,
0.0014295578002929688,
-0.01611328125,
0.082275390625,
0.038970947265625,
-0.043670654296875,
-0.05670166015625,
-0.00800323486328125,
0.006908416748046875,
0.042144775390625,
-0.015716552734375,
0.0200042724609375,
-0.0272979736328125,
-0.0026378631591796875,
-0.0021820068359375,
-0.0401611328125,
-0.007289886474609375,
0.019561767578125,
-0.00879669189453125,
-0.0201416015625,
0.03216552734375,
0.045196533203125,
0.001926422119140625,
0.01387786865234375,
-0.05499267578125,
-0.035186767578125,
0.004375457763671875,
0.0157928466796875,
-0.09527587890625,
0.037109375,
0.0008554458618164062,
0.0031833648681640625,
0.0199737548828125,
0.034088134765625,
0.049713134765625,
-0.0604248046875,
-0.009185791015625,
-0.00516510009765625,
-0.0235595703125,
-0.0732421875,
0.00426483154296875,
0.0037021636962890625,
-0.020263671875,
0.006984710693359375,
0.02252197265625,
0.022247314453125,
0.0092315673828125,
-0.0074462890625,
0.0013580322265625,
-0.045135498046875,
0.004589080810546875,
0.02117919921875,
-0.0197906494140625,
-0.03466796875,
0.0150604248046875,
-0.0091705322265625,
-0.01220703125,
0.0242462158203125,
0.0200042724609375,
0.005840301513671875,
-0.0078582763671875,
-0.09112548828125,
0.0297698974609375,
-0.0267486572265625,
0.016448974609375,
0.0036792755126953125,
0.0291748046875,
-0.018402099609375,
0.00977325439453125,
-0.01552581787109375,
0.0137481689453125,
0.0005846023559570312,
0.03887939453125,
0.00206756591796875,
-0.012298583984375,
-0.04364013671875,
-0.05877685546875,
-0.0296173095703125,
-0.0440673828125,
-0.0014371871948242188,
0.0120086669921875,
0.056854248046875,
0.0160064697265625,
0.0283966064453125,
-0.06787109375,
0.006160736083984375,
0.01309967041015625,
-0.0246124267578125,
-0.033935546875,
-0.0035858154296875,
0.0517578125,
-0.039764404296875,
-0.034912109375,
-0.039581298828125,
0.037628173828125,
-0.004596710205078125,
-0.03741455078125,
0.00821685791015625,
0.01081085205078125,
0.038116455078125,
-0.0012493133544921875,
0.0027313232421875,
0.035308837890625,
0.00939178466796875,
-0.0157318115234375,
0.022369384765625,
0.01056671142578125,
-0.03076171875,
-0.0399169921875,
-0.022674560546875,
-0.00920867919921875,
0.004856109619140625,
-0.061309814453125,
-0.025634765625,
0.01287078857421875,
-0.00681304931640625,
-0.017791748046875,
-0.018402099609375,
-0.0221405029296875,
0.038421630859375,
0.0265960693359375,
-0.001094818115234375,
-0.004459381103515625,
-0.040985107421875,
-0.00927734375,
0.0246124267578125,
-0.0108642578125,
0.04254150390625,
-0.011932373046875,
0.047210693359375,
0.02880859375,
0.06170654296875,
0.03912353515625,
-0.01313018798828125,
0.031402587890625,
-0.020965576171875,
0.042510986328125,
-0.01305389404296875,
-0.018951416015625,
-0.030029296875,
-0.004978179931640625,
0.0021610260009765625,
-0.043121337890625,
0.057769775390625,
0.0013332366943359375,
0.0014982223510742188,
-0.06671142578125,
-0.0264434814453125,
-0.037445068359375,
-0.0178070068359375,
0.00577545166015625,
0.0545654296875,
0.02557373046875,
0.050445556640625,
-0.0090179443359375,
0.01274871826171875,
0.072021484375,
0.007701873779296875,
0.018585205078125,
-0.01090240478515625,
0.04925537109375,
0.0364990234375,
-0.0218963623046875,
-0.03643798828125,
0.0249786376953125,
-0.07574462890625,
0.020782470703125,
0.0309295654296875,
-0.01175689697265625,
0.0126800537109375,
0.00007468461990356445,
0.003650665283203125,
-0.0031261444091796875,
-0.04315185546875,
-0.006603240966796875,
-0.036865234375,
0.02044677734375,
0.022979736328125,
0.02581787109375,
0.0229339599609375,
-0.06597900390625,
0.0311126708984375,
0.021026611328125,
0.02850341796875,
-0.003742218017578125,
0.0142364501953125,
0.0158233642578125,
-0.047088623046875,
-0.0182952880859375,
-0.0029544830322265625,
0.008575439453125,
-0.006305694580078125,
-0.0005331039428710938,
0.049346923828125,
0.0474853515625,
-0.0112762451171875,
-0.0190582275390625,
-0.004840850830078125,
0.0194854736328125,
-0.0050048828125,
0.0144805908203125,
-0.00722503662109375,
0.00644683837890625,
0.051055908203125,
-0.032012939453125,
0.058319091796875,
0.013885498046875,
-0.017303466796875,
0.038726806640625,
-0.0330810546875,
0.0301666259765625,
-0.0264892578125,
0.07568359375,
0.0657958984375,
-0.030609130859375,
0.043426513671875,
-0.01287841796875,
0.04071044921875,
-0.0261688232421875,
-0.025299072265625,
-0.03302001953125,
0.0093231201171875,
-0.057525634765625,
0.0141754150390625,
0.0343017578125,
0.1077880859375,
-0.01158905029296875,
-0.0280609130859375,
0.009033203125,
0.047698974609375,
-0.049530029296875,
-0.10369873046875,
0.004852294921875,
0.00485992431640625,
0.0181732177734375,
0.0270843505859375,
0.001209259033203125,
-0.036285400390625,
0.0386962890625,
-0.006168365478515625,
0.042144775390625,
0.0083770751953125,
-0.049346923828125,
-0.0100555419921875,
-0.07916259765625,
-0.031402587890625,
-0.01078033447265625,
0.008636474609375,
0.00838470458984375,
0.033233642578125,
0.0030307769775390625,
-0.0164794921875,
-0.001598358154296875,
0.01459503173828125,
-0.021820068359375,
-0.021270751953125,
0.01422119140625,
-0.03521728515625,
-0.04669189453125,
-0.003330230712890625,
-0.0269622802734375,
-0.03851318359375,
0.03363037109375,
-0.0128936767578125,
-0.027557373046875,
-0.038299560546875,
0.000720977783203125,
0.024566650390625,
0.0175628662109375,
-0.00901031494140625,
0.0565185546875,
-0.0312042236328125,
0.01073455810546875,
-0.023284912109375,
-0.029052734375,
-0.0272674560546875,
0.011810302734375,
0.01195526123046875,
-0.031768798828125,
-0.0146331787109375,
0.0078887939453125,
0.022216796875,
0.0231475830078125,
-0.01611328125,
0.01206207275390625,
-0.00708770751953125,
0.0027675628662109375,
-0.02313232421875,
0.031585693359375,
-0.0028171539306640625,
-0.0137786865234375,
0.007625579833984375,
0.0281829833984375,
-0.014801025390625,
0.007465362548828125,
-0.058319091796875,
-0.00798797607421875,
0.05499267578125,
0.035369873046875,
0.0201263427734375,
0.005313873291015625,
-0.0299530029296875,
0.01152801513671875,
0.050323486328125,
-0.08544921875,
-0.00409698486328125,
0.014404296875,
-0.004253387451171875,
0.0037059783935546875,
0.00630950927734375,
-0.082275390625,
-0.0222320556640625,
-0.099365234375,
0.035552978515625,
0.00982666015625,
-0.002971649169921875,
-0.04144287109375,
0.042388916015625,
-0.0755615234375,
-0.038818359375,
0.052459716796875,
-0.02874755859375,
0.023651123046875,
0.0010995864868164062,
-0.0087127685546875,
-0.01209259033203125,
-0.052215576171875,
-0.0179443359375,
-0.059417724609375,
-0.019622802734375,
-0.0001386404037475586,
0.038818359375,
0.00817108154296875,
-0.0204315185546875,
-0.048736572265625,
0.0283050537109375,
-0.0200653076171875,
-0.004673004150390625,
0.008331298828125,
0.031768798828125,
-0.0245513916015625,
0.0047454833984375,
-0.0204925537109375,
-0.02099609375,
-0.0014247894287109375,
0.02349853515625,
0.01180267333984375,
0.042999267578125,
-0.03399658203125,
-0.0367431640625,
0.01332855224609375,
-0.0303802490234375,
-0.04620361328125,
-0.041717529296875,
0.009613037109375,
0.0037097930908203125,
0.004558563232421875,
0.003185272216796875,
-0.04638671875,
-0.0244903564453125,
-0.01018524169921875,
-0.04364013671875,
-0.045654296875,
0.035614013671875,
0.0222930908203125,
0.0235137939453125,
0.004611968994140625,
-0.04339599609375,
0.0189666748046875,
0.068359375,
-0.02880859375,
0.050689697265625,
0.06512451171875,
-0.0307769775390625,
0.033538818359375,
0.0305633544921875,
0.00978851318359375,
-0.024322509765625,
0.03887939453125,
0.008392333984375,
-0.0136566162109375,
0.01337432861328125,
0.0177459716796875,
0.0007510185241699219,
0.01024627685546875,
-0.017608642578125,
0.0242462158203125,
-0.0243072509765625,
-0.011993408203125,
0.0239715576171875,
-0.0157470703125,
-0.0160369873046875,
-0.014801025390625,
-0.01160430908203125,
0.0276031494140625,
0.06744384765625,
0.03533935546875,
0.01044464111328125,
0.0140380859375,
0.035400390625,
0.00293731689453125,
0.0193939208984375,
0.0023193359375,
0.0247039794921875,
0.04437255859375,
0.008941650390625,
0.0099639892578125,
-0.0013713836669921875,
-0.0085601806640625,
0.0210418701171875,
0.01131439208984375,
-0.043212890625,
0.0205535888671875,
-0.0103759765625,
-0.0016679763793945312,
-0.01776123046875,
0.004642486572265625,
0.039642333984375,
0.028533935546875,
0.00994873046875,
-0.01142120361328125,
-0.01406097412109375,
0.0258331298828125,
-0.033782958984375,
-0.0109100341796875,
-0.0200958251953125,
-0.01052093505859375,
-0.0005879402160644531,
0.054718017578125,
-0.039459228515625,
0.037353515625,
-0.01107025146484375,
-0.041229248046875,
0.01235198974609375,
-0.0030231475830078125,
0.035736083984375,
0.018951416015625,
-0.01541900634765625,
-0.00791168212890625,
0.05078125,
-0.049468994140625,
0.004058837890625,
0.04156494140625,
0.07208251953125,
-0.0224609375,
-0.05059814453125,
0.0048828125,
-0.03973388671875,
-0.01425933837890625,
0.0271148681640625,
0.03265380859375,
-0.003345489501953125,
-0.02294921875,
0.004207611083984375,
0.035369873046875,
0.03045654296875,
0.0027256011962890625,
-0.00001424551010131836,
-0.03192138671875,
-0.00267791748046875,
-0.04168701171875,
-0.0021457672119140625,
-0.0197296142578125,
-0.0238189697265625,
-0.0273895263671875,
-0.0279998779296875,
0.007068634033203125,
-0.06024169921875,
-0.0138397216796875,
-0.00334930419921875,
-0.00972747802734375,
0.0260772705078125,
-0.0184478759765625,
0.0264129638671875,
-0.021392822265625,
-0.02923583984375,
-0.00395965576171875,
-0.01399993896484375,
0.10308837890625,
0.0654296875,
-0.09637451171875,
0.0305633544921875,
-0.0438232421875,
0.00838470458984375,
0.003093719482421875,
-0.0240631103515625,
-0.067138671875,
-0.033905029296875,
0.0196380615234375,
0.0352783203125,
-0.00836181640625,
-0.01885986328125,
-0.0321044921875,
-0.0034885406494140625,
0.0211639404296875,
0.087646484375,
-0.0214385986328125,
0.034027099609375,
0.0084991455078125,
0.024383544921875,
0.00836944580078125,
0.0189971923828125,
0.0193634033203125,
-0.0211639404296875,
0.03021240234375,
0.003814697265625,
-0.0213623046875,
-0.0298919677734375,
-0.01123809814453125,
-0.052734375,
0.0198211669921875,
-0.01910400390625,
-0.0078125,
0.027984619140625,
0.01910400390625,
-0.012359619140625,
-0.007110595703125,
0.026275634765625,
-0.0167388916015625,
0.01336669921875,
0.01157379150390625,
-0.006317138671875,
-0.01103973388671875,
-0.0018634796142578125,
-0.01702880859375,
0.01091766357421875,
-0.005329132080078125,
-0.04425048828125,
-0.01026153564453125,
0.0789794921875,
0.09478759765625,
-0.0196685791015625,
0.033660888671875,
0.071533203125,
-0.0189208984375,
-0.01519012451171875,
0.05181884765625,
0.0595703125,
-0.0297698974609375,
0.07672119140625,
0.004421234130859375,
-0.0277099609375,
0.017822265625,
-0.043853759765625,
0.0234832763671875,
0.023834228515625,
0.053680419921875,
-0.0335693359375,
0.0124053955078125,
0.03558349609375,
-0.04058837890625,
-0.01403045654296875,
-0.0248870849609375,
0.023193359375,
-0.02801513671875,
0.0643310546875,
0.01395416259765625,
-0.01611328125,
0.016815185546875,
-0.0261993408203125,
0.0012359619140625,
-0.01959228515625,
0.043975830078125,
-0.0002894401550292969,
-0.0657958984375,
-0.0198974609375,
0.033935546875,
-0.0172576904296875,
-0.00804901123046875,
0.00106048583984375,
-0.0297393798828125,
-0.01837158203125,
-0.0279388427734375,
0.0021648406982421875,
-0.0245361328125,
-0.0012006759643554688,
0.01068115234375,
-0.02191162109375,
-0.03070068359375,
0.037567138671875,
-0.05462646484375,
0.07550048828125,
-0.0043487548828125,
-0.0190582275390625,
0.05560302734375,
0.00872802734375,
0.0322265625,
0.0187835693359375,
-0.048248291015625,
-0.00092315673828125,
-0.0018930435180664062,
0.0131683349609375,
-0.0280609130859375,
-0.03851318359375,
0.095947265625,
-0.03570556640625,
-0.0194244384765625,
0.00695037841796875,
0.01219940185546875,
-0.00930023193359375,
-0.007640838623046875,
0.058135986328125,
-0.045318603515625,
-0.0038909912109375,
0.034088134765625,
0.015167236328125,
-0.056396484375,
-0.01275634765625,
-0.061676025390625,
0.04339599609375,
-0.016998291015625,
0.0202178955078125,
0.0012569427490234375,
0.0193023681640625,
0.0051116943359375,
-0.005615234375,
-0.0213623046875,
0.04901123046875,
0.022705078125,
0.0171966552734375,
-0.04437255859375,
-0.0180206298828125,
0.0037517547607421875,
0.04547119140625,
-0.040283203125,
-0.0061187744140625,
-0.010711669921875,
0.044708251953125,
0.0582275390625,
-0.0178985595703125,
-0.0206298828125,
0.036407470703125,
0.00551605224609375,
0.0343017578125,
0.035614013671875,
-0.04827880859375,
0.0257110595703125,
-0.014984130859375,
-0.005344390869140625,
0.03912353515625,
0.0014619827270507812,
-0.03387451171875,
0.02178955078125,
-0.005084991455078125,
-0.0863037109375,
0.035369873046875,
0.037506103515625,
0.036376953125,
-0.02142333984375,
0.057403564453125,
0.02752685546875,
-0.07208251953125,
-0.041595458984375,
-0.025787353515625,
0.04620361328125,
-0.00861358642578125,
0.058349609375,
0.01102447509765625,
0.02337646484375,
0.0762939453125,
-0.0130615234375,
0.019073486328125,
0.0274810791015625,
-0.0242156982421875,
-0.028411865234375,
0.025421142578125,
0.03173828125,
-0.004222869873046875,
-0.01012420654296875,
0.0309600830078125,
-0.0005211830139160156,
0.0010547637939453125,
-0.055328369140625,
0.01403045654296875,
0.01506805419921875,
-0.0020732879638671875,
-0.008056640625,
-0.0003027915954589844,
-0.039154052734375,
0.052825927734375,
-0.0556640625,
-0.016510009765625,
0.018341064453125,
0.03973388671875,
-0.0110015869140625,
-0.0206146240234375,
0.00787353515625,
-0.0289306640625,
-0.007694244384765625,
-0.005863189697265625,
0.00321197509765625,
0.04827880859375,
-0.00823974609375,
0.045257568359375,
-0.08258056640625,
-0.018341064453125,
-0.025909423828125,
0.016021728515625,
-0.0198211669921875,
0.0307159423828125,
-0.03955078125,
0.006046295166015625,
-0.0408935546875,
0.037567138671875,
0.02789306640625,
0.058837890625,
0.04541015625,
-0.01568603515625,
-0.017059326171875,
0.013885498046875,
0.06768798828125,
-0.038787841796875,
-0.04449462890625,
-0.01047515869140625,
-0.033660888671875,
0.0214996337890625,
-0.01043701171875,
0.01042938232421875,
0.030059814453125,
0.0062103271484375,
-0.021392822265625,
0.03076171875,
-0.009857177734375,
-0.0211639404296875,
0.028350830078125,
0.00009614229202270508,
0.050628662109375,
0.0031585693359375,
-0.0245819091796875,
-0.007022857666015625,
-0.04010009765625,
-0.048309326171875,
0.038482666015625,
0.048187255859375,
0.0310211181640625,
-0.0275421142578125,
-0.007904052734375,
-0.018096923828125,
0.027069091796875,
0.00884246826171875,
-0.00940704345703125,
0.028411865234375,
0.029815673828125,
-0.00640869140625,
-0.03814697265625,
-0.003108978271484375,
-0.012176513671875,
0.01297760009765625,
0.0026760101318359375,
0.0306854248046875,
0.0248260498046875,
0.0227203369140625,
-0.015350341796875,
0.0016193389892578125,
-0.017303466796875,
-0.0273895263671875,
0.038299560546875,
0.00412750244140625,
-0.01525115966796875,
-0.019439697265625,
-0.01285552978515625,
-0.017547607421875,
0.067626953125,
-0.01654052734375,
0.0084075927734375,
-0.01195526123046875,
0.0257110595703125,
-0.04052734375,
0.035186767578125,
-0.00687408447265625,
-0.00035643577575683594,
-0.0018310546875,
0.0257720947265625,
0.0307464599609375,
0.04534912109375,
-0.022003173828125,
0.0003018379211425781,
0.0252838134765625,
-0.019134521484375,
0.03759765625,
-0.01354217529296875,
0.0631103515625,
0.038726806640625,
-0.0225677490234375,
0.020477294921875,
-0.0161895751953125,
-0.03741455078125,
0.0291748046875,
-0.0029773712158203125,
0.0117950439453125,
0.0003247261047363281,
-0.00127410888671875,
0.027923583984375,
0.020233154296875,
0.031829833984375,
-0.0276336669921875,
0.0018339157104492188,
0.040618896484375,
-0.0023632049560546875,
-0.00980377197265625,
0.04876708984375,
-0.00745391845703125,
0.00002568960189819336,
0.01020050048828125,
0.00130462646484375,
0.02154541015625,
-0.01641845703125,
-0.030487060546875,
-0.0298004150390625,
0.043853759765625,
0.005077362060546875,
-0.01702880859375,
-0.03228759765625,
0.004123687744140625,
0.04742431640625,
0.01311492919921875,
0.025177001953125,
-0.0074615478515625,
-0.0147247314453125,
-0.08038330078125,
-0.0031299591064453125,
-0.03656005859375,
0.01409149169921875,
-0.031524658203125,
-0.02978515625,
-0.01271820068359375,
0.0176239013671875,
0.028076171875,
-0.0302276611328125,
-0.0306396484375,
0.0269622802734375,
-0.0318603515625,
-0.036895751953125,
0.0217742919921875,
-0.012542724609375,
-0.004550933837890625,
-0.04278564453125,
-0.00787353515625,
-0.052703857421875,
0.034423828125,
-0.0207672119140625,
-0.025848388671875,
-0.00806427001953125,
-0.034698486328125,
-0.02301025390625,
-0.00186920166015625,
0.0236968994140625,
-0.0253448486328125,
-0.0179443359375,
-0.0175628662109375,
-0.01456451416015625,
0.01372528076171875,
-0.0032520294189453125,
-0.04852294921875,
-0.0293426513671875,
0.0254364013671875,
0.0052642822265625,
0.007411956787109375,
0.04107666015625,
0.00814056396484375,
0.006694793701171875,
-0.00391387939453125,
-0.0131072998046875,
-0.053436279296875,
0.014373779296875,
-0.0259552001953125,
0.058563232421875,
0.0188446044921875,
-0.017120361328125,
0.02984619140625,
0.034088134765625,
-0.03497314453125,
0.00673675537109375,
-0.024078369140625,
-0.055877685546875,
-0.05059814453125,
0.0738525390625,
0.0106048583984375,
0.0252838134765625,
0.0112762451171875,
-0.0360107421875,
0.005199432373046875,
-0.018768310546875,
-0.01512908935546875,
0.0276641845703125,
-0.07952880859375,
-0.0221710205078125,
-0.0150604248046875,
0.0008416175842285156,
-0.01128387451171875,
-0.053955078125,
-0.0158843994140625,
-0.0240631103515625,
-0.01922607421875,
0.01140594482421875,
0.012451171875,
-0.0301971435546875,
0.0015535354614257812,
0.00942230224609375,
0.0006847381591796875,
-0.022796630859375,
0.0297393798828125,
-0.00989532470703125,
0.0137176513671875,
0.016815185546875,
0.0272064208984375,
-0.0229644775390625,
-0.0160369873046875,
0.035308837890625,
0.015655517578125,
0.01055145263671875,
-0.025482177734375,
-0.002407073974609375,
0.013702392578125,
-0.007129669189453125,
-0.0055694580078125,
-0.016143798828125,
0.059967041015625,
0.01241302490234375,
0.037567138671875,
-0.02392578125,
0.06805419921875,
0.006534576416015625,
0.040069580078125,
-0.009185791015625,
-0.01189422607421875,
0.0340576171875,
-0.06988525390625,
0.01113128662109375,
0.0296783447265625,
-0.005390167236328125,
0.0162811279296875,
-0.01207733154296875,
-0.02874755859375,
0.0003714561462402344,
-0.004940032958984375
] |
ba97e1e5bc79097244ef632b2027f58d19fbbab0
|
Wordpress Stackexchange
Q: Modal window from within Wordpress admin How can get a modal window to work from within the wordpress admin?
I want to create a modal window that will work from a meta box within the wp-admin.
Any ideas?
A: To use Thickbox for inline modal windows you can use the following code.
<?php add_thickbox(); ?>
<a href="#TB_inline?width=600&height=550&inlineId=modal-window-id" class="thickbox">Modal Me</a>
<div id="modal-window-id" style="display:none;">
<p>Lorem Ipsum sit dolla amet.</p>
</div>
http://codex.wordpress.org/ThickBox
|
Q: Modal window from within Wordpress admin How can get a modal window to work from within the wordpress admin?
I want to create a modal window that will work from a meta box within the wp-admin.
Any ideas?
A: To use Thickbox for inline modal windows you can use the following code.
<?php add_thickbox(); ?>
<a href="#TB_inline?width=600&height=550&inlineId=modal-window-id" class="thickbox">Modal Me</a>
<div id="modal-window-id" style="display:none;">
<p>Lorem Ipsum sit dolla amet.</p>
</div>
http://codex.wordpress.org/ThickBox
A: Give the anchor a class of thickbox and make sure that the thickbox script is enqueued on your admin page using add_thickbox
add_thickbox();
and
<a href="your url" class="thickbox">click here</a>
You can see what add_thickbox does here:
http://hitchhackerguide.com/2011/02/11/add_thickbox/
|
wordpress
|
{
"language": "en",
"length": 108,
"provenance": "stackexchange_00019.jsonl.gz:418919",
"question_score": "20",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48514"
}
|
[
0.04425048828125,
-0.0198516845703125,
0.02557373046875,
-0.04522705078125,
-0.018829345703125,
-0.00861358642578125,
0.019134521484375,
-0.0130615234375,
0.0265045166015625,
0.0308685302734375,
-0.04046630859375,
-0.005367279052734375,
0.0282135009765625,
-0.005458831787109375,
-0.007198333740234375,
-0.0149993896484375,
0.02471923828125,
-0.00521087646484375,
0.0177001953125,
-0.0278167724609375,
0.0048675537109375,
-0.0257568359375,
0.03399658203125,
0.054443359375,
0.028778076171875,
-0.032958984375,
0.0709228515625,
-0.0237274169921875,
0.034210205078125,
-0.010986328125,
0.032867431640625,
-0.02679443359375,
-0.003337860107421875,
0.0256195068359375,
0.0009627342224121094,
-0.052581787109375,
-0.011749267578125,
0.026885986328125,
0.0396728515625,
-0.0231475830078125,
-0.0084075927734375,
0.012359619140625,
0.0114593505859375,
0.0230865478515625,
-0.025299072265625,
-0.037322998046875,
-0.01404571533203125,
-0.0265655517578125,
0.026092529296875,
-0.00579071044921875,
0.045135498046875,
0.01212310791015625,
0.05078125,
-0.01073455810546875,
-0.0068511962890625,
0.020294189453125,
0.012542724609375,
-0.07366943359375,
0.0237884521484375,
0.04498291015625,
-0.0003380775451660156,
-0.017730712890625,
0.00624847412109375,
-0.043182373046875,
0.01458740234375,
-0.00475311279296875,
-0.0250396728515625,
0.0227203369140625,
-0.0250396728515625,
0.01215362548828125,
0.029510498046875,
-0.034576416015625,
-0.0288848876953125,
-0.026092529296875,
-0.001415252685546875,
0.0217132568359375,
-0.032470703125,
-0.0239105224609375,
0.013916015625,
0.024169921875,
0.061920166015625,
0.064453125,
-0.00035262107849121094,
0.03839111328125,
-0.0242767333984375,
0.027679443359375,
-0.0124053955078125,
-0.051666259765625,
-0.00830841064453125,
-0.0228424072265625,
-0.0187530517578125,
-0.0465087890625,
-0.0104522705078125,
0.0025768280029296875,
-0.0180206298828125,
-0.0215606689453125,
-0.00676727294921875,
-0.0027618408203125,
0.0230865478515625,
-0.0204620361328125,
-0.01056671142578125,
-0.01187896728515625,
-0.03350830078125,
-0.00743865966796875,
-0.0254364013671875,
0.04168701171875,
0.0010709762573242188,
-0.005825042724609375,
-0.0191497802734375,
0.01131439208984375,
-0.00396728515625,
-0.07568359375,
0.003009796142578125,
0.01470184326171875,
-0.02142333984375,
0.002285003662109375,
-0.0198822021484375,
0.0162506103515625,
-0.007022857666015625,
0.029632568359375,
0.0010061264038085938,
0.0272064208984375,
-0.0086669921875,
0.0249786376953125,
-0.011260986328125,
0.01039886474609375,
0.006320953369140625,
-0.029022216796875,
0.0223236083984375,
0.0030517578125,
-0.05316162109375,
-0.0022411346435546875,
0.046905517578125,
0.0408935546875,
0.033111572265625,
-0.0168914794921875,
0.0215606689453125,
-0.01439666748046875,
0.03460693359375,
-0.0347900390625,
0.06439208984375,
0.008209228515625,
0.01273345947265625,
0.035675048828125,
-0.052520751953125,
0.058441162109375,
0.016876220703125,
-0.03314208984375,
-0.019439697265625,
-0.06451416015625,
-0.0325927734375,
-0.039703369140625,
0.026153564453125,
0.027557373046875,
0.029541015625,
-0.00811767578125,
0.12152099609375,
-0.0433349609375,
-0.03924560546875,
-0.056610107421875,
-0.0265960693359375,
0.01300048828125,
0.087646484375,
0.00722503662109375,
0.02783203125,
-0.01136016845703125,
-0.0811767578125,
-0.0073699951171875,
0.0233001708984375,
0.01873779296875,
0.0187225341796875,
-0.00960540771484375,
0.0019016265869140625,
-0.0009741783142089844,
-0.0112152099609375,
0.00200653076171875,
0.00081634521484375,
0.035400390625,
0.0232696533203125,
0.0077667236328125,
-0.0167236328125,
-0.04730224609375,
0.080078125,
-0.0426025390625,
-0.036285400390625,
0.006374359130859375,
0.00890350341796875,
0.03314208984375,
0.01331329345703125,
0.0121002197265625,
0.0293731689453125,
-0.0011615753173828125,
-0.0011472702026367188,
-0.051971435546875,
0.01169586181640625,
-0.00122833251953125,
0.006496429443359375,
0.00229644775390625,
-0.004169464111328125,
0.024322509765625,
-0.035430908203125,
-0.03326416015625,
0.0233001708984375,
0.00412750244140625,
-0.01605224609375,
0.0011005401611328125,
-0.0206298828125,
0.0228271484375,
0.0187530517578125,
0.007442474365234375,
0.0006093978881835938,
0.0006818771362304688,
0.0157928466796875,
-0.08392333984375,
-0.0458984375,
-0.0050201416015625,
-0.012451171875,
0.03271484375,
0.007518768310546875,
0.04022216796875,
-0.01169586181640625,
-0.044586181640625,
-0.0164031982421875,
-0.02606201171875,
-0.023956298828125,
0.02081298828125,
-0.029510498046875,
0.02099609375,
-0.01332855224609375,
0.019927978515625,
0.0048370361328125,
0.0042877197265625,
-0.0000712275505065918,
0.0230560302734375,
-0.01187896728515625,
-0.0240631103515625,
-0.038421630859375,
-0.09405517578125,
0.006366729736328125,
0.05755615234375,
0.0198211669921875,
0.0347900390625,
0.0298004150390625,
0.08258056640625,
0.0343017578125,
-0.036285400390625,
0.005733489990234375,
0.0298004150390625,
-0.046630859375,
-0.0190582275390625,
-0.006801605224609375,
0.010589599609375,
0.037567138671875,
-0.0008349418640136719,
-0.01476287841796875,
0.0413818359375,
-0.0016603469848632812,
0.0260009765625,
0.01045989990234375,
0.0033283233642578125,
-0.009124755859375,
0.017913818359375,
0.006175994873046875,
-0.014923095703125,
-0.038238525390625,
-0.0224456787109375,
0.0003783702850341797,
-0.001956939697265625,
-0.00469207763671875,
-0.044708251953125,
0.0231170654296875,
0.038482666015625,
-0.0086669921875,
-0.023956298828125,
0.050048828125,
-0.00732421875,
-0.061004638671875,
0.0013275146484375,
0.04376220703125,
-0.00928497314453125,
-0.01690673828125,
-0.01751708984375,
-0.0116729736328125,
-0.0005488395690917969,
0.01446533203125,
-0.04376220703125,
0.041473388671875,
0.012451171875,
0.03857421875,
0.0005435943603515625,
0.05133056640625,
-0.032501220703125,
-0.06256103515625,
0.061370849609375,
-0.0194244384765625,
-0.053375244140625,
0.016998291015625,
-0.029266357421875,
0.04949951171875,
-0.0052947998046875,
0.060333251953125,
0.07720947265625,
-0.0231781005859375,
0.05328369140625,
-0.013519287109375,
0.00821685791015625,
-0.034942626953125,
0.0271148681640625,
0.018218994140625,
-0.025970458984375,
-0.0139617919921875,
0.046600341796875,
0.0087890625,
0.0352783203125,
-0.015045166015625,
-0.052215576171875,
-0.006015777587890625,
0.00286865234375,
-0.049072265625,
-0.0178375244140625,
-0.038970947265625,
-0.06982421875,
-0.01232147216796875,
0.00028133392333984375,
-0.040740966796875,
0.0167388916015625,
0.0440673828125,
0.01239013671875,
0.0019092559814453125,
-0.01230621337890625,
0.0014190673828125,
0.002620697021484375,
-0.0278472900390625,
-0.04583740234375,
0.00794219970703125,
-0.004154205322265625,
0.0133514404296875,
0.002147674560546875,
0.0064849853515625,
-0.032073974609375,
0.019012451171875,
0.012420654296875,
-0.00868988037109375,
0.00934600830078125,
0.00438690185546875,
-0.024383544921875,
-0.042572021484375,
-0.007289886474609375,
0.025421142578125,
-0.0007128715515136719,
0.01059722900390625,
0.00982666015625,
-0.0206146240234375,
-0.0318603515625,
-0.00843048095703125,
-0.01885986328125,
0.0120086669921875,
-0.0163421630859375,
0.0029926300048828125,
-0.04730224609375,
0.032562255859375,
0.008148193359375,
-0.01297760009765625,
-0.05413818359375,
-0.006793975830078125,
-0.035736083984375,
0.0226287841796875,
-0.051300048828125,
0.0042572021484375,
0.0099945068359375,
0.0271148681640625,
-0.0036334991455078125,
-0.021728515625,
-0.0025501251220703125,
-0.0131072998046875,
-0.0204010009765625,
0.043365478515625,
-0.006328582763671875,
0.0160064697265625,
0.0216522216796875,
-0.009857177734375,
-0.032012939453125,
0.0650634765625,
-0.0206451416015625,
-0.00896453857421875,
0.050506591796875,
0.01064300537109375,
0.030242919921875,
-0.021942138671875,
-0.037811279296875,
-0.012115478515625,
0.06854248046875,
-0.038238525390625,
-0.0097198486328125,
-0.0000171661376953125,
0.0030994415283203125,
-0.02618408203125,
-0.03411865234375,
-0.047027587890625,
0.01247406005859375,
-0.059722900390625,
0.0181427001953125,
0.0015249252319335938,
-0.0034656524658203125,
-0.04168701171875,
0.03643798828125,
-0.06146240234375,
-0.0267486572265625,
0.0194091796875,
-0.0202178955078125,
-0.0218963623046875,
-0.0081939697265625,
-0.027069091796875,
-0.027618408203125,
0.004558563232421875,
-0.02276611328125,
-0.1444091796875,
-0.018707275390625,
-0.0279541015625,
0.10101318359375,
0.00986480712890625,
-0.03326416015625,
-0.0384521484375,
0.040069580078125,
0.0026397705078125,
0.03594970703125,
0.0018253326416015625,
0.01172637939453125,
0.019287109375,
-0.0131378173828125,
0.004024505615234375,
-0.0190277099609375,
0.00815582275390625,
-0.0190277099609375,
-0.060089111328125,
0.0181121826171875,
-0.023529052734375,
0.033966064453125,
0.0179595947265625,
-0.031036376953125,
0.00579071044921875,
-0.0207061767578125,
-0.04571533203125,
-0.0013799667358398438,
-0.03057861328125,
-0.019683837890625,
-0.0012979507446289062,
-0.033294677734375,
-0.013397216796875,
0.0221710205078125,
-0.017059326171875,
0.012359619140625,
0.036163330078125,
0.0291900634765625,
-0.0164337158203125,
-0.0297088623046875,
0.00406646728515625,
0.03533935546875,
0.01094818115234375,
-0.00888824462890625,
-0.0249786376953125,
-0.05657958984375,
0.0655517578125,
0.01256561279296875,
0.01214599609375,
-0.0411376953125,
0.07098388671875,
-0.0029735565185546875,
-0.0251007080078125,
0.034027099609375,
-0.0292205810546875,
-0.0124664306640625,
0.0043182373046875,
-0.0095367431640625,
0.00276947021484375,
-0.00726318359375,
0.0258941650390625,
0.0146942138671875,
-0.035675048828125,
-0.0386962890625,
-0.00782012939453125,
-0.0004343986511230469,
-0.049896240234375,
0.05780029296875,
0.0400390625,
0.00604248046875,
0.0247650146484375,
0.039581298828125,
-0.003948211669921875,
0.0751953125,
0.0246429443359375,
0.01861572265625,
0.040069580078125,
0.0166778564453125,
-0.018524169921875,
0.045257568359375,
-0.0022907257080078125,
0.049072265625,
-0.0081024169921875,
-0.0262603759765625,
-0.0723876953125,
-0.002841949462890625,
0.0193939208984375,
0.0167083740234375,
-0.01172637939453125,
0.006366729736328125,
0.019317626953125,
-0.018890380859375,
0.0022449493408203125,
0.04888916015625,
-0.0304718017578125,
-0.025421142578125,
0.0109405517578125,
-0.003936767578125,
0.0029163360595703125,
-0.020294189453125,
0.123291015625,
0.0014905929565429688,
0.046173095703125,
-0.0213470458984375,
0.030853271484375,
0.0037326812744140625,
0.037994384765625,
0.0305938720703125,
-0.0299072265625,
0.020843505859375,
-0.0183563232421875,
-0.031646728515625,
-0.0212249755859375,
0.0031986236572265625,
-0.005527496337890625,
0.023681640625,
0.04437255859375,
0.0176849365234375,
0.003597259521484375,
-0.013336181640625,
-0.0236663818359375,
0.01788330078125,
0.019775390625,
-0.01418304443359375,
-0.01425933837890625,
-0.00476837158203125,
-0.0012960433959960938,
0.014739990234375,
-0.023590087890625,
0.042572021484375,
-0.0462646484375,
0.01503753662109375,
-0.049560546875,
-0.006305694580078125,
0.00909423828125,
0.022430419921875,
0.0281219482421875,
-0.03350830078125,
-0.0308837890625,
-0.035980224609375,
-0.01192474365234375,
-0.0224151611328125,
0.0172882080078125,
0.013885498046875,
-0.01253509521484375,
0.0133514404296875,
-0.02618408203125,
0.011474609375,
-0.041961669921875,
0.0087432861328125,
0.029388427734375,
0.01403045654296875,
-0.04095458984375,
0.0021457672119140625,
-0.050506591796875,
-0.034393310546875,
-0.06829833984375,
-0.0190582275390625,
-0.0472412109375,
-0.0014553070068359375,
-0.0098114013671875,
0.03973388671875,
-0.0215911865234375,
-0.01390838623046875,
0.0190582275390625,
-0.0018901824951171875,
-0.00885009765625,
0.05743408203125,
-0.0146636962890625,
0.09259033203125,
-0.00716400146484375,
0.0914306640625,
0.007640838623046875,
0.0125885009765625,
-0.0711669921875,
-0.00039458274841308594,
0.038421630859375,
0.0010623931884765625,
-0.046844482421875,
-0.052947998046875,
-0.0014600753784179688,
0.00555419921875,
0.040191650390625,
-0.0147705078125,
0.0201263427734375,
-0.021942138671875,
0.0021686553955078125,
-0.02117919921875,
0.0160369873046875,
-0.0305328369140625,
-0.0003867149353027344,
0.0002046823501586914,
-0.041107177734375,
-0.0240936279296875,
0.015869140625,
-0.0190277099609375,
0.03167724609375,
0.0017938613891601562,
0.0013580322265625,
0.03466796875,
-0.06683349609375,
0.0587158203125,
0.0921630859375,
0.037506103515625,
0.0643310546875,
0.018096923828125,
0.036163330078125,
0.01309967041015625,
0.022979736328125,
0.02374267578125,
0.0033283233642578125,
0.07025146484375,
-0.00020825862884521484,
-0.0107879638671875,
0.035369873046875,
-0.031097412109375,
0.01396942138671875,
0.04998779296875,
0.054962158203125,
-0.09210205078125,
0.0029125213623046875,
0.00650787353515625,
-0.027191162109375,
0.01959228515625,
-0.04339599609375,
0.0018949508666992188,
-0.040557861328125,
0.05322265625,
-0.0037784576416015625,
-0.0305633544921875,
-0.0012569427490234375,
-0.032012939453125,
-0.00653076171875,
0.004505157470703125,
0.01263427734375,
0.0100860595703125,
-0.0163421630859375,
-0.01508331298828125,
-0.00640106201171875,
0.02471923828125,
0.006458282470703125,
0.03057861328125,
-0.0306243896484375,
-0.020294189453125,
-0.0101470947265625,
0.0059661865234375,
-0.0008444786071777344,
-0.004581451416015625,
0.0218658447265625,
0.003936767578125,
0.043304443359375,
0.05535888671875,
-0.01125335693359375,
0.01529693603515625,
0.011474609375,
0.02392578125,
-0.00586700439453125,
-0.010711669921875,
-0.019775390625,
0.0112152099609375,
-0.0640869140625,
0.013214111328125,
-0.055267333984375,
0.0236053466796875,
0.00327301025390625,
0.047698974609375,
0.0543212890625,
0.0170745849609375,
-0.057525634765625,
0.0302581787109375,
-0.037567138671875,
-0.0276641845703125,
0.0103302001953125,
0.034820556640625,
-0.03265380859375,
-0.009368896484375,
0.0341796875,
-0.030059814453125,
-0.02325439453125,
0.0011072158813476562,
-0.0870361328125,
0.10601806640625,
0.0039043426513671875,
0.0360107421875,
0.0005955696105957031,
0.03521728515625,
-0.043426513671875,
-0.01120758056640625,
-0.014678955078125,
-0.01141357421875,
-0.01099395751953125,
-0.002346038818359375,
-0.04168701171875,
-0.0121612548828125,
-0.0357666015625,
0.0257720947265625,
-0.006420135498046875,
-0.0175018310546875,
-0.0229644775390625,
-0.005428314208984375,
0.063232421875,
0.03594970703125,
0.032470703125,
0.0226898193359375,
0.0095062255859375,
0.025604248046875,
0.0286865234375,
-0.01308441162109375,
0.031219482421875,
-0.01245880126953125,
-0.028564453125,
0.01519012451171875,
0.0143890380859375,
0.01403045654296875,
0.0164642333984375,
0.016448974609375,
-0.0175018310546875,
0.01404571533203125,
0.00955963134765625,
-0.0056915283203125,
-0.01001739501953125,
0.035400390625,
0.003376007080078125,
0.0254669189453125,
-0.0030803680419921875,
-0.0120697021484375,
0.022491455078125,
0.0239715576171875,
-0.0380859375,
-0.0257415771484375,
0.0009207725524902344,
-0.05615234375,
-0.022003173828125,
-0.037841796875,
0.0277252197265625,
-0.01013946533203125,
-0.014923095703125,
0.01163482666015625,
0.0018444061279296875,
-0.059417724609375,
-0.034027099609375,
0.068359375,
0.02813720703125,
-0.0090179443359375,
-0.01947021484375,
0.0007290840148925781,
0.004940032958984375,
0.01198577880859375,
-0.00022137165069580078,
0.027069091796875,
0.07647705078125,
0.0767822265625,
-0.004047393798828125,
-0.00988006591796875,
0.024871826171875,
0.0220184326171875,
0.0052947998046875,
0.0254364013671875,
-0.04217529296875,
-0.0152130126953125,
-0.0239105224609375,
0.005352020263671875,
0.02227783203125,
0.030731201171875,
0.0023326873779296875,
0.02581787109375,
-0.0104827880859375,
-0.005771636962890625,
0.0020847320556640625,
0.007740020751953125,
0.03778076171875,
-0.01441192626953125,
-0.002727508544921875,
0.0004076957702636719,
0.03607177734375,
0.001911163330078125,
0.0418701171875,
0.0478515625,
0.048248291015625,
0.005283355712890625,
-0.00946044921875,
0.00843048095703125,
0.00142669677734375,
-0.032012939453125,
0.00167083740234375,
-0.04364013671875,
0.020172119140625,
0.0123748779296875,
0.007480621337890625,
-0.005184173583984375,
0.020355224609375,
0.022216796875,
-0.0167236328125,
0.032073974609375,
0.001636505126953125,
0.007175445556640625,
-0.003192901611328125,
0.00007963180541992188,
0.0243072509765625,
0.01395416259765625,
-0.047943115234375,
-0.028167724609375,
0.040130615234375,
-0.0248870849609375,
-0.0041046142578125,
0.0287017822265625,
-0.038421630859375,
0.02435302734375,
0.0213623046875,
0.0188446044921875,
-0.01346588134765625,
-0.02447509765625,
0.042510986328125,
-0.021331787109375,
-0.0011720657348632812,
0.027984619140625,
-0.06573486328125,
-0.050750732421875,
-0.0205078125,
0.050140380859375,
0.01087188720703125,
0.06451416015625,
-0.01184844970703125,
0.01085662841796875,
-0.027740478515625,
-0.0278167724609375,
0.007305145263671875,
-0.015960693359375,
0.007717132568359375,
0.0102996826171875,
-0.031768798828125,
0.005565643310546875,
-0.037353515625,
0.01812744140625,
0.007198333740234375,
-0.004764556884765625,
-0.005939483642578125,
0.016998291015625,
0.0217132568359375,
0.0253143310546875,
0.009002685546875,
-0.007694244384765625,
-0.034149169921875,
-0.00002968311309814453,
0.006465911865234375,
0.01702880859375,
0.07733154296875,
0.0321044921875,
0.03955078125,
-0.0008649826049804688,
0.00803375244140625,
0.005550384521484375,
-0.00894927978515625,
-0.00545501708984375,
0.0257415771484375,
-0.037322998046875,
-0.028350830078125,
-0.023834228515625,
-0.0132904052734375,
0.005886077880859375,
-0.004177093505859375,
-0.0061187744140625,
0.00824737548828125,
-0.044097900390625,
0.06622314453125,
0.015869140625,
0.014312744140625,
-0.0709228515625,
-0.0189361572265625,
0.0927734375,
-0.01073455810546875,
0.0367431640625,
0.025665283203125,
-0.00933074951171875,
-0.056610107421875,
-0.0255126953125,
0.032562255859375,
-0.04925537109375,
0.011749267578125,
-0.07666015625,
0.0080108642578125,
0.0224761962890625,
0.01233673095703125,
-0.04248046875,
0.0072784423828125,
-0.005001068115234375,
0.03143310546875,
0.00801849365234375,
0.0023441314697265625,
0.01280975341796875,
0.04541015625,
-0.0163116455078125,
0.0021724700927734375,
-0.0182342529296875,
0.0018548965454101562,
-0.01421356201171875,
0.03668212890625,
0.0302734375,
-0.035675048828125,
0.0274200439453125,
0.04901123046875,
0.043914794921875,
0.10064697265625,
0.01232147216796875,
-0.02532958984375,
-0.04364013671875,
0.032440185546875,
0.0126800537109375,
0.0223846435546875,
0.012451171875,
0.0147247314453125,
-0.02081298828125,
0.0126800537109375,
-0.00467681884765625,
0.01422119140625,
-0.04638671875,
-0.0750732421875,
-0.0243377685546875,
0.017974853515625,
-0.050994873046875,
-0.03338623046875,
-0.0184478759765625,
-0.006946563720703125,
0.003955841064453125,
-0.0266876220703125,
0.01214599609375,
-0.042572021484375,
0.022247314453125,
0.0220489501953125,
0.0236053466796875,
0.01392364501953125,
0.02374267578125,
0.0055694580078125,
0.0516357421875,
0.03948974609375,
0.00691986083984375,
-0.0193939208984375,
0.01210784912109375,
0.005321502685546875,
0.0269012451171875,
-0.0167388916015625,
-0.0069580078125,
0.01049041748046875,
-0.00371551513671875,
0.01053619384765625,
-0.03662109375,
0.0016078948974609375,
0.001529693603515625,
0.0129241943359375,
0.022247314453125,
-0.0061798095703125,
-0.0284576416015625,
0.0160369873046875,
0.00479888916015625,
-0.02142333984375,
-0.00513458251953125,
0.00315093994140625,
-0.058868408203125,
-0.01403045654296875,
0.0045928955078125,
-0.0022144317626953125,
0.017578125,
0.00017440319061279297,
0.01384735107421875,
-0.01317596435546875,
0.0254974365234375,
-0.0266571044921875,
0.01226043701171875,
-0.01593017578125,
0.1142578125,
-0.06634521484375,
-0.01071929931640625,
0.0255126953125,
0.0131072998046875,
0.050994873046875,
-0.01104736328125,
0.01076507568359375,
0.00432586669921875,
-0.03173828125,
0.047882080078125,
-0.017608642578125,
0.06060791015625,
-0.0550537109375,
-0.0325927734375,
0.0005497932434082031,
0.038360595703125,
-0.006011962890625,
0.045806884765625,
0.0172576904296875,
0.00804901123046875,
-0.0005192756652832031,
0.0426025390625,
0.0011281967163085938,
0.01690673828125,
0.0016918182373046875,
0.037384033203125,
0.0123138427734375,
-0.0202789306640625,
0.04840087890625,
-0.0577392578125,
0.003787994384765625,
-0.0078277587890625,
-0.0260467529296875,
-0.04962158203125,
0.0233306884765625,
0.075439453125,
-0.0021228790283203125,
0.0283050537109375
] |
1de3e2ca7d41c9c13f85dcbd499116ea5e285953
|
Wordpress Stackexchange
Q: Filtering posts by post meta data I want to filter posts in such a way that only posts, for which get_post_meta($post->ID, "project_cat", true) (it returns a post ID) is equal to my specified value, are shown.
Any way to do this?
I am especially interested in ways to do it compatible with WP-Paginate plugin.
A: The WP_Query object accepts a post meta argument. Generally speaking you want to do the following:
$my_query = new WP_Query(
array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'project_cat',
'value' => 'my-value',
)
),
// Other query properties
)
);
Where 'my-value' is your 'specified value'.
Example usage:
add_action( 'pre_get_posts' , 'my_pre_get_posts' );
function my_pre_get_posts( $query ) {
// Check this is main query and other conditionals as needed
if( $query->is_main_query() ) {
$query->set(
'meta_query',
array(
array(
'key' => 'project_cat',
'value' => 'my-value'
)
)
);
}
}
See WP_Query, pre_get_posts. All conditionals are available to you. Currently this runs on every main query - which you probably don't want.
Alternatively you can use query_posts (a simpler, but much less efficient way) to alter the query for only a specific instance in a template.
|
Q: Filtering posts by post meta data I want to filter posts in such a way that only posts, for which get_post_meta($post->ID, "project_cat", true) (it returns a post ID) is equal to my specified value, are shown.
Any way to do this?
I am especially interested in ways to do it compatible with WP-Paginate plugin.
A: The WP_Query object accepts a post meta argument. Generally speaking you want to do the following:
$my_query = new WP_Query(
array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'project_cat',
'value' => 'my-value',
)
),
// Other query properties
)
);
Where 'my-value' is your 'specified value'.
Example usage:
add_action( 'pre_get_posts' , 'my_pre_get_posts' );
function my_pre_get_posts( $query ) {
// Check this is main query and other conditionals as needed
if( $query->is_main_query() ) {
$query->set(
'meta_query',
array(
array(
'key' => 'project_cat',
'value' => 'my-value'
)
)
);
}
}
See WP_Query, pre_get_posts. All conditionals are available to you. Currently this runs on every main query - which you probably don't want.
Alternatively you can use query_posts (a simpler, but much less efficient way) to alter the query for only a specific instance in a template.
A: you can filter the post based on the meta value and display the post on the cms page.
'meta_query' => array(
array(
'key' => 'front_page',
'value' => 'yes',
'compare' => 'LIKE',
))
please refer the tutorial for step by step explanation
http://www.pearlbells.co.uk/filter-posts-custom-fields-wp_query/
|
wordpress
|
{
"language": "en",
"length": 235,
"provenance": "stackexchange_00019.jsonl.gz:418921",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48516"
}
|
[
0.04803466796875,
0.00027632713317871094,
0.0296783447265625,
0.003818511962890625,
0.0155792236328125,
-0.01800537109375,
0.050537109375,
-0.044769287109375,
0.01509857177734375,
0.026824951171875,
-0.026214599609375,
-0.01128387451171875,
-0.0164642333984375,
-0.0218353271484375,
-0.024658203125,
-0.035308837890625,
0.033203125,
-0.0138092041015625,
0.0180206298828125,
-0.0226593017578125,
0.0113525390625,
-0.01806640625,
0.040069580078125,
0.05950927734375,
0.027435302734375,
-0.024200439453125,
0.03326416015625,
-0.006072998046875,
0.01416015625,
-0.01371002197265625,
0.010772705078125,
-0.0148468017578125,
0.00693511962890625,
-0.021820068359375,
0.0457763671875,
0.0112152099609375,
0.00868988037109375,
0.0014247894287109375,
0.0280609130859375,
-0.0071868896484375,
0.02593994140625,
-0.011444091796875,
-0.06341552734375,
0.03076171875,
-0.042083740234375,
-0.04534912109375,
0.033966064453125,
-0.00415802001953125,
0.0213470458984375,
-0.004032135009765625,
-0.0016651153564453125,
0.04071044921875,
0.01020050048828125,
-0.0279541015625,
0.0014200210571289062,
0.018310546875,
-0.016326904296875,
-0.01103973388671875,
0.052581787109375,
-0.005859375,
-0.0323486328125,
-0.04718017578125,
0.0208282470703125,
-0.034027099609375,
-0.018218994140625,
-0.0223388671875,
0.015533447265625,
-0.0006866455078125,
-0.0156707763671875,
0.004375457763671875,
0.0460205078125,
0.0063018798828125,
0.021331787109375,
-0.0235443115234375,
-0.020233154296875,
-0.004405975341796875,
0.0258636474609375,
0.005207061767578125,
0.0193023681640625,
-0.023162841796875,
0.014190673828125,
-0.040924072265625,
-0.007656097412109375,
0.0158233642578125,
-0.00827789306640625,
0.0274810791015625,
-0.00438690185546875,
-0.005725860595703125,
-0.034393310546875,
-0.0307769775390625,
-0.0218505859375,
-0.0214691162109375,
-0.0570068359375,
-0.0018930435180664062,
-0.0187835693359375,
-0.01323699951171875,
0.01175689697265625,
0.0274810791015625,
-0.0169219970703125,
0.0112152099609375,
-0.033843994140625,
-0.0172271728515625,
0.003711700439453125,
-0.018310546875,
-0.0001976490020751953,
0.0215606689453125,
-0.007259368896484375,
0.06402587890625,
0.062255859375,
0.064453125,
0.0277862548828125,
0.00701904296875,
-0.024810791015625,
0.0227813720703125,
-0.07177734375,
0.0218658447265625,
-0.0224456787109375,
-0.061126708984375,
-0.033111572265625,
0.004428863525390625,
0.0259246826171875,
0.03271484375,
0.050201416015625,
-0.089599609375,
0.03350830078125,
-0.006870269775390625,
-0.055694580078125,
-0.049072265625,
-0.0186614990234375,
0.0501708984375,
-0.0152435302734375,
-0.0018100738525390625,
0.053955078125,
0.0171661376953125,
-0.01320648193359375,
-0.033599853515625,
0.0008716583251953125,
-0.0306549072265625,
0.0027904510498046875,
-0.011871337890625,
0.01099395751953125,
-0.0271453857421875,
-0.008331298828125,
-0.007053375244140625,
-0.00811004638671875,
0.034942626953125,
0.049530029296875,
0.0017642974853515625,
-0.038330078125,
-0.0295867919921875,
-0.032379150390625,
0.022796630859375,
0.0204010009765625,
0.0008158683776855469,
-0.01433563232421875,
0.00537109375,
0.014556884765625,
-0.0171356201171875,
-0.0345458984375,
-0.018096923828125,
0.0195770263671875,
0.0213470458984375,
0.049072265625,
0.00815582275390625,
-0.01247406005859375,
-0.022125244140625,
-0.040924072265625,
-0.015899658203125,
0.0085601806640625,
0.038177490234375,
0.00927734375,
0.01384735107421875,
0.023651123046875,
-0.03143310546875,
-0.041473388671875,
-0.045318603515625,
0.0037994384765625,
0.0182647705078125,
0.0062255859375,
0.0237884521484375,
-0.01216888427734375,
-0.0321044921875,
0.0316162109375,
0.0003962516784667969,
-0.06597900390625,
0.0379638671875,
0.00931549072265625,
0.06072998046875,
-0.00843048095703125,
0.01441192626953125,
0.07049560546875,
0.028411865234375,
-0.034027099609375,
0.027618408203125,
-0.009490966796875,
-0.059722900390625,
0.034820556640625,
-0.013519287109375,
0.00820159912109375,
0.00644683837890625,
0.0224609375,
0.0056610107421875,
-0.0103912353515625,
0.002735137939453125,
-0.092041015625,
-0.0015048980712890625,
-0.032440185546875,
0.0237884521484375,
-0.01201629638671875,
0.03875732421875,
0.03497314453125,
0.025726318359375,
-0.041961669921875,
0.0174407958984375,
-0.004116058349609375,
-0.00565338134765625,
-0.00659942626953125,
-0.0031795501708984375,
-0.005374908447265625,
-0.025543212890625,
0.011871337890625,
-0.00885009765625,
-0.025238037109375,
0.027435302734375,
0.0721435546875,
0.003185272216796875,
0.002758026123046875,
-0.0192718505859375,
0.07177734375,
0.011810302734375,
-0.0308074951171875,
0.0019140243530273438,
0.052642822265625,
0.03460693359375,
-0.0321044921875,
0.01169586181640625,
0.0106658935546875,
-0.00766754150390625,
0.004047393798828125,
0.02410888671875,
0.020599365234375,
0.03704833984375,
-0.0009899139404296875,
-0.0036487579345703125,
0.048065185546875,
-0.04376220703125,
0.005123138427734375,
-0.003276824951171875,
0.0110321044921875,
0.0229339599609375,
-0.0293121337890625,
-0.035797119140625,
0.0290069580078125,
-0.03948974609375,
0.006771087646484375,
0.033538818359375,
0.019317626953125,
0.0462646484375,
-0.033447265625,
-0.006072998046875,
-0.0145111083984375,
0.00339508056640625,
-0.01509857177734375,
0.004955291748046875,
0.033203125,
-0.0009374618530273438,
0.036041259765625,
0.0284576416015625,
-0.018890380859375,
-0.00787353515625,
0.0125274658203125,
-0.01215362548828125,
0.007007598876953125,
0.01386260986328125,
-0.0282440185546875,
0.032379150390625,
-0.04345703125,
0.01531219482421875,
0.0272674560546875,
0.01105499267578125,
0.007534027099609375,
0.045684814453125,
-0.0112457275390625,
-0.0159149169921875,
-0.01446533203125,
-0.027984619140625,
0.0036182403564453125,
0.03240966796875,
0.0209197998046875,
-0.0156707763671875,
0.0180206298828125,
0.00988006591796875,
-0.0240020751953125,
0.04583740234375,
-0.0191650390625,
-0.0274658203125,
0.024688720703125,
-0.068603515625,
0.06219482421875,
-0.051605224609375,
0.0290374755859375,
0.06378173828125,
-0.041473388671875,
0.04852294921875,
-0.0056915283203125,
0.038909912109375,
-0.0297698974609375,
0.0245819091796875,
-0.00319671630859375,
-0.020416259765625,
-0.037109375,
0.01351165771484375,
0.0229949951171875,
0.03118896484375,
0.007175445556640625,
-0.0198211669921875,
0.006626129150390625,
0.0194854736328125,
-0.037994384765625,
-0.0548095703125,
0.004283905029296875,
-0.040252685546875,
-0.0212249755859375,
-0.0322265625,
-0.0251922607421875,
0.017242431640625,
-0.037872314453125,
-0.0037021636962890625,
-0.0051727294921875,
0.0009503364562988281,
-0.0836181640625,
-0.03436279296875,
-0.049835205078125,
0.0491943359375,
-0.0134735107421875,
0.0020694732666015625,
0.01168060302734375,
0.09808349609375,
0.021636962890625,
-0.089599609375,
0.01276397705078125,
0.0242462158203125,
-0.04168701171875,
0.050048828125,
-0.0084991455078125,
-0.03546142578125,
0.01849365234375,
-0.0013427734375,
0.0576171875,
0.01271820068359375,
-0.004138946533203125,
0.0226898193359375,
0.032257080078125,
0.0361328125,
0.046630859375,
-0.028717041015625,
-0.04473876953125,
0.034454345703125,
0.0250396728515625,
-0.0184478759765625,
-0.01207733154296875,
-0.050140380859375,
-0.055511474609375,
0.015899658203125,
0.031341552734375,
0.024688720703125,
-0.032623291015625,
0.0132904052734375,
0.006526947021484375,
-0.002086639404296875,
0.0038909912109375,
-0.018524169921875,
0.0291900634765625,
0.007965087890625,
0.0142059326171875,
-0.016754150390625,
0.0079345703125,
-0.049072265625,
0.0182037353515625,
-0.005168914794921875,
-0.01538848876953125,
0.00473785400390625,
-0.0232696533203125,
0.01001739501953125,
-0.0007557868957519531,
0.0506591796875,
0.0055694580078125,
0.039215087890625,
-0.0400390625,
-0.050689697265625,
-0.057830810546875,
0.07855224609375,
-0.021759033203125,
-0.040283203125,
-0.007061004638671875,
0.00791168212890625,
0.01380157470703125,
-0.0213165283203125,
0.0295562744140625,
-0.023162841796875,
-0.0648193359375,
-0.0109100341796875,
-0.032257080078125,
-0.035858154296875,
-0.0126800537109375,
-0.036346435546875,
-0.048004150390625,
-0.03851318359375,
0.049652099609375,
-0.0304107666015625,
0.0241546630859375,
-0.00982666015625,
-0.0001652240753173828,
0.0002123117446899414,
-0.042388916015625,
-0.01568603515625,
-0.04345703125,
-0.0160369873046875,
0.02734375,
0.022613525390625,
-0.0219268798828125,
0.004146575927734375,
-0.03436279296875,
0.015838623046875,
0.042327880859375,
0.0296173095703125,
-0.00021696090698242188,
-0.0007047653198242188,
-0.014251708984375,
-0.040740966796875,
0.005588531494140625,
-0.051483154296875,
-0.0017404556274414062,
-0.0132904052734375,
-0.00801849365234375,
-0.0274200439453125,
-0.057342529296875,
-0.03619384765625,
-0.036529541015625,
-0.0199432373046875,
-0.06475830078125,
-0.0302734375,
-0.0240325927734375,
-0.0015697479248046875,
-0.03607177734375,
-0.00384521484375,
-0.036712646484375,
-0.05609130859375,
0.035888671875,
0.037353515625,
-0.012969970703125,
-0.00920867919921875,
0.06353759765625,
0.01325225830078125,
-0.034942626953125,
-0.0273284912109375,
-0.0038776397705078125,
0.01168060302734375,
-0.0131988525390625,
0.06658935546875,
0.0025081634521484375,
-0.009613037109375,
0.08367919921875,
-0.023345947265625,
-0.01435089111328125,
-0.017791748046875,
0.049041748046875,
-0.0271148681640625,
-0.024139404296875,
0.00595855712890625,
-0.05322265625,
0.034454345703125,
0.04681396484375,
0.00952911376953125,
-0.05389404296875,
0.0178070068359375,
0.06951904296875,
0.0118560791015625,
-0.029510498046875,
-0.0640869140625,
0.0016632080078125,
-0.006343841552734375,
0.0188140869140625,
0.0312347412109375,
0.0283355712890625,
-0.007724761962890625,
-0.0131683349609375,
0.01396942138671875,
-0.00472259521484375,
-0.01026153564453125,
0.060394287109375,
-0.0533447265625,
0.023773193359375,
0.004604339599609375,
-0.042724609375,
-0.0266571044921875,
-0.00452423095703125,
0.011688232421875,
-0.03228759765625,
-0.0341796875,
0.0007719993591308594,
-0.0160980224609375,
0.03973388671875,
0.03985595703125,
-0.0291748046875,
0.0203094482421875,
0.038116455078125,
-0.0462646484375,
-0.01113128662109375,
0.007598876953125,
-0.038421630859375,
-0.04803466796875,
0.0081634521484375,
-0.0164947509765625,
0.00978851318359375,
0.008819580078125,
0.0877685546875,
-0.0193939208984375,
0.06640625,
-0.027587890625,
0.050079345703125,
0.028839111328125,
0.0005869865417480469,
-0.008758544921875,
0.0286407470703125,
0.00954437255859375,
-0.01104736328125,
0.0018911361694335938,
-0.004367828369140625,
-0.023529052734375,
-0.005107879638671875,
0.0167083740234375,
-0.0015277862548828125,
0.0186004638671875,
0.01593017578125,
-0.00571441650390625,
-0.0170745849609375,
0.0097503662109375,
0.043853759765625,
0.0037326812744140625,
-0.0206756591796875,
-0.01910400390625,
0.0008325576782226562,
0.0239715576171875,
0.0035400390625,
0.006610870361328125,
0.00907135009765625,
0.0621337890625,
-0.003871917724609375,
0.03875732421875,
-0.006305694580078125,
-0.0135955810546875,
-0.00539398193359375,
-0.037689208984375,
-0.02423095703125,
0.00936126708984375,
0.00927734375,
-0.01250457763671875,
-0.01447296142578125,
0.0180816650390625,
-0.01375579833984375,
0.055999755859375,
-0.044097900390625,
-0.01666259765625,
-0.01404571533203125,
0.0048980712890625,
0.033966064453125,
0.01038360595703125,
-0.0278778076171875,
-0.0148162841796875,
-0.04522705078125,
-0.0226287841796875,
-0.003925323486328125,
-0.016937255859375,
-0.02764892578125,
0.00672149658203125,
-0.0186614990234375,
0.044219970703125,
-0.0179290771484375,
-0.0069732666015625,
0.0014810562133789062,
-0.012969970703125,
-0.0020198822021484375,
0.056732177734375,
-0.01015472412109375,
0.07769775390625,
-0.0323486328125,
0.078857421875,
0.006656646728515625,
0.01910400390625,
-0.01043701171875,
-0.0237884521484375,
0.0010900497436523438,
-0.09149169921875,
-0.0240325927734375,
-0.004604339599609375,
-0.031463623046875,
0.035736083984375,
0.004741668701171875,
-0.0049285888671875,
0.016448974609375,
-0.01113128662109375,
-0.0042724609375,
-0.004730224609375,
0.0265350341796875,
-0.000583648681640625,
0.0140838623046875,
0.0589599609375,
0.00807952880859375,
0.0028553009033203125,
-0.0250396728515625,
-0.0178070068359375,
0.00931549072265625,
0.01049041748046875,
0.006755828857421875,
0.0026702880859375,
-0.03173828125,
0.0438232421875,
0.06536865234375,
0.02001953125,
0.040130615234375,
0.011322021484375,
0.023651123046875,
0.001079559326171875,
-0.031494140625,
0.007366180419921875,
0.0251922607421875,
0.04010009765625,
-0.0153656005859375,
0.0052947998046875,
0.050323486328125,
-0.0202484130859375,
-0.01043701171875,
0.0140533447265625,
0.0241241455078125,
-0.031280517578125,
0.00742340087890625,
0.020751953125,
-0.00984954833984375,
-0.031707763671875,
0.0140380859375,
-0.0090179443359375,
-0.007312774658203125,
0.01151275634765625,
0.01007843017578125,
-0.01358795166015625,
0.0198211669921875,
0.0404052734375,
-0.0158233642578125,
-0.02423095703125,
0.00531768798828125,
-0.005084991455078125,
-0.0164337158203125,
-0.00731658935546875,
0.01146697998046875,
-0.033050537109375,
-0.05126953125,
0.022430419921875,
-0.0032825469970703125,
-0.002056121826171875,
-0.101806640625,
-0.016326904296875,
0.01073455810546875,
-0.01187896728515625,
0.039642333984375,
0.042083740234375,
0.0229644775390625,
0.035369873046875,
0.0183258056640625,
-0.01361846923828125,
0.0180206298828125,
-0.013336181640625,
-0.034210205078125,
-0.03936767578125,
-0.006687164306640625,
0.03350830078125,
-0.0287628173828125,
0.0273590087890625,
-0.004383087158203125,
-0.021453857421875,
-0.0178375244140625,
-0.038848876953125,
0.07757568359375,
-0.0245819091796875,
-0.018218994140625,
0.00543212890625,
0.0194854736328125,
-0.01003265380859375,
0.0026950836181640625,
-0.01401519775390625,
-0.01303863525390625,
-0.00962066650390625,
-0.0157470703125,
-0.05389404296875,
-0.004482269287109375,
-0.017669677734375,
-0.058990478515625,
0.060546875,
0.03216552734375,
0.016204833984375,
-0.00872039794921875,
0.021514892578125,
-0.01419830322265625,
0.01171112060546875,
-0.060577392578125,
0.08197021484375,
0.0233001708984375,
0.09295654296875,
-0.091552734375,
-0.0296478271484375,
0.03472900390625,
0.050048828125,
0.055908203125,
0.006740570068359375,
-0.04107666015625,
-0.025634765625,
0.02655029296875,
0.058624267578125,
0.0206298828125,
0.03680419921875,
-0.00485992431640625,
0.064208984375,
0.064697265625,
-0.06396484375,
0.028289794921875,
-0.00013017654418945312,
-0.0296173095703125,
0.0134735107421875,
0.0001049041748046875,
0.009765625,
-0.0013628005981445312,
0.055908203125,
-0.0111083984375,
-0.0085906982421875,
0.0225067138671875,
-0.022674560546875,
0.033599853515625,
0.03125,
0.07623291015625,
-0.0565185546875,
-0.04632568359375,
-0.00525665283203125,
0.045867919921875,
0.0267181396484375,
0.0265655517578125,
0.040130615234375,
0.00392913818359375,
0.053375244140625,
0.00222015380859375,
0.01300811767578125,
0.0137786865234375,
-0.0027256011962890625,
0.047393798828125,
0.0183563232421875,
0.0311737060546875,
-0.0197296142578125,
0.043121337890625,
0.033416748046875,
0.046142578125,
-0.04449462890625,
-0.045440673828125,
-0.00365447998046875,
-0.017730712890625,
-0.00308990478515625,
0.004482269287109375,
-0.01253509521484375,
0.04083251953125,
0.06805419921875,
-0.074462890625,
0.0016632080078125,
0.0155792236328125,
-0.0018434524536132812,
-0.032440185546875,
-0.0261383056640625,
0.02606201171875,
0.0204010009765625,
-0.0562744140625,
0.017974853515625,
0.0226593017578125,
0.0760498046875,
0.031280517578125,
0.042633056640625,
-0.0130157470703125,
-0.034423828125,
-0.01116943359375,
0.0251007080078125,
-0.01514434814453125,
0.02069091796875,
-0.03851318359375,
-0.0301513671875,
-0.0231475830078125,
0.04119873046875,
0.0498046875,
0.0523681640625,
0.07275390625,
0.033935546875,
-0.0272216796875,
0.0205230712890625,
0.053131103515625,
-0.017181396484375,
0.0026378631591796875,
-0.04791259765625,
0.01554107666015625,
0.005947113037109375,
-0.00363922119140625,
0.01016998291015625,
0.015167236328125,
0.0007967948913574219,
0.01861572265625,
0.002056121826171875,
0.008758544921875,
-0.0036792755126953125,
0.0556640625,
-0.0291595458984375,
0.030426025390625,
0.006591796875,
-0.052734375,
0.01200103759765625,
-0.0305023193359375,
-0.058929443359375,
0.00751495361328125,
0.0289764404296875,
-0.029388427734375,
0.0196990966796875,
0.0259246826171875,
-0.0001042485237121582,
0.042266845703125,
-0.0186767578125,
0.00504302978515625,
0.026123046875,
0.035675048828125,
0.0244140625,
-0.038665771484375,
-0.01494598388671875,
-0.005817413330078125,
0.014068603515625,
0.0038585662841796875,
-0.005191802978515625,
0.0299835205078125,
0.0168914794921875,
-0.0166778564453125,
0.007015228271484375,
-0.0301666259765625,
-0.006175994873046875,
0.0220794677734375,
-0.0194854736328125,
-0.01213836669921875,
0.00923919677734375,
0.01666259765625,
-0.027984619140625,
0.0682373046875,
-0.052032470703125,
-0.00238037109375,
-0.035552978515625,
0.0237579345703125,
-0.052398681640625,
0.0274505615234375,
-0.0167999267578125,
0.00677490234375,
-0.04595947265625,
-0.033233642578125,
0.07476806640625,
0.043121337890625,
-0.0146484375,
0.01320648193359375,
0.005809783935546875,
-0.007740020751953125,
0.0306243896484375,
-0.00522613525390625,
0.05255126953125,
0.038787841796875,
-0.050140380859375,
0.035003662109375,
0.0110015869140625,
-0.01013946533203125,
0.0101776123046875,
0.0248260498046875,
-0.045166015625,
0.019866943359375,
-0.01480865478515625,
-0.0460205078125,
-0.0139923095703125,
0.0208587646484375,
-0.0059356689453125,
0.01629638671875,
-0.0299072265625,
0.0010614395141601562,
-0.00820159912109375,
0.0130615234375,
-0.03448486328125,
-0.0281524658203125,
-0.03302001953125,
-0.0302886962890625,
-0.0136566162109375,
-0.11810302734375,
-0.011138916015625,
-0.0185089111328125,
0.0234832763671875,
-0.00342559814453125,
-0.035491943359375,
0.00832366943359375,
-0.01262664794921875,
0.00841522216796875,
-0.01236724853515625,
-0.03057861328125,
0.00431060791015625,
0.018768310546875,
-0.0034465789794921875,
0.0016374588012695312,
-0.02398681640625,
-0.0008411407470703125,
0.012115478515625,
0.008148193359375,
0.0272979736328125,
-0.01148223876953125,
-0.04461669921875,
0.013946533203125,
0.002300262451171875,
0.0404052734375,
0.00429534912109375,
-0.0033893585205078125,
0.031463623046875,
-0.004619598388671875,
-0.0285186767578125,
-0.08477783203125,
0.0053558349609375,
-0.07135009765625,
-0.0002777576446533203,
0.00553131103515625,
0.0156707763671875,
0.041168212890625,
-0.018890380859375,
-0.08001708984375,
0.058502197265625,
-0.026123046875,
-0.029022216796875,
-0.0133514404296875,
0.002315521240234375,
-0.0022735595703125,
-0.00310516357421875,
0.0189361572265625,
-0.0501708984375,
-0.048309326171875,
-0.015472412109375,
0.015869140625,
-0.0056304931640625,
0.0280609130859375,
0.0215301513671875,
-0.077392578125,
-0.0030307769775390625,
-0.0241851806640625,
0.0036106109619140625,
-0.0166015625,
0.01500701904296875,
-0.005382537841796875,
0.00974273681640625,
-0.037933349609375,
0.02294921875,
-0.0038013458251953125,
0.00969696044921875,
0.0124359130859375,
-0.00348663330078125,
-0.0687255859375,
-0.0285491943359375,
0.08355712890625,
0.04046630859375,
0.04193115234375,
-0.027252197265625,
-0.0043792724609375,
-0.0266571044921875,
-0.0307769775390625,
-0.039154052734375,
0.0250244140625,
-0.062469482421875,
-0.02838134765625,
-0.0159454345703125,
-0.0186309814453125,
-0.0036258697509765625,
-0.031646728515625,
-0.040679931640625,
0.00960540771484375,
-0.0095672607421875,
0.01515960693359375,
-0.00559234619140625,
-0.03436279296875,
0.008697509765625,
-0.0245208740234375,
-0.055145263671875,
0.01071929931640625,
0.0189208984375,
-0.042633056640625,
0.0029811859130859375,
0.0191192626953125,
-0.00027561187744140625,
-0.00020456314086914062,
-0.00504302978515625,
0.0377197265625,
-0.0193634033203125,
0.04644775390625,
-0.0260162353515625,
-0.03253173828125,
0.0192413330078125,
0.017547607421875,
0.01371002197265625,
-0.023529052734375,
0.0176849365234375,
0.03106689453125,
0.0400390625,
0.0109710693359375,
0.05157470703125,
0.0096588134765625,
0.036956787109375,
-0.0093841552734375,
-0.029022216796875,
-0.01374053955078125,
-0.025726318359375,
-0.01535797119140625,
-0.0186004638671875,
-0.0732421875,
-0.01629638671875,
-0.005725860595703125,
-0.01361083984375,
-0.043731689453125,
0.006374359130859375
] |
a1c1daa7d27f5c9d6d09c757496e4c411c4e8c2b
|
Wordpress Stackexchange
Q: How do I make script load after jquery? function load_my_script(){
wp_register_script( 'my_script', get_template_directory_uri() . '/js/myscript.js', 'jquery' );
wp_enqueue_script( 'my_script', 'jquery');
}
add_action('wp_enqueue_scripts', 'load_my_script');
myscript.js is loading before jquery, why? And how do I make it load AFTER jquery?
Thanks.
A: You have a typo in your code. It should be:
function load_my_script(){
wp_register_script(
'my_script',
get_template_directory_uri() . '/js/myscript.js',
array( 'jquery' )
);
wp_enqueue_script( 'my_script' );
}
add_action('wp_enqueue_scripts', 'load_my_script');
The jQuery dependency needs to be an array(), not just a string. This will force your script to load after jQuery.
|
Q: How do I make script load after jquery? function load_my_script(){
wp_register_script( 'my_script', get_template_directory_uri() . '/js/myscript.js', 'jquery' );
wp_enqueue_script( 'my_script', 'jquery');
}
add_action('wp_enqueue_scripts', 'load_my_script');
myscript.js is loading before jquery, why? And how do I make it load AFTER jquery?
Thanks.
A: You have a typo in your code. It should be:
function load_my_script(){
wp_register_script(
'my_script',
get_template_directory_uri() . '/js/myscript.js',
array( 'jquery' )
);
wp_enqueue_script( 'my_script' );
}
add_action('wp_enqueue_scripts', 'load_my_script');
The jQuery dependency needs to be an array(), not just a string. This will force your script to load after jQuery.
A: get_template_directory_uri() does give you the theme directory, but this is not what you want if you are using a Child Theme.
get_stylesheet_directory_uri() will give your the directory of your "current theme", so in either case, it is safest to use.
|
wordpress
|
{
"language": "en",
"length": 130,
"provenance": "stackexchange_00019.jsonl.gz:418925",
"question_score": "14",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48530"
}
|
[
0.0423583984375,
0.01171875,
-0.07049560546875,
-0.068115234375,
0.035003662109375,
-0.050689697265625,
0.01354217529296875,
0.0275726318359375,
-0.037261962890625,
0.0050506591796875,
-0.05303955078125,
0.04681396484375,
-0.070556640625,
0.013671875,
-0.0016880035400390625,
-0.08355712890625,
0.06298828125,
-0.06622314453125,
0.005100250244140625,
-0.0084381103515625,
0.0291748046875,
0.015777587890625,
0.034088134765625,
0.114501953125,
0.003662109375,
-0.0096588134765625,
0.1171875,
-0.00705718994140625,
0.0026760101318359375,
-0.02008056640625,
0.0254364013671875,
-0.0174102783203125,
0.002838134765625,
0.00495147705078125,
0.0227203369140625,
0.0254058837890625,
0.01800537109375,
0.0111541748046875,
0.03009033203125,
0.0224456787109375,
0.032928466796875,
-0.01154327392578125,
0.015045166015625,
0.00778961181640625,
-0.00634765625,
-0.032440185546875,
0.022369384765625,
-0.03460693359375,
0.01102447509765625,
-0.00351715087890625,
0.004150390625,
-0.0020084381103515625,
0.0249786376953125,
-0.00220489501953125,
0.0025177001953125,
0.0175018310546875,
-0.038604736328125,
-0.0002834796905517578,
0.0160064697265625,
0.08697509765625,
0.0236053466796875,
0.00705718994140625,
-0.0235137939453125,
-0.0733642578125,
-0.01763916015625,
-0.0015382766723632812,
-0.031280517578125,
0.0018301010131835938,
-0.044708251953125,
-0.0078582763671875,
0.033721923828125,
-0.044036865234375,
-0.024200439453125,
-0.01209259033203125,
0.0035858154296875,
-0.0011587142944335938,
0.024017333984375,
0.0071563720703125,
-0.0025234222412109375,
0.02191162109375,
0.00927734375,
-0.027557373046875,
-0.00281524658203125,
0.000946044921875,
-0.017120361328125,
0.0182037353515625,
-0.019989013671875,
0.00421905517578125,
-0.035247802734375,
-0.0247650146484375,
-0.0318603515625,
-0.00946807861328125,
-0.020355224609375,
-0.0213623046875,
-0.031768798828125,
-0.00045871734619140625,
0.028839111328125,
0.0369873046875,
-0.001972198486328125,
0.004566192626953125,
0.004337310791015625,
-0.026092529296875,
0.02410888671875,
-0.022705078125,
-0.02166748046875,
0.03753662109375,
0.01959228515625,
-0.003253936767578125,
-0.01727294921875,
0.00020384788513183594,
-0.01210784912109375,
-0.039337158203125,
0.0280303955078125,
0.03656005859375,
-0.046600341796875,
-0.0367431640625,
-0.03131103515625,
-0.0189666748046875,
-0.01085662841796875,
-0.002197265625,
0.0088043212890625,
0.02349853515625,
-0.0107879638671875,
-0.0144500732421875,
0.03289794921875,
-0.0034637451171875,
-0.01210784912109375,
-0.021881103515625,
-0.004070281982421875,
0.0141754150390625,
0.00628662109375,
0.0028629302978515625,
0.01486968994140625,
0.02734375,
-0.01161956787109375,
-0.00800323486328125,
0.0266571044921875,
-0.0275726318359375,
0.0005698204040527344,
-0.01036834716796875,
-0.005275726318359375,
-0.026153564453125,
0.003894805908203125,
-0.0128936767578125,
-0.0203857421875,
0.0104827880859375,
-0.0032215118408203125,
0.00897216796875,
-0.004711151123046875,
-0.041046142578125,
0.016510009765625,
-0.040435791015625,
0.047454833984375,
0.00759124755859375,
0.00737762451171875,
-0.037017822265625,
0.06304931640625,
-0.04345703125,
-0.01427459716796875,
-0.048126220703125,
-0.0155792236328125,
0.039642333984375,
0.0158843994140625,
-0.05126953125,
-0.03466796875,
-0.071044921875,
-0.005645751953125,
0.005382537841796875,
0.0328369140625,
0.0160980224609375,
-0.006793975830078125,
-0.0201568603515625,
-0.0038585662841796875,
0.006549835205078125,
-0.01067352294921875,
0.022705078125,
0.01399993896484375,
-0.00078582763671875,
0.028350830078125,
-0.00738525390625,
-0.042999267578125,
-0.039581298828125,
0.037384033203125,
-0.0428466796875,
-0.034271240234375,
0.01328277587890625,
0.0364990234375,
0.07373046875,
-0.03155517578125,
0.043792724609375,
0.0504150390625,
0.030029296875,
-0.034515380859375,
0.0025997161865234375,
-0.00228118896484375,
-0.0013723373413085938,
-0.00010412931442260742,
0.00894927978515625,
-0.0091094970703125,
-0.007396697998046875,
0.0130462646484375,
0.02862548828125,
-0.02630615234375,
-0.00334930419921875,
-0.055755615234375,
-0.0138092041015625,
-0.01800537109375,
0.04071044921875,
0.0182952880859375,
0.0173797607421875,
-0.00377655029296875,
0.0184783935546875,
-0.0013914108276367188,
-0.05645751953125,
-0.047454833984375,
0.024871826171875,
-0.02838134765625,
0.08465576171875,
-0.0006985664367675781,
0.057952880859375,
0.0017185211181640625,
-0.047637939453125,
0.01366424560546875,
-0.011749267578125,
0.0058441162109375,
0.0055999755859375,
-0.039031982421875,
-0.0159454345703125,
-0.006938934326171875,
-0.0014505386352539062,
-0.0219268798828125,
0.0699462890625,
0.042694091796875,
0.0270538330078125,
-0.0233001708984375,
0.012969970703125,
0.008148193359375,
0.00044655799865722656,
-0.014404296875,
0.0213470458984375,
0.0211334228515625,
0.03936767578125,
-0.006381988525390625,
0.032196044921875,
-0.0191192626953125,
-0.071044921875,
0.00667572021484375,
0.01361083984375,
-0.012176513671875,
-0.004924774169921875,
0.003276824951171875,
-0.00555419921875,
0.03570556640625,
-0.0604248046875,
0.006549835205078125,
0.05523681640625,
0.029083251953125,
0.00899505615234375,
-0.01534271240234375,
0.01300811767578125,
-0.001262664794921875,
0.01629638671875,
-0.029052734375,
0.009918212890625,
0.002307891845703125,
0.0131072998046875,
0.0029582977294921875,
0.0018701553344726562,
-0.01267242431640625,
0.01229095458984375,
0.02362060546875,
-0.0426025390625,
0.0007452964782714844,
0.037567138671875,
0.0281829833984375,
-0.01678466796875,
-0.0207977294921875,
-0.00861358642578125,
-0.00449371337890625,
0.0178375244140625,
0.007659912109375,
-0.0161285400390625,
-0.016998291015625,
-0.0003170967102050781,
0.0252838134765625,
-0.043914794921875,
0.0224456787109375,
0.037384033203125,
0.01166534423828125,
0.0200958251953125,
0.04461669921875,
0.004344940185546875,
0.01544952392578125,
0.0022411346435546875,
0.0090789794921875,
-0.0264434814453125,
0.0784912109375,
-0.0062103271484375,
0.0168304443359375,
-0.023895263671875,
0.045623779296875,
0.029937744140625,
-0.022003173828125,
0.003551483154296875,
-0.0114898681640625,
0.0506591796875,
0.043670654296875,
-0.045928955078125,
-0.02874755859375,
-0.0103912353515625,
-0.047088623046875,
-0.0215911865234375,
0.0278472900390625,
0.0552978515625,
0.0115509033203125,
-0.0399169921875,
0.0131988525390625,
0.030853271484375,
-0.08746337890625,
-0.113037109375,
-0.021240234375,
-0.07513427734375,
0.0450439453125,
-0.00777435302734375,
-0.01241302490234375,
-0.03155517578125,
0.0289764404296875,
0.034210205078125,
-0.019683837890625,
-0.042816162109375,
-0.023284912109375,
-0.051727294921875,
-0.039794921875,
0.01390838623046875,
0.005603790283203125,
-0.0285797119140625,
0.0232696533203125,
0.007537841796875,
0.0149383544921875,
-0.0654296875,
0.005828857421875,
0.02154541015625,
-0.0233306884765625,
0.0099029541015625,
0.0206298828125,
-0.045654296875,
-0.00402069091796875,
0.003101348876953125,
0.00757598876953125,
0.02288818359375,
0.007213592529296875,
0.0004374980926513672,
-0.0207061767578125,
-0.04583740234375,
0.002826690673828125,
0.051727294921875,
-0.008392333984375,
-0.038482666015625,
0.039886474609375,
-0.06573486328125,
-0.004337310791015625,
0.0006380081176757812,
-0.03350830078125,
-0.0193328857421875,
0.02154541015625,
-0.019866943359375,
-0.00786590576171875,
-0.00876617431640625,
0.0143585205078125,
-0.01508331298828125,
-0.0088348388671875,
-0.0255279541015625,
0.07470703125,
0.00823974609375,
0.028839111328125,
-0.030487060546875,
0.06707763671875,
-0.01175689697265625,
-0.0257415771484375,
0.00489044189453125,
0.0096282958984375,
-0.0207061767578125,
0.0024871826171875,
-0.049468994140625,
-0.00542449951171875,
0.0278167724609375,
0.0172576904296875,
0.010223388671875,
-0.039215087890625,
-0.020538330078125,
-0.0229034423828125,
0.0478515625,
-0.01715087890625,
-0.0015401840209960938,
0.01739501953125,
0.0164794921875,
-0.032440185546875,
-0.040069580078125,
-0.058013916015625,
-0.006450653076171875,
-0.04364013671875,
0.0223236083984375,
-0.03472900390625,
0.01470947265625,
-0.041351318359375,
0.033966064453125,
-0.0213470458984375,
-0.044586181640625,
0.04718017578125,
-0.079345703125,
-0.01374053955078125,
-0.01071929931640625,
-0.0120697021484375,
-0.06219482421875,
-0.02789306640625,
-0.02130126953125,
-0.09088134765625,
-0.002834320068359375,
-0.068115234375,
0.08636474609375,
0.042327880859375,
-0.01107025146484375,
-0.001285552978515625,
0.048065185546875,
0.021759033203125,
0.022430419921875,
0.0252685546875,
-0.007129669189453125,
0.0467529296875,
-0.0196685791015625,
0.0137176513671875,
-0.0309906005859375,
0.00457763671875,
-0.0217132568359375,
-0.038604736328125,
-0.01317596435546875,
-0.037872314453125,
0.0206146240234375,
-0.0116424560546875,
-0.01192474365234375,
0.0157012939453125,
-0.0053253173828125,
-0.021270751953125,
0.0016603469848632812,
0.01505279541015625,
-0.037689208984375,
-0.00014519691467285156,
-0.00972747802734375,
0.0012884140014648438,
-0.013397216796875,
-0.004825592041015625,
-0.01311492919921875,
0.00672149658203125,
0.0284576416015625,
-0.0033779144287109375,
0.057647705078125,
-0.01025390625,
0.0196990966796875,
0.01360321044921875,
0.0408935546875,
0.006153106689453125,
0.0003383159637451172,
0.0290985107421875,
0.0011930465698242188,
-0.00244140625,
0.01016998291015625,
0.07275390625,
0.0278778076171875,
-0.002681732177734375,
-0.00441741943359375,
0.0161895751953125,
-0.06915283203125,
-0.00797271728515625,
-0.018707275390625,
0.0160064697265625,
0.022674560546875,
-0.0005688667297363281,
-0.032989501953125,
0.0217437744140625,
-0.007686614990234375,
-0.0231475830078125,
0.002025604248046875,
-0.022552490234375,
0.080078125,
0.03955078125,
-0.0032482147216796875,
0.0465087890625,
0.050872802734375,
-0.0216522216796875,
-0.0195159912109375,
-0.0160369873046875,
0.0115966796875,
0.02239990234375,
-0.0108795166015625,
0.005077362060546875,
-0.0111236572265625,
-0.0060272216796875,
0.047454833984375,
0.04302978515625,
-0.013702392578125,
-0.03076171875,
0.00627899169921875,
0.04791259765625,
-0.0518798828125,
0.0269622802734375,
0.0281982421875,
0.020751953125,
-0.0230865478515625,
-0.0292205810546875,
0.007366180419921875,
0.0087127685546875,
-0.03729248046875,
0.03839111328125,
0.0303955078125,
-0.0139617919921875,
-0.039794921875,
0.061248779296875,
0.00980377197265625,
-0.00675201416015625,
0.00016570091247558594,
0.05902099609375,
0.0165252685546875,
0.042999267578125,
0.006748199462890625,
-0.01080322265625,
0.005779266357421875,
0.016632080078125,
-0.020172119140625,
-0.031768798828125,
0.0238189697265625,
0.005535125732421875,
0.00919342041015625,
-0.042724609375,
-0.034423828125,
0.051300048828125,
-0.01296234130859375,
-0.044921875,
0.01404571533203125,
0.0295867919921875,
-0.0086822509765625,
-0.025970458984375,
-0.0262451171875,
0.0194244384765625,
0.0465087890625,
0.0158538818359375,
0.055023193359375,
-0.00658416748046875,
0.0272369384765625,
0.00846099853515625,
0.006832122802734375,
-0.044403076171875,
-0.02630615234375,
0.0241851806640625,
0.019805908203125,
-0.006572723388671875,
-0.0447998046875,
-0.04547119140625,
-0.004283905029296875,
-0.005706787109375,
0.0369873046875,
-0.00836944580078125,
0.0014734268188476562,
-0.036041259765625,
0.02374267578125,
-0.043243408203125,
0.01058197021484375,
0.005123138427734375,
-0.020721435546875,
-0.0325927734375,
-0.018890380859375,
-0.046783447265625,
-0.0249481201171875,
-0.039306640625,
-0.048858642578125,
-0.040802001953125,
0.015228271484375,
-0.00992584228515625,
0.005443572998046875,
-0.01438140869140625,
0.0007734298706054688,
-0.006809234619140625,
0.0197296142578125,
0.015960693359375,
0.0069427490234375,
-0.0181121826171875,
0.09674072265625,
-0.0081634521484375,
0.01922607421875,
0.01277923583984375,
0.056610107421875,
0.005863189697265625,
-0.005443572998046875,
-0.035064697265625,
-0.0906982421875,
0.024322509765625,
0.024566650390625,
-0.04840087890625,
0.040069580078125,
0.050567626953125,
0.02093505859375,
0.030792236328125,
0.0172271728515625,
-0.00453948974609375,
0.0045318603515625,
-0.00589752197265625,
0.052947998046875,
0.039764404296875,
0.055572509765625,
-0.0031375885009765625,
-0.004100799560546875,
0.0008988380432128906,
-0.0143280029296875,
0.03515625,
-0.00988006591796875,
0.0286102294921875,
-0.0236053466796875,
-0.0504150390625,
0.04620361328125,
0.006885528564453125,
0.007572174072265625,
0.0163116455078125,
-0.021636962890625,
0.006195068359375,
-0.008544921875,
0.02880859375,
-0.030670166015625,
-0.043212890625,
-0.0028400421142578125,
-0.0083770751953125,
-0.005718231201171875,
-0.00946807861328125,
-0.01261138916015625,
-0.0065765380859375,
0.0288238525390625,
0.0511474609375,
-0.040374755859375,
0.00652313232421875,
0.0046844482421875,
-0.031494140625,
-0.0282745361328125,
-0.0377197265625,
0.00649261474609375,
-0.001773834228515625,
0.07366943359375,
0.049102783203125,
-0.0008096694946289062,
0.051483154296875,
0.0211334228515625,
-0.024444580078125,
-0.018585205078125,
-0.0030117034912109375,
0.02886962890625,
-0.020477294921875,
0.0447998046875,
-0.00598907470703125,
0.04351806640625,
-0.0399169921875,
0.004428863525390625,
0.0301513671875,
-0.01206207275390625,
-0.00965118408203125,
0.07275390625,
-0.005886077880859375,
0.0188446044921875,
0.01061248779296875,
0.00104522705078125,
0.0245819091796875,
0.023284912109375,
-0.005062103271484375,
0.003360748291015625,
-0.0020885467529296875,
0.01251220703125,
0.017364501953125,
-0.0283355712890625,
0.0092926025390625,
0.0207672119140625,
-0.0237884521484375,
0.0032405853271484375,
-0.0003542900085449219,
-0.0240478515625,
-0.021728515625,
-0.017913818359375,
0.042999267578125,
-0.01457977294921875,
-0.01100921630859375,
0.0166778564453125,
0.056671142578125,
-0.00890350341796875,
-0.005615234375,
0.00801849365234375,
-0.04833984375,
-0.0215606689453125,
0.0016345977783203125,
-0.05926513671875,
-0.0283966064453125,
-0.04681396484375,
-0.019195556640625,
0.0987548828125,
-0.035675048828125,
0.013092041015625,
0.0238800048828125,
0.0411376953125,
0.0013780593872070312,
0.041961669921875,
-0.0290069580078125,
0.0120849609375,
-0.0369873046875,
0.03900146484375,
-0.04669189453125,
-0.01035308837890625,
-0.0041046142578125,
0.026336669921875,
-0.0179443359375,
-0.0134429931640625,
0.007312774658203125,
0.0060577392578125,
0.038665771484375,
0.10382080078125,
0.05047607421875,
-0.04937744140625,
0.0014810562133789062,
0.005535125732421875,
-0.01068878173828125,
-0.0102386474609375,
0.0193023681640625,
-0.0457763671875,
-0.047698974609375,
0.015045166015625,
0.0218048095703125,
0.0152587890625,
0.00897216796875,
-0.0027103424072265625,
-0.034515380859375,
0.0374755859375,
0.01273345947265625,
0.07861328125,
-0.01288604736328125,
0.047637939453125,
-0.020965576171875,
0.052459716796875,
-0.0391845703125,
-0.01273345947265625,
0.01361083984375,
-0.00926971435546875,
-0.0194244384765625,
0.021484375,
0.00969696044921875,
-0.03656005859375,
0.0321044921875,
-0.00473785400390625,
0.0380859375,
-0.01349639892578125,
0.0208282470703125,
0.026275634765625,
0.040252685546875,
-0.0362548828125,
-0.050628662109375,
0.0304107666015625,
0.04388427734375,
-0.00910186767578125,
-0.0005674362182617188,
0.0027828216552734375,
-0.0180511474609375,
-0.015777587890625,
-0.033721923828125,
-0.01104736328125,
-0.0023860931396484375,
-0.004970550537109375,
0.005779266357421875,
-0.0294189453125,
-0.004215240478515625,
0.00545501708984375,
0.006366729736328125,
-0.00672149658203125,
0.031646728515625,
-0.01258087158203125,
-0.056243896484375,
0.041839599609375,
0.026885986328125,
0.06976318359375,
-0.0029277801513671875,
0.054718017578125,
-0.040435791015625,
-0.03131103515625,
0.00872802734375,
0.0216064453125,
0.00397491455078125,
-0.0074005126953125,
0.0095367431640625,
0.00394439697265625,
-0.027923583984375,
0.003963470458984375,
0.03033447265625,
0.0330810546875,
0.0616455078125,
0.02716064453125,
-0.04144287109375,
0.00220489501953125,
0.0562744140625,
-0.0180511474609375,
0.044219970703125,
0.01537322998046875,
0.0673828125,
0.0209197998046875,
-0.002513885498046875,
-0.05706787109375,
0.09417724609375,
0.0112762451171875,
-0.04046630859375,
0.047210693359375,
-0.0009322166442871094,
-0.022308349609375,
0.039886474609375,
-0.003673553466796875,
0.1043701171875,
0.00042366981506347656,
-0.015899658203125,
-0.00241851806640625,
-0.03643798828125,
-0.0263671875,
0.03814697265625,
0.043060302734375,
-0.007781982421875,
0.0268096923828125,
0.07586669921875,
-0.0347900390625,
0.0201873779296875,
0.0211334228515625,
0.0211029052734375,
-0.01654052734375,
0.027069091796875,
0.0289459228515625,
-0.0131378173828125,
-0.00778961181640625,
0.003185272216796875,
0.0152740478515625,
0.01296234130859375,
-0.02099609375,
0.0120849609375,
0.0251312255859375,
0.023529052734375,
-0.0272979736328125,
0.026885986328125,
0.01007843017578125,
-0.003932952880859375,
-0.010589599609375,
0.0019817352294921875,
-0.00823211669921875,
-0.03973388671875,
0.06494140625,
-0.01107025146484375,
0.0201263427734375,
0.038482666015625,
-0.018768310546875,
0.004482269287109375,
0.0201568603515625,
0.01091766357421875,
-0.033538818359375,
-0.035400390625,
-0.021270751953125,
0.0023479461669921875,
-0.006969451904296875,
-0.035369873046875,
-0.0254974365234375,
-0.0174407958984375,
0.0159149169921875,
-0.0192413330078125,
0.000423431396484375,
0.027191162109375,
-0.019989013671875,
0.0096282958984375,
0.0179290771484375,
0.0047760009765625,
0.01145172119140625,
-0.0139007568359375,
0.03326416015625,
-0.00211334228515625,
0.018463134765625,
0.003093719482421875,
-0.005031585693359375,
-0.0167083740234375,
0.0335693359375,
0.059661865234375,
0.0218353271484375,
0.036865234375,
-0.0251312255859375,
-0.01165771484375,
-0.0035839080810546875,
-0.04132080078125,
-0.015655517578125,
0.006927490234375,
-0.00286865234375,
0.031036376953125,
0.0253448486328125,
-0.011932373046875,
-0.0099639892578125,
-0.00402069091796875,
0.042694091796875,
0.0180816650390625,
-0.07891845703125,
0.044952392578125,
-0.03985595703125,
0.0248260498046875,
0.0008802413940429688,
0.01244354248046875,
-0.0158843994140625,
-0.0150299072265625,
-0.0276641845703125,
-0.036285400390625,
-0.039825439453125,
0.04315185546875,
-0.01094818115234375,
0.01319122314453125,
0.0279998779296875,
-0.01447296142578125,
0.0128631591796875,
0.0308685302734375,
0.005950927734375,
0.08111572265625,
-0.003055572509765625,
0.0019426345825195312,
0.006786346435546875,
0.05987548828125,
-0.0178070068359375,
-0.07989501953125,
-0.0188140869140625,
0.0090484619140625,
0.045379638671875,
-0.046630859375,
0.02801513671875,
0.0284423828125,
-0.03460693359375,
-0.07269287109375,
0.08050537109375,
-0.02801513671875,
-0.0238800048828125,
-0.060455322265625,
0.0129547119140625,
0.0150604248046875,
-0.0226898193359375,
-0.02752685546875,
-0.030609130859375,
-0.04522705078125,
0.034698486328125,
0.01873779296875,
0.03460693359375,
0.0290985107421875,
-0.024261474609375,
-0.032684326171875,
-0.00301361083984375,
-0.01036834716796875,
0.033843994140625,
-0.05303955078125,
0.0201873779296875,
0.003116607666015625,
0.0400390625,
0.00780487060546875,
0.03594970703125,
0.032257080078125,
-0.0121917724609375,
-0.007564544677734375,
-0.03466796875,
-0.00754547119140625,
-0.0100250244140625,
0.06884765625,
-0.0147552490234375,
0.014678955078125,
-0.008697509765625,
-0.018707275390625,
-0.026031494140625,
-0.006206512451171875,
-0.019866943359375,
0.0231475830078125,
-0.065185546875,
0.0033206939697265625,
0.01953125,
-0.005550384521484375,
0.006290435791015625,
-0.03765869140625,
-0.040313720703125,
-0.0145721435546875,
-0.027069091796875,
0.0213470458984375,
-0.068359375,
0.025787353515625,
0.0880126953125,
-0.035858154296875,
0.0275421142578125,
0.0217742919921875,
-0.00450897216796875,
0.07025146484375,
0.0265350341796875,
0.0099029541015625,
0.0546875,
-0.0438232421875,
-0.0269622802734375,
0.00780487060546875,
0.007144927978515625,
0.010406494140625,
-0.01438140869140625,
-0.0017118453979492188,
0.0276641845703125,
-0.0011043548583984375,
0.0220794677734375,
-0.0123443603515625,
0.01496124267578125,
-0.005611419677734375,
0.01284027099609375,
-0.059600830078125,
0.022491455078125,
-0.0128936767578125,
-0.01275634765625,
0.00595855712890625,
0.0430908203125,
0.060272216796875,
0.007495880126953125,
-0.0103302001953125,
0.0078125,
-0.034271240234375,
-0.00904083251953125,
-0.007282257080078125,
-0.043060302734375,
-0.0137481689453125,
-0.00424957275390625
] |
65567ae0ec3b1ff5ad0f812ed8d50f9abc747fce
|
Wordpress Stackexchange
Q: How to include own css on wordpress tinymce editor? I have added some text on tinymce editor on load.
(Every time you click on Add new the tinymce editor load with this text.)
but problem is how to enable css class which are using in default text.
Thanks
A: add_editor_style is recommended for theme.
You can mce_css filter in plugin. The following sample code is from here
function plugin_mce_css( $mce_css ) {
if ( !empty( $mce_css ) )
$mce_css .= ',';
$mce_css .= plugins_url( 'editor.css', __FILE__ );
return $mce_css;
}
add_filter( 'mce_css', 'plugin_mce_css' );
|
Q: How to include own css on wordpress tinymce editor? I have added some text on tinymce editor on load.
(Every time you click on Add new the tinymce editor load with this text.)
but problem is how to enable css class which are using in default text.
Thanks
A: add_editor_style is recommended for theme.
You can mce_css filter in plugin. The following sample code is from here
function plugin_mce_css( $mce_css ) {
if ( !empty( $mce_css ) )
$mce_css .= ',';
$mce_css .= plugins_url( 'editor.css', __FILE__ );
return $mce_css;
}
add_filter( 'mce_css', 'plugin_mce_css' );
A: Nothing I found worked. Took me half a day on Google, but finally stumbled upon this script that works:
function kwh_add_editor_style( $mceInit ) {
$custom_css = get_theme_mod( 'custom_css' );
$styles = '.mce-content-body { EDIT YOUR CUSTOM CSS HERE ' . $custom_css . '; }';
if ( !isset( $mceInit['content_style'] ) ) {
$mceInit['content_style'] = $styles . ' ';
} else {
$mceInit['content_style'] .= ' ' . $styles . ' ';
}
return $mceInit;
}
add_filter( 'tiny_mce_before_init', 'kwh_add_editor_style' );
Source of snippet.
A: Use add_editor_style
e.g.: functions.php
add_editor_style('custom-editor-style.css');
http://codex.wordpress.org/Function_Reference/add_editor_style
|
wordpress
|
{
"language": "en",
"length": 183,
"provenance": "stackexchange_00019.jsonl.gz:418950",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48609"
}
|
[
0.027130126953125,
-0.0010309219360351562,
-0.0157318115234375,
-0.0031414031982421875,
0.000484466552734375,
-0.0301513671875,
0.041351318359375,
-0.0080413818359375,
-0.03179931640625,
0.0311431884765625,
-0.0025482177734375,
0.034332275390625,
-0.01303863525390625,
-0.0163116455078125,
0.0228118896484375,
-0.0187530517578125,
0.038116455078125,
-0.0081939697265625,
0.030517578125,
0.005367279052734375,
-0.0179443359375,
0.0340576171875,
0.0209503173828125,
-0.0312042236328125,
0.035430908203125,
-0.009552001953125,
0.05718994140625,
-0.025360107421875,
0.0185699462890625,
-0.02947998046875,
0.0253753662109375,
-0.013946533203125,
0.0237579345703125,
0.078369140625,
-0.08251953125,
0.05877685546875,
-0.004550933837890625,
0.027618408203125,
0.004779815673828125,
0.0322265625,
0.048553466796875,
-0.024322509765625,
-0.0215606689453125,
0.03717041015625,
-0.0257720947265625,
-0.061981201171875,
0.073486328125,
-0.0085296630859375,
0.00305938720703125,
-0.050384521484375,
-0.0073699951171875,
0.00861358642578125,
0.019287109375,
-0.06292724609375,
0.0002865791320800781,
0.016632080078125,
-0.039031982421875,
0.0258331298828125,
0.01375579833984375,
0.01120758056640625,
0.01287078857421875,
0.00670623779296875,
0.003017425537109375,
0.00745391845703125,
-0.00225067138671875,
-0.00328826904296875,
0.014495849609375,
0.010467529296875,
-0.012847900390625,
-0.0095672607421875,
0.00910186767578125,
-0.011444091796875,
-0.00011855363845825195,
-0.031158447265625,
-0.034149169921875,
0.037017822265625,
-0.0222015380859375,
-0.0311279296875,
0.028717041015625,
-0.015533447265625,
0.01218414306640625,
0.0208587646484375,
-0.03570556640625,
-0.02960205078125,
0.00876617431640625,
-0.0074920654296875,
-0.01537322998046875,
-0.0244598388671875,
-0.01557159423828125,
-0.0115814208984375,
-0.01392364501953125,
-0.01499176025390625,
-0.018768310546875,
0.01092529296875,
-0.0156707763671875,
-0.019195556640625,
0.02581787109375,
0.07305908203125,
-0.0261077880859375,
0.02838134765625,
-0.0260162353515625,
-0.037139892578125,
0.05487060546875,
-0.055633544921875,
0.005218505859375,
0.029205322265625,
-0.0076446533203125,
0.03668212890625,
0.035003662109375,
0.014739990234375,
-0.0009975433349609375,
0.0008263587951660156,
-0.0136871337890625,
-0.01247406005859375,
-0.0019054412841796875,
-0.0050048828125,
-0.041595458984375,
0.031707763671875,
-0.006633758544921875,
0.003345489501953125,
0.004886627197265625,
0.018951416015625,
0.0107879638671875,
-0.02410888671875,
-0.041412353515625,
-0.052459716796875,
0.0004017353057861328,
-0.0217132568359375,
0.01381683349609375,
0.01372528076171875,
-0.0212249755859375,
0.0168914794921875,
0.054534912109375,
0.03204345703125,
0.006591796875,
-0.017059326171875,
0.041900634765625,
0.01317596435546875,
0.01139068603515625,
-0.002704620361328125,
-0.00989532470703125,
-0.0131378173828125,
-0.00506591796875,
-0.011627197265625,
-0.040008544921875,
0.031280517578125,
0.0229339599609375,
-0.0162353515625,
-0.036285400390625,
-0.07684326171875,
0.0082855224609375,
-0.036041259765625,
0.03497314453125,
0.03240966796875,
-0.0254669189453125,
-0.021575927734375,
0.03216552734375,
-0.038970947265625,
-0.00749969482421875,
-0.0518798828125,
0.009857177734375,
0.00713348388671875,
0.022705078125,
-0.01470184326171875,
-0.005878448486328125,
-0.0292205810546875,
-0.0513916015625,
0.0017480850219726562,
0.0273590087890625,
-0.007415771484375,
-0.0162506103515625,
0.0174407958984375,
0.048187255859375,
0.0203094482421875,
0.0084381103515625,
0.0245819091796875,
0.00954437255859375,
0.01983642578125,
0.0157470703125,
0.027099609375,
-0.005340576171875,
-0.045135498046875,
0.08154296875,
-0.036285400390625,
-0.005710601806640625,
-0.0145111083984375,
-0.00665283203125,
0.041229248046875,
0.017486572265625,
0.041778564453125,
-0.05560302734375,
-0.0108489990234375,
0.0187835693359375,
-0.0240936279296875,
-0.00344085693359375,
-0.0166778564453125,
-0.025238037109375,
0.0016307830810546875,
0.0014162063598632812,
0.0026073455810546875,
0.0204010009765625,
-0.0170135498046875,
0.056976318359375,
-0.041473388671875,
-0.0290679931640625,
0.019683837890625,
-0.01468658447265625,
0.038299560546875,
0.020233154296875,
-0.0245361328125,
-0.0102081298828125,
-0.018035888671875,
0.019012451171875,
-0.056243896484375,
-0.0311737060546875,
0.06597900390625,
0.0180511474609375,
0.042449951171875,
0.035308837890625,
0.017730712890625,
0.07122802734375,
-0.026580810546875,
0.058074951171875,
0.034454345703125,
-0.0016317367553710938,
-0.021484375,
-0.0160980224609375,
-0.01076507568359375,
0.0216827392578125,
-0.0084228515625,
0.039398193359375,
0.01216888427734375,
0.0058441162109375,
0.040679931640625,
-0.03057861328125,
-0.03045654296875,
-0.03948974609375,
-0.0482177734375,
0.0301055908203125,
0.049407958984375,
0.035797119140625,
0.006603240966796875,
-0.0092926025390625,
0.00960540771484375,
0.06390380859375,
-0.0020122528076171875,
0.01165008544921875,
-0.01031494140625,
0.012451171875,
0.03436279296875,
0.0085296630859375,
-0.0391845703125,
0.0145263671875,
-0.05230712890625,
0.0245208740234375,
0.012359619140625,
-0.00852203369140625,
-0.0024089813232421875,
0.00591278076171875,
-0.0170745849609375,
0.01861572265625,
0.02227783203125,
-0.0160675048828125,
-0.003231048583984375,
-0.01873779296875,
0.06903076171875,
0.03369140625,
0.048187255859375,
-0.00711822509765625,
0.0374755859375,
-0.007274627685546875,
-0.01081085205078125,
0.0098114013671875,
0.0096435546875,
0.004791259765625,
0.001323699951171875,
-0.045623779296875,
-0.00809478759765625,
0.07147216796875,
0.0164031982421875,
-0.0234222412109375,
-0.01068878173828125,
-0.028106689453125,
-0.004741668701171875,
0.004520416259765625,
-0.039947509765625,
0.034332275390625,
-0.0092010498046875,
0.033905029296875,
-0.00981903076171875,
0.01506805419921875,
-0.00804901123046875,
-0.0170745849609375,
0.0243682861328125,
0.00771331787109375,
-0.032318115234375,
0.07122802734375,
0.02764892578125,
0.0247344970703125,
0.0159912109375,
0.02325439453125,
0.032196044921875,
-0.011138916015625,
-0.00659942626953125,
0.02398681640625,
0.008270263671875,
0.00788116455078125,
0.0182647705078125,
0.0012226104736328125,
0.0305023193359375,
-0.056671142578125,
0.00726318359375,
0.026214599609375,
0.006725311279296875,
0.01079559326171875,
-0.0270538330078125,
-0.0128936767578125,
0.0181884765625,
-0.0142059326171875,
-0.002910614013671875,
-0.00678253173828125,
-0.076904296875,
-0.06964111328125,
0.01049041748046875,
-0.06658935546875,
0.035858154296875,
0.0253143310546875,
-0.0085296630859375,
-0.025848388671875,
-0.0272979736328125,
-0.00705718994140625,
-0.038421630859375,
-0.037750244140625,
-0.0054779052734375,
0.0003676414489746094,
-0.01001739501953125,
0.0118408203125,
0.08782958984375,
0.01276397705078125,
-0.021148681640625,
0.0298614501953125,
-0.041229248046875,
-0.0196533203125,
0.040435791015625,
-0.0232391357421875,
-0.03131103515625,
-0.0021800994873046875,
-0.005687713623046875,
-0.00005930662155151367,
0.00638580322265625,
0.0025787353515625,
0.005695343017578125,
-0.0157928466796875,
-0.00018143653869628906,
-0.005035400390625,
0.0457763671875,
0.0259857177734375,
0.0270843505859375,
0.06396484375,
-0.00824737548828125,
-0.027252197265625,
0.01255035400390625,
-0.017333984375,
0.0207366943359375,
-0.026336669921875,
-0.0004940032958984375,
-0.023468017578125,
0.07611083984375,
0.01361846923828125,
0.007663726806640625,
0.062469482421875,
-0.02667236328125,
0.027435302734375,
-0.012115478515625,
-0.016326904296875,
-0.038665771484375,
0.00775146484375,
-0.023529052734375,
0.0142822265625,
-0.0200653076171875,
0.00270843505859375,
-0.03265380859375,
0.0222625732421875,
-0.054534912109375,
-0.00867462158203125,
0.024139404296875,
-0.0115509033203125,
0.040985107421875,
-0.0261383056640625,
-0.01427459716796875,
-0.020538330078125,
0.060516357421875,
0.0225830078125,
-0.022979736328125,
0.01274871826171875,
0.009521484375,
-0.045318603515625,
-0.044586181640625,
-0.01253509521484375,
-0.00763702392578125,
-0.0982666015625,
0.007274627685546875,
-0.0269622802734375,
-0.0310821533203125,
-0.01360321044921875,
-0.0257720947265625,
-0.06280517578125,
-0.053375244140625,
0.00994110107421875,
0.01065826416015625,
-0.0206451416015625,
0.036956787109375,
-0.048065185546875,
0.0243377685546875,
0.007904052734375,
-0.03509521484375,
-0.09844970703125,
-0.0185394287109375,
-0.037200927734375,
0.0809326171875,
0.006305694580078125,
0.037445068359375,
-0.01006317138671875,
0.059539794921875,
-0.029937744140625,
0.0172576904296875,
-0.00328826904296875,
0.045318603515625,
-0.0036334991455078125,
-0.019866943359375,
-0.00266265869140625,
-0.0303955078125,
0.0287933349609375,
0.039093017578125,
-0.054962158203125,
0.0162353515625,
-0.021820068359375,
-0.0196075439453125,
0.0718994140625,
-0.079833984375,
-0.00836944580078125,
-0.0247344970703125,
-0.017333984375,
0.01065826416015625,
0.0033416748046875,
-0.03350830078125,
-0.008270263671875,
0.00021731853485107422,
0.016876220703125,
-0.0157012939453125,
0.00177764892578125,
0.00408172607421875,
0.048187255859375,
0.0243072509765625,
-0.00937652587890625,
0.00839996337890625,
-0.0234375,
0.0206451416015625,
0.0123748779296875,
0.019622802734375,
-0.00363922119140625,
-0.007198333740234375,
0.026153564453125,
-0.00035572052001953125,
0.00556182861328125,
-0.0489501953125,
0.0850830078125,
-0.0235748291015625,
-0.0222930908203125,
0.025421142578125,
-0.03192138671875,
0.015533447265625,
-0.00852203369140625,
0.01453399658203125,
0.0018310546875,
0.07843017578125,
-0.0012350082397460938,
-0.00826263427734375,
-0.0174713134765625,
0.005931854248046875,
0.01462554931640625,
-0.020172119140625,
0.03973388671875,
0.0816650390625,
0.07110595703125,
-0.016876220703125,
0.02069091796875,
0.021636962890625,
-0.031982421875,
0.052459716796875,
0.0130462646484375,
0.0321044921875,
-0.0038967132568359375,
0.049774169921875,
-0.035400390625,
0.0062255859375,
-0.01535797119140625,
0.0662841796875,
0.026214599609375,
-0.0255889892578125,
-0.017791748046875,
-0.01209259033203125,
0.035186767578125,
-0.00823211669921875,
-0.0291900634765625,
0.039031982421875,
0.02691650390625,
-0.034637451171875,
-0.00023818016052246094,
-0.005237579345703125,
-0.03631591796875,
-0.04608154296875,
-0.0262603759765625,
-0.0175933837890625,
-0.0139923095703125,
0.0168609619140625,
0.0163116455078125,
0.0269775390625,
0.01329803466796875,
-0.019744873046875,
0.00557708740234375,
-0.01538848876953125,
0.01544952392578125,
0.00951385498046875,
0.0238494873046875,
-0.0008692741394042969,
0.01409149169921875,
0.0082550048828125,
-0.035125732421875,
-0.022247314453125,
0.0178070068359375,
0.034271240234375,
-0.0238037109375,
-0.0203857421875,
0.026641845703125,
-0.00785064697265625,
-0.009918212890625,
-0.0210113525390625,
-0.039520263671875,
-0.02423095703125,
-0.017120361328125,
-0.006519317626953125,
0.0173187255859375,
0.017333984375,
-0.052337646484375,
0.01494598388671875,
-0.0487060546875,
0.0205078125,
-0.0049896240234375,
-0.035888671875,
0.03729248046875,
0.01092529296875,
0.0193328857421875,
-0.0126800537109375,
-0.033477783203125,
-0.078369140625,
-0.0287017822265625,
-0.0064544677734375,
0.01007080078125,
0.0206146240234375,
0.0036163330078125,
0.025177001953125,
-0.02142333984375,
-0.01513671875,
-0.018768310546875,
0.0147552490234375,
-0.0120849609375,
-0.03082275390625,
0.0171051025390625,
0.000896453857421875,
-0.0328369140625,
-0.0277252197265625,
-0.01422882080078125,
-0.04119873046875,
-0.0246124267578125,
-0.0272979736328125,
0.01221466064453125,
0.00408172607421875,
0.01434326171875,
-0.033538818359375,
-0.0200653076171875,
0.0275726318359375,
0.04107666015625,
0.0185546875,
-0.018951416015625,
0.07080078125,
-0.01172637939453125,
0.08111572265625,
0.01561737060546875,
0.014373779296875,
-0.029205322265625,
-0.019622802734375,
-0.00112152099609375,
-0.0404052734375,
-0.006755828857421875,
-0.0081787109375,
-0.002899169921875,
0.0328369140625,
0.05029296875,
0.00560760498046875,
0.0224609375,
-0.01198577880859375,
-0.0157623291015625,
-0.01525115966796875,
0.01116180419921875,
-0.003078460693359375,
0.0286865234375,
-0.005382537841796875,
0.0023193359375,
0.05078125,
-0.0157623291015625,
-0.006046295166015625,
0.01467132568359375,
-0.0176849365234375,
0.041839599609375,
-0.00984954833984375,
-0.03460693359375,
0.045562744140625,
0.028350830078125,
-0.0146484375,
0.0173187255859375,
0.0174102783203125,
0.00238800048828125,
-0.0310211181640625,
-0.007568359375,
-0.0194091796875,
0.0430908203125,
0.025482177734375,
-0.0165863037109375,
0.007053375244140625,
0.01218414306640625,
0.0025157928466796875,
0.0224761962890625,
0.060821533203125,
0.071044921875,
-0.0751953125,
-0.0110015869140625,
-0.01358795166015625,
-0.0271759033203125,
0.0513916015625,
0.0291290283203125,
-0.045440673828125,
-0.06829833984375,
0.0638427734375,
-0.045562744140625,
0.0142364501953125,
0.045135498046875,
-0.00640106201171875,
0.0016937255859375,
-0.004352569580078125,
0.00261688232421875,
-0.0072021484375,
-0.0159912109375,
-0.0239410400390625,
0.01470947265625,
-0.0012750625610351562,
-0.0070037841796875,
0.0187835693359375,
-0.01421356201171875,
0.0165252685546875,
-0.032562255859375,
0.007785797119140625,
-0.054779052734375,
-0.0089111328125,
0.02490234375,
0.0189361572265625,
-0.00939178466796875,
0.043060302734375,
-0.0246429443359375,
0.048065185546875,
0.0122528076171875,
-0.037109375,
0.05059814453125,
-0.0266876220703125,
0.019317626953125,
0.0026988983154296875,
-0.02960205078125,
0.010833740234375,
0.0171356201171875,
-0.022003173828125,
0.00882720947265625,
0.0296783447265625,
0.024810791015625,
-0.01197052001953125,
-0.03765869140625,
0.0215301513671875,
-0.007266998291015625,
0.01322174072265625,
-0.05322265625,
-0.0092620849609375,
-0.060150146484375,
-0.0004603862762451172,
-0.040985107421875,
-0.0109405517578125,
0.0208892822265625,
-0.07049560546875,
-0.038726806640625,
0.10186767578125,
-0.016845703125,
0.01849365234375,
0.0252838134765625,
0.0479736328125,
-0.045501708984375,
0.0257568359375,
0.00911712646484375,
-0.0011529922485351562,
-0.0231781005859375,
-0.0298614501953125,
-0.042694091796875,
-0.018035888671875,
-0.02325439453125,
0.07904052734375,
0.0340576171875,
0.00015234947204589844,
-0.056060791015625,
-0.002838134765625,
0.05328369140625,
0.06939697265625,
0.019287109375,
0.0240936279296875,
-0.011505126953125,
-0.0150909423828125,
-0.00677490234375,
0.023223876953125,
0.0217132568359375,
-0.018218994140625,
-0.049774169921875,
0.0163421630859375,
-0.0221710205078125,
-0.0419921875,
0.032440185546875,
-0.011810302734375,
0.0168609619140625,
0.01166534423828125,
-0.015380859375,
-0.084228515625,
-0.0230255126953125,
0.05377197265625,
0.00841522216796875,
-0.07061767578125,
-0.06317138671875,
-0.0213165283203125,
0.0215301513671875,
-0.002819061279296875,
-0.01446533203125,
-0.0194854736328125,
-0.0133209228515625,
0.00684356689453125,
-0.00927734375,
-0.0257568359375,
0.026275634765625,
0.01560211181640625,
-0.00669097900390625,
-0.022430419921875,
0.0120697021484375,
-0.03277587890625,
-0.005077362060546875,
-0.00482177734375,
-0.00975799560546875,
-0.0036487579345703125,
-0.004085540771484375,
0.01355743408203125,
0.00787353515625,
-0.0271148681640625,
-0.02740478515625,
-0.035980224609375,
-0.021148681640625,
0.0170135498046875,
0.005855560302734375,
-0.0253448486328125,
0.017913818359375,
0.0024738311767578125,
-0.00004553794860839844,
-0.002490997314453125,
0.0277862548828125,
-0.011749267578125,
-0.040557861328125,
-0.0188751220703125,
0.01258087158203125,
0.035736083984375,
0.03466796875,
0.036529541015625,
0.034912109375,
-0.0178985595703125,
-0.044342041015625,
0.0185089111328125,
0.046112060546875,
0.035980224609375,
0.0055694580078125,
0.06512451171875,
-0.0026798248291015625,
0.004032135009765625,
-0.00778961181640625,
0.0238037109375,
0.0290069580078125,
-0.005115509033203125,
-0.042388916015625,
-0.01358795166015625,
-0.02520751953125,
-0.0498046875,
-0.011444091796875,
-0.06121826171875,
-0.0043487548828125,
0.01248931884765625,
-0.006500244140625,
0.023193359375,
-0.037109375,
0.045166015625,
-0.00009840726852416992,
-0.013458251953125,
0.01499176025390625,
-0.038482666015625,
-0.0222930908203125,
-0.0001461505889892578,
-0.0006589889526367188,
0.0236663818359375,
-0.0167999267578125,
0.01329803466796875,
-0.0201263427734375,
-0.036163330078125,
0.012359619140625,
0.049591064453125,
-0.00896453857421875,
0.0040130615234375,
0.004566192626953125,
-0.01520538330078125,
0.01331329345703125,
-0.002254486083984375,
0.01404571533203125,
-0.01447296142578125,
0.0002999305725097656,
-0.005523681640625,
-0.04296875,
-0.0269775390625,
-0.031402587890625,
0.058380126953125,
0.039154052734375,
0.06976318359375,
-0.036529541015625,
0.04461669921875,
-0.0203094482421875,
0.002124786376953125,
-0.00337982177734375,
-0.01248931884765625,
0.00882720947265625,
0.0288848876953125,
-0.0021266937255859375,
-0.0203094482421875,
-0.0465087890625,
0.06591796875,
0.01678466796875,
0.002452850341796875,
0.0207366943359375,
0.0419921875,
-0.00647735595703125,
-0.0171356201171875,
0.016082763671875,
-0.0241241455078125,
-0.03131103515625,
-0.036102294921875,
-0.005405426025390625,
-0.0002092123031616211,
-0.0142822265625,
0.00018215179443359375,
0.00865936279296875,
0.05084228515625,
-0.0177459716796875,
0.0264892578125,
-0.012908935546875,
0.05291748046875,
0.033233642578125,
0.01229095458984375,
-0.052520751953125,
0.00765228271484375,
-0.01174163818359375,
-0.01404571533203125,
0.013580322265625,
0.043548583984375,
0.00736236572265625,
-0.06756591796875,
0.0926513671875,
0.08270263671875,
0.11737060546875,
0.006397247314453125,
0.034576416015625,
0.0738525390625,
-0.0046539306640625,
0.02069091796875,
-0.0134735107421875,
-0.032012939453125,
-0.0316162109375,
0.0206298828125,
0.0285491943359375,
-0.004665374755859375,
-0.01910400390625,
-0.07196044921875,
-0.0208587646484375,
0.0400390625,
0.00644683837890625,
-0.0423583984375,
0.0303802490234375,
-0.030426025390625,
0.01306915283203125,
0.00829315185546875,
0.004619598388671875,
0.003055572509765625,
0.0165252685546875,
-0.0269775390625,
-0.03680419921875,
-0.0248260498046875,
0.033111572265625,
-0.02911376953125,
0.029022216796875,
0.0596923828125,
-0.0244140625,
0.0328369140625,
0.0016145706176757812,
0.0171051025390625,
0.046844482421875,
-0.10174560546875,
-0.00044727325439453125,
0.07000732421875,
-0.025604248046875,
-0.033477783203125,
-0.11328125,
-0.016357421875,
-0.08819580078125,
0.042572021484375,
0.0031795501708984375,
-0.01242828369140625,
0.0031280517578125,
-0.05224609375,
-0.07568359375,
0.03948974609375,
0.0035858154296875,
-0.03515625,
-0.006534576416015625,
0.01306915283203125,
-0.021087646484375,
-0.0037403106689453125,
-0.00479888916015625,
-0.01119232177734375,
0.0291290283203125,
0.02728271484375,
0.0095062255859375,
0.033111572265625,
0.0037136077880859375,
0.0013599395751953125,
-0.0872802734375,
-0.00878143310546875,
-0.027618408203125,
0.025665283203125,
0.008941650390625,
-0.01000213623046875,
0.02471923828125,
0.032257080078125,
-0.01483917236328125,
-0.075927734375,
0.0120391845703125,
-0.05426025390625,
0.01406097412109375,
-0.0767822265625,
-0.042236328125,
-0.0494384765625,
0.108642578125,
0.005275726318359375,
0.0169677734375,
-0.0009293556213378906,
-0.010406494140625,
-0.014862060546875,
-0.03802490234375,
-0.0011968612670898438,
0.03106689453125,
-0.06817626953125,
-0.006610870361328125,
0.0214996337890625,
0.0168914794921875,
0.01293182373046875,
0.033721923828125,
-0.005512237548828125,
-0.0217742919921875,
-0.0044403076171875,
-0.0318603515625,
-0.07373046875,
0.0144195556640625,
0.039703369140625,
-0.02032470703125,
0.002323150634765625,
0.02484130859375,
-0.0166473388671875,
0.0275421142578125,
0.0721435546875,
-0.0310821533203125,
-0.00927734375,
-0.0146484375,
0.0225830078125,
-0.019775390625,
0.0147705078125,
-0.0240020751953125,
0.01465606689453125,
-0.0161590576171875,
-0.00650787353515625,
0.004383087158203125,
-0.00930023193359375,
-0.00971221923828125,
-0.0011157989501953125,
0.01500701904296875,
0.0012712478637695312,
-0.0025920867919921875,
-0.01195526123046875,
-0.025421142578125,
0.029083251953125,
0.00830841064453125,
-0.01204681396484375,
0.0139617919921875,
-0.0024547576904296875,
0.0167694091796875,
-0.00933074951171875,
0.00771331787109375,
-0.00704193115234375,
0.0171661376953125,
0.004123687744140625,
-0.01503753662109375,
0.004375457763671875
] |
b28b6f2d640c72c7f2a38b992d8fb5f73042b22b
|
Wordpress Stackexchange
Q: How to prevent duplicate slugs for wp_insert_post? I have a function that creates a page when I create a post (so as to construct parent-child relationship trees).
I'm using the $title of the post to create the page and this also creates a duplicate slug. Is there a way to alter the slug slightly so as to make it unique? How can I assure that the new slug will not interfere with the original post?
A: If you use wp_insert_post, it should calculate a unique post slug for you. If you don't use wp_insert_post, try using wp_unique_post_slug. If neither of those are working for you, you could simple try appending -page or to the new page's post_name (slug) before inserting it.
WordPress does its uniqueness check on post slugs at application level -- it doesn't look like there's a unique index on wp_posts.post_name. So, for instance, if you're inside a transaction where you're creating two posts simultaneously, the uniqueness checks would fail. It's also possible that you could create some sort of race condition where the two posts are being inserted at the same time and a uniqueness check on both slugs would fail.
|
Q: How to prevent duplicate slugs for wp_insert_post? I have a function that creates a page when I create a post (so as to construct parent-child relationship trees).
I'm using the $title of the post to create the page and this also creates a duplicate slug. Is there a way to alter the slug slightly so as to make it unique? How can I assure that the new slug will not interfere with the original post?
A: If you use wp_insert_post, it should calculate a unique post slug for you. If you don't use wp_insert_post, try using wp_unique_post_slug. If neither of those are working for you, you could simple try appending -page or to the new page's post_name (slug) before inserting it.
WordPress does its uniqueness check on post slugs at application level -- it doesn't look like there's a unique index on wp_posts.post_name. So, for instance, if you're inside a transaction where you're creating two posts simultaneously, the uniqueness checks would fail. It's also possible that you could create some sort of race condition where the two posts are being inserted at the same time and a uniqueness check on both slugs would fail.
A: I guess WP automatically appends a number at the end if the slug repeats.
A: From my experience the requirement is usually opposite - achieving same slugs when WP stubbornly refuses to generate them. :)
In very few words slug might overlap between hierarchical and non-hierarchical post types, but not within them separately. Since in your case post (non-hierarchical) and page (hierarchical) are involved, WP happily allows slug reuse.
If you want to manually force WP to de-duplicate page's slug your best option is probably to force duplication check to fail and trigger numeric suffix logic. From the look at wp_unique_post_slug() source that can be done via following filter:
apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent )
|
wordpress
|
{
"language": "en",
"length": 312,
"provenance": "stackexchange_00019.jsonl.gz:418957",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48635"
}
|
[
0.0726318359375,
0.0273895263671875,
0.01025390625,
-0.0158538818359375,
0.03656005859375,
-0.027618408203125,
0.082275390625,
-0.054595947265625,
-0.043182373046875,
0.0159149169921875,
0.003368377685546875,
0.029449462890625,
0.0027217864990234375,
-0.0277099609375,
0.033050537109375,
-0.003604888916015625,
0.0211334228515625,
-0.005725860595703125,
0.01824951171875,
-0.0272979736328125,
0.023681640625,
-0.0140228271484375,
0.003711700439453125,
0.0662841796875,
0.0279693603515625,
-0.05181884765625,
0.0401611328125,
-0.01959228515625,
0.0222320556640625,
-0.0167694091796875,
0.033477783203125,
-0.0011320114135742188,
0.00731658935546875,
-0.0098724365234375,
0.021392822265625,
0.005825042724609375,
0.01117706298828125,
0.0006999969482421875,
0.0171661376953125,
0.019439697265625,
0.0189208984375,
0.0009946823120117188,
0.03363037109375,
0.0107269287109375,
-0.005588531494140625,
-0.026519775390625,
0.00421142578125,
-0.033538818359375,
0.0404052734375,
-0.0093231201171875,
-0.0020275115966796875,
0.0141143798828125,
0.0092010498046875,
-0.00018906593322753906,
-0.0226287841796875,
-0.00333404541015625,
-0.011810302734375,
0.0343017578125,
0.03497314453125,
-0.0231475830078125,
-0.034149169921875,
-0.005695343017578125,
0.015838623046875,
-0.01354217529296875,
0.0308990478515625,
0.006938934326171875,
-0.0014276504516601562,
0.0263519287109375,
-0.04986572265625,
0.038909912109375,
0.0369873046875,
-0.0699462890625,
0.0004506111145019531,
0.00821685791015625,
-0.00630950927734375,
-0.0218505859375,
-0.00209808349609375,
-0.019439697265625,
0.02069091796875,
0.031768798828125,
0.0124969482421875,
-0.021514892578125,
-0.008544921875,
-0.0406494140625,
0.0295257568359375,
-0.0125732421875,
-0.0079498291015625,
-0.00032806396484375,
-0.0163421630859375,
-0.0150909423828125,
-0.0296783447265625,
-0.025543212890625,
-0.00008952617645263672,
0.02587890625,
-0.018218994140625,
0.0060272216796875,
0.0146636962890625,
0.070068359375,
-0.041168212890625,
0.0196075439453125,
-0.003482818603515625,
-0.034942626953125,
0.04290771484375,
-0.0517578125,
0.0147552490234375,
0.0189666748046875,
-0.014801025390625,
-0.032135009765625,
0.0193023681640625,
0.0135040283203125,
-0.01100921630859375,
0.0300140380859375,
0.01519775390625,
-0.05426025390625,
-0.0223236083984375,
0.048614501953125,
0.0185546875,
-0.009368896484375,
0.029632568359375,
-0.0073394775390625,
0.001956939697265625,
0.01116943359375,
0.0128936767578125,
-0.005168914794921875,
0.0299835205078125,
0.026763916015625,
-0.0261383056640625,
-0.02618408203125,
-0.0007271766662597656,
-0.01024627685546875,
-0.043426513671875,
0.00775909423828125,
0.1322021484375,
0.07305908203125,
0.03973388671875,
-0.0219573974609375,
-0.027008056640625,
-0.016693115234375,
-0.02069091796875,
0.001544952392578125,
-0.0201416015625,
-0.011260986328125,
0.030670166015625,
-0.040008544921875,
0.0277099609375,
0.04052734375,
-0.01068878173828125,
-0.00798797607421875,
0.045654296875,
-0.0193328857421875,
-0.0250244140625,
-0.050811767578125,
0.01479339599609375,
0.0162811279296875,
0.0007834434509277344,
-0.03863525390625,
-0.031463623046875,
-0.004383087158203125,
0.052001953125,
-0.0115203857421875,
0.00664520263671875,
0.0023708343505859375,
0.0177764892578125,
-0.017913818359375,
-0.03997802734375,
-0.002544403076171875,
-0.043304443359375,
-0.005161285400390625,
0.01094818115234375,
0.0178680419921875,
-0.0038738250732421875,
0.0003197193145751953,
-0.05072021484375,
-0.02642822265625,
-0.0129547119140625,
-0.01186370849609375,
0.00025773048400878906,
-0.0219879150390625,
0.0217437744140625,
0.072509765625,
0.004150390625,
-0.0252227783203125,
0.034027099609375,
-0.01024627685546875,
-0.06201171875,
0.04461669921875,
-0.003673553466796875,
0.044586181640625,
0.027557373046875,
0.0005078315734863281,
0.045135498046875,
0.0193939208984375,
-0.037872314453125,
0.0291748046875,
-0.019989013671875,
-0.0301361083984375,
0.0140838623046875,
0.01502227783203125,
-0.0146331787109375,
0.0075531005859375,
-0.0172882080078125,
0.033782958984375,
-0.005855560302734375,
0.0338134765625,
-0.0274505615234375,
0.01532745361328125,
-0.0064239501953125,
0.03509521484375,
-0.01104736328125,
0.02471923828125,
0.01457977294921875,
-0.006404876708984375,
-0.017852783203125,
-0.007701873779296875,
-0.0093841552734375,
-0.0149993896484375,
-0.0221405029296875,
-0.05047607421875,
-0.034027099609375,
0.0056610107421875,
-0.04962158203125,
0.02874755859375,
-0.08245849609375,
-0.0261688232421875,
0.04180908203125,
-0.00792694091796875,
-0.0294189453125,
-0.03143310546875,
-0.01593017578125,
0.004840850830078125,
-0.0606689453125,
0.058135986328125,
0.037322998046875,
0.039306640625,
-0.018463134765625,
-0.000415802001953125,
0.0037746429443359375,
-0.027862548828125,
-0.0028934478759765625,
0.039276123046875,
0.04290771484375,
-0.00934600830078125,
0.00738525390625,
0.000030338764190673828,
-0.030303955078125,
-0.09075927734375,
0.0015125274658203125,
-0.00739288330078125,
0.044769287109375,
0.0858154296875,
0.0157623291015625,
0.0124359130859375,
-0.0020599365234375,
-0.035858154296875,
0.026397705078125,
0.0301361083984375,
-0.039398193359375,
-0.0104827880859375,
-0.0011472702026367188,
0.0028018951416015625,
-0.0018301010131835938,
-0.0382080078125,
0.0222930908203125,
-0.032135009765625,
-0.026947021484375,
0.0021343231201171875,
-0.008575439453125,
-0.0030155181884765625,
-0.0004398822784423828,
-0.0033168792724609375,
0.0184478759765625,
-0.04681396484375,
0.0037975311279296875,
0.0017709732055664062,
0.037078857421875,
0.0183868408203125,
-0.04986572265625,
-0.002620697021484375,
0.03167724609375,
0.01409912109375,
-0.02734375,
0.03326416015625,
0.010833740234375,
-0.01702880859375,
-0.02471923828125,
-0.07916259765625,
0.01119232177734375,
-0.0263519287109375,
-0.01055908203125,
-0.039337158203125,
-0.01259613037109375,
0.0206298828125,
-0.0396728515625,
0.05108642578125,
0.01470184326171875,
-0.0277557373046875,
-0.0116119384765625,
-0.0350341796875,
0.030853271484375,
-0.02752685546875,
0.024017333984375,
0.064208984375,
0.0180206298828125,
-0.0012998580932617188,
-0.0003113746643066406,
0.0003681182861328125,
-0.01910400390625,
-0.018280029296875,
-0.0360107421875,
-0.0017213821411132812,
-0.0684814453125,
0.0212860107421875,
0.0303192138671875,
0.0341796875,
0.036834716796875,
-0.0266265869140625,
0.039459228515625,
0.0306243896484375,
-0.0229949951171875,
-0.06585693359375,
-0.05596923828125,
-0.033721923828125,
0.01904296875,
-0.00923919677734375,
-0.00298309326171875,
-0.0126953125,
0.005889892578125,
0.023681640625,
-0.0196075439453125,
-0.037567138671875,
-0.04705810546875,
-0.061309814453125,
-0.04779052734375,
0.003265380859375,
0.006011962890625,
0.0024776458740234375,
0.01331329345703125,
0.05218505859375,
0.01412200927734375,
-0.0208740234375,
0.0254364013671875,
0.031829833984375,
-0.028045654296875,
-0.01523590087890625,
-0.0261383056640625,
-0.00641632080078125,
0.0304107666015625,
-0.007274627685546875,
-0.0271453857421875,
0.0294952392578125,
0.012359619140625,
-0.00957489013671875,
0.01467132568359375,
0.006580352783203125,
0.0345458984375,
0.0546875,
-0.018463134765625,
0.0258331298828125,
0.072509765625,
-0.005237579345703125,
-0.0222930908203125,
-0.0340576171875,
-0.048309326171875,
0.0012807846069335938,
-0.00804901123046875,
0.024139404296875,
-0.013214111328125,
0.018402099609375,
0.0211181640625,
0.0108184814453125,
0.0127410888671875,
0.0011529922485351562,
0.0655517578125,
-0.0162811279296875,
-0.0076446533203125,
-0.042816162109375,
0.01346588134765625,
-0.004528045654296875,
-0.0022144317626953125,
-0.0031948089599609375,
0.0157470703125,
-0.0221710205078125,
0.0170745849609375,
-0.055267333984375,
-0.05938720703125,
0.0130462646484375,
-0.0565185546875,
0.04840087890625,
-0.047088623046875,
-0.0104217529296875,
-0.0085296630859375,
0.08892822265625,
-0.04193115234375,
-0.0231170654296875,
-0.00220489501953125,
0.016998291015625,
0.0135498046875,
-0.039031982421875,
0.0016117095947265625,
-0.03948974609375,
0.0249786376953125,
-0.0033130645751953125,
-0.004791259765625,
0.0029430389404296875,
-0.035125732421875,
0.0374755859375,
0.0015344619750976562,
0.005523681640625,
0.035919189453125,
-0.058441162109375,
0.0345458984375,
0.0244140625,
0.01053619384765625,
0.004886627197265625,
-0.036834716796875,
-0.0300445556640625,
-0.08709716796875,
-0.0041351318359375,
-0.01265716552734375,
0.03759765625,
-0.02252197265625,
0.0138702392578125,
-0.0210723876953125,
0.0302581787109375,
-0.0011224746704101562,
0.06878662109375,
0.0023975372314453125,
0.0128936767578125,
0.02996826171875,
-0.0071868896484375,
0.0157928466796875,
-0.011260986328125,
0.007137298583984375,
-0.0280303955078125,
-0.0302276611328125,
0.0013208389282226562,
-0.050750732421875,
0.031005859375,
-0.02996826171875,
-0.014404296875,
-0.03753662109375,
-0.03948974609375,
0.029052734375,
0.033905029296875,
0.033935546875,
-0.00010848045349121094,
-0.06121826171875,
-0.035736083984375,
0.0328369140625,
-0.0011568069458007812,
-0.0088348388671875,
0.00469207763671875,
0.078857421875,
0.01337432861328125,
-0.0228424072265625,
-0.042724609375,
-0.00865936279296875,
0.0029087066650390625,
0.00762176513671875,
0.031829833984375,
-0.00487518310546875,
0.0163116455078125,
-0.0038394927978515625,
-0.0168304443359375,
-0.061859130859375,
0.00238037109375,
0.061126708984375,
-0.011077880859375,
-0.0081787109375,
-0.0200653076171875,
-0.07330322265625,
0.07598876953125,
0.054443359375,
-0.00759124755859375,
-0.0244903564453125,
-0.048583984375,
0.05609130859375,
0.01349639892578125,
0.009918212890625,
-0.0703125,
-0.08514404296875,
0.02447509765625,
-0.0207977294921875,
-0.0072174072265625,
0.0008258819580078125,
0.000675201416015625,
0.0258941650390625,
-0.0241851806640625,
-0.014068603515625,
-0.01329803466796875,
0.031890869140625,
-0.0032215118408203125,
0.0340576171875,
-0.0059356689453125,
-0.004383087158203125,
-0.052276611328125,
-0.01446533203125,
0.060943603515625,
0.0233612060546875,
-0.0229644775390625,
0.00928497314453125,
-0.0201416015625,
-0.01132965087890625,
0.006580352783203125,
0.01641845703125,
0.0201263427734375,
0.029266357421875,
-0.00959014892578125,
0.00618743896484375,
0.00502777099609375,
0.01216888427734375,
-0.0200347900390625,
0.00574493408203125,
0.0245208740234375,
-0.0269622802734375,
0.03765869140625,
0.005218505859375,
0.0211334228515625,
0.0181121826171875,
-0.017578125,
0.025299072265625,
0.04345703125,
0.023834228515625,
0.012969970703125,
-0.0192413330078125,
-0.006305694580078125,
0.0099945068359375,
0.0075225830078125,
-0.049163818359375,
-0.0016603469848632812,
0.039825439453125,
0.0421142578125,
-0.01580810546875,
-0.038330078125,
0.0233001708984375,
-0.0169219970703125,
0.0063323974609375,
-0.01299285888671875,
-0.0201416015625,
-0.0157928466796875,
0.0052642822265625,
0.01178741455078125,
0.009002685546875,
-0.0019588470458984375,
0.005634307861328125,
-0.0162353515625,
-0.020965576171875,
0.0101165771484375,
0.01556396484375,
0.00994873046875,
-0.0214996337890625,
-0.0262451171875,
0.01416015625,
-0.051513671875,
-0.0268096923828125,
0.0252227783203125,
0.04217529296875,
-0.037689208984375,
-0.01221466064453125,
0.03631591796875,
0.01020050048828125,
0.041412353515625,
-0.026641845703125,
-0.035919189453125,
0.0302581787109375,
-0.0033397674560546875,
0.042877197265625,
-0.00984954833984375,
0.020660400390625,
-0.0125579833984375,
-0.046783447265625,
-0.019317626953125,
0.03753662109375,
-0.028076171875,
-0.0074005126953125,
-0.0289459228515625,
-0.007175445556640625,
0.014251708984375,
-0.03009033203125,
-0.025360107421875,
-0.0016946792602539062,
0.019622802734375,
0.0160064697265625,
-0.0009517669677734375,
-0.03839111328125,
0.0230255126953125,
0.035736083984375,
-0.0227203369140625,
-0.0181732177734375,
-0.00357818603515625,
0.040069580078125,
-0.01219940185546875,
-0.0087127685546875,
-0.0574951171875,
-0.0052642822265625,
-0.0023593902587890625,
0.002635955810546875,
0.038848876953125,
0.034820556640625,
0.004085540771484375,
0.036102294921875,
-0.0274200439453125,
0.006320953369140625,
-0.005611419677734375,
-0.0054779052734375,
-0.056304931640625,
-0.0428466796875,
0.07366943359375,
-0.0271453857421875,
0.03350830078125,
-0.01099395751953125,
0.01087188720703125,
0.02252197265625,
-0.0487060546875,
0.032012939453125,
0.0140228271484375,
-0.03778076171875,
0.01419830322265625,
0.0279693603515625,
0.04400634765625,
0.052886962890625,
-0.00426483154296875,
0.054107666015625,
0.0134735107421875,
-0.00965118408203125,
0.0037994384765625,
-0.0181121826171875,
0.067138671875,
0.005458831787109375,
-0.0085906982421875,
0.050048828125,
-0.0382080078125,
0.01403045654296875,
0.03363037109375,
0.037322998046875,
-0.041168212890625,
-0.004352569580078125,
0.01026153564453125,
-0.0257110595703125,
0.006038665771484375,
-0.004955291748046875,
0.01666259765625,
0.00904083251953125,
0.0509033203125,
-0.0232391357421875,
-0.007720947265625,
0.0256195068359375,
-0.037353515625,
-0.017974853515625,
-0.0290679931640625,
0.0283203125,
0.0204620361328125,
0.01412200927734375,
0.0005617141723632812,
-0.004688262939453125,
0.01512908935546875,
-0.0284423828125,
-0.025054931640625,
0.0163421630859375,
-0.03424072265625,
-0.08062744140625,
0.01319122314453125,
-0.043304443359375,
0.0176849365234375,
0.035980224609375,
0.048126220703125,
0.041107177734375,
0.0283050537109375,
0.038055419921875,
-0.0233306884765625,
0.00675201416015625,
-0.020538330078125,
0.0018110275268554688,
0.01113128662109375,
0.006134033203125,
0.00820159912109375,
-0.015716552734375,
0.004238128662109375,
-0.035888671875,
0.00455474853515625,
-0.005847930908203125,
-0.0016317367553710938,
0.06951904296875,
-0.0296783447265625,
-0.0192413330078125,
0.01519775390625,
0.004444122314453125,
0.01081085205078125,
-0.01160430908203125,
0.044281005859375,
-0.045379638671875,
-0.0226287841796875,
0.0120086669921875,
-0.0245361328125,
-0.026458740234375,
-0.019561767578125,
-0.117431640625,
0.129638671875,
0.0343017578125,
0.0869140625,
-0.0035266876220703125,
0.031524658203125,
-0.038330078125,
-0.0009250640869140625,
-0.062744140625,
0.0772705078125,
0.0166778564453125,
0.0711669921875,
-0.06671142578125,
-0.0103302001953125,
0.02410888671875,
0.029541015625,
0.07611083984375,
0.01021575927734375,
0.0010013580322265625,
0.009674072265625,
0.0650634765625,
0.00899505615234375,
-0.03289794921875,
0.0357666015625,
-0.00873565673828125,
0.0305938720703125,
0.042694091796875,
-0.058868408203125,
0.0215301513671875,
0.0012969970703125,
-0.0087432861328125,
0.01346588134765625,
0.01096343994140625,
-0.006397247314453125,
0.007419586181640625,
-0.0307769775390625,
-0.021026611328125,
0.00911712646484375,
0.00835418701171875,
0.0122222900390625,
-0.00244903564453125,
0.035400390625,
0.0287322998046875,
-0.046356201171875,
-0.0228424072265625,
-0.03228759765625,
0.04901123046875,
0.006500244140625,
-0.00286865234375,
0.0078277587890625,
0.0015316009521484375,
0.0013513565063476562,
0.0174102783203125,
0.0009756088256835938,
0.0240936279296875,
0.0032100677490234375,
0.04071044921875,
0.0277862548828125,
0.035614013671875,
-0.032073974609375,
-0.0077056884765625,
0.0633544921875,
0.06011962890625,
-0.035247802734375,
0.0023632049560546875,
0.0260162353515625,
0.0029506683349609375,
-0.037017822265625,
-0.037506103515625,
-0.0225067138671875,
-0.0028629302978515625,
0.0229949951171875,
-0.02294921875,
-0.03179931640625,
0.0189056396484375,
0.0235137939453125,
0.0031795501708984375,
-0.0032482147216796875,
0.0143890380859375,
-0.0279693603515625,
-0.049468994140625,
0.02325439453125,
0.02374267578125,
0.0635986328125,
0.00208282470703125,
0.06903076171875,
-0.0296173095703125,
-0.026641845703125,
-0.011993408203125,
0.0048370361328125,
0.0328369140625,
0.003955841064453125,
-0.0181427001953125,
-0.0204620361328125,
0.0673828125,
0.0103759765625,
0.03106689453125,
0.05548095703125,
0.064208984375,
0.0148162841796875,
-0.03997802734375,
-0.005413055419921875,
0.003429412841796875,
-0.04449462890625,
0.0180816650390625,
-0.028350830078125,
-0.01806640625,
-0.0249786376953125,
-0.027313232421875,
-0.0267486572265625,
0.002536773681640625,
0.00038433074951171875,
0.0240631103515625,
-0.01146697998046875,
0.0178070068359375,
-0.00653076171875,
0.057952880859375,
0.0242919921875,
0.007358551025390625,
0.059783935546875,
-0.07818603515625,
-0.0006012916564941406,
-0.03106689453125,
-0.08648681640625,
0.01358795166015625,
0.032012939453125,
-0.036651611328125,
0.016876220703125,
0.06024169921875,
-0.0228424072265625,
0.0135650634765625,
-0.013824462890625,
0.037994384765625,
-0.006587982177734375,
0.0013742446899414062,
0.0198974609375,
-0.062744140625,
-0.01953125,
0.00959014892578125,
-0.00174713134765625,
-0.03302001953125,
0.059112548828125,
0.0058135986328125,
-0.018890380859375,
-0.018157958984375,
0.0037136077880859375,
-0.0087432861328125,
-0.0192413330078125,
0.045257568359375,
-0.0031375885009765625,
-0.0190582275390625,
-0.01123046875,
-0.0565185546875,
-0.04364013671875,
0.037689208984375,
-0.02349853515625,
-0.0303955078125,
-0.0531005859375,
0.03729248046875,
-0.00536346435546875,
0.027252197265625,
-0.0168304443359375,
0.025970458984375,
-0.02020263671875,
-0.0293426513671875,
0.052459716796875,
0.0195159912109375,
-0.00460052490234375,
0.052520751953125,
-0.0340576171875,
-0.043182373046875,
0.0101776123046875,
-0.08233642578125,
-0.023193359375,
0.0160064697265625,
0.02789306640625,
-0.0117034912109375,
-0.0229339599609375,
-0.017181396484375,
-0.0244903564453125,
0.01186370849609375,
-0.01264190673828125,
-0.005702972412109375,
-0.050750732421875,
-0.036834716796875,
0.00420379638671875,
-0.001544952392578125,
-0.0160064697265625,
0.01132965087890625,
-0.01265716552734375,
-0.019317626953125,
-0.006542205810546875,
-0.0208740234375,
-0.032684326171875,
-0.03289794921875,
-0.000732421875,
0.0293121337890625,
-0.0276641845703125,
0.0015659332275390625,
-0.0618896484375,
-0.0158538818359375,
0.032989501953125,
-0.0248260498046875,
0.006153106689453125,
-0.006618499755859375,
-0.03369140625,
0.0253753662109375,
-0.016021728515625,
0.0267333984375,
0.0059967041015625,
0.012664794921875,
-0.08001708984375,
-0.0128631591796875,
-0.002063751220703125,
0.0039215087890625,
-0.0189208984375,
0.00643157958984375,
0.041656494140625,
-0.0355224609375,
-0.041412353515625,
-0.0269775390625,
0.025360107421875,
0.00021350383758544922,
0.023345947265625,
-0.0155487060546875,
0.0108795166015625,
0.00141143798828125,
-0.0105133056640625,
-0.050750732421875,
0.021484375,
-0.06878662109375,
-0.01454925537109375,
-0.037261962890625,
0.01300811767578125,
0.01213836669921875,
-0.038055419921875,
-0.046844482421875,
0.052886962890625,
-0.0165557861328125,
-0.0278472900390625,
-0.039794921875,
-0.0054931640625,
-0.00858306884765625,
0.005649566650390625,
-0.0089263916015625,
-0.013031005859375,
-0.02392578125,
0.04266357421875,
-0.0015554428100585938,
0.037567138671875,
0.01751708984375,
-0.01108551025390625,
0.015411376953125,
0.0193939208984375,
0.028076171875,
-0.01558685302734375,
0.0255584716796875,
0.0027294158935546875,
0.024505615234375,
0.063232421875,
-0.040802001953125,
0.004055023193359375,
-0.0413818359375,
-0.0292205810546875,
-0.037445068359375,
-0.0135955810546875,
-0.0208587646484375,
0.01203155517578125,
0.09710693359375,
0.11102294921875,
0.0245208740234375,
-0.0694580078125,
-0.010223388671875,
-0.05242919921875,
-0.0496826171875,
0.0197601318359375,
0.039642333984375,
-0.0654296875,
0.0260009765625,
0.0599365234375,
0.01334381103515625,
-0.0014190673828125,
-0.035614013671875,
0.004344940185546875,
-0.025054931640625,
-0.0100860595703125,
0.01433563232421875,
-0.0286865234375,
0.0242919921875,
0.02532958984375,
-0.026885986328125,
-0.0092315673828125,
-0.0216522216796875,
0.01366424560546875,
-0.0173797607421875,
-0.044158935546875,
0.00588226318359375,
0.01690673828125,
-0.0340576171875,
-0.002925872802734375,
0.0031337738037109375,
0.0208282470703125,
-0.031494140625,
-0.0050506591796875,
-0.0299530029296875,
0.016937255859375,
0.0036411285400390625,
0.018280029296875,
0.0025787353515625,
0.0556640625,
0.0182952880859375,
0.08233642578125,
-0.00531005859375,
0.019561767578125,
0.0140838623046875,
0.0180816650390625,
-0.033660888671875,
0.01024627685546875,
-0.004497528076171875,
-0.02978515625,
0.0016031265258789062,
0.01099395751953125,
-0.0108795166015625,
-0.0174407958984375,
0.006801605224609375,
-0.0036983489990234375,
0.006343841552734375,
0.00543212890625
] |
2accd3d71610269aeed80b40b4a12d2776d02bd2
|
Wordpress Stackexchange
Q: Check for update vs new post on save_post action Is it possible within the save_post action to determine whether it's a new post being created or an existing post being update?
A: I ended up just checking for the existence of a custom value prior to setting it. That way, if it's a newly created post the custom value would not yet exist.
function attributes_save_postdata($post_id) {
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
if (!wp_verify_nonce($_POST['_attributes_noncename'], plugin_basename(__FILE__))) return;
if ('page' == $_POST['post_type']) {
if (!current_user_can('edit_page', $post_id)) return;
} else {
if (!current_user_can('edit_post', $post_id)) return;
}
$termid = get_post_meta($post_id, '_termid', true);
if ($termid != '') {
// it's a new record
$termid = 'update';
} else {
// it's an existing record
}
update_post_meta($post_id, '_termid', $termid);
}
add_action('save_post', 'attributes_save_postdata');
|
Q: Check for update vs new post on save_post action Is it possible within the save_post action to determine whether it's a new post being created or an existing post being update?
A: I ended up just checking for the existence of a custom value prior to setting it. That way, if it's a newly created post the custom value would not yet exist.
function attributes_save_postdata($post_id) {
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
if (!wp_verify_nonce($_POST['_attributes_noncename'], plugin_basename(__FILE__))) return;
if ('page' == $_POST['post_type']) {
if (!current_user_can('edit_page', $post_id)) return;
} else {
if (!current_user_can('edit_post', $post_id)) return;
}
$termid = get_post_meta($post_id, '_termid', true);
if ($termid != '') {
// it's a new record
$termid = 'update';
} else {
// it's an existing record
}
update_post_meta($post_id, '_termid', $termid);
}
add_action('save_post', 'attributes_save_postdata');
A: Example to ialocin answer with "update" paremeter:
function save_func($ID, $post,$update) {
if($update == false) {
// do something if its first time publish
} else {
// Do something if its update
}
}
add_action( 'save_post', 'save_func', 10, 3 );
A: I have just encountered the save_post about new and update. After reading the source code to understand the flow. I found that the following method might be useful. Since it is not yet mentioned before. See if it is useful to anyone. (The test is Core 5.3.3)
The Post creation flow is approximately:
*
*After pressing Add New (Post)
*$post = get_default_post_to_edit( $post_type, true ); will be called where
*get_default_post_to_edit() receive argument $create_in_db = true
*so wp_insert_post() is immediately being called, auto-draft post is being created, even it is not saved, every time clicking Add New, an auto-draft is created
*$update is always true for Publish. So when Publish a new post, it is true.
By comparing the $_POST object for new post and update post or republish post, the prominent difference is value _wp_http_referer, the new post is /wp-admin/post-new.php
Assumption: assumed the post is published/added from UI. If it is done by other mechanism, custom code, the checking is needed to adjust.
add_action( 'save_post', 'test_save_post_check', 0, 3 );
function test_save_post_check( $post_ID, $post, $update ) {
// other tests + this
// checking the 'post-new' position from the '_wp_http_referer'
if( strpos( wp_get_raw_referer(), 'post-new' ) > 0 ) {
// new
} else {
// update
}
}
A: here is a functional code that worked and tested by me i used in my website also it solve the two following problem associated with save_post action :
*
*problem to check between ubdate or insert
*problem of twice insert by save_post action
function save_annonces_callback($post_ID, $post, $update){
$post_type = get_post_type($post_ID);
if ( $post_type === 'annonces' ){
//this to preventtwice insert by save_post action :)
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {
return;
} else {
//check if new post so insert
if( strpos( wp_get_raw_referer(), 'post-new' ) > 0 ){
//perform insert
}else{
//perform update
}
}
}
}add_action('save_post','save_annonces_callback', 10, 3);
A: Since WordPress version 3.7. - IIRC - the save_post hook - more information about the hook and its usage at Code Reference: save_post and Codex: save_post - has a third parameter $update which can be used to determine just that.
@param int $post_ID Post ID.
@param WP_Post $post Post object.
@param bool $update Whether this is an existing post being updated or not.
Note:
$update is not always true – you can see and test it yourself with below code. It is not well documented though, possibly far from optimally named, and hence creates misleading expectations. Below code can be used for some debugging, play around with when to intercept code execution, because otherwise you won't see the information/messages. I think, the culprit in deceptive behavior is the handling of revisions and auto saves – which could be disabled, but I don't recommend it, and haven't tested it. Not sure if this warrants a Trac Ticket, so I didn't open one, if you think so, please follow the link and do it yourself. Aside from that, as stated in the comments, if you have a specific problem, post a new question.
add_action( 'save_post', 'debug_save_post_update', 10, 3 );
function debug_save_post_update( $ID, $post, $update ) {
echo '<pre>';
print_r( $post ); echo '<br>';
echo '$update == ';
echo $update ? 'true' : 'false';
//conditions
if( ! $update && $post->post_status == "auto-draft" ) {
// applies to new post
echo ' && $post->post_status == "auto-draft"';
//die();
} else if ( ! $update ) {
// applies basically to the (auto saved) revision
//die();
} else {
// applies to updating a published post
// when there is a revision, which is normally the case,
// standard behavior of WordPress, then it is considered
// an update, which is where the confusion sets in
// there are other methods, like checking time or post status
// depending on your use case it might be more appropriate
// to use one of those alternatives
//die();
}
echo '</pre>';
//die();
}
A: The way I perform this check (within a hooked function) is to compare the post date and modified date (in GMT for standardisation)
function check_new_vs_update( $post_id ){
$myPost = get_post($post_id);
$post_created = new DateTime( $myPost->post_date_gmt );
$post_modified = new DateTime( $myPost->post_modified_gmt );
$diff = $created->diff( $modified );
$seconds_difference = ((($diff->y * 365.25 + $diff->m * 30 + $diff->d) * 24 + $diff->h) * 60 + $diff->i)*60 + $diff->s;
if( $seconds_difference <= 1 ){
// New post
}else{
// Updated post
}
}
add_action('save_post', 'check_new_vs_update' );
This works because even at creation the post has a 'modified' date attached to it, which is exactly the same as the 'created' date, but we allow a variance of 1 second either way in case a second ticks over during the creation of the post.
A: You can use pre_post_update action hook for the update code and save_post for the new post code. It works before a post is updated.
A: As Darshan Thanki hinted (and Stephen Harris further elaborated), you can use pre_post_update to your advantage.
global $___new_post;
$___new_post = true;
add_action(
'pre_post_update',
function() {
global $___new_post;
$___new_post = false;
},
0
);
function is_new_post() {
global $___new_post;
return $___new_post;
}
The reason why I used globals is because function is_new_post() use ( &$new_post ) is not valid in PHP (shocking...) so pulling in that variable into the function scope doesn't work -- hence the global.
Note that this can really only reliably be used within/after the save_post event (which is usually sufficient, at least for what we're doing with it).
A: When save_post is triggered, all information about that post is already available, so in theory you could use
function f4553265_check_post() {
if (!get_posts($post_id)) {
// if this is a new post get_posts($post_id) should return null
} else {
// $post_id already exists on the database
}
}
add_action('save_post','f4553265_check_post');
this is untested, though. =)
A: Another approach that uses a built-in function and no addition to the database would involve get_post_status().
$post_status = get_post_status();
if ( $post_status != 'draft' ) {
//draft
} else {
//not a draft: can be published, pending, etc.
}
Note however that it might not be appropriate if you plan to later set the status back to "draft" – your instructions would be repeated the next time you will update the post.
Depending on the context, you might want to consider the various strings that can be returned by get_post_status() to build a more appropriate scenario.
See Codex for get_post_status() and Post Status
Possible values are:
*
*'publish' - A published post or page
*'pending' - post is pending review
*'draft' - a post in draft status
*'auto-draft' - a newly created post, with no content
*'future' - a post to publish in the future
*'private' - not visible to users who are not logged in
*'inherit' - a revision. see get_children.
*'trash' - post is in trashbin. added with Version 2.9.
A: Since the $update param is useless, this is the fastest way I tested:
function wpse48678_check_is_post_new($post_id, $post, $update)
{
if (false !== strpos($_POST['_wp_http_referer'], 'post-new.php')) {
return true; // Or do something else.
} else {
return false; // Or do something else.
}
}
add_action('save_post_{$post_type}', 'wpse48678_check_is_post_new', 10, 3);
|
wordpress
|
{
"language": "en",
"length": 1345,
"provenance": "stackexchange_00019.jsonl.gz:418968",
"question_score": "24",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48678"
}
|
[
0.0784912109375,
-0.01143646240234375,
0.0255889892578125,
-0.041412353515625,
0.01183319091796875,
-0.0141143798828125,
0.0343017578125,
-0.03814697265625,
-0.0025043487548828125,
-0.0321044921875,
-0.049468994140625,
-0.002582550048828125,
-0.00823211669921875,
-0.03668212890625,
0.042938232421875,
-0.0438232421875,
0.05108642578125,
-0.02459716796875,
0.04351806640625,
-0.0013914108276367188,
-0.0015916824340820312,
0.013702392578125,
0.07281494140625,
0.032928466796875,
0.042327880859375,
-0.0276947021484375,
0.04095458984375,
0.004093170166015625,
0.030792236328125,
0.0019216537475585938,
0.036834716796875,
-0.029998779296875,
0.02056884765625,
0.00760650634765625,
-0.01483154296875,
0.00565338134765625,
0.0298614501953125,
-0.00469207763671875,
0.0200347900390625,
0.004985809326171875,
0.028656005859375,
-0.0169677734375,
0.0211944580078125,
-0.012481689453125,
0.0118865966796875,
-0.024993896484375,
0.033599853515625,
-0.04425048828125,
0.025421142578125,
0.0217437744140625,
-0.0144195556640625,
0.0270843505859375,
-0.0245208740234375,
0.00621795654296875,
0.007167816162109375,
0.0152740478515625,
-0.0285797119140625,
-0.00789642333984375,
0.058441162109375,
0.0195159912109375,
-0.0288238525390625,
-0.055023193359375,
0.0221099853515625,
-0.049591064453125,
0.005054473876953125,
0.003299713134765625,
0.00958251953125,
0.00981903076171875,
-0.046234130859375,
-0.006282806396484375,
0.0188140869140625,
-0.034027099609375,
0.004825592041015625,
0.022613525390625,
0.0022678375244140625,
-0.036956787109375,
0.0208587646484375,
0.02239990234375,
0.00033974647521972656,
0.037750244140625,
-0.012115478515625,
-0.01006317138671875,
0.00399017333984375,
-0.0439453125,
0.0031452178955078125,
-0.006195068359375,
-0.01312255859375,
0.007354736328125,
-0.0338134765625,
-0.04852294921875,
-0.03387451171875,
-0.036407470703125,
-0.02264404296875,
-0.034637451171875,
-0.0204925537109375,
-0.033111572265625,
0.007568359375,
0.08349609375,
-0.045257568359375,
0.0113677978515625,
-0.027801513671875,
-0.0273895263671875,
0.0283966064453125,
-0.055450439453125,
0.0150604248046875,
0.04388427734375,
0.0322265625,
-0.0341796875,
0.004970550537109375,
-0.0033969879150390625,
-0.0257568359375,
0.0169525146484375,
-0.0034198760986328125,
-0.00010001659393310547,
-0.03802490234375,
0.0159454345703125,
-0.0276641845703125,
0.0017004013061523438,
-0.006656646728515625,
0.02655029296875,
0.000339508056640625,
0.0139007568359375,
0.0237884521484375,
-0.03863525390625,
0.0623779296875,
0.0277252197265625,
-0.038055419921875,
-0.0219879150390625,
-0.0260467529296875,
0.0168609619140625,
-0.034820556640625,
0.0212249755859375,
0.0928955078125,
0.01169586181640625,
-0.0086212158203125,
-0.021728515625,
-0.00018930435180664062,
-0.0222015380859375,
-0.038238525390625,
0.031005859375,
-0.01157379150390625,
-0.04296875,
-0.0155181884765625,
-0.0286407470703125,
-0.0247650146484375,
0.030517578125,
0.0022182464599609375,
0.01898193359375,
-0.0029468536376953125,
-0.0855712890625,
0.01125335693359375,
-0.044036865234375,
0.03411865234375,
-0.0202484130859375,
-0.02301025390625,
-0.031829833984375,
-0.016510009765625,
-0.0180206298828125,
-0.0099639892578125,
-0.026947021484375,
0.03814697265625,
-0.014556884765625,
-0.0058441162109375,
-0.0247955322265625,
-0.0556640625,
0.01035308837890625,
-0.0469970703125,
-0.0102386474609375,
0.0222320556640625,
0.0261383056640625,
0.048797607421875,
0.01102447509765625,
0.051849365234375,
0.0038242340087890625,
-0.01198577880859375,
-0.0186767578125,
0.0238037109375,
-0.03955078125,
0.038604736328125,
0.00820159912109375,
-0.042083740234375,
-0.0094451904296875,
0.0382080078125,
-0.00969696044921875,
-0.04449462890625,
0.07965087890625,
-0.006168365478515625,
0.051116943359375,
0.00957489013671875,
-0.00012874603271484375,
0.029876708984375,
0.0147552490234375,
-0.025726318359375,
0.012298583984375,
0.00403594970703125,
-0.002758026123046875,
-0.035125732421875,
0.0011453628540039062,
-0.005542755126953125,
-0.018280029296875,
-0.0247802734375,
0.006622314453125,
-0.0071258544921875,
0.00437164306640625,
-0.083251953125,
-0.00229644775390625,
-0.035736083984375,
0.057403564453125,
-0.04425048828125,
0.0308685302734375,
0.0458984375,
0.0019855499267578125,
-0.037628173828125,
0.01340484619140625,
0.007656097412109375,
-0.0166015625,
-0.0305328369140625,
-0.0098876953125,
-0.021697998046875,
0.0271148681640625,
-0.0226593017578125,
-0.002620697021484375,
-0.0404052734375,
-0.01386260986328125,
-0.006877899169921875,
-0.003986358642578125,
-0.0081634521484375,
0.01090240478515625,
0.003662109375,
0.027923583984375,
0.00978851318359375,
-0.003875732421875,
0.01270294189453125,
0.0029850006103515625,
-0.0265350341796875,
-0.02960205078125,
-0.036712646484375,
-0.127685546875,
0.0216064453125,
0.08837890625,
0.044281005859375,
-0.0214385986328125,
0.00027298927307128906,
0.0031032562255859375,
0.0452880859375,
-0.01215362548828125,
0.0186920166015625,
-0.0216064453125,
0.0198516845703125,
0.05438232421875,
-0.00598907470703125,
-0.007678985595703125,
-0.0006604194641113281,
-0.04364013671875,
0.01128387451171875,
0.0256195068359375,
-0.0200653076171875,
0.0158843994140625,
-0.01128387451171875,
-0.02032470703125,
-0.01299285888671875,
-0.032928466796875,
0.00592041015625,
-0.021087646484375,
0.03656005859375,
0.0272979736328125,
0.05029296875,
0.040985107421875,
-0.0161895751953125,
0.00733184814453125,
0.0097198486328125,
-0.0220184326171875,
0.0046234130859375,
0.0176849365234375,
0.00807952880859375,
0.06390380859375,
-0.05487060546875,
-0.005619049072265625,
0.0582275390625,
0.043701171875,
-0.03662109375,
0.0018835067749023438,
-0.00997161865234375,
-0.0157012939453125,
0.0011396408081054688,
-0.06646728515625,
0.00919342041015625,
-0.0399169921875,
-0.002292633056640625,
-0.01166534423828125,
0.018463134765625,
0.007076263427734375,
-0.038848876953125,
0.0440673828125,
0.01105499267578125,
-0.031768798828125,
-0.01474761962890625,
-0.00909423828125,
0.0199432373046875,
0.0048065185546875,
0.004673004150390625,
0.06927490234375,
0.0246124267578125,
0.0129241943359375,
-0.0110015869140625,
0.010650634765625,
-0.03704833984375,
0.047149658203125,
-0.0008463859558105469,
-0.050201416015625,
-0.035552978515625,
-0.01555633544921875,
0.00244140625,
0.03759765625,
-0.00970458984375,
-0.04034423828125,
0.0193939208984375,
0.007572174072265625,
-0.0435791015625,
-0.047637939453125,
-0.02777099609375,
-0.07806396484375,
0.0128173828125,
-0.034912109375,
-0.032806396484375,
-0.00618743896484375,
-0.00759124755859375,
0.03033447265625,
-0.059539794921875,
-0.0031185150146484375,
-0.0360107421875,
-0.051727294921875,
-0.039215087890625,
0.02276611328125,
0.0017690658569335938,
0.014007568359375,
0.00493621826171875,
0.056182861328125,
0.0025157928466796875,
-0.0716552734375,
-0.0008959770202636719,
-0.039398193359375,
-0.0270233154296875,
0.0254669189453125,
-0.02166748046875,
-0.027679443359375,
0.025115966796875,
-0.019561767578125,
0.03875732421875,
0.0213165283203125,
0.0031261444091796875,
0.006519317626953125,
-0.01241302490234375,
-0.01849365234375,
0.032562255859375,
-0.0174713134765625,
-0.0072784423828125,
0.03778076171875,
0.06976318359375,
-0.01314544677734375,
-0.0310821533203125,
-0.00559234619140625,
-0.06317138671875,
0.0112762451171875,
0.03118896484375,
0.006572723388671875,
0.01255035400390625,
-0.0009489059448242188,
-0.0224609375,
-0.010711669921875,
0.068603515625,
-0.0201873779296875,
-0.0054931640625,
-0.031280517578125,
-0.062225341796875,
-0.041748046875,
0.0009541511535644531,
-0.02191162109375,
0.0209197998046875,
-0.0073699951171875,
0.01511383056640625,
-0.0037994384765625,
-0.005771636962890625,
-0.03680419921875,
-0.037017822265625,
0.0002359151840209961,
-0.0428466796875,
0.04876708984375,
-0.0457763671875,
-0.00481414794921875,
-0.032562255859375,
0.058624267578125,
-0.016937255859375,
-0.0166015625,
-0.033538818359375,
0.003719329833984375,
-0.01360321044921875,
-0.0362548828125,
-0.0048828125,
0.002758026123046875,
-0.03668212890625,
0.0216064453125,
0.01386260986328125,
-0.0006532669067382812,
-0.0236358642578125,
0.06988525390625,
-0.031982421875,
-0.010040283203125,
0.0302886962890625,
-0.034698486328125,
0.024383544921875,
0.022735595703125,
0.014739990234375,
-0.0020599365234375,
-0.0108489990234375,
-0.0352783203125,
-0.077880859375,
-0.003833770751953125,
-0.050445556640625,
0.034271240234375,
-0.003681182861328125,
0.0226593017578125,
-0.0335693359375,
0.0006361007690429688,
0.0208282470703125,
0.0015916824340820312,
-0.01168060302734375,
-0.0127105712890625,
-0.020263671875,
-0.0196075439453125,
0.0052337646484375,
-0.03472900390625,
-0.0300140380859375,
-0.038909912109375,
0.004154205322265625,
0.016693115234375,
-0.0325927734375,
-0.004726409912109375,
-0.043121337890625,
0.0102691650390625,
-0.045166015625,
-0.0064849853515625,
-0.0149078369140625,
-0.002105712890625,
-0.01502227783203125,
-0.00868988037109375,
-0.00782012939453125,
-0.0784912109375,
0.0377197265625,
-0.0299530029296875,
-0.01204681396484375,
0.01255035400390625,
0.0941162109375,
0.017181396484375,
0.005481719970703125,
-0.01374053955078125,
0.00662994384765625,
0.046966552734375,
0.05181884765625,
0.003917694091796875,
0.01525115966796875,
-0.0179290771484375,
0.0150146484375,
0.041961669921875,
-0.015838623046875,
-0.01422882080078125,
0.034332275390625,
0.005878448486328125,
0.005504608154296875,
-0.02142333984375,
-0.0212554931640625,
0.034210205078125,
0.0281219482421875,
-0.0357666015625,
-0.005157470703125,
-0.01415252685546875,
0.03594970703125,
-0.042755126953125,
0.03668212890625,
-0.0318603515625,
-0.03564453125,
0.0224761962890625,
-0.004711151123046875,
-0.0216217041015625,
0.0202484130859375,
-0.0191192626953125,
0.0027637481689453125,
-0.031494140625,
-0.0130615234375,
-0.0283966064453125,
0.034881591796875,
-0.0125579833984375,
0.0302276611328125,
-0.019989013671875,
-0.0127410888671875,
-0.05120849609375,
0.0072174072265625,
0.02752685546875,
-0.04901123046875,
-0.082763671875,
-0.01399993896484375,
0.0024394989013671875,
0.035186767578125,
0.07763671875,
0.0254364013671875,
0.032958984375,
0.01165771484375,
-0.0076446533203125,
-0.025848388671875,
0.00189208984375,
0.0036106109619140625,
-0.042877197265625,
-0.0413818359375,
0.0215301513671875,
-0.0242919921875,
-0.007648468017578125,
0.02569580078125,
0.0195770263671875,
-0.0017633438110351562,
-0.021728515625,
0.073486328125,
0.03948974609375,
0.031463623046875,
0.01291656494140625,
-0.006145477294921875,
-0.01490020751953125,
0.00557708740234375,
-0.056121826171875,
-0.0577392578125,
-0.0196075439453125,
0.0102691650390625,
0.03173828125,
-0.0171356201171875,
-0.0278778076171875,
0.055206298828125,
0.01071929931640625,
-0.01497650146484375,
0.01442718505859375,
0.021728515625,
-0.038726806640625,
0.009490966796875,
0.054443359375,
0.01480865478515625,
-0.01412200927734375,
0.004261016845703125,
-0.003429412841796875,
-0.0201263427734375,
0.03515625,
-0.064697265625,
0.015899658203125,
-0.013214111328125,
-0.0114593505859375,
-0.0143585205078125,
-0.023345947265625,
0.00433349609375,
0.05987548828125,
0.0203704833984375,
-0.043792724609375,
-0.051910400390625,
0.042999267578125,
-0.01500701904296875,
0.036590576171875,
-0.03485107421875,
-0.006069183349609375,
0.006755828857421875,
0.004123687744140625,
0.05133056640625,
0.0091400146484375,
0.007904052734375,
-0.004169464111328125,
-0.048736572265625,
-0.025848388671875,
0.016021728515625,
-0.0184173583984375,
-0.010284423828125,
-0.01904296875,
0.0118408203125,
0.018951416015625,
-0.01861572265625,
-0.00499725341796875,
0.03326416015625,
0.0277557373046875,
-0.0105743408203125,
0.04913330078125,
-0.0025157928466796875,
0.060455322265625,
0.0054931640625,
0.07159423828125,
0.01221466064453125,
-0.0201416015625,
-0.058929443359375,
-0.0037670135498046875,
-0.009490966796875,
-0.00710296630859375,
0.01226043701171875,
-0.0039215087890625,
0.03997802734375,
-0.0182037353515625,
0.009674072265625,
0.0005497932434082031,
0.0034084320068359375,
-0.0017061233520507812,
0.011138916015625,
-0.0223236083984375,
-0.00860595703125,
-0.0008568763732910156,
-0.028350830078125,
0.03900146484375,
-0.04730224609375,
-0.021942138671875,
0.0198974609375,
0.004604339599609375,
0.0214385986328125,
-0.02044677734375,
0.0037841796875,
0.04132080078125,
-0.0301361083984375,
0.0283966064453125,
0.0374755859375,
0.0147552490234375,
0.0545654296875,
0.002635955810546875,
0.037261962890625,
0.036712646484375,
-0.03839111328125,
-0.0103759765625,
0.028472900390625,
0.073486328125,
0.0107574462890625,
-0.02532958984375,
0.074462890625,
-0.035888671875,
0.038665771484375,
0.0254669189453125,
0.06317138671875,
-0.0462646484375,
0.0174713134765625,
0.0258636474609375,
-0.0255889892578125,
0.03692626953125,
-0.0184173583984375,
0.002063751220703125,
-0.0026302337646484375,
0.02960205078125,
-0.03564453125,
-0.0333251953125,
0.00870513916015625,
-0.01221466064453125,
0.005123138427734375,
-0.0226593017578125,
0.0084075927734375,
0.010345458984375,
0.0203094482421875,
0.0126800537109375,
-0.0011768341064453125,
0.01739501953125,
-0.037628173828125,
0.01148223876953125,
-0.0204010009765625,
0.00283050537109375,
-0.08154296875,
-0.01480865478515625,
-0.005954742431640625,
-0.0009241104125976562,
0.012420654296875,
0.0018644332885742188,
0.09234619140625,
0.050994873046875,
0.0201873779296875,
-0.0236053466796875,
0.0263824462890625,
0.04034423828125,
-0.10113525390625,
-0.0179595947265625,
0.0159149169921875,
0.0272216796875,
-0.025634765625,
0.039093017578125,
-0.0258331298828125,
-0.03826904296875,
0.0189361572265625,
0.0078582763671875,
0.044158935546875,
-0.044525146484375,
-0.0182647705078125,
0.0257568359375,
-0.0283050537109375,
0.003391265869140625,
0.0021533966064453125,
-0.0208892822265625,
-0.022064208984375,
-0.019683837890625,
-0.033477783203125,
-0.08624267578125,
-0.011199951171875,
-0.033050537109375,
-0.11346435546875,
0.10064697265625,
0.052734375,
0.05255126953125,
-0.0582275390625,
0.03985595703125,
-0.0111236572265625,
0.021087646484375,
-0.04742431640625,
0.06951904296875,
-0.001850128173828125,
0.0699462890625,
-0.0369873046875,
-0.004665374755859375,
0.0303497314453125,
0.01541900634765625,
0.04998779296875,
0.01470947265625,
0.00701904296875,
0.006519317626953125,
0.01090240478515625,
-0.01861572265625,
-0.050323486328125,
0.0284576416015625,
0.020782470703125,
0.052581787109375,
0.05816650390625,
-0.035980224609375,
0.03826904296875,
0.00917816162109375,
-0.00951385498046875,
0.041656494140625,
0.0205230712890625,
0.020111083984375,
-0.027099609375,
0.0007371902465820312,
-0.0145721435546875,
-0.0154266357421875,
0.01145172119140625,
0.005809783935546875,
0.0211944580078125,
-0.01080322265625,
0.0302886962890625,
-0.0791015625,
-0.00390625,
-0.02655029296875,
0.043701171875,
0.027191162109375,
0.0222320556640625,
0.0050201416015625,
0.0008625984191894531,
0.044403076171875,
0.041412353515625,
0.0035991668701171875,
0.04345703125,
0.01160430908203125,
0.039093017578125,
0.0660400390625,
0.0175323486328125,
-0.0006251335144042969,
0.01654052734375,
0.043670654296875,
0.059783935546875,
-0.048828125,
0.0036144256591796875,
0.0192718505859375,
0.003444671630859375,
-0.0236968994140625,
-0.038116455078125,
-0.0013818740844726562,
0.0257720947265625,
0.0169677734375,
-0.05633544921875,
0.01763916015625,
0.0307464599609375,
0.0269927978515625,
-0.0019330978393554688,
0.01250457763671875,
-0.0718994140625,
-0.02044677734375,
-0.05145263671875,
-0.02154541015625,
0.0269012451171875,
0.08221435546875,
0.0667724609375,
0.03485107421875,
-0.007129669189453125,
-0.042755126953125,
-0.0196685791015625,
-0.0005307197570800781,
0.0021610260009765625,
0.032318115234375,
-0.04364013671875,
-0.019744873046875,
0.008575439453125,
0.045379638671875,
0.004779815673828125,
0.07281494140625,
0.040008544921875,
0.035736083984375,
0.01788330078125,
0.01291656494140625,
0.0728759765625,
-0.0152587890625,
0.004302978515625,
-0.02642822265625,
0.0236358642578125,
0.0224151611328125,
0.00389862060546875,
-0.0190887451171875,
0.01129150390625,
0.041351318359375,
-0.007617950439453125,
0.03887939453125,
-0.0004699230194091797,
-0.0136871337890625,
0.01482391357421875,
0.027191162109375,
0.06683349609375,
0.034576416015625,
0.0052337646484375,
0.0243072509765625,
-0.0209503173828125,
-0.047088623046875,
-0.0247039794921875,
0.01389312744140625,
-0.027801513671875,
0.05230712890625,
0.0250396728515625,
-0.01262664794921875,
0.00762176513671875,
0.0219879150390625,
0.0011682510375976562,
0.0215606689453125,
0.0386962890625,
0.0218505859375,
0.005100250244140625,
0.021636962890625,
0.05157470703125,
-0.010009765625,
-0.033416748046875,
0.04388427734375,
-0.0099945068359375,
-0.0273284912109375,
-0.00684356689453125,
0.052520751953125,
-0.06500244140625,
-0.01367950439453125,
0.0270538330078125,
-0.0190277099609375,
0.021636962890625,
0.01337432861328125,
-0.01812744140625,
0.0284576416015625,
0.0213623046875,
0.015045166015625,
0.00661468505859375,
-0.0249176025390625,
0.0301055908203125,
0.0253448486328125,
-0.002658843994140625,
-0.03826904296875,
-0.00833892822265625,
-0.0197601318359375,
-0.0032291412353515625,
0.0183258056640625,
-0.00788116455078125,
-0.0031871795654296875,
0.038482666015625,
0.003932952880859375,
-0.0007600784301757812,
0.00943756103515625,
-0.002666473388671875,
-0.0049591064453125,
0.0257568359375,
-0.020782470703125,
0.009429931640625,
0.0255584716796875,
-0.0228271484375,
0.0222625732421875,
0.01277923583984375,
0.01971435546875,
0.0191802978515625,
-0.0308990478515625,
0.0001323223114013672,
0.020416259765625,
0.03143310546875,
-0.0178985595703125,
0.00325775146484375,
0.00572967529296875,
-0.0081939697265625,
0.0073089599609375,
-0.01062774658203125,
-0.0037441253662109375,
-0.0220947265625,
-0.02862548828125,
-0.0020275115966796875,
-0.0153045654296875,
-0.00958251953125,
0.0208740234375,
-0.0153961181640625,
0.050567626953125,
-0.0013093948364257812,
-0.02581787109375,
-0.0027923583984375,
-0.0289306640625,
0.0253448486328125,
-0.00262451171875,
-0.006656646728515625,
-0.0017061233520507812,
0.031890869140625,
-0.0013027191162109375,
0.004032135009765625,
-0.0183868408203125,
0.0203094482421875,
0.016937255859375,
-0.0017642974853515625,
0.006244659423828125,
-0.01529693603515625,
-0.06585693359375,
0.004169464111328125,
0.003452301025390625,
0.0198974609375,
0.03826904296875,
-0.0156402587890625,
0.0036602020263671875,
-0.006011962890625,
-0.0051422119140625,
-0.03265380859375,
0.004749298095703125,
-0.049407958984375,
-0.05328369140625,
-0.0145721435546875,
0.044677734375,
0.0654296875,
0.006504058837890625,
-0.04901123046875,
0.032440185546875,
-0.0205841064453125,
-0.02008056640625,
-0.00616455078125,
-0.002666473388671875,
-0.034423828125,
0.03143310546875,
0.0121307373046875,
-0.0462646484375,
0.01593017578125,
0.0394287109375,
-0.00555419921875,
0.0126495361328125,
0.026153564453125,
-0.01104736328125,
-0.08245849609375,
-0.029083251953125,
-0.042388916015625,
-0.006343841552734375,
0.01172637939453125,
-0.002124786376953125,
-0.005062103271484375,
0.0282440185546875,
-0.037445068359375,
-0.07135009765625,
-0.0290985107421875,
-0.01342010498046875,
-0.01403045654296875,
-0.026763916015625,
-0.02374267578125,
0.00836944580078125,
0.08551025390625,
0.068603515625,
0.01544189453125,
-0.05718994140625,
0.037353515625,
-0.0203399658203125,
-0.0546875,
0.0189361572265625,
0.02032470703125,
-0.0294342041015625,
0.01078033447265625,
0.0169525146484375,
0.0083160400390625,
-0.0101165771484375,
0.03143310546875,
-0.004436492919921875,
-0.0127716064453125,
0.06219482421875,
0.0060272216796875,
-0.052581787109375,
-0.0123291015625,
0.02520751953125,
-0.024658203125,
-0.017364501953125,
0.01313018798828125,
-0.00572967529296875,
0.004608154296875,
0.0428466796875,
0.032958984375,
0.0517578125,
-0.040069580078125,
-0.0165557861328125,
0.02935791015625,
0.00041365623474121094,
-0.01457977294921875,
-0.019439697265625,
-0.01509857177734375,
-0.0011234283447265625,
-0.0021076202392578125,
-0.01204681396484375,
-0.0170135498046875,
0.005199432373046875,
-0.0224761962890625,
0.068359375,
-0.0124053955078125,
0.055206298828125,
0.0017576217651367188,
0.01251983642578125,
0.0034046173095703125,
0.00157928466796875,
0.038726806640625,
-0.00853729248046875,
-0.0011415481567382812,
0.01190948486328125,
-0.005321502685546875,
-0.04998779296875,
0.015533447265625,
0.0146636962890625,
0.00946044921875,
0.01068115234375
] |
ef16d6202a019a9b6060c55f904eda8448ba93d4
|
Wordpress Stackexchange
Q: Having two different versions of the same post? I'm currently working on a site that's targeted for beginners in a new language. Now I'm looking for something that can ease my work with having two different versions of the same post. One "easy to read" and one with more adept language.
In the front end there should be some sort of option that let the user tab to which ever version he or she would want to read. Would be good if the user could set a default value in the user profile aswell.
Anything ring a bell?
I figure WPML would be worth a shot, but I haven't used it before, and I would like to try and find something else, since WPML also seems a little bit to advance for this purpose.
A: I think, as @Brad points out, Custom Fields would be the easy way to go.
Advanced Custom Fields is quite nice for this kind of situation.
Here's a screenshot of what can be achieved. I configured the fields to appear only if category equals "lingo" and to hide the regular content box.
|
Q: Having two different versions of the same post? I'm currently working on a site that's targeted for beginners in a new language. Now I'm looking for something that can ease my work with having two different versions of the same post. One "easy to read" and one with more adept language.
In the front end there should be some sort of option that let the user tab to which ever version he or she would want to read. Would be good if the user could set a default value in the user profile aswell.
Anything ring a bell?
I figure WPML would be worth a shot, but I haven't used it before, and I would like to try and find something else, since WPML also seems a little bit to advance for this purpose.
A: I think, as @Brad points out, Custom Fields would be the easy way to go.
Advanced Custom Fields is quite nice for this kind of situation.
Here's a screenshot of what can be achieved. I configured the fields to appear only if category equals "lingo" and to hide the regular content box.
A: I think that having two separate posts for the easy/adept versions is going to be hard to manage consistently, especially if you end up with alot of content.
It would be easier to use custom fields to store the two sets of information within the one 'post', then use javascript to toggle between which one is visible on the frontend.
A: You might try Posts 2 Posts which would allow you to directly connect the posts. On the front-end the user could just click the link to the more advanced or more basic post, back and forth.
The plugin provides some robust functionality, and you could even use it to display information about the connected post (such as comments).
|
wordpress
|
{
"language": "en",
"length": 308,
"provenance": "stackexchange_00019.jsonl.gz:418975",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48693"
}
|
[
0.01373291015625,
-0.0180816650390625,
-0.035736083984375,
-0.028350830078125,
-0.0083160400390625,
-0.0300140380859375,
0.01537322998046875,
-0.0090789794921875,
0.0018568038940429688,
0.0087432861328125,
-0.0182037353515625,
-0.0105438232421875,
-0.040496826171875,
-0.0275421142578125,
-0.0189208984375,
-0.055419921875,
0.044708251953125,
0.0254974365234375,
0.03436279296875,
-0.008209228515625,
-0.00176239013671875,
0.00720977783203125,
0.024932861328125,
0.051727294921875,
0.050750732421875,
-0.048095703125,
0.00772857666015625,
-0.0089569091796875,
0.0055999755859375,
-0.0088653564453125,
0.032257080078125,
0.0051727294921875,
0.0104522705078125,
0.0018415451049804688,
-0.01522064208984375,
0.00276947021484375,
0.01959228515625,
-0.01476287841796875,
-0.019866943359375,
0.047943115234375,
0.00852203369140625,
-0.0024623870849609375,
0.01320648193359375,
-0.0027523040771484375,
0.002655029296875,
-0.07110595703125,
0.061279296875,
-0.0250091552734375,
0.02520751953125,
0.0004038810729980469,
-0.00014603137969970703,
-0.0048370361328125,
-0.0011234283447265625,
0.0016145706176757812,
-0.0242919921875,
-0.02264404296875,
-0.0106353759765625,
0.01175689697265625,
0.058746337890625,
-0.004505157470703125,
-0.03167724609375,
-0.04595947265625,
0.019256591796875,
-0.01708984375,
-0.009002685546875,
0.0144805908203125,
0.0528564453125,
0.004154205322265625,
-0.033843994140625,
-0.0411376953125,
0.022491455078125,
-0.00594329833984375,
0.026885986328125,
-0.061065673828125,
0.0010528564453125,
0.05859375,
-0.03741455078125,
-0.0104522705078125,
0.036102294921875,
-0.0247344970703125,
-0.0621337890625,
-0.01409912109375,
-0.0285186767578125,
-0.0731201171875,
0.00940704345703125,
-0.0406494140625,
-0.0323486328125,
0.030303955078125,
-0.0194854736328125,
-0.0170135498046875,
-0.00968170166015625,
-0.030029296875,
-0.085205078125,
0.07122802734375,
0.0289306640625,
-0.01068878173828125,
0.012054443359375,
0.04827880859375,
-0.0177154541015625,
0.020965576171875,
-0.030487060546875,
-0.013336181640625,
0.0209503173828125,
-0.031280517578125,
0.034698486328125,
0.0345458984375,
-0.01409912109375,
-0.0271759033203125,
0.06292724609375,
-0.004077911376953125,
0.0015478134155273438,
0.0677490234375,
0.006946563720703125,
-0.0511474609375,
0.00323486328125,
0.00783538818359375,
-0.0165863037109375,
0.0347900390625,
0.033447265625,
-0.009796142578125,
-0.01568603515625,
0.0164794921875,
0.0199737548828125,
-0.021453857421875,
-0.0017681121826171875,
-0.005687713623046875,
0.0010471343994140625,
-0.04156494140625,
0.03387451171875,
0.004833221435546875,
-0.0273590087890625,
-0.00994110107421875,
0.054931640625,
0.039794921875,
0.0298919677734375,
-0.0050201416015625,
-0.0195159912109375,
-0.0137176513671875,
-0.02764892578125,
0.039093017578125,
-0.047821044921875,
-0.03662109375,
0.0242156982421875,
-0.048431396484375,
-0.022125244140625,
0.055328369140625,
0.0253143310546875,
-0.007083892822265625,
-0.017547607421875,
-0.0777587890625,
-0.0166778564453125,
-0.01421356201171875,
0.010040283203125,
-0.0029621124267578125,
-0.0272216796875,
-0.01953125,
-0.03375244140625,
-0.00388336181640625,
0.0214691162109375,
-0.01328277587890625,
0.0281219482421875,
-0.0261688232421875,
-0.0102386474609375,
-0.01947021484375,
-0.043304443359375,
0.027191162109375,
-0.0306243896484375,
0.0016660690307617188,
0.00740814208984375,
-0.06402587890625,
0.02783203125,
-0.00463104248046875,
0.0197906494140625,
-0.0240478515625,
0.00347137451171875,
0.0243682861328125,
-0.0325927734375,
-0.00408935546875,
0.054962158203125,
0.01081085205078125,
0.00299835205078125,
-0.0109405517578125,
0.07318115234375,
-0.004547119140625,
-0.052032470703125,
0.01535797119140625,
-0.031768798828125,
0.038299560546875,
0.059356689453125,
0.003322601318359375,
0.004856109619140625,
-0.01922607421875,
-0.0178070068359375,
0.02581787109375,
-0.0325927734375,
-0.01519012451171875,
-0.000835418701171875,
0.028778076171875,
-0.0411376953125,
-0.01186370849609375,
0.03265380859375,
0.022979736328125,
-0.03314208984375,
0.02825927734375,
-0.053192138671875,
0.0079193115234375,
-0.0208587646484375,
0.023834228515625,
-0.045196533203125,
0.048492431640625,
0.044036865234375,
0.01447296142578125,
-0.0215606689453125,
-0.0303802490234375,
0.01861572265625,
-0.0186309814453125,
-0.0010347366333007812,
-0.002716064453125,
0.0290679931640625,
-0.0316162109375,
0.05816650390625,
0.0107574462890625,
0.0200958251953125,
0.0214996337890625,
0.0092010498046875,
-0.0099334716796875,
0.0017480850219726562,
-0.00344085693359375,
0.02630615234375,
0.008544921875,
0.02960205078125,
0.003055572509765625,
0.044830322265625,
-0.0018548965454101562,
-0.0272064208984375,
0.02459716796875,
0.01422882080078125,
-0.048797607421875,
-0.007465362548828125,
0.048583984375,
-0.00576019287109375,
-0.0268402099609375,
-0.03662109375,
0.03509521484375,
0.0247650146484375,
-0.0159149169921875,
-0.00843048095703125,
0.04010009765625,
-0.01129913330078125,
0.02972412109375,
0.01505279541015625,
0.01410675048828125,
0.009033203125,
-0.061798095703125,
0.016357421875,
0.032745361328125,
-0.027069091796875,
0.0010061264038085938,
0.0313720703125,
-0.0214996337890625,
-0.002094268798828125,
-0.007541656494140625,
0.0021495819091796875,
-0.0177459716796875,
0.05865478515625,
-0.0362548828125,
0.054840087890625,
0.047027587890625,
-0.01108551025390625,
-0.0290374755859375,
0.011566162109375,
0.0240478515625,
0.005107879638671875,
-0.020416259765625,
-0.0226898193359375,
0.03656005859375,
-0.0040435791015625,
0.0027828216552734375,
0.00787353515625,
-0.010009765625,
-0.004146575927734375,
0.0478515625,
-0.083251953125,
-0.0221099853515625,
-0.002071380615234375,
-0.05853271484375,
-0.050994873046875,
0.02545166015625,
0.025054931640625,
-0.007465362548828125,
0.023529052734375,
0.0082244873046875,
-0.01163482666015625,
0.01554107666015625,
-0.00562286376953125,
-0.0340576171875,
0.0406494140625,
-0.08355712890625,
0.0655517578125,
-0.067626953125,
0.022216796875,
0.06256103515625,
0.00647735595703125,
-0.0012941360473632812,
0.004123687744140625,
0.0170440673828125,
0.0216217041015625,
0.0206756591796875,
0.00010651350021362305,
-0.004489898681640625,
-0.046142578125,
-0.0260467529296875,
0.038055419921875,
0.026947021484375,
0.01305389404296875,
0.0024509429931640625,
0.0033702850341796875,
0.039276123046875,
-0.037445068359375,
-0.042083740234375,
-0.029876708984375,
-0.050201416015625,
0.0662841796875,
0.023651123046875,
-0.0006747245788574219,
-0.048370361328125,
0.062225341796875,
0.0256195068359375,
0.00873565673828125,
-0.049102783203125,
-0.054473876953125,
-0.0750732421875,
-0.07684326171875,
-0.040557861328125,
-0.005458831787109375,
0.0028171539306640625,
0.00804901123046875,
-0.007282257080078125,
-0.006824493408203125,
-0.01385498046875,
0.0011396408081054688,
0.015869140625,
-0.006946563720703125,
-0.00998687744140625,
-0.0328369140625,
-0.002513885498046875,
0.0008654594421386719,
0.0030517578125,
0.0024852752685546875,
-0.0037326812744140625,
0.011505126953125,
-0.006439208984375,
0.0108642578125,
0.0260467529296875,
0.03179931640625,
-0.04400634765625,
-0.0216827392578125,
0.083251953125,
0.0116729736328125,
0.0032291412353515625,
0.00740814208984375,
0.0193634033203125,
-0.0128631591796875,
-0.04095458984375,
-0.0278472900390625,
-0.0013942718505859375,
-0.0382080078125,
0.02789306640625,
-0.0218353271484375,
-0.0251007080078125,
0.054901123046875,
-0.01800537109375,
0.0259246826171875,
-0.033599853515625,
-0.037567138671875,
-0.051055908203125,
-0.01236724853515625,
-0.040557861328125,
0.0179901123046875,
-0.03564453125,
-0.0204620361328125,
-0.0257415771484375,
0.0268707275390625,
0.00021374225616455078,
-0.067626953125,
0.017303466796875,
-0.07305908203125,
0.01515960693359375,
-0.0501708984375,
-0.011749267578125,
-0.0027408599853515625,
0.07940673828125,
-0.05804443359375,
-0.0010128021240234375,
0.0110015869140625,
0.0197601318359375,
-0.044921875,
-0.04046630859375,
-0.0823974609375,
0.016143798828125,
-0.025390625,
-0.0055084228515625,
-0.0008397102355957031,
0.0011281967163085938,
-0.065185546875,
0.093017578125,
-0.033966064453125,
0.00347900390625,
0.06640625,
-0.05194091796875,
-0.0089874267578125,
0.0020961761474609375,
-0.0113372802734375,
-0.038360595703125,
-0.05462646484375,
-0.007415771484375,
-0.075927734375,
-0.0221099853515625,
-0.02264404296875,
0.08563232421875,
0.01204681396484375,
-0.02069091796875,
-0.01091766357421875,
0.07342529296875,
-0.01763916015625,
0.046630859375,
-0.040985107421875,
-0.0029449462890625,
0.00885009765625,
-0.00403594970703125,
-0.01235198974609375,
-0.001880645751953125,
-0.01491546630859375,
-0.048309326171875,
-0.0240936279296875,
0.0187530517578125,
-0.0228424072265625,
0.020477294921875,
-0.03631591796875,
0.0049896240234375,
-0.06573486328125,
-0.02178955078125,
-0.0237884521484375,
-0.01165771484375,
-0.0111846923828125,
-0.0217437744140625,
-0.00884246826171875,
-0.05743408203125,
0.0242462158203125,
0.0255889892578125,
-0.0056915283203125,
0.021514892578125,
0.02655029296875,
-0.005695343017578125,
-0.02294921875,
-0.07672119140625,
-0.0134735107421875,
0.03851318359375,
0.0237884521484375,
0.0345458984375,
0.0285491943359375,
-0.035491943359375,
0.0625,
0.018646240234375,
-0.0064544677734375,
0.0184478759765625,
0.0242156982421875,
0.0038166046142578125,
-0.0206756591796875,
0.009918212890625,
0.02197265625,
-0.021209716796875,
0.00928497314453125,
-0.0147552490234375,
0.0367431640625,
-0.003261566162109375,
-0.0034694671630859375,
-0.0030670166015625,
-0.033172607421875,
-0.034393310546875,
-0.034149169921875,
0.01071929931640625,
-0.0023632049560546875,
-0.0268096923828125,
0.010589599609375,
-0.004924774169921875,
-0.01404571533203125,
-0.005863189697265625,
0.01132965087890625,
0.0213470458984375,
0.054534912109375,
0.00905609130859375,
0.03448486328125,
0.0024394989013671875,
-0.005443572998046875,
-0.037078857421875,
-0.0087890625,
0.0268402099609375,
0.003032684326171875,
-0.0694580078125,
0.017120361328125,
0.0013532638549804688,
0.0017538070678710938,
0.0294952392578125,
0.01427459716796875,
0.01038360595703125,
0.0031909942626953125,
0.008270263671875,
0.0038967132568359375,
0.036651611328125,
-0.01221466064453125,
-0.00962066650390625,
-0.04150390625,
0.0216217041015625,
-0.01190948486328125,
0.052490234375,
0.038787841796875,
-0.0301971435546875,
0.06304931640625,
-0.033935546875,
0.056549072265625,
0.04278564453125,
-0.00726318359375,
0.0143280029296875,
0.0345458984375,
-0.01047515869140625,
-0.033721923828125,
-0.0254058837890625,
0.0007905960083007812,
-0.005741119384765625,
0.0153350830078125,
0.02166748046875,
-0.035308837890625,
-0.01505279541015625,
0.013671875,
-0.03363037109375,
0.0136566162109375,
-0.016693115234375,
-0.00597381591796875,
-0.0016422271728515625,
0.0156097412109375,
0.01702880859375,
0.006198883056640625,
-0.0145721435546875,
-0.0247344970703125,
-0.0279083251953125,
-0.0704345703125,
0.020355224609375,
0.006359100341796875,
-0.0018367767333984375,
0.00966644287109375,
-0.0026874542236328125,
-0.0177764892578125,
-0.0171966552734375,
0.0020771026611328125,
-0.0504150390625,
-0.0163116455078125,
-0.01050567626953125,
-0.0036258697509765625,
0.01454925537109375,
-0.00731658935546875,
0.02313232421875,
-0.0162811279296875,
-0.01678466796875,
0.01059722900390625,
0.0023860931396484375,
0.06085205078125,
0.0166168212890625,
-0.0550537109375,
-0.005096435546875,
-0.05950927734375,
-0.024200439453125,
-0.045166015625,
-0.06549072265625,
-0.03692626953125,
-0.01251983642578125,
0.0305633544921875,
0.03411865234375,
0.0035552978515625,
-0.0273590087890625,
-0.00008696317672729492,
-0.0031681060791015625,
0.01030731201171875,
0.037109375,
-0.01006317138671875,
0.051849365234375,
0.01332855224609375,
0.0787353515625,
0.0000584721565246582,
0.01788330078125,
-0.00838470458984375,
-0.034942626953125,
-0.0178070068359375,
-0.06549072265625,
-0.0017948150634765625,
0.016845703125,
0.00933837890625,
0.051025390625,
0.005100250244140625,
0.0151824951171875,
-0.01120758056640625,
-0.00606536865234375,
0.0219879150390625,
-0.024200439453125,
0.0154571533203125,
-0.0262908935546875,
-0.03973388671875,
-0.0029163360595703125,
-0.0227813720703125,
0.0277099609375,
0.000004172325134277344,
0.01861572265625,
0.017608642578125,
-0.034942626953125,
0.024169921875,
0.022735595703125,
0.01123809814453125,
-0.0413818359375,
0.0008096694946289062,
-0.01058197021484375,
0.0452880859375,
0.0232391357421875,
0.04510498046875,
0.05828857421875,
-0.0501708984375,
0.004810333251953125,
0.04351806640625,
-0.0028095245361328125,
-0.037109375,
0.03521728515625,
0.01507568359375,
0.002574920654296875,
0.00859832763671875,
0.061126708984375,
0.07208251953125,
-0.07269287109375,
0.0025119781494140625,
0.02947998046875,
-0.040496826171875,
-0.03717041015625,
0.0226593017578125,
-0.0257568359375,
-0.04443359375,
0.0212860107421875,
-0.039642333984375,
0.009307861328125,
0.0206298828125,
-0.011627197265625,
-0.0124969482421875,
-0.0181884765625,
0.03179931640625,
0.05413818359375,
-0.033782958984375,
0.06219482421875,
0.0352783203125,
0.040618896484375,
-0.024200439453125,
-0.0294036865234375,
-0.0029449462890625,
-0.047332763671875,
-0.08795166015625,
-0.03955078125,
-0.0243072509765625,
-0.0008287429809570312,
0.03411865234375,
-0.005451202392578125,
0.01019287109375,
0.037628173828125,
-0.012298583984375,
0.00832366943359375,
-0.00946044921875,
0.01369476318359375,
-0.0013332366943359375,
-0.021148681640625,
0.01519775390625,
-0.01122283935546875,
-0.01439666748046875,
0.008453369140625,
-0.0253448486328125,
-0.0382080078125,
-0.022491455078125,
-0.0265960693359375,
0.10040283203125,
-0.01555633544921875,
-0.03106689453125,
0.016998291015625,
0.0164031982421875,
-0.0250396728515625,
0.004077911376953125,
-0.0246124267578125,
-0.048736572265625,
-0.054168701171875,
-0.0216827392578125,
-0.09619140625,
0.00580596923828125,
-0.0143585205078125,
-0.1015625,
0.052978515625,
0.04522705078125,
0.08538818359375,
-0.00457763671875,
-0.0141448974609375,
-0.01543426513671875,
-0.037139892578125,
-0.043060302734375,
0.040802001953125,
0.0106658935546875,
0.005184173583984375,
-0.032562255859375,
0.0139617919921875,
-0.0168304443359375,
0.006107330322265625,
0.041961669921875,
0.018585205078125,
-0.0009093284606933594,
0.004665374755859375,
0.02020263671875,
0.01152801513671875,
-0.0382080078125,
0.0217437744140625,
0.024383544921875,
0.025634765625,
0.062042236328125,
-0.0158843994140625,
0.045684814453125,
-0.010345458984375,
0.00720977783203125,
0.0181121826171875,
0.03033447265625,
0.0372314453125,
0.00147247314453125,
0.053314208984375,
-0.05950927734375,
0.00045299530029296875,
0.06927490234375,
-0.012664794921875,
0.00682830810546875,
0.01399993896484375,
0.044342041015625,
-0.03753662109375,
0.033416748046875,
-0.0291748046875,
0.047607421875,
0.022003173828125,
-0.001476287841796875,
0.020965576171875,
0.0064544677734375,
0.03314208984375,
0.013427734375,
-0.006191253662109375,
0.023468017578125,
0.0216064453125,
0.025543212890625,
0.02001953125,
-0.004154205322265625,
-0.022064208984375,
0.034942626953125,
0.040771484375,
0.031585693359375,
-0.04229736328125,
-0.0469970703125,
0.003322601318359375,
0.01091766357421875,
0.00605010986328125,
-0.0036163330078125,
0.00009363889694213867,
-0.0180206298828125,
0.036376953125,
-0.03448486328125,
0.02679443359375,
0.014312744140625,
-0.012115478515625,
0.0023212432861328125,
0.0205230712890625,
-0.0121307373046875,
0.03594970703125,
-0.06536865234375,
0.0302581787109375,
0.0059967041015625,
0.05718994140625,
0.0299835205078125,
0.03558349609375,
-0.0002791881561279297,
-0.0262451171875,
-0.00879669189453125,
0.00988006591796875,
0.0198974609375,
-0.00339508056640625,
-0.0546875,
-0.0394287109375,
0.04388427734375,
0.049041748046875,
0.011138916015625,
-0.030517578125,
0.0298004150390625,
0.072998046875,
-0.030242919921875,
-0.03350830078125,
0.037384033203125,
-0.0007114410400390625,
0.0243072509765625,
-0.039093017578125,
-0.0206451416015625,
-0.0236663818359375,
-0.026763916015625,
0.01486968994140625,
-0.0003695487976074219,
-0.0175933837890625,
0.00016605854034423828,
0.01404571533203125,
0.0081329345703125,
-0.00873565673828125,
0.0189208984375,
-0.008453369140625,
0.042083740234375,
0.01873779296875,
-0.07757568359375,
0.004016876220703125,
-0.038787841796875,
-0.09185791015625,
0.0352783203125,
0.0399169921875,
-0.0289306640625,
0.0107421875,
0.01532745361328125,
0.031402587890625,
-0.0184478759765625,
-0.050994873046875,
0.038116455078125,
-0.04510498046875,
-0.0138092041015625,
0.01003265380859375,
-0.050140380859375,
-0.02410888671875,
-0.00738525390625,
0.03826904296875,
0.0177459716796875,
0.0206146240234375,
0.02215576171875,
0.0445556640625,
-0.033782958984375,
0.039276123046875,
-0.05023193359375,
-0.0283966064453125,
0.027740478515625,
0.00719451904296875,
0.03179931640625,
-0.00021350383758544922,
-0.00452423095703125,
0.0015430450439453125,
0.0186767578125,
-0.0304718017578125,
0.0200958251953125,
-0.022308349609375,
0.0105743408203125,
-0.0213165283203125,
0.012725830078125,
-0.0269012451171875,
-0.006591796875,
-0.0265045166015625,
-0.0118408203125,
0.02606201171875,
-0.0098419189453125,
-0.0119781494140625,
-0.000457763671875,
0.0246734619140625,
-0.01873779296875,
0.027984619140625,
0.020233154296875,
0.0133514404296875,
0.038330078125,
0.022705078125,
0.009033203125,
0.03350830078125,
-0.0051727294921875,
0.00666046142578125,
0.03143310546875,
-0.00785064697265625,
0.04229736328125,
-0.003662109375,
0.01175689697265625,
-0.01641845703125,
0.02313232421875,
-0.03228759765625,
-0.019927978515625,
0.031585693359375,
-0.01556396484375,
-0.04010009765625,
0.0144195556640625,
0.0008511543273925781,
0.0031185150146484375,
-0.0362548828125,
-0.0133056640625,
0.0172576904296875,
-0.04742431640625,
0.023101806640625,
-0.042724609375,
0.00458526611328125,
-0.02423095703125,
0.045684814453125,
-0.046661376953125,
0.007686614990234375,
-0.0115203857421875,
-0.0232391357421875,
-0.038055419921875,
0.01134490966796875,
0.041290283203125,
-0.044219970703125,
-0.014678955078125,
-0.0333251953125,
-0.0175018310546875,
-0.046783447265625,
-0.0015535354614257812,
0.007213592529296875,
-0.001377105712890625,
-0.030792236328125,
0.0276336669921875,
0.006683349609375,
0.0401611328125,
0.02288818359375,
-0.01288604736328125,
-0.00014388561248779297,
0.0028896331787109375,
-0.04150390625,
-0.0396728515625,
0.0440673828125,
-0.055145263671875,
-0.042449951171875,
-0.0003306865692138672,
-0.0216827392578125,
-0.0156097412109375,
-0.03375244140625,
-0.0694580078125,
0.059844970703125,
-0.01250457763671875,
-0.0225372314453125,
-0.031219482421875,
-0.0209197998046875,
-0.0252685546875,
0.0189971923828125,
-0.011444091796875,
-0.0362548828125,
-0.0193939208984375,
0.031646728515625,
-0.0073699951171875,
0.054351806640625,
0.000021159648895263672,
0.01169586181640625,
-0.0191802978515625,
0.005382537841796875,
0.0117950439453125,
-0.005710601806640625,
0.060760498046875,
-0.022979736328125,
0.007457733154296875,
0.00927734375,
-0.06011962890625,
-0.04638671875,
-0.044219970703125,
0.01122283935546875,
-0.00830841064453125,
-0.00447845458984375,
-0.033660888671875,
-0.024383544921875,
0.048736572265625,
0.06048583984375,
0.00901031494140625,
-0.0224761962890625,
0.02728271484375,
-0.0159454345703125,
-0.054595947265625,
0.01363372802734375,
0.00872039794921875,
-0.02362060546875,
0.018890380859375,
-0.0011653900146484375,
-0.0250091552734375,
0.00124359130859375,
0.034576416015625,
-0.03271484375,
0.005435943603515625,
0.028900146484375,
0.0083770751953125,
-0.09832763671875,
-0.0165252685546875,
0.04901123046875,
-0.0186767578125,
0.02423095703125,
-0.000263214111328125,
0.0089569091796875,
0.049468994140625,
0.060211181640625,
-0.0164031982421875,
-0.0294189453125,
-0.035491943359375,
0.01363372802734375,
-0.01383209228515625,
-0.0137939453125,
-0.01483917236328125,
-0.0014734268188476562,
-0.0120697021484375,
0.0154876708984375,
0.0164794921875,
0.01287841796875,
0.00887298583984375,
0.006801605224609375,
0.0033016204833984375,
-0.00267791748046875,
-0.01131439208984375,
-0.0271453857421875,
-0.035919189453125,
0.0182342529296875,
-0.0196075439453125,
0.00992584228515625,
0.0011625289916992188,
0.00490570068359375,
-0.006183624267578125,
0.00450897216796875,
-0.0205078125,
-0.03521728515625,
-0.00662994384765625,
0.0262603759765625,
0.01177978515625,
0.0122833251953125
] |
1be6c7f887c4db6b691d15fc40b71175ac4d216e
|
Wordpress Stackexchange
Q: How to exclude/filter a tag from get_the_tag_list() Does anyone know how to exclude/filter a tag from the HTML string generated by get_the_tag_list()?
http://codex.wordpress.org/Function_Reference/get_the_tag_list
Any help much appreciated.
A: function mytheme_filter_tags( $term_links ) {
$result = array();
$exclude_tags = array( 'some tag', 'another tag', 'third tag' );
foreach ( $term_links as $link ) {
foreach ( $exclude_tags as $tag ) {
if ( stripos( $link, $tag ) !== false ) continue 2;
}
$result[] = $link;
}
return $result;
}
add_filter( "term_links-post_tag", 'mytheme_filter_tags', 100, 1 );
// do loop stuff
echo get_the_tag_list('<p>Tags: ',', ','</p>');
// end loop stuff
remove_filter( "term_links-post_tag", 'mytheme_filter_tags', 100 );
|
Q: How to exclude/filter a tag from get_the_tag_list() Does anyone know how to exclude/filter a tag from the HTML string generated by get_the_tag_list()?
http://codex.wordpress.org/Function_Reference/get_the_tag_list
Any help much appreciated.
A: function mytheme_filter_tags( $term_links ) {
$result = array();
$exclude_tags = array( 'some tag', 'another tag', 'third tag' );
foreach ( $term_links as $link ) {
foreach ( $exclude_tags as $tag ) {
if ( stripos( $link, $tag ) !== false ) continue 2;
}
$result[] = $link;
}
return $result;
}
add_filter( "term_links-post_tag", 'mytheme_filter_tags', 100, 1 );
// do loop stuff
echo get_the_tag_list('<p>Tags: ',', ','</p>');
// end loop stuff
remove_filter( "term_links-post_tag", 'mytheme_filter_tags', 100 );
A: This is a snippet from one of my blogs:
function get_filtered_tags($post_id) {
// the slugs to be INCLUDED in the term list:
$primary_tags = array( 'books', 'travel', ... );
$post_tags = wp_get_object_terms($post_id, 'post_tag');
if( ! empty( $post_tags ) ) {
if( ! is_wp_error( $post_tags )) {
$tag_end = __( ', ', 'twentytwelve' );
foreach ( $post_tags as $term ) {
$term_slug = $term->slug;
if ( in_array( $term_slug, $primary_tags) ) {
if ( isset( $tag_list ) ) {
$tag_list .= $tag_end;
}
$tag_list .= '<a href="' . get_term_link($term_slug, 'post_tag') .
'">' . $term->name . '</a>';
}
}
}
}
return $tag_list;
}
If you want to exclude $primary_tags do the following instead:
if ( ! in_array( $term_slug, $primary_tags) ) {
...
}
I.e. add a ! before in_array( ... ).
A: get_the_tag_list calls get_the_term_list which then calls get_the_terms that has a filter named get_the_terms so you can use that filter to exclude your tags:
//add filter
add_filter( 'get_the_terms', 'exclude_terms_48735', 10, 1 );
//function to do filtering
function exclude_terms_48735( $terms ) {
//list the unwanted terms ids
$blacklist_terms = array( 1,2,3);
// loop through the terms
foreach( $terms as $k => $term ) {
//only remove term if it's ID is in the array.
if(in_array( $term->term_id, $blacklist_terms, true ))
unset( $terms[$k] );
}
return $terms;
}
|
wordpress
|
{
"language": "en",
"length": 318,
"provenance": "stackexchange_00019.jsonl.gz:418987",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48735"
}
|
[
0.07452392578125,
0.00901031494140625,
0.0185546875,
-0.014312744140625,
0.055450439453125,
-0.038726806640625,
0.1143798828125,
-0.0254058837890625,
-0.00777435302734375,
0.0301361083984375,
-0.0138702392578125,
-0.005458831787109375,
-0.00640106201171875,
-0.00983428955078125,
-0.02001953125,
-0.042266845703125,
0.01268768310546875,
0.01332855224609375,
0.03607177734375,
-0.009796142578125,
0.0127105712890625,
-0.0194091796875,
0.040374755859375,
0.00522613525390625,
0.00734710693359375,
-0.024627685546875,
0.051727294921875,
-0.018951416015625,
0.017608642578125,
-0.01116180419921875,
0.0165557861328125,
-0.015350341796875,
0.039581298828125,
0.010406494140625,
-0.06463623046875,
-0.043426513671875,
-0.0245819091796875,
-0.00909423828125,
-0.0109710693359375,
-0.003238677978515625,
0.0311737060546875,
-0.0178985595703125,
-0.041046142578125,
-0.017791748046875,
-0.034027099609375,
0.003673553466796875,
0.0133209228515625,
-0.01971435546875,
-0.0239715576171875,
-0.0364990234375,
0.067138671875,
-0.02398681640625,
0.08465576171875,
-0.03411865234375,
-0.0186920166015625,
0.03509521484375,
-0.0164031982421875,
0.042327880859375,
0.03094482421875,
-0.00881195068359375,
-0.03314208984375,
0.0033931732177734375,
0.01168060302734375,
-0.0193634033203125,
-0.01415252685546875,
0.0165252685546875,
0.017181396484375,
0.0004036426544189453,
-0.0419921875,
-0.0196075439453125,
0.031524658203125,
-0.03790283203125,
0.00406646728515625,
-0.01482391357421875,
-0.032196044921875,
0.008697509765625,
0.01519775390625,
-0.01360321044921875,
0.0048675537109375,
-0.0202484130859375,
0.037567138671875,
-0.00360107421875,
-0.021270751953125,
0.01690673828125,
-0.023681640625,
0.0228424072265625,
-0.00506591796875,
-0.01345062255859375,
-0.024261474609375,
-0.00782012939453125,
-0.0266876220703125,
0.0230560302734375,
-0.040802001953125,
-0.006195068359375,
-0.0110931396484375,
-0.005695343017578125,
0.035552978515625,
0.02459716796875,
-0.0122222900390625,
-0.0128021240234375,
0.0345458984375,
-0.053955078125,
0.035247802734375,
-0.0301055908203125,
0.007537841796875,
0.049407958984375,
-0.016693115234375,
0.071533203125,
0.06146240234375,
0.02581787109375,
0.022674560546875,
-0.024078369140625,
-0.039703369140625,
-0.0200042724609375,
-0.035186767578125,
0.01061248779296875,
-0.044281005859375,
-0.05242919921875,
-0.0159454345703125,
-0.046478271484375,
0.000759124755859375,
0.0229034423828125,
-0.0265350341796875,
-0.0006594657897949219,
0.017425537109375,
0.006366729736328125,
0.0004775524139404297,
-0.004482269287109375,
-0.0097808837890625,
-0.01174163818359375,
-0.0247955322265625,
0.027923583984375,
0.0263671875,
0.0214691162109375,
-0.0012912750244140625,
-0.00616455078125,
-0.0020122528076171875,
-0.024383544921875,
-0.01114654541015625,
0.02008056640625,
-0.0209808349609375,
-0.03948974609375,
-0.004291534423828125,
-0.033203125,
0.0029010772705078125,
0.0186614990234375,
0.01221466064453125,
0.007312774658203125,
-0.0005626678466796875,
-0.0277862548828125,
0.01309967041015625,
-0.00664520263671875,
0.059600830078125,
-0.011962890625,
-0.01959228515625,
-0.057586669921875,
0.0018863677978515625,
-0.0460205078125,
0.0030841827392578125,
-0.050506591796875,
0.0193023681640625,
-0.01117706298828125,
-0.00582122802734375,
-0.004436492919921875,
-0.02789306640625,
0.0145721435546875,
-0.023712158203125,
-0.01058197021484375,
0.0198974609375,
0.004230499267578125,
0.001804351806640625,
-0.0014429092407226562,
0.044097900390625,
0.01629638671875,
-0.0015211105346679688,
0.0180511474609375,
0.01094818115234375,
0.021728515625,
0.006656646728515625,
0.0279388427734375,
-0.02679443359375,
-0.04327392578125,
0.0307464599609375,
-0.031036376953125,
-0.08563232421875,
0.0413818359375,
0.01519012451171875,
0.0787353515625,
0.01374053955078125,
0.01025390625,
0.06878662109375,
0.0264434814453125,
-0.017822265625,
0.01184844970703125,
0.002529144287109375,
-0.03985595703125,
-0.037353515625,
-0.034027099609375,
-0.01183319091796875,
0.0288238525390625,
0.0240936279296875,
-0.01084136962890625,
0.00914764404296875,
0.0024089813232421875,
-0.0496826171875,
0.00757598876953125,
-0.024139404296875,
0.021453857421875,
-0.0273590087890625,
0.0004031658172607422,
0.0218963623046875,
-0.03375244140625,
-0.037841796875,
0.0560302734375,
-0.00409698486328125,
-0.0065765380859375,
-0.0048370361328125,
-0.00907135009765625,
0.0211334228515625,
-0.025634765625,
0.053619384765625,
-0.005596160888671875,
0.0237579345703125,
0.0210723876953125,
0.0439453125,
-0.002838134765625,
-0.0182342529296875,
-0.0143585205078125,
-0.00919342041015625,
0.0125732421875,
-0.062042236328125,
0.053985595703125,
0.0460205078125,
0.08154296875,
-0.008209228515625,
-0.0065765380859375,
0.0196685791015625,
-0.03143310546875,
0.01352691650390625,
0.038055419921875,
0.04931640625,
0.031402587890625,
-0.02398681640625,
-0.04071044921875,
0.08343505859375,
-0.0677490234375,
-0.0104217529296875,
-0.0294647216796875,
0.0081787109375,
0.01873779296875,
0.0120849609375,
-0.006359100341796875,
0.0390625,
0.0135955810546875,
0.01788330078125,
0.0164337158203125,
0.0019521713256835938,
0.032196044921875,
-0.01092529296875,
-0.0275115966796875,
0.005023956298828125,
-0.01971435546875,
-0.01171875,
-0.0200958251953125,
0.043182373046875,
-0.0011739730834960938,
0.01123809814453125,
0.0142364501953125,
-0.03948974609375,
0.0006852149963378906,
0.0372314453125,
0.003993988037109375,
-0.00957489013671875,
0.03045654296875,
-0.00275421142578125,
-0.00470733642578125,
-0.03131103515625,
-0.0006623268127441406,
-0.006069183349609375,
-0.0023136138916015625,
0.01593017578125,
0.06353759765625,
0.057037353515625,
-0.0152435302734375,
-0.0311126708984375,
-0.04998779296875,
0.0247955322265625,
0.0157012939453125,
-0.0450439453125,
-0.01145172119140625,
0.00960540771484375,
0.03680419921875,
-0.005947113037109375,
-0.0174560546875,
0.005619049072265625,
0.01727294921875,
-0.00644683837890625,
-0.032623291015625,
0.046783447265625,
-0.034149169921875,
0.059844970703125,
0.070556640625,
0.004489898681640625,
0.00286865234375,
0.0204315185546875,
-0.0196685791015625,
0.004611968994140625,
-0.0081634521484375,
-0.01861572265625,
0.0181884765625,
-0.09832763671875,
0.0024700164794921875,
0.006259918212890625,
-0.0203399658203125,
-0.0005173683166503906,
-0.03973388671875,
-0.029144287109375,
-0.007343292236328125,
-0.08245849609375,
0.005466461181640625,
0.037628173828125,
-0.0450439453125,
-0.054962158203125,
-0.01898193359375,
-0.044830322265625,
0.0095367431640625,
-0.00276947021484375,
-0.0223236083984375,
-0.004550933837890625,
-0.031585693359375,
-0.067626953125,
-0.040069580078125,
-0.040924072265625,
0.07537841796875,
-0.0157623291015625,
0.006145477294921875,
0.021240234375,
0.07916259765625,
0.0278778076171875,
-0.05511474609375,
0.01473236083984375,
-0.0126190185546875,
-0.033966064453125,
0.038604736328125,
-0.025909423828125,
0.0142669677734375,
-0.002117156982421875,
0.0009136199951171875,
0.033203125,
0.01104736328125,
-0.0206298828125,
-0.0169525146484375,
-0.0035686492919921875,
0.0234375,
0.042938232421875,
-0.022003173828125,
-0.017303466796875,
0.03753662109375,
0.030120849609375,
-0.025115966796875,
0.00600433349609375,
-0.01116180419921875,
0.005840301513671875,
0.062255859375,
-0.0298919677734375,
-0.007442474365234375,
-0.005329132080078125,
0.057220458984375,
0.02423095703125,
0.0211334228515625,
0.0333251953125,
0.0021572113037109375,
0.010467529296875,
0.0022144317626953125,
-0.0017633438110351562,
-0.0266571044921875,
0.03802490234375,
-0.01454925537109375,
-0.0017337799072265625,
-0.0005788803100585938,
0.02447509765625,
-0.004070281982421875,
-0.01528167724609375,
-0.0499267578125,
0.007251739501953125,
0.05780029296875,
0.0295257568359375,
-0.0215301513671875,
0.0007863044738769531,
-0.044189453125,
-0.0038852691650390625,
0.045166015625,
-0.0132598876953125,
-0.0209197998046875,
-0.058563232421875,
0.0014123916625976562,
0.04150390625,
-0.0689697265625,
0.0252685546875,
-0.0204315185546875,
-0.1109619140625,
0.0258026123046875,
-0.01580810546875,
-0.0089874267578125,
-0.0005879402160644531,
-0.0157318115234375,
-0.03863525390625,
-0.042022705078125,
0.039703369140625,
-0.032745361328125,
-0.006923675537109375,
-0.0232086181640625,
0.01910400390625,
-0.06689453125,
-0.00751495361328125,
-0.004024505615234375,
0.01450347900390625,
0.0186920166015625,
-0.04412841796875,
-0.025665283203125,
0.025909423828125,
-0.0012054443359375,
-0.0007977485656738281,
-0.006267547607421875,
0.01485443115234375,
-0.001224517822265625,
0.0029449462890625,
-0.007579803466796875,
0.01407623291015625,
0.0213623046875,
0.01114654541015625,
-0.0103759765625,
-0.0215301513671875,
-0.00461578369140625,
-0.0312042236328125,
0.07470703125,
0.006099700927734375,
0.033721923828125,
0.008819580078125,
-0.0086669921875,
-0.06573486328125,
-0.0170440673828125,
-0.00910186767578125,
-0.050628662109375,
-0.00128936767578125,
-0.016632080078125,
0.0225830078125,
-0.04730224609375,
0.06781005859375,
0.04412841796875,
-0.01328277587890625,
-0.0138397216796875,
0.08148193359375,
0.01531219482421875,
-0.048980712890625,
-0.04254150390625,
0.029083251953125,
0.0491943359375,
-0.05194091796875,
0.057769775390625,
0.02093505859375,
-0.036590576171875,
0.1099853515625,
-0.0005941390991210938,
0.033966064453125,
-0.01287078857421875,
0.046478271484375,
0.01531982421875,
0.0135955810546875,
-0.00487518310546875,
0.03070068359375,
-0.01280975341796875,
-0.0126190185546875,
-0.00910186767578125,
-0.0242767333984375,
0.044189453125,
0.032562255859375,
0.015869140625,
-0.01398468017578125,
-0.035675048828125,
-0.0217132568359375,
0.004344940185546875,
0.04205322265625,
0.0087127685546875,
0.0294952392578125,
0.0029125213623046875,
-0.006591796875,
0.0196685791015625,
0.018798828125,
-0.055694580078125,
-0.01120758056640625,
-0.048065185546875,
0.038818359375,
-0.0587158203125,
-0.008544921875,
-0.0198211669921875,
0.0007233619689941406,
-0.0211181640625,
0.00904083251953125,
-0.033050537109375,
0.038848876953125,
0.0078887939453125,
0.0128936767578125,
0.0201568603515625,
0.000995635986328125,
0.035125732421875,
0.03436279296875,
0.00852203369140625,
0.01158905029296875,
-0.01200103759765625,
0.01099395751953125,
-0.0305328369140625,
-0.01323699951171875,
0.00054931640625,
-0.01461029052734375,
0.039306640625,
0.01313018798828125,
-0.007244110107421875,
0.03497314453125,
-0.027923583984375,
-0.002063751220703125,
-0.0159149169921875,
0.041717529296875,
0.01407623291015625,
-0.029510498046875,
0.0080413818359375,
0.01354217529296875,
0.034637451171875,
-0.0190582275390625,
-0.039520263671875,
0.0125885009765625,
0.007091522216796875,
-0.01727294921875,
0.0030384063720703125,
0.026947021484375,
0.01145172119140625,
-0.0095977783203125,
0.04058837890625,
-0.0111541748046875,
-0.035186767578125,
-0.044219970703125,
0.0027751922607421875,
0.040252685546875,
-0.00849151611328125,
-0.027374267578125,
0.060760498046875,
-0.00716400146484375,
0.0301666259765625,
0.031280517578125,
-0.03857421875,
0.00940704345703125,
0.03021240234375,
-0.0214691162109375,
-0.02435302734375,
0.009918212890625,
-0.07733154296875,
-0.0211029052734375,
-0.002010345458984375,
0.0174560546875,
0.01416015625,
0.0004496574401855469,
0.06707763671875,
-0.0164794921875,
-0.053192138671875,
-0.004638671875,
0.00992584228515625,
0.045440673828125,
0.03448486328125,
-0.046600341796875,
0.01788330078125,
-0.0579833984375,
-0.00890350341796875,
-0.054840087890625,
-0.045196533203125,
-0.047119140625,
0.0013875961303710938,
-0.002231597900390625,
0.005413055419921875,
-0.00205230712890625,
0.0099945068359375,
0.036285400390625,
0.01407623291015625,
-0.0209503173828125,
0.0104217529296875,
-0.01287078857421875,
0.03173828125,
0.0224761962890625,
0.0137786865234375,
0.015472412109375,
0.006694793701171875,
0.0046234130859375,
-0.0205078125,
-0.018768310546875,
-0.08197021484375,
-0.0063934326171875,
0.00969696044921875,
-0.033416748046875,
0.0435791015625,
0.01444244384765625,
0.0236968994140625,
-0.00907135009765625,
-0.011383056640625,
-0.00418853759765625,
-0.0247650146484375,
0.023956298828125,
0.00775909423828125,
-0.030059814453125,
0.0220794677734375,
-0.0103912353515625,
-0.002643585205078125,
-0.005550384521484375,
0.0260467529296875,
-0.0199737548828125,
-0.004901885986328125,
-0.0284423828125,
-0.0029048919677734375,
0.02093505859375,
0.0163421630859375,
0.01715087890625,
-0.018707275390625,
0.012969970703125,
0.010833740234375,
0.01019287109375,
-0.005096435546875,
0.00040912628173828125,
0.0242919921875,
0.00012314319610595703,
0.0484619140625,
0.004852294921875,
0.0193328857421875,
0.05792236328125,
-0.02154541015625,
-0.01629638671875,
0.01024627685546875,
0.003231048583984375,
-0.03778076171875,
-0.00478363037109375,
0.015533447265625,
0.0215911865234375,
-0.0384521484375,
0.0230865478515625,
-0.0207672119140625,
-0.033477783203125,
-0.0003745555877685547,
-0.03045654296875,
-0.006565093994140625,
0.0020580291748046875,
0.005329132080078125,
-0.014404296875,
0.01282501220703125,
0.06549072265625,
0.0108642578125,
-0.0195465087890625,
-0.034027099609375,
0.006069183349609375,
-0.02764892578125,
-0.0261077880859375,
0.01322174072265625,
-0.0200958251953125,
-0.02435302734375,
-0.0794677734375,
-0.01502227783203125,
0.0215301513671875,
-0.0239715576171875,
0.017669677734375,
-0.0298004150390625,
0.008148193359375,
0.016387939453125,
-0.006481170654296875,
-0.031524658203125,
0.004825592041015625,
-0.0633544921875,
-0.005611419677734375,
-0.008575439453125,
-0.00305938720703125,
0.0081939697265625,
-0.011383056640625,
0.00749969482421875,
-0.017181396484375,
-0.0208587646484375,
-0.00299072265625,
-0.031036376953125,
0.041046142578125,
0.033233642578125,
-0.050872802734375,
0.00795745849609375,
-0.00017464160919189453,
-0.0011529922485351562,
-0.038604736328125,
-0.00043201446533203125,
-0.031982421875,
-0.00397491455078125,
-0.03936767578125,
-0.037811279296875,
0.00803375244140625,
-0.06304931640625,
-0.0989990234375,
0.0877685546875,
0.0022430419921875,
0.0697021484375,
-0.0145263671875,
0.0237274169921875,
-0.01513671875,
-0.007137298583984375,
-0.046875,
0.058502197265625,
0.04180908203125,
0.052947998046875,
-0.0308990478515625,
-0.01421356201171875,
0.030426025390625,
0.02081298828125,
-0.0016880035400390625,
-0.0083465576171875,
0.0029296875,
-0.01522064208984375,
0.046142578125,
0.057373046875,
0.0281982421875,
-0.010711669921875,
0.0230865478515625,
0.039093017578125,
0.006622314453125,
-0.048828125,
0.032806396484375,
-0.09136962890625,
0.0157470703125,
0.0440673828125,
-0.01204681396484375,
-0.03375244140625,
0.0009064674377441406,
-0.025054931640625,
-0.003597259521484375,
-0.0086517333984375,
-0.0214691162109375,
-0.00714874267578125,
0.0121307373046875,
0.0247650146484375,
0.0268402099609375,
-0.08538818359375,
-0.040740966796875,
-0.0275726318359375,
0.0296630859375,
0.0021305084228515625,
0.049346923828125,
0.0291290283203125,
0.0115814208984375,
0.095703125,
-0.01161956787109375,
0.0309600830078125,
0.005168914794921875,
0.003070831298828125,
0.0199432373046875,
-0.01448822021484375,
-0.003551483154296875,
-0.08587646484375,
-0.0182647705078125,
0.040313720703125,
0.036529541015625,
-0.031219482421875,
-0.016082763671875,
0.0032100677490234375,
-0.003215789794921875,
0.00885009765625,
-0.018463134765625,
0.01493072509765625,
0.005107879638671875,
0.0213165283203125,
-0.0380859375,
-0.01203155517578125,
0.0291900634765625,
0.037017822265625,
-0.00753021240234375,
-0.0292205810546875,
-0.00681304931640625,
-0.0272979736328125,
-0.057891845703125,
0.00432586669921875,
0.0214385986328125,
0.04656982421875,
0.026031494140625,
0.01898193359375,
0.0178985595703125,
-0.02508544921875,
-0.0107574462890625,
0.040863037109375,
-0.0207061767578125,
0.01509857177734375,
-0.00991058349609375,
-0.032928466796875,
-0.0040740966796875,
0.00878143310546875,
-0.0040130615234375,
-0.0014629364013671875,
0.034820556640625,
0.041534423828125,
-0.0491943359375,
-0.0215301513671875,
0.038238525390625,
-0.025238037109375,
-0.035888671875,
-0.0210418701171875,
-0.01275634765625,
0.040069580078125,
-0.01174163818359375,
0.0361328125,
-0.017578125,
0.046783447265625,
-0.035430908203125,
0.0672607421875,
-0.0201568603515625,
-0.00020420551300048828,
-0.004619598388671875,
-0.021514892578125,
0.03448486328125,
-0.016326904296875,
-0.03155517578125,
0.013214111328125,
-0.02728271484375,
-0.0194091796875,
-0.01134490966796875,
0.0189361572265625,
-0.0289764404296875,
0.056121826171875,
0.0294647216796875,
-0.036529541015625,
0.00424957275390625,
0.032135009765625,
0.0181427001953125,
0.02752685546875,
-0.006053924560546875,
0.004787445068359375,
-0.031036376953125,
0.0010004043579101562,
0.003711700439453125,
0.00782012939453125,
0.034454345703125,
0.0280303955078125,
0.004398345947265625,
0.024932861328125,
0.004390716552734375,
0.07708740234375,
-0.060943603515625,
-0.0249786376953125,
0.044158935546875,
-0.0241851806640625,
0.0150299072265625,
0.002620697021484375,
-0.0259857177734375,
0.005176544189453125,
0.0467529296875,
-0.034423828125,
0.0181121826171875,
-0.0269317626953125,
0.0117645263671875,
-0.034210205078125,
0.06195068359375,
-0.005340576171875,
-0.0543212890625,
-0.07080078125,
-0.01331329345703125,
0.038818359375,
0.1024169921875,
0.0295257568359375,
0.017608642578125,
0.006587982177734375,
-0.0007085800170898438,
0.020294189453125,
-0.0166473388671875,
0.023284912109375,
0.035980224609375,
-0.0221099853515625,
-0.023773193359375,
0.0227813720703125,
-0.0088043212890625,
0.02447509765625,
0.005702972412109375,
0.051788330078125,
0.0230255126953125,
-0.02789306640625,
0.006137847900390625,
0.01270294189453125,
0.040374755859375,
-0.0232086181640625,
0.0318603515625,
0.0017271041870117188,
0.00644683837890625,
0.004985809326171875,
0.0130462646484375,
-0.0321044921875,
-0.01141357421875,
-0.0311126708984375,
-0.00925445556640625,
-0.01023101806640625,
-0.10284423828125,
-0.04913330078125,
-0.01099395751953125,
0.00812530517578125,
-0.0022335052490234375,
-0.022552490234375,
-0.00040984153747558594,
-0.0096435546875,
0.01328277587890625,
-0.022491455078125,
0.02825927734375,
-0.01253509521484375,
-0.00972747802734375,
-0.0526123046875,
-0.052398681640625,
-0.034515380859375,
0.070556640625,
-0.0303802490234375,
-0.002376556396484375,
0.035797119140625,
-0.01517486572265625,
-0.059173583984375,
0.0135040283203125,
-0.0011310577392578125,
0.050445556640625,
-0.045745849609375,
0.0067901611328125,
0.0157623291015625,
0.0008816719055175781,
-0.03643798828125,
-0.0771484375,
0.0180511474609375,
-0.067138671875,
-0.014617919921875,
0.03472900390625,
-0.026092529296875,
-0.00826263427734375,
-0.0394287109375,
-0.09967041015625,
0.052703857421875,
-0.00917816162109375,
-0.033294677734375,
0.00916290283203125,
0.01236724853515625,
-0.007801055908203125,
-0.0218658447265625,
0.00516510009765625,
-0.00868988037109375,
0.002948760986328125,
-0.0098419189453125,
0.011077880859375,
0.0364990234375,
-0.00295257568359375,
-0.00423431396484375,
-0.042510986328125,
0.0200958251953125,
0.0012922286987304688,
0.01214599609375,
-0.032257080078125,
0.0137176513671875,
0.00426483154296875,
0.0304718017578125,
-0.01300048828125,
0.022308349609375,
0.01488494873046875,
0.000385284423828125,
0.03765869140625,
-0.0164947509765625,
-0.072998046875,
-0.05914306640625,
0.0241546630859375,
0.0297088623046875,
0.026885986328125,
0.0169677734375,
-0.019439697265625,
-0.0001957416534423828,
-0.026824951171875,
-0.02008056640625,
0.041778564453125,
-0.09637451171875,
-0.031341552734375,
0.01360321044921875,
-0.0007266998291015625,
0.0252532958984375,
-0.0282135009765625,
-0.0309600830078125,
-0.0201568603515625,
-0.026947021484375,
0.02459716796875,
-0.083740234375,
0.0159454345703125,
0.003772735595703125,
-0.033416748046875,
-0.04461669921875,
-0.0242462158203125,
0.01018524169921875,
-0.0264892578125,
-0.045501708984375,
0.00977325439453125,
-0.0236358642578125,
0.04412841796875,
0.041961669921875,
0.03271484375,
0.0193939208984375,
0.0235748291015625,
-0.00751495361328125,
-0.042724609375,
-0.0121612548828125,
0.01580810546875,
-0.0106658935546875,
-0.022796630859375,
-0.0038471221923828125,
0.0273284912109375,
0.0198822021484375,
-0.0124359130859375,
0.07452392578125,
0.000025451183319091797,
0.01641845703125,
-0.01006317138671875,
0.0153350830078125,
0.0269012451171875,
-0.01102447509765625,
0.01128387451171875,
0.0042877197265625,
0.0259246826171875,
-0.02850341796875,
0.010467529296875,
-0.0389404296875,
0.0218963623046875,
0.0238800048828125
] |
f87930558909d06120c6852c3afe1bdadaf7d732
|
Wordpress Stackexchange
Q: How to get category and archive title? When I query the category (category.php), how do I get the title of the current category, ie., the one that is being queried?
And how do I get the title for tag and date (be it the day, the month or the year)?
A: In addition to the other answers, you can call: single_term_title('Currently browsing: ') to display 'Currenty browsing term' (where term is the name of the taxonomy term you are viewing. (See Codex)
This works for custom taxonomies as well category and tag terms.
Also, you might find it easier to use wp_title which handles taxonomies and archives, displaying the appropriate title depending on what you are viewing. It essentially switches through all the available functions for displaying titles so you might want to take a look at the source code. Others include:
*
*single_post_title() for posts
*get_the_date() for date based archives
*get_the_author() for author based archives
|
Q: How to get category and archive title? When I query the category (category.php), how do I get the title of the current category, ie., the one that is being queried?
And how do I get the title for tag and date (be it the day, the month or the year)?
A: In addition to the other answers, you can call: single_term_title('Currently browsing: ') to display 'Currenty browsing term' (where term is the name of the taxonomy term you are viewing. (See Codex)
This works for custom taxonomies as well category and tag terms.
Also, you might find it easier to use wp_title which handles taxonomies and archives, displaying the appropriate title depending on what you are viewing. It essentially switches through all the available functions for displaying titles so you might want to take a look at the source code. Others include:
*
*single_post_title() for posts
*get_the_date() for date based archives
*get_the_author() for author based archives
A: For category use single_cat_title function: http://codex.wordpress.org/Function_Reference/single_cat_title
For tag use single_tag_title function: http://codex.wordpress.org/Function_Reference/single_tag_title
For date use get_the_date function:
http://codex.wordpress.org/Function_Reference/get_the_date
For example if you open twentyten theme you will see following:
category.php:
<h1 class="page-title"><?php
printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?></h1>
date.php:
<h1 class="page-title">
<?php if ( is_day() ) : ?>
<?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyten' ) ) ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyten' ) ) ); ?>
<?php else : ?>
<?php _e( 'Blog Archives', 'twentyten' ); ?>
<?php endif; ?>
</h1>
A: Try the following
<?php single_cat_title(); ?>
<?php single_tag_title(); ?>
<?php the_time('F jS, Y'); ?> // day, month, year
<?php the_time('F, Y'); ?> // month, year
<?php the_time('Y'); ?> // year
See the Codex for more on formatting the date: HERE
PS. These are to be called within the loop. Except the first two which must be outside the loop.
A: Thank you for your replies! I made this for date:
for archive.php
<?php
/*get archives header*/
if ( is_day() ) { $this_header = "Daily archives for " . get_the_date(); }
else if ( is_month() ){ $this_header = "Monthly archives for " . get_the_date('F, Y'); }
else if ( is_year() ){ $this_header = "Yearly archives for " . get_the_date('Y'); }
else { $this_header = "Archives"; }
?>
then just
<?php echo $this_header; >
A: This is probably more than you need right now, but is probably something you will need on other areas of your theme.
This code gets the category name of the current post, then displays it as a link to the posts listed in the category via the category.php file.
<?php
$category = get_the_category();
$current_category = $category[0];
$parent_category = $current_category->category_parent;
if ( $parent_category != 0 ) {
echo '<a href="' . get_category_link($parent_category) . '">' . get_cat_name($parent_category) . '</a>';
}
echo '<a href="' . get_category_link($current_category) . '">' . $current_category->cat_name . '</a>';
?>
|
wordpress
|
{
"language": "en",
"length": 522,
"provenance": "stackexchange_00019.jsonl.gz:418995",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48767"
}
|
[
0.03680419921875,
-0.0068817138671875,
-0.05047607421875,
-0.0162811279296875,
0.01268768310546875,
-0.045257568359375,
0.03985595703125,
0.018341064453125,
0.026336669921875,
0.041534423828125,
-0.00003439188003540039,
-0.0247344970703125,
0.0124969482421875,
-0.020721435546875,
-0.054229736328125,
-0.0124053955078125,
0.05029296875,
-0.043426513671875,
0.032928466796875,
0.00943756103515625,
0.01409149169921875,
0.05023193359375,
0.03753662109375,
0.009979248046875,
0.0235443115234375,
-0.038604736328125,
0.0877685546875,
-0.024261474609375,
0.0341796875,
-0.0259857177734375,
0.0240478515625,
-0.0125885009765625,
0.0277557373046875,
-0.020263671875,
0.050750732421875,
0.0489501953125,
0.010528564453125,
-0.0069122314453125,
0.03271484375,
0.0220489501953125,
0.0357666015625,
-0.0261077880859375,
-0.006603240966796875,
0.007659912109375,
-0.0013151168823242188,
-0.04547119140625,
0.046630859375,
-0.0274200439453125,
-0.00791168212890625,
-0.0124359130859375,
0.0293426513671875,
0.017303466796875,
0.044830322265625,
-0.03076171875,
-0.0194549560546875,
-0.0018587112426757812,
0.0024566650390625,
-0.01434326171875,
0.04119873046875,
-0.054046630859375,
-0.06219482421875,
-0.03436279296875,
0.04937744140625,
-0.006450653076171875,
0.005939483642578125,
0.0076446533203125,
0.116943359375,
0.01299285888671875,
-0.0216827392578125,
-0.022552490234375,
0.01556396484375,
0.01435089111328125,
0.0168609619140625,
-0.006870269775390625,
-0.01324462890625,
-0.0219268798828125,
-0.0016565322875976562,
-0.02294921875,
0.016571044921875,
-0.009033203125,
0.04412841796875,
0.0016880035400390625,
-0.0458984375,
0.0222320556640625,
0.03704833984375,
0.0364990234375,
0.006000518798828125,
-0.03369140625,
-0.011322021484375,
-0.02679443359375,
-0.01039886474609375,
-0.0212249755859375,
-0.032867431640625,
0.01415252685546875,
-0.0009050369262695312,
-0.04412841796875,
0.01134490966796875,
0.0977783203125,
-0.051666259765625,
-0.004974365234375,
-0.04541015625,
0.01055145263671875,
-0.059600830078125,
-0.03216552734375,
0.006252288818359375,
0.005634307861328125,
0.0009207725524902344,
-0.01329803466796875,
0.0357666015625,
0.01934814453125,
-0.016448974609375,
0.0305023193359375,
-0.030303955078125,
-0.0167236328125,
-0.01041412353515625,
0.061859130859375,
-0.0187530517578125,
0.00994110107421875,
-0.00826263427734375,
0.04168701171875,
0.0023250579833984375,
0.0361328125,
0.02069091796875,
0.01126861572265625,
-0.0003476142883300781,
0.0278167724609375,
-0.0026454925537109375,
-0.0517578125,
0.0012159347534179688,
0.00971221923828125,
-0.0221099853515625,
0.007099151611328125,
-0.00959014892578125,
-0.0013713836669921875,
-0.013275146484375,
-0.00920867919921875,
0.017822265625,
-0.02825927734375,
0.0013303756713867188,
-0.010650634765625,
0.0053863525390625,
0.02203369140625,
0.044586181640625,
-0.033660888671875,
0.0034008026123046875,
-0.006015777587890625,
0.007259368896484375,
0.03460693359375,
0.004169464111328125,
-0.0146636962890625,
0.040252685546875,
-0.0150909423828125,
0.0234527587890625,
0.0151519775390625,
-0.068603515625,
-0.004344940185546875,
0.006008148193359375,
-0.01739501953125,
-0.017059326171875,
-0.059112548828125,
0.044586181640625,
0.0037078857421875,
-0.00302886962890625,
0.0164031982421875,
-0.006778717041015625,
-0.0102996826171875,
-0.048187255859375,
-0.0006814002990722656,
0.0050506591796875,
-0.033966064453125,
-0.0153961181640625,
0.0084228515625,
0.029083251953125,
-0.0207366943359375,
-0.021087646484375,
0.004852294921875,
-0.0673828125,
-0.02178955078125,
0.032989501953125,
0.026336669921875,
-0.01325225830078125,
-0.033966064453125,
-0.026947021484375,
0.00936126708984375,
-0.00757598876953125,
-0.0207061767578125,
0.0232696533203125,
-0.001399993896484375,
-0.006992340087890625,
0.0215606689453125,
0.01061248779296875,
0.03387451171875,
-0.087890625,
0.0127716064453125,
0.0205841064453125,
0.0443115234375,
-0.032379150390625,
0.013946533203125,
0.0034465789794921875,
-0.043609619140625,
-0.0052490234375,
0.01386260986328125,
-0.0128326416015625,
0.00829315185546875,
-0.03509521484375,
0.00553131103515625,
-0.006488800048828125,
0.035186767578125,
-0.00975799560546875,
0.0264892578125,
0.0030460357666015625,
-0.02349853515625,
0.0140838623046875,
-0.04205322265625,
-0.00124359130859375,
0.0067596435546875,
-0.0229339599609375,
-0.0281219482421875,
-0.031646728515625,
-0.01934814453125,
-0.004489898681640625,
0.0111846923828125,
-0.0136566162109375,
0.058624267578125,
0.0372314453125,
-0.012359619140625,
-0.01361083984375,
-0.0201568603515625,
0.036102294921875,
0.0467529296875,
-0.0662841796875,
-0.0299530029296875,
0.04254150390625,
0.05755615234375,
-0.0203094482421875,
-0.007709503173828125,
-0.01259613037109375,
-0.0307159423828125,
-0.0040435791015625,
0.04583740234375,
0.028106689453125,
0.01806640625,
0.0023040771484375,
0.00914764404296875,
0.0160369873046875,
-0.03271484375,
0.01849365234375,
-0.0203399658203125,
0.0145263671875,
0.03509521484375,
0.0211639404296875,
-0.01348114013671875,
0.0102691650390625,
0.0298309326171875,
0.0128936767578125,
0.01111602783203125,
0.006412506103515625,
-0.03643798828125,
0.0024547576904296875,
0.0186767578125,
0.0261993408203125,
-0.0149993896484375,
-0.0506591796875,
0.01560211181640625,
0.0225677490234375,
0.04473876953125,
0.030670166015625,
0.048553466796875,
-0.01983642578125,
0.0279083251953125,
-0.004314422607421875,
-0.0027408599853515625,
0.0131378173828125,
0.0281219482421875,
0.0033359527587890625,
-0.00027751922607421875,
-0.0203857421875,
-0.0224151611328125,
0.0275726318359375,
0.014404296875,
0.0072784423828125,
0.055450439453125,
0.01519775390625,
-0.01125335693359375,
-0.03717041015625,
-0.05218505859375,
0.0175323486328125,
0.024566650390625,
-0.013519287109375,
-0.006504058837890625,
0.0089569091796875,
0.0421142578125,
-0.01032257080078125,
0.029144287109375,
-0.0222015380859375,
0.00621795654296875,
0.012176513671875,
-0.018798828125,
0.0259246826171875,
-0.0166778564453125,
0.06494140625,
0.060028076171875,
-0.02880859375,
0.032684326171875,
0.0011501312255859375,
-0.035247802734375,
0.01995849609375,
-0.0316162109375,
-0.04498291015625,
0.0184326171875,
-0.087158203125,
0.0169677734375,
0.005107879638671875,
0.0290069580078125,
-0.0062713623046875,
-0.049560546875,
0.009307861328125,
-0.0014801025390625,
-0.08282470703125,
-0.081298828125,
-0.0013246536254882812,
-0.100341796875,
0.0234527587890625,
0.0021305084228515625,
-0.039398193359375,
-0.0265655517578125,
0.059722900390625,
0.0162811279296875,
0.05560302734375,
-0.0391845703125,
-0.05908203125,
-0.016693115234375,
-0.08050537109375,
-0.0185394287109375,
0.00426483154296875,
-0.00191497802734375,
-0.0126190185546875,
0.06622314453125,
-0.0016880035400390625,
-0.0772705078125,
-0.0262908935546875,
0.0146942138671875,
-0.00568389892578125,
0.006622314453125,
0.0172576904296875,
-0.0033054351806640625,
0.01326751708984375,
0.0248260498046875,
-0.031494140625,
0.0258026123046875,
-0.011383056640625,
-0.039886474609375,
0.01363372802734375,
0.0243682861328125,
0.02630615234375,
0.0024318695068359375,
-0.019287109375,
0.06658935546875,
0.0252685546875,
-0.0112762451171875,
-0.022430419921875,
-0.00554656982421875,
-0.038482666015625,
-0.00855255126953125,
0.0289459228515625,
-0.006046295166015625,
-0.0181121826171875,
-0.0022411346435546875,
-0.036346435546875,
-0.01446533203125,
-0.0037517547607421875,
-0.03289794921875,
0.033782958984375,
0.0006103515625,
-0.00936126708984375,
0.025146484375,
0.0091094970703125,
-0.033203125,
0.034881591796875,
0.0109100341796875,
0.0012149810791015625,
-0.00731658935546875,
0.0161285400390625,
0.0028057098388671875,
-0.056671142578125,
0.036346435546875,
-0.0478515625,
-0.0014905929565429688,
-0.03643798828125,
-0.0203704833984375,
0.0195770263671875,
0.08880615234375,
-0.04754638671875,
-0.01898193359375,
0.01444244384765625,
0.0133056640625,
-0.01314544677734375,
-0.0147857666015625,
-0.043731689453125,
-0.0236358642578125,
-0.1241455078125,
0.01263427734375,
-0.0211944580078125,
-0.0177154541015625,
-0.0308074951171875,
0.0289764404296875,
-0.06512451171875,
-0.047149658203125,
0.035797119140625,
-0.0173492431640625,
0.0110015869140625,
-0.00388336181640625,
-0.0294952392578125,
0.010467529296875,
-0.0439453125,
-0.0203857421875,
-0.057037353515625,
-0.01308441162109375,
0.0006122589111328125,
0.03973388671875,
-0.0212554931640625,
0.01222991943359375,
-0.0186920166015625,
0.047760009765625,
0.005054473876953125,
0.0242462158203125,
0.0172882080078125,
-0.00829315185546875,
0.035888671875,
0.0157623291015625,
0.00478363037109375,
-0.01110076904296875,
-0.0013790130615234375,
-0.036468505859375,
-0.024688720703125,
-0.01617431640625,
-0.04827880859375,
-0.01372528076171875,
-0.037261962890625,
-0.0086669921875,
-0.0665283203125,
-0.030487060546875,
0.025970458984375,
0.010162353515625,
-0.01227569580078125,
0.0282135009765625,
-0.0008406639099121094,
-0.052520751953125,
0.06451416015625,
0.035888671875,
-0.0274658203125,
-0.00684356689453125,
0.0601806640625,
0.00399017333984375,
-0.049896240234375,
-0.055908203125,
0.03955078125,
0.053802490234375,
-0.048431396484375,
0.054656982421875,
0.004993438720703125,
-0.053680419921875,
0.114013671875,
-0.0120697021484375,
0.008880615234375,
-0.0003533363342285156,
0.0248565673828125,
-0.0084075927734375,
-0.037200927734375,
0.01520538330078125,
-0.01513671875,
0.02117919921875,
-0.017364501953125,
-0.0189056396484375,
-0.002292633056640625,
0.0014352798461914062,
0.019561767578125,
-0.01062774658203125,
0.03533935546875,
-0.002979278564453125,
-0.0256500244140625,
-0.0033130645751953125,
0.025848388671875,
0.0135498046875,
0.051910400390625,
-0.0196075439453125,
0.0006670951843261719,
0.0006461143493652344,
-0.00371551513671875,
-0.06182861328125,
-0.031982421875,
-0.0301666259765625,
0.022796630859375,
-0.06561279296875,
-0.0137176513671875,
-0.0139923095703125,
0.004627227783203125,
-0.0019102096557617188,
-0.025360107421875,
-0.053619384765625,
-0.004730224609375,
-0.0035800933837890625,
0.017913818359375,
0.05841064453125,
-0.030364990234375,
0.0207061767578125,
0.049163818359375,
0.003681182861328125,
0.017730712890625,
-0.058319091796875,
0.02447509765625,
-0.01959228515625,
0.010162353515625,
0.017730712890625,
-0.00989532470703125,
0.02813720703125,
0.06732177734375,
-0.00035572052001953125,
0.04815673828125,
-0.035400390625,
-0.01331329345703125,
0.0034542083740234375,
0.048248291015625,
0.029266357421875,
-0.06781005859375,
-0.0005054473876953125,
0.03155517578125,
0.022613525390625,
-0.0163116455078125,
-0.00008696317672729492,
0.01192474365234375,
0.0011749267578125,
-0.027679443359375,
-0.0196380615234375,
0.03692626953125,
-0.0099029541015625,
-0.03863525390625,
0.0264892578125,
0.0093841552734375,
-0.00855255126953125,
-0.059478759765625,
-0.02313232421875,
0.039306640625,
0.040435791015625,
-0.047882080078125,
0.035980224609375,
-0.06732177734375,
0.05743408203125,
0.0137481689453125,
0.0159149169921875,
0.0203094482421875,
-0.0020732879638671875,
-0.030059814453125,
-0.0426025390625,
0.0067291259765625,
0.0011453628540039062,
0.036407470703125,
-0.04608154296875,
-0.048614501953125,
0.047210693359375,
-0.003997802734375,
0.04449462890625,
-0.04205322265625,
-0.01433563232421875,
0.004528045654296875,
-0.01430511474609375,
0.0811767578125,
0.037841796875,
-0.0670166015625,
0.0031185150146484375,
-0.059783935546875,
-0.0007486343383789062,
-0.011871337890625,
-0.06182861328125,
-0.0301361083984375,
-0.0251007080078125,
0.021697998046875,
0.0084228515625,
0.03033447265625,
-0.0021648406982421875,
-0.0234527587890625,
0.0333251953125,
0.03515625,
0.044342041015625,
-0.006237030029296875,
0.049560546875,
0.03131103515625,
0.03790283203125,
0.0028324127197265625,
0.0027866363525390625,
-0.04229736328125,
-0.0126495361328125,
-0.0024356842041015625,
-0.0650634765625,
-0.026519775390625,
0.0166778564453125,
-0.03363037109375,
0.00817108154296875,
-0.00507354736328125,
0.0048828125,
-0.0230560302734375,
0.005168914794921875,
0.0038967132568359375,
-0.0030040740966796875,
-0.004596710205078125,
0.031158447265625,
-0.043426513671875,
0.0174560546875,
-0.043914794921875,
0.03350830078125,
-0.00005990266799926758,
0.005298614501953125,
0.040557861328125,
-0.0667724609375,
0.034454345703125,
0.07696533203125,
-0.0098724365234375,
0.038848876953125,
0.04742431640625,
-0.007663726806640625,
0.02685546875,
0.017547607421875,
0.01617431640625,
-0.0009012222290039062,
-0.007419586181640625,
-0.00289154052734375,
-0.0088348388671875,
0.042022705078125,
0.00006538629531860352,
0.0052032470703125,
0.036407470703125,
-0.019775390625,
-0.0223236083984375,
-0.0128021240234375,
0.011016845703125,
0.0010137557983398438,
0.0004425048828125,
0.0240478515625,
-0.0180816650390625,
-0.03802490234375,
0.036834716796875,
-0.022491455078125,
-0.04168701171875,
0.029632568359375,
-0.01580810546875,
0.004535675048828125,
0.030914306640625,
0.021575927734375,
0.01141357421875,
0.0000502467155456543,
0.056732177734375,
-0.006229400634765625,
-0.060699462890625,
-0.05804443359375,
0.0240478515625,
-0.0249786376953125,
-0.03704833984375,
-0.006359100341796875,
0.0143280029296875,
-0.003376007080078125,
-0.047576904296875,
0.054901123046875,
-0.00799560546875,
0.0228424072265625,
-0.005809783935546875,
0.0083770751953125,
0.006046295166015625,
0.03619384765625,
-0.0286407470703125,
0.0259246826171875,
0.01120758056640625,
-0.039459228515625,
-0.04058837890625,
0.0049285888671875,
0.020843505859375,
0.00978851318359375,
-0.0216522216796875,
0.01328277587890625,
-0.050323486328125,
-0.0012569427490234375,
-0.0247802734375,
-0.05419921875,
0.0347900390625,
-0.004238128662109375,
-0.0135955810546875,
0.01549530029296875,
0.0142364501953125,
0.006072998046875,
0.0061798095703125,
0.037261962890625,
-0.0265045166015625,
0.019683837890625,
0.021453857421875,
0.0145721435546875,
0.0047454833984375,
0.018280029296875,
-0.052398681640625,
0.006618499755859375,
-0.006252288818359375,
0.01116943359375,
-0.00038433074951171875,
-0.004634857177734375,
0.003513336181640625,
-0.0247344970703125,
-0.025115966796875,
0.03460693359375,
-0.0010280609130859375,
0.0010528564453125,
-0.031402587890625,
0.004802703857421875,
-0.0007600784301757812,
0.01013946533203125,
0.03582763671875,
0.007617950439453125,
-0.01375579833984375,
-0.0230560302734375,
0.022430419921875,
0.05316162109375,
-0.004180908203125,
0.020751953125,
0.02154541015625,
-0.0015039443969726562,
0.029083251953125,
0.0248870849609375,
0.045989990234375,
0.007465362548828125,
-0.02587890625,
0.061248779296875,
0.039398193359375,
0.04266357421875,
0.00423431396484375,
0.01161956787109375,
-0.024566650390625,
0.00225830078125,
0.031036376953125,
-0.007732391357421875,
-0.000698089599609375,
0.059783935546875,
0.060028076171875,
-0.05474853515625,
0.0169525146484375,
-0.040374755859375,
0.065673828125,
0.0067291259765625,
0.015655517578125,
0.045867919921875,
0.0161285400390625,
0.0199737548828125,
-0.007610321044921875,
0.020538330078125,
-0.01422119140625,
0.006961822509765625,
0.051422119140625,
0.005214691162109375,
0.01227569580078125,
-0.043243408203125,
-0.02069091796875,
0.05865478515625,
0.08984375,
-0.0272674560546875,
-0.0281982421875,
0.0305633544921875,
-0.0024566650390625,
-0.0280609130859375,
0.015594482421875,
-0.0233001708984375,
0.037841796875,
0.08062744140625,
-0.00806427001953125,
-0.00848388671875,
0.03338623046875,
0.03662109375,
0.0287322998046875,
0.0285491943359375,
-0.054290771484375,
-0.0369873046875,
-0.037506103515625,
0.018463134765625,
0.004913330078125,
0.041656494140625,
0.0059967041015625,
0.05694580078125,
-0.04144287109375,
-0.01450347900390625,
0.0007772445678710938,
0.05047607421875,
0.0017824172973632812,
-0.0271759033203125,
-0.006778717041015625,
-0.045074462890625,
-0.019073486328125,
0.0190887451171875,
0.046844482421875,
-0.004276275634765625,
0.039031982421875,
0.0198974609375,
-0.024200439453125,
-0.00186920166015625,
0.006000518798828125,
-0.0084686279296875,
-0.006626129150390625,
-0.043182373046875,
0.044769287109375,
0.037078857421875,
0.013397216796875,
0.00461578369140625,
0.0192108154296875,
0.05267333984375,
-0.0677490234375,
0.0139617919921875,
-0.01448822021484375,
-0.02496337890625,
0.0372314453125,
-0.047576904296875,
0.00817108154296875,
-0.04583740234375,
-0.07818603515625,
-0.01427459716796875,
-0.041778564453125,
-0.0148162841796875,
0.032012939453125,
0.0335693359375,
-0.02081298828125,
0.0129241943359375,
-0.018463134765625,
-0.0193023681640625,
0.005374908447265625,
-0.00420379638671875,
0.004009246826171875,
0.048858642578125,
0.005126953125,
0.0257415771484375,
-0.0206146240234375,
0.0016317367553710938,
0.0006976127624511719,
0.02056884765625,
0.022705078125,
-0.0296783447265625,
0.03472900390625,
0.03753662109375,
-0.0260467529296875,
0.05023193359375,
-0.10491943359375,
-0.043792724609375,
0.060272216796875,
-0.045501708984375,
-0.0126800537109375,
0.01531219482421875,
-0.033599853515625,
0.0226898193359375,
0.047821044921875,
-0.02947998046875,
0.0233154296875,
-0.0024509429931640625,
0.010833740234375,
-0.042755126953125,
0.0311431884765625,
-0.02099609375,
0.005489349365234375,
0.00434112548828125,
-0.029083251953125,
0.03057861328125,
0.018402099609375,
0.020599365234375,
-0.005146026611328125,
0.03070068359375,
-0.0042877197265625,
-0.00458526611328125,
0.03192138671875,
0.0137176513671875,
0.039947509765625,
-0.0234832763671875,
0.003589630126953125,
0.0006189346313476562,
-0.01242828369140625,
0.0169830322265625,
0.01422882080078125,
0.005954742431640625,
0.005916595458984375,
0.02679443359375,
0.0304412841796875,
-0.047454833984375,
0.038299560546875,
0.00350189208984375,
0.003078460693359375,
-0.037750244140625,
0.035125732421875,
-0.0189056396484375,
-0.05267333984375,
-0.0225067138671875,
-0.02972412109375,
-0.01142120361328125,
0.01338958740234375,
-0.01251220703125,
-0.050537109375,
-0.0458984375,
-0.02935791015625,
0.007221221923828125,
-0.0171051025390625,
0.026214599609375,
0.01131439208984375,
-0.0413818359375,
-0.044677734375,
-0.003627777099609375,
-0.048553466796875,
0.004726409912109375,
0.0017919540405273438,
-0.041412353515625,
0.0049896240234375,
-0.07049560546875,
-0.039947509765625,
-0.050811767578125,
0.0018358230590820312,
0.010498046875,
-0.017303466796875,
-0.030029296875,
0.0024623870849609375,
-0.0005083084106445312,
0.045501708984375,
0.0170745849609375,
0.007781982421875,
0.0131072998046875,
0.018096923828125,
-0.055908203125,
-0.034698486328125,
0.039703369140625,
0.004268646240234375,
-0.03692626953125,
0.004581451416015625,
-0.033599853515625,
-0.017303466796875,
-0.03399658203125,
-0.03936767578125,
0.0286712646484375,
0.004669189453125,
-0.0360107421875,
-0.016448974609375,
0.04180908203125,
-0.00145721435546875,
-0.0208740234375,
-0.0013666152954101562,
-0.0096893310546875,
0.025848388671875,
0.000016510486602783203,
0.0341796875,
0.03155517578125,
0.0103607177734375,
0.01373291015625,
-0.06488037109375,
0.00934600830078125,
-0.0175018310546875,
0.0257720947265625,
0.01678466796875,
-0.00406646728515625,
0.005680084228515625,
0.018463134765625,
-0.0618896484375,
0.000037729740142822266,
-0.02020263671875,
0.058502197265625,
0.0011358261108398438,
-0.0194091796875,
-0.0372314453125,
-0.0406494140625,
0.0181732177734375,
0.0295257568359375,
0.0027618408203125,
-0.003414154052734375,
-0.041015625,
-0.022857666015625,
-0.0209808349609375,
0.00951385498046875,
0.0167236328125,
-0.04132080078125,
0.0190277099609375,
0.0097198486328125,
-0.0201416015625,
-0.0206298828125,
0.00909423828125,
-0.05633544921875,
0.0035610198974609375,
-0.024139404296875,
-0.004909515380859375,
-0.0428466796875,
0.00568389892578125,
0.0223236083984375,
-0.043975830078125,
-0.0693359375,
0.00934600830078125,
0.006870269775390625,
-0.045684814453125,
-0.04052734375,
-0.01290130615234375,
0.0223236083984375,
-0.00579833984375,
-0.0280609130859375,
0.030120849609375,
-0.00035309791564941406,
0.05718994140625,
0.00860595703125,
0.0135345458984375,
0.00611114501953125,
-0.0023212432861328125,
-0.01142120361328125,
-0.005825042724609375,
0.02178955078125,
-0.0188446044921875,
0.05401611328125,
0.0184173583984375,
0.0029773712158203125,
-0.013397216796875,
0.055328369140625,
-0.030792236328125,
-0.03448486328125,
-0.0236053466796875,
-0.0396728515625,
0.008514404296875,
-0.007236480712890625,
0.0286865234375,
-0.034515380859375,
0.0258331298828125,
-0.04046630859375,
0.0019378662109375,
0.0295257568359375
] |
e1e3702aa3ada81461641bc4e542ab21ecee1ed0
|
Wordpress Stackexchange
Q: Change the name of the 'Default Template' I am working on a client's site and they need to select a Template whenever they are adding a new page; the "Default Template" is not a valid choice.
I would like to rename "Default Template" to something like "-- Select Template --".
Searching the WordPress codebase I found references to "Default Template" are hard-coded, in wp-admin/includes/meta-boxes.php (line 588) and wp-admin/includes/class-wp-posts-list-table.php (line 882). Does this mean there is currently no way to change this, without altering the core code (something I want to avoid)?
A: There is a filter for this since version 4.1; cf. https://github.com/WordPress/WordPress/commit/7cdbac53e8497b346d1009375d36586fb6e5197c
You can now use:
add_filter('default_page_template_title', function() {
return __('My default template name', 'your_text_domain');
});
|
Q: Change the name of the 'Default Template' I am working on a client's site and they need to select a Template whenever they are adding a new page; the "Default Template" is not a valid choice.
I would like to rename "Default Template" to something like "-- Select Template --".
Searching the WordPress codebase I found references to "Default Template" are hard-coded, in wp-admin/includes/meta-boxes.php (line 588) and wp-admin/includes/class-wp-posts-list-table.php (line 882). Does this mean there is currently no way to change this, without altering the core code (something I want to avoid)?
A: There is a filter for this since version 4.1; cf. https://github.com/WordPress/WordPress/commit/7cdbac53e8497b346d1009375d36586fb6e5197c
You can now use:
add_filter('default_page_template_title', function() {
return __('My default template name', 'your_text_domain');
});
A: I agree with the answer that is given by @TravisPflanz but if you only want to change the name that is provided by the WordPress core you can use the following filter.
function yourprefix_filter_gettext( $translation, $text, $domain ) {
if ( $text == 'Default Template' ) {
return __( 'Detail Page', 'your-theme-or-plugin-textdomain' );
}
return $translation;
}
add_filter( 'gettext', 'yourprefix_filter_gettext', 10, 3 );
This replaces the default core translation with one of your own.
Please rename yourprefix and your-theme-or-plugin-textdomain to your configuration
A: Your request, if I'm not mistaken, is to create an empty selection as the default for the page template drop-down, then force a user to select a custom page template.
This may be an over-simplified answer, but you should create a default template that is a valid choice, then offer other templates to supplement the "Default Template". Just make default the most basic possible page layout. This will eliminate confusion for the user as well. Just determine which will be the most common page layout and make it the "Default".
As Chip points out below, the "Default Template" always exists, even if you simply try to change the name using the traditional template naming methods. If you change the template name of page.php, you will simply be given the options of "Default Template" and the "New & Cool Page Template".
A: I hit problems with using a new page.php in the child theme to define a different default template, so instead I using an
add_action( 'after_setup_theme'...
to setup a global option using
update_option ('default_template','page-content.php');
I then used
function replace_page_attributes_metaboxes() {
add_meta_box('post-parent', 'Page attributes', 'attributes_meta_box',
'page', 'side', 'high');
remove_meta_box('pageparentdiv', 'page', 'side');
}
add_action( 'admin_menu' , 'replace_page_attributes_metaboxes' );
to delete the standard Page Attributes metabox that is used to define the Page Template and replace it with a copy of the code (see http://wpseek.com/page_attributes_meta_box/). I replaced the section of the code that finds the page template name with:
if ( ($post->post_type == 'page') && (count( get_page_templates() ) != 0) ) {
if (!empty($post->page_template))
$template = $post->page_template;
else
$template = get_option ('default_template');
}
if no option is found $template is set to false, which makes the underlying code pick up the standard default template.
|
wordpress
|
{
"language": "en",
"length": 483,
"provenance": "stackexchange_00019.jsonl.gz:418997",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48772"
}
|
[
-0.0268096923828125,
-0.02154541015625,
0.0192108154296875,
0.0384521484375,
-0.02679443359375,
-0.004947662353515625,
0.0345458984375,
-0.0479736328125,
-0.0078277587890625,
0.01560211181640625,
0.008544921875,
-0.007457733154296875,
-0.017059326171875,
-0.01953125,
-0.0128021240234375,
-0.056365966796875,
0.03399658203125,
-0.01629638671875,
0.0144805908203125,
-0.027130126953125,
0.04595947265625,
-0.00263214111328125,
0.0184173583984375,
0.09405517578125,
-0.00791168212890625,
-0.020477294921875,
0.092529296875,
-0.0271148681640625,
0.006107330322265625,
-0.0208282470703125,
0.0160980224609375,
0.027130126953125,
0.0027065277099609375,
0.0089569091796875,
-0.00827789306640625,
0.01416778564453125,
0.0009717941284179688,
0.01110076904296875,
0.002574920654296875,
0.030059814453125,
0.006866455078125,
-0.0011949539184570312,
-0.0263824462890625,
-0.01230621337890625,
-0.0321044921875,
-0.0115203857421875,
-0.00701904296875,
-0.01263427734375,
0.0282440185546875,
-0.00283050537109375,
-0.0015411376953125,
0.0032215118408203125,
0.0100555419921875,
-0.0391845703125,
-0.0160369873046875,
-0.017059326171875,
-0.00788116455078125,
0.019317626953125,
0.032318115234375,
0.014556884765625,
-0.01371002197265625,
-0.0007152557373046875,
0.0002503395080566406,
-0.03265380859375,
0.01389312744140625,
-0.007747650146484375,
-0.002864837646484375,
0.042205810546875,
0.0086822509765625,
0.0299224853515625,
0.0100555419921875,
-0.0134735107421875,
0.0147247314453125,
-0.06036376953125,
0.01528167724609375,
0.0280609130859375,
-0.0213775634765625,
0.0047454833984375,
0.0261993408203125,
-0.02020263671875,
0.047515869140625,
-0.0250091552734375,
0.01412200927734375,
-0.0360107421875,
0.047576904296875,
-0.005023956298828125,
0.009979248046875,
-0.0184478759765625,
-0.023895263671875,
0.0014162063598632812,
-0.01395416259765625,
-0.0207366943359375,
0.01218414306640625,
-0.005992889404296875,
-0.033905029296875,
0.001476287841796875,
-0.002552032470703125,
0.049163818359375,
-0.01404571533203125,
0.011016845703125,
-0.034271240234375,
-0.0118865966796875,
-0.00726318359375,
-0.0255889892578125,
-0.01174163818359375,
0.045013427734375,
0.0200347900390625,
0.042510986328125,
0.01129150390625,
0.02484130859375,
-0.00618743896484375,
-0.0231781005859375,
-0.00939178466796875,
0.0163726806640625,
-0.06646728515625,
0.0004935264587402344,
-0.032379150390625,
-0.0196380615234375,
-0.01235198974609375,
0.01312255859375,
0.007740020751953125,
0.00975799560546875,
0.032623291015625,
-0.041473388671875,
-0.00011730194091796875,
-0.0165557861328125,
-0.046539306640625,
-0.036956787109375,
-0.043914794921875,
-0.018646240234375,
-0.0162353515625,
0.01428985595703125,
0.056365966796875,
0.0772705078125,
0.022674560546875,
-0.0034580230712890625,
-0.0003085136413574219,
0.0186004638671875,
0.0082244873046875,
-0.01412200927734375,
0.0280303955078125,
-0.02105712890625,
-0.00769805908203125,
0.0200042724609375,
0.0274658203125,
0.025909423828125,
0.0200347900390625,
0.0175628662109375,
-0.0014982223510742188,
-0.0147552490234375,
0.006336212158203125,
-0.01329803466796875,
0.037567138671875,
-0.00004410743713378906,
0.006801605224609375,
-0.05352783203125,
0.0092926025390625,
-0.041015625,
0.000377655029296875,
-0.039306640625,
0.0026912689208984375,
-0.024017333984375,
-0.0188140869140625,
-0.01129913330078125,
-0.042755126953125,
0.0489501953125,
0.0086212158203125,
0.00015115737915039062,
0.0120086669921875,
-0.0256500244140625,
-0.0044403076171875,
-0.011505126953125,
0.020599365234375,
-0.005828857421875,
-0.0029773712158203125,
0.03277587890625,
0.01241302490234375,
0.0105133056640625,
-0.01318359375,
0.0289764404296875,
0.005462646484375,
-0.036346435546875,
-0.0113067626953125,
0.008148193359375,
-0.06109619140625,
-0.00011020898818969727,
0.004001617431640625,
0.039276123046875,
0.0146026611328125,
0.005435943603515625,
0.058563232421875,
0.00458526611328125,
-0.057159423828125,
0.0312042236328125,
-0.0003657341003417969,
-0.0076751708984375,
-0.034820556640625,
0.0009126663208007812,
-0.006488800048828125,
-0.01117706298828125,
0.01374053955078125,
0.01006317138671875,
-0.017578125,
-0.00554656982421875,
-0.04302978515625,
-0.01666259765625,
-0.0012912750244140625,
0.0250701904296875,
-0.0085906982421875,
-0.0179290771484375,
0.0068817138671875,
-0.043212890625,
0.01446533203125,
-0.051025390625,
-0.052093505859375,
0.0195465087890625,
0.003398895263671875,
-0.0092926025390625,
0.0251007080078125,
0.0098876953125,
0.0218048095703125,
0.00806427001953125,
-0.0070037841796875,
-0.0027141571044921875,
0.01837158203125,
-0.005336761474609375,
-0.052398681640625,
-0.0108642578125,
-0.0123291015625,
0.005855560302734375,
-0.04803466796875,
0.0634765625,
-0.038787841796875,
0.01104736328125,
-0.00884246826171875,
-0.01189422607421875,
-0.02178955078125,
-0.036041259765625,
0.021148681640625,
0.03985595703125,
0.0007810592651367188,
0.03692626953125,
-0.012359619140625,
0.046630859375,
0.051055908203125,
0.00390625,
0.01535797119140625,
0.037384033203125,
0.04241943359375,
0.03265380859375,
0.002162933349609375,
-0.0232391357421875,
0.01861572265625,
-0.0494384765625,
0.0299072265625,
0.0200042724609375,
-0.02484130859375,
-0.04620361328125,
0.0260009765625,
0.004451751708984375,
0.01110076904296875,
-0.02313232421875,
-0.014312744140625,
-0.0006194114685058594,
0.047210693359375,
-0.02008056640625,
0.010833740234375,
-0.008544921875,
-0.046478271484375,
0.0264739990234375,
0.031036376953125,
-0.0312347412109375,
-0.016387939453125,
0.03863525390625,
0.03497314453125,
0.0169219970703125,
-0.056060791015625,
-0.00299072265625,
-0.012115478515625,
0.032470703125,
0.005786895751953125,
0.0660400390625,
-0.0670166015625,
-0.0193328857421875,
-0.0258331298828125,
-0.08673095703125,
-0.045684814453125,
0.041534423828125,
-0.0001913309097290039,
-0.01556396484375,
0.0024776458740234375,
0.033111572265625,
-0.030426025390625,
0.03668212890625,
0.007442474365234375,
-0.0202484130859375,
0.03875732421875,
-0.044769287109375,
0.031524658203125,
-0.043792724609375,
0.06036376953125,
0.05828857421875,
-0.0401611328125,
0.0247039794921875,
0.011138916015625,
0.0216217041015625,
0.0283355712890625,
-0.0199432373046875,
-0.0275115966796875,
0.004871368408203125,
-0.05169677734375,
-0.006397247314453125,
0.0054779052734375,
0.10394287109375,
-0.053802490234375,
-0.0484619140625,
-0.010772705078125,
0.0160369873046875,
-0.00980377197265625,
-0.00418853759765625,
0.0024051666259765625,
-0.00400543212890625,
-0.0253143310546875,
-0.00734710693359375,
-0.002666473388671875,
-0.0065460205078125,
-0.0278778076171875,
-0.01067352294921875,
0.042327880859375,
-0.045562744140625,
-0.07513427734375,
-0.06280517578125,
-0.0740966796875,
-0.07098388671875,
-0.01357269287109375,
-0.0167236328125,
0.005786895751953125,
0.05487060546875,
0.00930023193359375,
-0.039703369140625,
0.0088653564453125,
-0.001708984375,
-0.0239715576171875,
-0.005527496337890625,
0.0567626953125,
-0.0633544921875,
0.00844573974609375,
-0.0017147064208984375,
-0.0251312255859375,
0.04901123046875,
-0.018218994140625,
-0.007511138916015625,
-0.031951904296875,
-0.035675048828125,
-0.020721435546875,
0.037628173828125,
0.037322998046875,
-0.039764404296875,
0.01108551025390625,
-0.060455322265625,
-0.035858154296875,
-0.0064697265625,
-0.038726806640625,
0.07952880859375,
0.011260986328125,
-0.008575439453125,
-0.007442474365234375,
0.044189453125,
-0.003894805908203125,
0.005321502685546875,
0.049072265625,
-0.01276397705078125,
-0.026214599609375,
-0.01482391357421875,
-0.03961181640625,
-0.030609130859375,
0.047698974609375,
-0.0238037109375,
-0.01194000244140625,
0.0230865478515625,
0.0141143798828125,
0.04217529296875,
-0.037353515625,
0.01343536376953125,
-0.10833740234375,
0.05035400390625,
-0.06378173828125,
-0.018890380859375,
-0.0543212890625,
-0.00521087646484375,
0.0269775390625,
0.11688232421875,
-0.01031494140625,
-0.026885986328125,
-0.01271820068359375,
-0.005130767822265625,
0.0180816650390625,
0.006534576416015625,
-0.0032787322998046875,
-0.0267181396484375,
-0.0665283203125,
0.01099395751953125,
-0.01468658447265625,
-0.036346435546875,
-0.029144287109375,
0.0023555755615234375,
-0.03900146484375,
-0.0323486328125,
0.0301971435546875,
-0.031097412109375,
0.0102081298828125,
0.003406524658203125,
-0.01386260986328125,
-0.00673675537109375,
-0.00628662109375,
-0.04327392578125,
-0.03558349609375,
-0.0221099853515625,
0.0122222900390625,
0.0287933349609375,
0.01139068603515625,
-0.0253448486328125,
-0.007602691650390625,
0.027618408203125,
0.007293701171875,
0.0190277099609375,
-0.0204620361328125,
0.0017032623291015625,
-0.00563812255859375,
0.02374267578125,
0.01380157470703125,
-0.01549530029296875,
-0.0005555152893066406,
-0.0098419189453125,
-0.0657958984375,
-0.0091705322265625,
-0.01177215576171875,
0.02264404296875,
0.038116455078125,
-0.0447998046875,
-0.062286376953125,
-0.058807373046875,
0.017852783203125,
0.00811004638671875,
-0.0081634521484375,
0.0169677734375,
-0.053863525390625,
-0.045806884765625,
0.08673095703125,
-0.0014133453369140625,
-0.0077667236328125,
-0.0035953521728515625,
0.09130859375,
-0.0020160675048828125,
-0.041900634765625,
-0.052154541015625,
0.0137786865234375,
0.029876708984375,
0.01503753662109375,
0.0243377685546875,
-0.002796173095703125,
-0.014129638671875,
0.06207275390625,
-0.01425933837890625,
-0.0047149658203125,
-0.01396942138671875,
0.050445556640625,
-0.007415771484375,
-0.039825439453125,
0.033172607421875,
-0.0201873779296875,
-0.0037994384765625,
0.051361083984375,
-0.0088043212890625,
-0.0214385986328125,
-0.035614013671875,
0.035003662109375,
0.01143646240234375,
-0.01026153564453125,
-0.05999755859375,
-0.01233673095703125,
0.015899658203125,
-0.00827789306640625,
-0.0278167724609375,
-0.0017900466918945312,
0.000006377696990966797,
-0.031646728515625,
-0.021148681640625,
0.0175323486328125,
-0.0164642333984375,
-0.01497650146484375,
-0.0006842613220214844,
0.028900146484375,
0.0107421875,
0.0211639404296875,
-0.0109710693359375,
-0.0092620849609375,
0.059539794921875,
0.016998291015625,
-0.048431396484375,
-0.01436614990234375,
-0.0008974075317382812,
0.034820556640625,
0.0014257431030273438,
0.04058837890625,
0.04400634765625,
0.00989532470703125,
0.00977325439453125,
-0.01280975341796875,
-0.03680419921875,
0.0240325927734375,
-0.053680419921875,
-0.0011034011840820312,
0.027557373046875,
-0.023101806640625,
0.04248046875,
0.01416778564453125,
0.049835205078125,
0.0124053955078125,
-0.0308074951171875,
0.023529052734375,
0.0016651153564453125,
0.025726318359375,
0.006717681884765625,
0.0135345458984375,
0.005496978759765625,
-0.01715087890625,
0.000247955322265625,
-0.0226593017578125,
-0.0130767822265625,
-0.0019664764404296875,
0.038330078125,
-0.01045989990234375,
-0.0080108642578125,
0.020416259765625,
-0.054412841796875,
0.0205230712890625,
-0.00836944580078125,
-0.049407958984375,
-0.028656005859375,
-0.013275146484375,
0.006984710693359375,
0.01253509521484375,
-0.034759521484375,
-0.0182037353515625,
-0.006717681884765625,
-0.05450439453125,
-0.0081634521484375,
0.022003173828125,
-0.037872314453125,
-0.014434814453125,
-0.015716552734375,
-0.035675048828125,
-0.01194000244140625,
-0.01419830322265625,
-0.045989990234375,
-0.050811767578125,
0.00879669189453125,
-0.0016574859619140625,
0.04876708984375,
-0.0022945404052734375,
0.06292724609375,
-0.0165252685546875,
-0.0411376953125,
0.0036525726318359375,
0.0196685791015625,
0.010498046875,
-0.0133209228515625,
-0.02764892578125,
-0.0148773193359375,
-0.08355712890625,
-0.0416259765625,
-0.04150390625,
-0.044921875,
-0.040008544921875,
0.0088043212890625,
-0.0085296630859375,
0.00786590576171875,
0.005504608154296875,
0.0265045166015625,
-0.0186614990234375,
0.02392578125,
-0.01221466064453125,
0.030029296875,
-0.032928466796875,
0.0457763671875,
0.034088134765625,
0.0029296875,
0.0008912086486816406,
-0.01413726806640625,
-0.0125885009765625,
0.007701873779296875,
0.00525665283203125,
-0.018524169921875,
-0.0140380859375,
-0.00909423828125,
-0.0745849609375,
0.0166778564453125,
0.09649658203125,
-0.00724029541015625,
0.0277099609375,
-0.00849151611328125,
0.01396942138671875,
-0.028076171875,
0.007701873779296875,
-0.040985107421875,
0.01861572265625,
-0.0167236328125,
-0.00493621826171875,
0.027618408203125,
-0.0243377685546875,
-0.0045013427734375,
0.014373779296875,
-0.023468017578125,
-0.005828857421875,
0.016265869140625,
-0.0726318359375,
0.05926513671875,
0.040313720703125,
-0.00873565673828125,
0.01727294921875,
-0.00998687744140625,
-0.005359649658203125,
0.0085296630859375,
0.0067291259765625,
-0.0139617919921875,
-0.037506103515625,
0.048095703125,
0.023406982421875,
-0.017547607421875,
0.0472412109375,
-0.0277862548828125,
0.03436279296875,
0.054168701171875,
0.058319091796875,
-0.099609375,
0.026123046875,
0.0164794921875,
0.0004379749298095703,
0.04949951171875,
-0.0247344970703125,
-0.00939178466796875,
-0.02081298828125,
0.031890869140625,
0.0018596649169921875,
-0.0178680419921875,
0.0196380615234375,
0.00919342041015625,
-0.031829833984375,
-0.01043701171875,
0.04681396484375,
0.00696563720703125,
0.0270233154296875,
-0.0165863037109375,
-0.038421630859375,
-0.0018377304077148438,
-0.034820556640625,
0.0049285888671875,
-0.006809234619140625,
-0.00855255126953125,
-0.05364990234375,
0.0322265625,
-0.028106689453125,
0.0130157470703125,
0.024810791015625,
0.0019140243530273438,
-0.00787353515625,
0.07470703125,
-0.046844482421875,
0.04998779296875,
0.048126220703125,
-0.01444244384765625,
0.00782012939453125,
-0.01322174072265625,
-0.01873779296875,
-0.0197906494140625,
-0.0274658203125,
0.003688812255859375,
-0.043914794921875,
-0.021697998046875,
0.007114410400390625,
-0.0024318695068359375,
0.0440673828125,
-0.00799560546875,
-0.0311279296875,
0.0265960693359375,
-0.01297760009765625,
-0.01348114013671875,
0.0085906982421875,
-0.0190887451171875,
-0.02313232421875,
-0.016326904296875,
-0.004657745361328125,
-0.0567626953125,
0.004058837890625,
-0.00214385986328125,
-0.069091796875,
0.07379150390625,
0.0214691162109375,
0.0272369384765625,
0.00182342529296875,
0.01715087890625,
-0.046478271484375,
-0.00440216064453125,
-0.01201629638671875,
0.0020599365234375,
0.0161285400390625,
0.0418701171875,
0.0312042236328125,
0.01219940185546875,
0.0276031494140625,
0.009918212890625,
0.0267181396484375,
-0.003631591796875,
0.034393310546875,
-0.0042724609375,
0.04278564453125,
0.0141143798828125,
-0.0196685791015625,
-0.013031005859375,
-0.0087127685546875,
0.01087188720703125,
-0.041259765625,
-0.02264404296875,
-0.003681182861328125,
-0.028045654296875,
-0.0592041015625,
0.0192108154296875,
0.021759033203125,
0.05230712890625,
-0.01230621337890625,
-0.0005559921264648438,
-0.032440185546875,
-0.0157928466796875,
0.046630859375,
-0.031341552734375,
-0.041259765625,
0.06982421875,
0.032257080078125,
-0.04217529296875,
-0.01110076904296875,
-0.05291748046875,
0.060455322265625,
0.0234527587890625,
-0.0275726318359375,
0.045806884765625,
0.0091552734375,
-0.0290679931640625,
-0.0235137939453125,
-0.0189971923828125,
-0.009552001953125,
0.0014142990112304688,
0.048980712890625,
-0.00621795654296875,
0.00777435302734375,
-0.060028076171875,
0.0185699462890625,
0.031494140625,
0.059783935546875,
-0.043609619140625,
0.007411956787109375,
0.0164947509765625,
0.00586700439453125,
-0.0156402587890625,
-0.047821044921875,
-0.00505828857421875,
-0.0144500732421875,
-0.0077972412109375,
-0.018951416015625,
-0.0035877227783203125,
0.0229339599609375,
-0.036590576171875,
-0.0185089111328125,
-0.0207977294921875,
0.04010009765625,
0.045196533203125,
-0.016082763671875,
0.0058441162109375,
0.0214691162109375,
0.038909912109375,
-0.0062103271484375,
0.04248046875,
-0.021484375,
-0.00606536865234375,
-0.0204620361328125,
0.03424072265625,
-0.000823974609375,
0.01349639892578125,
-0.0206298828125,
-0.0031375885009765625,
-0.0143280029296875,
0.017730712890625,
0.0210113525390625,
0.04931640625,
0.08270263671875,
0.01470184326171875,
-0.0545654296875,
-0.005340576171875,
-0.01416015625,
-0.063720703125,
0.050537109375,
-0.038482666015625,
0.040802001953125,
-0.000017404556274414062,
-0.0160980224609375,
-0.007465362548828125,
0.00904083251953125,
0.043609619140625,
-0.049530029296875,
0.035888671875,
0.0015583038330078125,
-0.01445770263671875,
0.048248291015625,
0.00919342041015625,
0.035858154296875,
0.006977081298828125,
-0.07427978515625,
-0.0204315185546875,
-0.0162200927734375,
-0.05029296875,
0.019287109375,
0.037811279296875,
-0.022491455078125,
0.0169219970703125,
0.0007662773132324219,
0.033538818359375,
-0.0038204193115234375,
-0.042816162109375,
0.01146697998046875,
0.00893402099609375,
0.0267791748046875,
0.0184173583984375,
-0.05340576171875,
-0.045867919921875,
-0.0279998779296875,
0.052642822265625,
0.0249481201171875,
0.0982666015625,
-0.0262603759765625,
0.0225982666015625,
-0.02093505859375,
0.016082763671875,
-0.0196380615234375,
-0.040008544921875,
0.06988525390625,
0.006526947021484375,
-0.01421356201171875,
-0.016754150390625,
-0.041046142578125,
0.02789306640625,
0.03863525390625,
-0.0304107666015625,
0.0263519287109375,
-0.009857177734375,
0.004459381103515625,
-0.03619384765625,
0.03790283203125,
-0.004192352294921875,
-0.047821044921875,
-0.01334381103515625,
0.04901123046875,
0.00975799560546875,
0.04144287109375,
-0.043182373046875,
0.03472900390625,
-0.052734375,
-0.024993896484375,
0.01242828369140625,
-0.036102294921875,
-0.0108184814453125,
0.0144195556640625,
-0.035400390625,
-0.06402587890625,
0.04248046875,
0.0024204254150390625,
-0.0047454833984375,
0.02325439453125,
0.0450439453125,
0.03692626953125,
-0.022430419921875,
-0.0306396484375,
-0.07574462890625,
-0.0227508544921875,
-0.06903076171875,
-0.016510009765625,
-0.037139892578125,
0.0343017578125,
0.017059326171875,
-0.0223541259765625,
-0.0196685791015625,
-0.027862548828125,
0.005275726318359375,
0.0279693603515625,
-0.0074462890625,
-0.02191162109375,
-0.0240478515625,
0.0110015869140625,
0.00949859619140625,
-0.0156402587890625,
-0.0133209228515625,
0.03656005859375,
-0.044036865234375,
-0.01568603515625,
-0.0075531005859375,
-0.046600341796875,
0.024444580078125,
0.0159454345703125,
-0.0309600830078125,
0.00701904296875,
-0.042388916015625,
-0.04022216796875,
-0.0256500244140625,
-0.0008330345153808594,
0.041748046875,
0.00760650634765625,
-0.016357421875,
-0.00620269775390625,
-0.0419921875,
0.0616455078125,
-0.065673828125,
-0.007198333740234375,
0.048187255859375,
-0.034515380859375,
-0.030120849609375,
-0.0780029296875,
-0.0041351318359375,
-0.08172607421875,
0.00012826919555664062,
0.0234222412109375,
-0.0208740234375,
0.0192413330078125,
-0.04693603515625,
-0.075927734375,
0.0171356201171875,
-0.0003609657287597656,
-0.0440673828125,
-0.02459716796875,
0.02093505859375,
-0.019561767578125,
0.040313720703125,
0.01503753662109375,
-0.0226593017578125,
0.012176513671875,
0.01788330078125,
0.01009368896484375,
0.0345458984375,
0.03857421875,
0.004116058349609375,
0.00750732421875,
0.006519317626953125,
0.004924774169921875,
-0.0086517333984375,
0.01219940185546875,
-0.0278778076171875,
0.03021240234375,
0.04107666015625,
-0.039459228515625,
-0.046234130859375,
-0.01465606689453125,
0.0006937980651855469,
0.000012099742889404297,
-0.0266571044921875,
-0.031768798828125,
0.002048492431640625,
0.0438232421875,
0.0596923828125,
0.0169525146484375,
-0.04168701171875,
-0.021728515625,
-0.0237274169921875,
-0.037261962890625,
-0.016143798828125,
0.030364990234375,
-0.08447265625,
-0.0059356689453125,
0.0306549072265625,
-0.050506591796875,
-0.025665283203125,
-0.00931549072265625,
-0.0716552734375,
0.0288543701171875,
-0.01255035400390625,
0.0187225341796875,
-0.0287017822265625,
0.0165557861328125,
0.0325927734375,
-0.0219573974609375,
0.01483917236328125,
-0.038970947265625,
0.027252197265625,
0.018890380859375,
-0.046783447265625,
-0.00324249267578125,
0.0311279296875,
-0.039154052734375,
-0.0209503173828125,
0.0174560546875,
0.00830078125,
0.003925323486328125,
0.00437164306640625,
0.00301361083984375,
0.037628173828125,
-0.01436614990234375,
0.046783447265625,
0.013336181640625,
0.045196533203125,
0.00505828857421875,
0.0535888671875,
-0.00554656982421875,
0.006168365478515625,
-0.0018482208251953125,
0.03857421875,
-0.033935546875,
-0.0180816650390625,
-0.0139007568359375,
-0.042449951171875,
0.007282257080078125,
0.03204345703125,
0.0256500244140625,
-0.0145111083984375,
0.033294677734375,
-0.0146636962890625,
0.01399993896484375,
0.01207733154296875
] |
c0c262fbd063080ff93467e346fa3e9265980491
|
Wordpress Stackexchange
Q: Get Featured Image via direct sql query I know you can use the wordpress methods for getting a featured image, however with this particular project I need to get the featured image via mysql query. Can anyone point me in the right direction. Thank you.
This is what I have so far but my query is not doing the trick. I have the $post->id stored as a variable called $da_id
$Featured_image = $wpdb->get_results("
SELECT *
FROM net_5_postmeta
INNER JOIN net_5_posts ON net_5_postmeta.post_id=net_5_posts.ID
WHERE post_parent = $da_id
AND meta_key = '_wp_attached_file'
ORDER BY post_date
DESC LIMIT 15",'ARRAY_A');
A: $Featured_image = $wpdb->get_results("
SELECT p.*
FROM net_5_postmeta AS pm
INNER JOIN net_5_posts AS p ON pm.meta_value=p.ID
WHERE pm.post_id = $da_id
AND pm.meta_key = '_thumbnail_id'
ORDER BY p.post_date DESC
LIMIT 15
",'ARRAY_A');
|
Q: Get Featured Image via direct sql query I know you can use the wordpress methods for getting a featured image, however with this particular project I need to get the featured image via mysql query. Can anyone point me in the right direction. Thank you.
This is what I have so far but my query is not doing the trick. I have the $post->id stored as a variable called $da_id
$Featured_image = $wpdb->get_results("
SELECT *
FROM net_5_postmeta
INNER JOIN net_5_posts ON net_5_postmeta.post_id=net_5_posts.ID
WHERE post_parent = $da_id
AND meta_key = '_wp_attached_file'
ORDER BY post_date
DESC LIMIT 15",'ARRAY_A');
A: $Featured_image = $wpdb->get_results("
SELECT p.*
FROM net_5_postmeta AS pm
INNER JOIN net_5_posts AS p ON pm.meta_value=p.ID
WHERE pm.post_id = $da_id
AND pm.meta_key = '_thumbnail_id'
ORDER BY p.post_date DESC
LIMIT 15
",'ARRAY_A');
A: A related solution, to query for posts WITHOUT providing a post ID (ordered by post date, and using the wp_ database prefix):
SELECT
p1.*,
wm2.meta_value
FROM
wp_posts p1
LEFT JOIN
wp_postmeta wm1
ON (
wm1.post_id = p1.id
AND wm1.meta_value IS NOT NULL
AND wm1.meta_key = "_thumbnail_id"
)
LEFT JOIN
wp_postmeta wm2
ON (
wm1.meta_value = wm2.post_id
AND wm2.meta_key = "_wp_attached_file"
AND wm2.meta_value IS NOT NULL
)
WHERE
p1.post_status="publish"
AND p1.post_type="post"
ORDER BY
p1.post_date DESC
|
wordpress
|
{
"language": "en",
"length": 204,
"provenance": "stackexchange_00019.jsonl.gz:419026",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48878"
}
|
[
0.04998779296875,
-0.01233673095703125,
0.039337158203125,
-0.0181121826171875,
0.031585693359375,
-0.007198333740234375,
0.064208984375,
-0.040252685546875,
0.0290374755859375,
0.032958984375,
-0.01922607421875,
-0.0014715194702148438,
-0.032958984375,
-0.00376129150390625,
-0.04150390625,
-0.036041259765625,
0.06591796875,
-0.031402587890625,
0.06591796875,
0.037750244140625,
-0.0194091796875,
0.08087158203125,
0.0333251953125,
0.015350341796875,
0.032073974609375,
-0.011566162109375,
0.047760009765625,
-0.01331329345703125,
0.0276641845703125,
0.01036834716796875,
0.0217742919921875,
-0.029449462890625,
-0.00031375885009765625,
0.00826263427734375,
0.04046630859375,
-0.0040130615234375,
0.022796630859375,
0.000865936279296875,
0.0215606689453125,
0.00873565673828125,
-0.01224517822265625,
0.030731201171875,
-0.017333984375,
-0.0018548965454101562,
-0.054718017578125,
-0.022125244140625,
-0.0205535888671875,
0.0006771087646484375,
0.00968170166015625,
-0.00893402099609375,
0.0193328857421875,
0.038299560546875,
0.034027099609375,
-0.039154052734375,
-0.01087188720703125,
0.0008349418640136719,
-0.0214996337890625,
0.032623291015625,
0.037872314453125,
-0.02044677734375,
-0.04742431640625,
-0.0137939453125,
0.0303802490234375,
-0.00933074951171875,
-0.000316619873046875,
0.0218048095703125,
0.057159423828125,
0.0122833251953125,
0.002941131591796875,
-0.0122833251953125,
-0.0174560546875,
0.005771636962890625,
-0.0163116455078125,
-0.007640838623046875,
-0.0225067138671875,
0.01409149169921875,
-0.007404327392578125,
-0.0302886962890625,
0.01009368896484375,
0.005401611328125,
-0.0005769729614257812,
-0.00516510009765625,
-0.052001953125,
0.035247802734375,
-0.0277557373046875,
0.037628173828125,
-0.0152435302734375,
-0.006336212158203125,
-0.032684326171875,
-0.0207977294921875,
-0.0259552001953125,
-0.041534423828125,
-0.06402587890625,
0.039337158203125,
-0.006252288818359375,
-0.002056121826171875,
0.039398193359375,
0.031585693359375,
0.011474609375,
0.019927978515625,
-0.023712158203125,
-0.033538818359375,
0.00490570068359375,
-0.01343536376953125,
0.005809783935546875,
-0.01346588134765625,
0.00562286376953125,
-0.0100555419921875,
0.0258331298828125,
0.0345458984375,
-0.004962921142578125,
0.00870513916015625,
-0.005889892578125,
-0.0225830078125,
-0.022674560546875,
0.0204010009765625,
-0.01020050048828125,
-0.01331329345703125,
0.007488250732421875,
-0.0288848876953125,
-0.0026416778564453125,
-0.00865936279296875,
0.037689208984375,
-0.035888671875,
0.005573272705078125,
-0.009063720703125,
-0.044036865234375,
-0.01226806640625,
-0.08453369140625,
0.053314208984375,
-0.031494140625,
0.0229339599609375,
0.06787109375,
0.0200042724609375,
-0.01271820068359375,
-0.03704833984375,
-0.00473785400390625,
-0.005558013916015625,
0.01361083984375,
-0.0027103424072265625,
-0.01108551025390625,
0.003795623779296875,
0.06317138671875,
-0.014801025390625,
-0.018157958984375,
0.0005412101745605469,
0.0195465087890625,
0.03125,
-0.0266571044921875,
-0.027557373046875,
0.006343841552734375,
0.00077056884765625,
-0.01255035400390625,
0.032379150390625,
0.0245513916015625,
0.0177001953125,
0.0374755859375,
-0.0126953125,
0.0137176513671875,
-0.021636962890625,
0.03619384765625,
0.0169219970703125,
0.00829315185546875,
0.0208892822265625,
0.0019512176513671875,
-0.01763916015625,
-0.033416748046875,
-0.006458282470703125,
0.0208740234375,
0.04925537109375,
0.0096282958984375,
-0.038299560546875,
0.00864410400390625,
0.0152740478515625,
-0.0168304443359375,
0.022552490234375,
-0.000018596649169921875,
-0.0008492469787597656,
0.0173797607421875,
0.0239105224609375,
-0.006069183349609375,
-0.036773681640625,
0.03082275390625,
-0.019378662109375,
-0.00902557373046875,
0.0294036865234375,
0.00934600830078125,
0.03778076171875,
-0.0004963874816894531,
0.018524169921875,
0.0111846923828125,
0.015960693359375,
-0.03668212890625,
0.019195556640625,
0.0023345947265625,
-0.02294921875,
-0.010894775390625,
-0.0183868408203125,
-0.00415802001953125,
0.01236724853515625,
0.007404327392578125,
0.007503509521484375,
0.003009796142578125,
0.005619049072265625,
-0.02252197265625,
-0.003986358642578125,
-0.002513885498046875,
0.0213470458984375,
-0.032318115234375,
0.0198974609375,
0.0202789306640625,
0.006763458251953125,
-0.008087158203125,
-0.01494598388671875,
-0.00026154518127441406,
0.00608062744140625,
-0.01508331298828125,
0.0165557861328125,
0.0024280548095703125,
0.059417724609375,
-0.033905029296875,
0.0037403106689453125,
-0.049591064453125,
-0.01392364501953125,
0.059967041015625,
-0.00936126708984375,
-0.007755279541015625,
-0.0290985107421875,
0.060150146484375,
-0.0115509033203125,
-0.032989501953125,
0.0241851806640625,
-0.002124786376953125,
-0.01024627685546875,
-0.0093841552734375,
0.0050811767578125,
0.0413818359375,
-0.07232666015625,
0.00766754150390625,
0.027740478515625,
0.040008544921875,
-0.00899505615234375,
-0.0172119140625,
-0.01129150390625,
-0.0098114013671875,
-0.031890869140625,
0.031646728515625,
-0.03875732421875,
-0.0079498291015625,
-0.005359649658203125,
0.0061798095703125,
-0.021881103515625,
0.04058837890625,
-0.047576904296875,
-0.005855560302734375,
0.046234130859375,
0.029693603515625,
0.0298919677734375,
-0.057159423828125,
0.077392578125,
-0.0228424072265625,
0.0672607421875,
0.0133209228515625,
0.01543426513671875,
0.01377105712890625,
0.041290283203125,
0.0215301513671875,
0.024871826171875,
-0.01235198974609375,
0.0191497802734375,
-0.0014657974243164062,
-0.0205078125,
-0.0011072158813476562,
0.031951904296875,
-0.0175018310546875,
0.0013647079467773438,
-0.0246429443359375,
0.01236724853515625,
-0.004985809326171875,
-0.005794525146484375,
0.0016527175903320312,
-0.003482818603515625,
0.01314544677734375,
0.0007920265197753906,
-0.0050048828125,
-0.0281524658203125,
0.04278564453125,
0.0352783203125,
-0.003833770751953125,
0.032867431640625,
0.033538818359375,
0.06622314453125,
0.01145172119140625,
0.0161590576171875,
-0.007007598876953125,
0.033233642578125,
-0.0009684562683105469,
-0.023956298828125,
0.0391845703125,
-0.025146484375,
0.0176544189453125,
0.062408447265625,
-0.027801513671875,
0.0277557373046875,
-0.0052032470703125,
-0.033782958984375,
0.0018863677978515625,
0.0041961669921875,
-0.0133819580078125,
-0.040283203125,
-0.051055908203125,
0.027099609375,
0.038299560546875,
0.04620361328125,
-0.0031452178955078125,
-0.0238494873046875,
0.0016326904296875,
0.0286712646484375,
-0.06719970703125,
-0.09222412109375,
-0.0179290771484375,
-0.013214111328125,
-0.03271484375,
0.007537841796875,
-0.00479888916015625,
0.0155181884765625,
0.00923919677734375,
-0.01157379150390625,
-0.0171356201171875,
0.0015726089477539062,
-0.05767822265625,
-0.033416748046875,
-0.055450439453125,
-0.00020968914031982422,
-0.01065826416015625,
0.038177490234375,
-0.00016951560974121094,
0.044677734375,
-0.0013294219970703125,
-0.0477294921875,
-0.00727081298828125,
0.0233612060546875,
-0.005756378173828125,
-0.004505157470703125,
0.00452423095703125,
0.007965087890625,
-0.019256591796875,
0.0029506683349609375,
-0.03924560546875,
0.01849365234375,
-0.0203857421875,
-0.0020656585693359375,
-0.0123291015625,
-0.004596710205078125,
0.01288604736328125,
-0.00757598876953125,
0.00012564659118652344,
0.03594970703125,
0.04376220703125,
-0.0228271484375,
-0.0228118896484375,
-0.04986572265625,
-0.054168701171875,
0.0258636474609375,
0.0200347900390625,
0.026123046875,
-0.00982666015625,
0.01334381103515625,
0.017913818359375,
-0.0027065277099609375,
-0.007564544677734375,
-0.0618896484375,
0.06439208984375,
0.033447265625,
0.0677490234375,
-0.022705078125,
0.020416259765625,
-0.001903533935546875,
0.047607421875,
0.0202789306640625,
0.0526123046875,
-0.02825927734375,
0.0304718017578125,
-0.0921630859375,
-0.044158935546875,
0.044891357421875,
0.0102691650390625,
0.004596710205078125,
0.0038890838623046875,
-0.032073974609375,
0.0137176513671875,
0.06829833984375,
0.007373809814453125,
-0.035614013671875,
-0.02496337890625,
-0.003223419189453125,
-0.02252197265625,
0.010589599609375,
-0.0117034912109375,
0.005420684814453125,
-0.07989501953125,
-0.020660400390625,
-0.0157318115234375,
-0.057464599609375,
0.0099334716796875,
-0.040802001953125,
-0.05841064453125,
-0.047515869140625,
0.032562255859375,
-0.050994873046875,
-0.009735107421875,
0.070556640625,
-0.031524658203125,
0.034088134765625,
-0.0491943359375,
-0.031280517578125,
-0.087646484375,
-0.0003056526184082031,
-0.00563812255859375,
0.03802490234375,
-0.01715087890625,
0.01000213623046875,
-0.0335693359375,
0.032196044921875,
0.01500701904296875,
-0.010009765625,
0.01169586181640625,
0.002986907958984375,
-0.026123046875,
-0.024078369140625,
0.00569915771484375,
-0.046905517578125,
-0.0367431640625,
-0.06573486328125,
-0.017822265625,
-0.045440673828125,
-0.0238189697265625,
0.02105712890625,
-0.0197601318359375,
0.013519287109375,
0.01580810546875,
0.010528564453125,
0.051025390625,
0.06304931640625,
0.027069091796875,
-0.007106781005859375,
-0.0134124755859375,
0.0020751953125,
0.042877197265625,
0.0177154541015625,
0.0008177757263183594,
0.01470947265625,
0.0692138671875,
0.01114654541015625,
-0.039581298828125,
-0.07672119140625,
-0.0103759765625,
0.03619384765625,
0.02801513671875,
0.040191650390625,
0.0251312255859375,
-0.0223541259765625,
0.0231781005859375,
0.044525146484375,
0.0010814666748046875,
-0.01552581787109375,
0.037567138671875,
0.008544921875,
0.0185394287109375,
-0.01004791259765625,
-0.002086639404296875,
0.0270233154296875,
0.024688720703125,
-0.0157623291015625,
-0.030426025390625,
-0.04638671875,
0.033477783203125,
-0.0026092529296875,
0.031890869140625,
-0.0338134765625,
-0.031982421875,
-0.001617431640625,
-0.0025177001953125,
0.05059814453125,
0.00891876220703125,
0.0066375732421875,
0.0216064453125,
0.061187744140625,
-0.0009632110595703125,
0.026153564453125,
-0.029693603515625,
0.01085662841796875,
0.0297698974609375,
-0.0230560302734375,
0.0123138427734375,
0.0264129638671875,
0.002445220947265625,
0.00997161865234375,
-0.0089111328125,
-0.041717529296875,
-0.0517578125,
-0.0185394287109375,
0.012176513671875,
0.0158233642578125,
-0.018951416015625,
0.037139892578125,
0.0301666259765625,
-0.01184844970703125,
-0.005832672119140625,
-0.03387451171875,
0.006717681884765625,
-0.042022705078125,
0.02593994140625,
-0.00525665283203125,
0.005588531494140625,
0.0184783935546875,
0.0806884765625,
-0.04046630859375,
0.08056640625,
-0.006038665771484375,
0.00504302978515625,
-0.0350341796875,
0.045074462890625,
-0.005718231201171875,
0.0226898193359375,
0.0126800537109375,
0.023712158203125,
0.021514892578125,
0.0026645660400390625,
0.026092529296875,
-0.0159759521484375,
0.0178070068359375,
-0.041900634765625,
-0.0396728515625,
0.0548095703125,
-0.056915283203125,
-0.0167388916015625,
0.0027713775634765625,
-0.01491546630859375,
0.0025348663330078125,
-0.037353515625,
-0.0149688720703125,
0.056610107421875,
0.0280609130859375,
-0.01558685302734375,
0.0107269287109375,
0.00313568115234375,
0.039459228515625,
-0.0396728515625,
-0.0026493072509765625,
0.0276641845703125,
0.035736083984375,
-0.006999969482421875,
-0.02020263671875,
-0.028778076171875,
0.049835205078125,
0.0161285400390625,
-0.01554107666015625,
-0.0302886962890625,
0.02679443359375,
-0.0231170654296875,
0.0240020751953125,
-0.0209808349609375,
-0.003387451171875,
-0.0246734619140625,
0.007198333740234375,
0.05474853515625,
0.035614013671875,
0.036590576171875,
-0.029052734375,
-0.038116455078125,
-0.0099029541015625,
0.106689453125,
-0.014862060546875,
0.002353668212890625,
-0.053466796875,
0.005859375,
0.046539306640625,
-0.02398681640625,
-0.031707763671875,
0.0016994476318359375,
-0.0027904510498046875,
-0.007106781005859375,
0.08642578125,
-0.0171966552734375,
0.01064300537109375,
-0.004302978515625,
0.044281005859375,
-0.007534027099609375,
-0.0003795623779296875,
0.005115509033203125,
-0.026275634765625,
-0.0286102294921875,
-0.034698486328125,
0.0293121337890625,
0.034027099609375,
0.00994873046875,
-0.031585693359375,
-0.0182037353515625,
0.0251007080078125,
0.03973388671875,
-0.0252685546875,
0.00528717041015625,
-0.026641845703125,
-0.0228271484375,
-0.0496826171875,
-0.0003898143768310547,
0.0052490234375,
-0.04425048828125,
-0.028411865234375,
-0.02783203125,
-0.0139007568359375,
0.0298309326171875,
-0.0278167724609375,
-0.0174102783203125,
0.05523681640625,
0.0033416748046875,
0.0248870849609375,
0.083984375,
0.0067138671875,
0.056732177734375,
0.01058197021484375,
-0.000522613525390625,
0.006378173828125,
0.0267486572265625,
-0.034515380859375,
-0.034820556640625,
0.0029544830322265625,
0.0022125244140625,
0.0318603515625,
0.01812744140625,
0.01511383056640625,
0.007720947265625,
-0.04083251953125,
0.037261962890625,
0.0325927734375,
-0.0009326934814453125,
0.006069183349609375,
-0.038330078125,
0.02056884765625,
0.02191162109375,
0.024383544921875,
0.0005888938903808594,
-0.01495361328125,
0.0288543701171875,
-0.0062713623046875,
-0.018646240234375,
0.0061492919921875,
-0.0012989044189453125,
0.023193359375,
0.0293731689453125,
0.0088958740234375,
-0.058349609375,
-0.028289794921875,
0.040435791015625,
-0.041107177734375,
-0.0161285400390625,
0.025726318359375,
-0.047821044921875,
0.0135498046875,
-0.02838134765625,
0.021820068359375,
-0.01528167724609375,
0.0191192626953125,
0.04681396484375,
0.017822265625,
0.0261077880859375,
0.057464599609375,
0.0078887939453125,
-0.0022754669189453125,
0.0214080810546875,
-0.036285400390625,
0.03594970703125,
0.0027675628662109375,
0.012451171875,
0.03436279296875,
-0.044403076171875,
0.0019350051879882812,
-0.032806396484375,
0.02911376953125,
-0.003398895263671875,
-0.0243988037109375,
0.0419921875,
-0.03070068359375,
-0.01129913330078125,
0.034088134765625,
0.01558685302734375,
-0.026214599609375,
-0.01171112060546875,
0.040740966796875,
-0.0204315185546875,
0.0010023117065429688,
0.005771636962890625,
-0.0033111572265625,
-0.00846099853515625,
-0.040252685546875,
-0.0213775634765625,
0.04693603515625,
-0.032806396484375,
-0.0075531005859375,
0.023406982421875,
0.02459716796875,
-0.0083465576171875,
-0.0101470947265625,
-0.0291595458984375,
0.045623779296875,
-0.048736572265625,
0.0533447265625,
-0.0281219482421875,
0.0276947021484375,
0.0150146484375,
-0.00006777048110961914,
0.062164306640625,
0.008056640625,
-0.055023193359375,
-0.03497314453125,
0.053741455078125,
0.05816650390625,
0.03253173828125,
0.0281219482421875,
-0.0263824462890625,
0.038055419921875,
0.06878662109375,
-0.0511474609375,
0.0268096923828125,
0.01416015625,
-0.0355224609375,
-0.0081939697265625,
0.0301361083984375,
0.04083251953125,
0.032562255859375,
0.030670166015625,
-0.023712158203125,
0.0178375244140625,
0.048248291015625,
-0.06427001953125,
-0.01213836669921875,
0.031402587890625,
0.0252838134765625,
-0.0794677734375,
-0.020477294921875,
-0.0223846435546875,
0.049652099609375,
-0.0051116943359375,
0.030670166015625,
0.02276611328125,
0.00960540771484375,
0.0295867919921875,
-0.0061187744140625,
0.011077880859375,
0.012176513671875,
-0.0047149658203125,
0.049713134765625,
0.00554656982421875,
0.015655517578125,
-0.075927734375,
-0.02630615234375,
0.050048828125,
0.07958984375,
-0.039459228515625,
-0.0214691162109375,
0.00902557373046875,
0.0137939453125,
-0.00038886070251464844,
-0.002704620361328125,
-0.0016889572143554688,
0.0205230712890625,
0.048126220703125,
-0.0178070068359375,
-0.004657745361328125,
0.03271484375,
0.0087890625,
0.004390716552734375,
-0.005870819091796875,
-0.0098419189453125,
-0.01003265380859375,
-0.01288604736328125,
0.0194854736328125,
-0.00860595703125,
0.00699615478515625,
0.003902435302734375,
0.00948333740234375,
-0.01727294921875,
0.015655517578125,
-0.019561767578125,
0.0219573974609375,
-0.0299072265625,
0.044342041015625,
-0.0455322265625,
-0.04168701171875,
0.0088348388671875,
0.040496826171875,
0.00626373291015625,
-0.0289154052734375,
0.0296783447265625,
0.0266571044921875,
-0.0704345703125,
-0.028228759765625,
0.0116119384765625,
-0.028076171875,
-0.033111572265625,
-0.037506103515625,
-0.004314422607421875,
0.03350830078125,
0.00024819374084472656,
0.022552490234375,
-0.0094757080078125,
0.03204345703125,
-0.036102294921875,
0.05828857421875,
-0.02557373046875,
0.006687164306640625,
0.00208282470703125,
-0.057281494140625,
-0.0174560546875,
-0.046844482421875,
-0.08441162109375,
-0.03155517578125,
-0.029022216796875,
-0.025299072265625,
0.01027679443359375,
0.03155517578125,
0.00572967529296875,
0.0162200927734375,
0.009674072265625,
0.0010576248168945312,
0.01174163818359375,
-0.02691650390625,
0.006923675537109375,
-0.009490966796875,
0.0316162109375,
-0.006500244140625,
-0.049072265625,
-0.0421142578125,
-0.0242919921875,
0.0428466796875,
0.018157958984375,
0.001590728759765625,
0.0179595947265625,
0.033782958984375,
-0.0129241943359375,
-0.00476837158203125,
-0.027435302734375,
-0.01499176025390625,
0.0298919677734375,
-0.0306243896484375,
-0.031707763671875,
-0.003070831298828125,
-0.033111572265625,
-0.009765625,
0.050567626953125,
-0.0186767578125,
-0.05047607421875,
0.0269775390625,
0.0294952392578125,
0.01214599609375,
0.018157958984375,
-0.03533935546875,
-0.014312744140625,
-0.049835205078125,
-0.046539306640625,
0.03521728515625,
-0.010406494140625,
0.021697998046875,
0.0264434814453125,
0.033538818359375,
-0.005062103271484375,
0.04864501953125,
-0.03759765625,
0.1085205078125,
0.06280517578125,
-0.053466796875,
-0.0004394054412841797,
-0.036407470703125,
-0.0264129638671875,
0.012115478515625,
-0.0184783935546875,
0.027099609375,
-0.01451873779296875,
-0.020477294921875,
-0.0006618499755859375,
0.01702880859375,
0.0126495361328125,
-0.03277587890625,
0.00516510009765625,
0.02294921875,
-0.01532745361328125,
0.0154266357421875,
-0.00848388671875,
0.007495880126953125,
-0.05108642578125,
-0.03240966796875,
0.01953125,
-0.04388427734375,
-0.014801025390625,
-0.006229400634765625,
0.010772705078125,
0.0213775634765625,
0.0178375244140625,
-0.06146240234375,
0.037567138671875,
0.0012359619140625,
0.0204315185546875,
0.001605987548828125,
-0.07818603515625,
0.0212860107421875,
0.05133056640625,
0.0062408447265625,
-0.0504150390625,
-0.041778564453125,
-0.0007510185241699219,
-0.05108642578125,
0.0197601318359375,
0.0178375244140625,
-0.0098724365234375,
0.03662109375,
0.0360107421875,
-0.004756927490234375,
0.0927734375,
-0.050872802734375,
-0.03961181640625,
-0.0109100341796875,
-0.0013189315795898438,
-0.0038909912109375,
-0.020263671875,
0.031890869140625,
-0.053070068359375,
-0.0258026123046875,
-0.050262451171875,
0.0419921875,
0.04180908203125,
-0.0406494140625,
-0.1260986328125,
0.05499267578125,
-0.04583740234375,
-0.04034423828125,
-0.026092529296875,
0.0322265625,
0.01015472412109375,
-0.0197906494140625,
-0.0010137557983398438,
-0.0157928466796875,
-0.02337646484375,
0.00031638145446777344,
0.035430908203125,
-0.01187896728515625,
0.04876708984375,
0.024688720703125,
-0.06805419921875,
-0.0022068023681640625,
-0.02001953125,
0.0091094970703125,
-0.01285552978515625,
0.0034084320068359375,
0.032196044921875,
0.016693115234375,
-0.043975830078125,
0.0123748779296875,
-0.0021457672119140625,
0.00569915771484375,
-0.042388916015625,
-0.0083465576171875,
0.0030364990234375,
0.01300048828125,
0.08001708984375,
0.0301971435546875,
0.01453399658203125,
-0.04766845703125,
-0.005252838134765625,
-0.048614501953125,
-0.000698089599609375,
-0.048797607421875,
0.025787353515625,
-0.11468505859375,
-0.041961669921875,
0.04693603515625,
-0.040008544921875,
-0.0175628662109375,
0.0129852294921875,
-0.07269287109375,
-0.0025730133056640625,
-0.0312042236328125,
-0.00020253658294677734,
-0.06610107421875,
0.04644775390625,
0.0298004150390625,
-0.049560546875,
-0.00774383544921875,
-0.007038116455078125,
-0.01296234130859375,
0.016082763671875,
-0.02716064453125,
-0.005931854248046875,
0.05645751953125,
0.0008683204650878906,
-0.0030384063720703125,
0.035064697265625,
-0.041473388671875,
0.022125244140625,
0.022064208984375,
-0.00391387939453125,
0.0010814666748046875,
0.0007405281066894531,
-0.0029010772705078125,
0.00106048583984375,
0.017730712890625,
-0.007678985595703125,
0.0144805908203125,
0.00922393798828125,
0.017913818359375,
-0.01268768310546875,
0.052459716796875,
-0.003246307373046875,
-0.0443115234375,
0.03155517578125,
-0.051025390625,
0.01404571533203125,
0.03192138671875,
0.00015795230865478516,
0.0026264190673828125,
-0.0166168212890625,
0.045562744140625,
-0.01123809814453125,
-0.004261016845703125
] |
e433e713b082beb70af256dbe147e86b337a5e63
|
Wordpress Stackexchange
Q: Auto-modifying original [full size] images Is there a way to make WordPress process Full size images, which by default it leaves unmodified?
A: Yes, there is.
Found here:
http://www.wprecipes.com/how-to-automatically-use-resized-image-instead-of-originals
It will replace the original picture with the large size, defined in Media Settings (/wp-admin/options-media.php).
Here's the code:
add_filter('wp_generate_attachment_metadata','replace_uploaded_image');
function replace_uploaded_image($image_data)
{
// if there is no large image : return
if ( !isset($image_data['sizes']['large']) )
return $image_data;
// paths to the uploaded image and the large image
$upload_dir = wp_upload_dir();
$uploaded_image_location = $upload_dir['basedir'] . '/' . $image_data['file'];
$large_image_location = $upload_dir['path'] . '/' . $image_data['sizes']['large']['file'];
// delete the uploaded image
unlink($uploaded_image_location);
// rename the large image
rename($large_image_location, $uploaded_image_location);
// update image metadata and return them
$image_data['width'] = $image_data['sizes']['large']['width'];
$image_data['height'] = $image_data['sizes']['large']['height'];
unset($image_data['sizes']['large']);
return $image_data;
}
It is possible to use it with a custom size:
add_image_size( 'new-large', 1600, 1200 );
Changing all the occurrences of $image_data['sizes']['large'] in the original code with $image_data['sizes']['new-large']
|
Q: Auto-modifying original [full size] images Is there a way to make WordPress process Full size images, which by default it leaves unmodified?
A: Yes, there is.
Found here:
http://www.wprecipes.com/how-to-automatically-use-resized-image-instead-of-originals
It will replace the original picture with the large size, defined in Media Settings (/wp-admin/options-media.php).
Here's the code:
add_filter('wp_generate_attachment_metadata','replace_uploaded_image');
function replace_uploaded_image($image_data)
{
// if there is no large image : return
if ( !isset($image_data['sizes']['large']) )
return $image_data;
// paths to the uploaded image and the large image
$upload_dir = wp_upload_dir();
$uploaded_image_location = $upload_dir['basedir'] . '/' . $image_data['file'];
$large_image_location = $upload_dir['path'] . '/' . $image_data['sizes']['large']['file'];
// delete the uploaded image
unlink($uploaded_image_location);
// rename the large image
rename($large_image_location, $uploaded_image_location);
// update image metadata and return them
$image_data['width'] = $image_data['sizes']['large']['width'];
$image_data['height'] = $image_data['sizes']['large']['height'];
unset($image_data['sizes']['large']);
return $image_data;
}
It is possible to use it with a custom size:
add_image_size( 'new-large', 1600, 1200 );
Changing all the occurrences of $image_data['sizes']['large'] in the original code with $image_data['sizes']['new-large']
|
wordpress
|
{
"language": "en",
"length": 151,
"provenance": "stackexchange_00019.jsonl.gz:419027",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48882"
}
|
[
-0.0000502467155456543,
-0.0156402587890625,
-0.0007472038269042969,
0.0159759521484375,
0.0038890838623046875,
-0.0304107666015625,
0.06658935546875,
-0.00928497314453125,
0.036895751953125,
0.0148468017578125,
-0.0083160400390625,
-0.02374267578125,
0.00971221923828125,
-0.031982421875,
-0.0121002197265625,
-0.011199951171875,
0.053863525390625,
-0.02423095703125,
0.05157470703125,
0.01971435546875,
0.0028629302978515625,
0.05084228515625,
0.048675537109375,
0.06256103515625,
-0.024658203125,
0.018829345703125,
0.056060791015625,
-0.01285552978515625,
-0.046722412109375,
-0.0382080078125,
0.0010156631469726562,
0.041290283203125,
0.04205322265625,
0.0021152496337890625,
-0.0157470703125,
0.012420654296875,
0.00885772705078125,
-0.01091766357421875,
-0.0145721435546875,
0.022857666015625,
0.0439453125,
-0.031982421875,
0.039276123046875,
-0.00272369384765625,
0.020111083984375,
-0.0040130615234375,
0.038970947265625,
-0.0615234375,
0.01067352294921875,
0.02166748046875,
0.0301971435546875,
0.026519775390625,
0.03607177734375,
-0.0159149169921875,
-0.00482177734375,
0.027313232421875,
-0.0231475830078125,
0.0428466796875,
0.0207061767578125,
-0.0094146728515625,
-0.036956787109375,
0.00270843505859375,
0.0234375,
-0.01410675048828125,
-0.005825042724609375,
0.005157470703125,
-0.006694793701171875,
0.0078887939453125,
-0.0285186767578125,
-0.0049285888671875,
0.0224609375,
-0.031768798828125,
-0.0126495361328125,
0.0005965232849121094,
0.00390625,
0.008392333984375,
-0.00421142578125,
0.0016040802001953125,
0.01401519775390625,
0.00519561767578125,
0.0643310546875,
0.006565093994140625,
0.05133056640625,
-0.0126953125,
0.0212249755859375,
-0.001758575439453125,
0.0014028549194335938,
-0.01512908935546875,
-0.002544403076171875,
0.0113067626953125,
-0.005733489990234375,
-0.06805419921875,
0.008392333984375,
0.039459228515625,
0.004482269287109375,
-0.0249786376953125,
0.0200958251953125,
0.0015964508056640625,
-0.006191253662109375,
0.0236053466796875,
0.00748443603515625,
-0.0430908203125,
0.04937744140625,
-0.03924560546875,
0.0254669189453125,
0.04644775390625,
-0.006866455078125,
-0.05877685546875,
0.01132965087890625,
0.0029697418212890625,
-0.005329132080078125,
-0.01462554931640625,
-0.006099700927734375,
-0.0108795166015625,
0.0093841552734375,
0.022674560546875,
-0.040863037109375,
0.0704345703125,
-0.01284027099609375,
0.069091796875,
-0.00948333740234375,
0.00682830810546875,
0.01090240478515625,
-0.0169219970703125,
0.0083770751953125,
-0.00504302978515625,
-0.0183258056640625,
-0.0172271728515625,
-0.01062774658203125,
0.026031494140625,
-0.02264404296875,
0.024444580078125,
0.043121337890625,
-0.0182037353515625,
-0.024688720703125,
-0.01727294921875,
-0.015899658203125,
-0.023834228515625,
-0.008636474609375,
0.0418701171875,
-0.014678955078125,
-0.056671142578125,
0.017608642578125,
-0.0028247833251953125,
0.039825439453125,
0.007335662841796875,
0.0250244140625,
0.01546478271484375,
-0.008544921875,
-0.05572509765625,
0.0465087890625,
-0.0034694671630859375,
0.04156494140625,
0.036224365234375,
-0.006374359130859375,
0.0098876953125,
0.08941650390625,
-0.04022216796875,
-0.04522705078125,
-0.07611083984375,
0.044403076171875,
-0.0203094482421875,
-0.01007080078125,
0.00601959228515625,
-0.019775390625,
0.00994110107421875,
-0.0609130859375,
-0.0013170242309570312,
0.027435302734375,
0.00981903076171875,
0.042388916015625,
0.002033233642578125,
-0.0184173583984375,
0.00971221923828125,
0.0042877197265625,
0.0035915374755859375,
0.0106658935546875,
0.024810791015625,
-0.0017614364624023438,
0.0374755859375,
0.0088043212890625,
-0.0308837890625,
0.041412353515625,
-0.011688232421875,
-0.00983428955078125,
-0.035552978515625,
-0.004993438720703125,
0.0185089111328125,
0.026336669921875,
0.03826904296875,
-0.0222930908203125,
-0.0251617431640625,
-0.06207275390625,
0.03033447265625,
-0.03265380859375,
0.004253387451171875,
-0.004150390625,
0.02276611328125,
-0.0159149169921875,
-0.0027618408203125,
0.0225372314453125,
-0.015777587890625,
-0.0049591064453125,
-0.0018968582153320312,
-0.1103515625,
0.01160430908203125,
-0.043701171875,
0.035736083984375,
-0.037872314453125,
0.014923095703125,
0.021392822265625,
0.01169586181640625,
-0.0086822509765625,
-0.03240966796875,
0.0024967193603515625,
-0.004253387451171875,
-0.006084442138671875,
0.017791748046875,
-0.0168304443359375,
0.07525634765625,
-0.053558349609375,
-0.0195465087890625,
-0.052764892578125,
-0.00832366943359375,
0.047943115234375,
0.0132293701171875,
-0.0282135009765625,
-0.006778717041015625,
0.01285552978515625,
0.004180908203125,
-0.0259552001953125,
0.059326171875,
-0.0088653564453125,
-0.00475311279296875,
-0.01165008544921875,
-0.038116455078125,
-0.03173828125,
-0.1334228515625,
0.026092529296875,
0.07806396484375,
0.01512908935546875,
0.01401519775390625,
-0.004730224609375,
0.034423828125,
0.06829833984375,
0.0347900390625,
0.021453857421875,
0.006923675537109375,
0.01381683349609375,
0.005504608154296875,
-0.0160369873046875,
-0.042022705078125,
0.032684326171875,
-0.07977294921875,
0.010040283203125,
0.031524658203125,
-0.0634765625,
-0.023773193359375,
0.0034008026123046875,
0.0014734268188476562,
-0.0008325576782226562,
0.005153656005859375,
0.043121337890625,
-0.0186309814453125,
0.0198974609375,
0.008392333984375,
-0.0034961700439453125,
-0.01317596435546875,
-0.06695556640625,
0.058197021484375,
0.0379638671875,
-0.039642333984375,
0.0034332275390625,
-0.007293701171875,
0.00008863210678100586,
-0.0183563232421875,
-0.029022216796875,
0.029205322265625,
-0.01276397705078125,
-0.0215606689453125,
-0.019134521484375,
0.0230712890625,
-0.051910400390625,
-0.0208587646484375,
-0.0080108642578125,
-0.06219482421875,
-0.01288604736328125,
0.00019252300262451172,
-0.015625,
-0.025665283203125,
0.006069183349609375,
0.03399658203125,
-0.00730133056640625,
0.033905029296875,
0.00321197509765625,
-0.01416778564453125,
0.045684814453125,
-0.050048828125,
0.04058837890625,
-0.0355224609375,
0.10455322265625,
0.0653076171875,
-0.041259765625,
0.0328369140625,
-0.01450347900390625,
0.00798797607421875,
-0.00232696533203125,
-0.0038604736328125,
-0.0283660888671875,
-0.03704833984375,
-0.0264739990234375,
-0.00897979736328125,
-0.00040435791015625,
0.00982666015625,
-0.0250091552734375,
-0.033111572265625,
-0.003582000732421875,
-0.00008416175842285156,
-0.0288848876953125,
0.00286102294921875,
0.00318145751953125,
-0.0499267578125,
-0.05023193359375,
-0.01503753662109375,
-0.040130615234375,
0.0252227783203125,
-0.0038909912109375,
-0.01183319091796875,
0.031768798828125,
-0.0089874267578125,
0.014495849609375,
-0.0099639892578125,
-0.028167724609375,
-0.048583984375,
0.02069091796875,
-0.0189666748046875,
-0.013336181640625,
0.025665283203125,
-0.0142364501953125,
-0.0159912109375,
-0.023834228515625,
0.04052734375,
0.03265380859375,
-0.03643798828125,
0.05389404296875,
-0.0191802978515625,
-0.000762939453125,
0.0015916824340820312,
0.04510498046875,
0.054107666015625,
-0.053192138671875,
-0.01279449462890625,
-0.037994384765625,
-0.0155181884765625,
-0.0107269287109375,
0.044403076171875,
0.046478271484375,
-0.056793212890625,
-0.0037288665771484375,
-0.064453125,
-0.02606201171875,
-0.0270233154296875,
-0.05120849609375,
0.03289794921875,
0.045196533203125,
-0.0181884765625,
-0.02191162109375,
0.035980224609375,
0.0224609375,
0.01409912109375,
0.033050537109375,
-0.0227203369140625,
0.005931854248046875,
-0.00963592529296875,
-0.006317138671875,
-0.03546142578125,
0.03302001953125,
-0.01110076904296875,
0.013427734375,
0.0016889572143554688,
-0.01055145263671875,
-0.006229400634765625,
-0.022247314453125,
-0.04669189453125,
-0.041473388671875,
0.039093017578125,
-0.0296783447265625,
0.02880859375,
-0.0482177734375,
-0.0307769775390625,
0.0018968582153320312,
0.104736328125,
-0.038604736328125,
-0.006313323974609375,
0.0078887939453125,
-0.004085540771484375,
-0.01122283935546875,
0.001857757568359375,
-0.05352783203125,
0.004184722900390625,
-0.09881591796875,
0.00572967529296875,
0.0203094482421875,
-0.055267333984375,
-0.007503509521484375,
0.0117340087890625,
-0.057830810546875,
-0.0299835205078125,
0.026702880859375,
0.000040531158447265625,
0.002162933349609375,
0.0145263671875,
0.00655364990234375,
-0.0034580230712890625,
0.004665374755859375,
-0.022674560546875,
-0.07745361328125,
-0.00044846534729003906,
-0.044830322265625,
0.0711669921875,
-0.01007843017578125,
0.0740966796875,
-0.057952880859375,
0.0281982421875,
0.016326904296875,
0.003368377685546875,
0.00388336181640625,
-0.0096588134765625,
-0.015899658203125,
0.01352691650390625,
0.0086517333984375,
-0.0170440673828125,
-0.0010213851928710938,
-0.049835205078125,
-0.07464599609375,
-0.0491943359375,
-0.01549530029296875,
0.02935791015625,
0.0215606689453125,
-0.01085662841796875,
-0.033050537109375,
-0.033233642578125,
-0.0469970703125,
-0.0038509368896484375,
-0.0132904052734375,
-0.01145172119140625,
-0.0482177734375,
-0.059722900390625,
0.059844970703125,
0.0447998046875,
-0.004291534423828125,
-0.0008788108825683594,
0.06878662109375,
0.0024204254150390625,
-0.040802001953125,
-0.0841064453125,
-0.0328369140625,
0.03594970703125,
0.0455322265625,
-0.00815582275390625,
0.018707275390625,
-0.019866943359375,
-0.00738525390625,
0.041748046875,
-0.017425537109375,
0.024688720703125,
0.04351806640625,
0.01522064208984375,
-0.0283203125,
0.01214599609375,
-0.00974273681640625,
-0.02178955078125,
0.018951416015625,
-0.0211639404296875,
0.011077880859375,
-0.038787841796875,
0.0213470458984375,
0.004253387451171875,
0.0029811859130859375,
-0.039337158203125,
-0.045745849609375,
0.01296234130859375,
0.0154571533203125,
0.005031585693359375,
-0.0020847320556640625,
0.007411956787109375,
-0.001689910888671875,
0.004772186279296875,
0.022674560546875,
-0.028472900390625,
-0.01165771484375,
-0.0428466796875,
0.0472412109375,
-0.03521728515625,
-0.0010557174682617188,
0.021453857421875,
0.00980377197265625,
-0.0170745849609375,
0.0002084970474243164,
-0.007110595703125,
-0.0758056640625,
0.0141143798828125,
0.04541015625,
-0.00502777099609375,
0.002811431884765625,
0.04290771484375,
0.0229949951171875,
-0.00806427001953125,
-0.024810791015625,
-0.024810791015625,
0.009521484375,
-0.04376220703125,
-0.0241851806640625,
0.0269927978515625,
-0.03302001953125,
0.0188446044921875,
-0.0034542083740234375,
0.037353515625,
-0.0231781005859375,
-0.01128387451171875,
0.05389404296875,
0.040130615234375,
0.0179595947265625,
0.00592803955078125,
0.03509521484375,
-0.00566864013671875,
-0.00591278076171875,
0.007904052734375,
-0.015167236328125,
-0.005451202392578125,
0.04949951171875,
0.01007080078125,
-0.032379150390625,
-0.01503753662109375,
0.0126953125,
0.00856781005859375,
-0.0091705322265625,
0.0452880859375,
-0.0304718017578125,
-0.09967041015625,
-0.0153045654296875,
0.042266845703125,
0.047027587890625,
-0.059417724609375,
-0.0411376953125,
-0.0019054412841796875,
-0.040130615234375,
0.007282257080078125,
0.01229095458984375,
-0.022491455078125,
0.0181121826171875,
0.0011081695556640625,
-0.03411865234375,
-0.04156494140625,
-0.03460693359375,
0.01496124267578125,
0.0108795166015625,
-0.00812530517578125,
-0.03607177734375,
0.031402587890625,
-0.004619598388671875,
-0.007396697998046875,
-0.0284271240234375,
0.0071563720703125,
-0.0161895751953125,
-0.002887725830078125,
0.04443359375,
-0.0081787109375,
0.0164794921875,
-0.03411865234375,
-0.02215576171875,
-0.0232086181640625,
0.0579833984375,
0.01076507568359375,
0.004047393798828125,
-0.030548095703125,
-0.0031108856201171875,
0.01568603515625,
-0.01218414306640625,
0.00957489013671875,
-0.000881195068359375,
0.015655517578125,
-0.0250396728515625,
0.035797119140625,
-0.019134521484375,
-0.00868988037109375,
0.00933074951171875,
0.0003612041473388672,
-0.01194000244140625,
-0.02679443359375,
-0.00002777576446533203,
-0.0012302398681640625,
-0.032745361328125,
-0.0250701904296875,
0.01528167724609375,
0.00899505615234375,
-0.0138092041015625,
0.0265960693359375,
0.061737060546875,
0.0221405029296875,
0.044525146484375,
-0.03717041015625,
-0.01233673095703125,
-0.036895751953125,
0.039306640625,
-0.07745361328125,
0.050384521484375,
-0.015838623046875,
-0.01477813720703125,
0.0272369384765625,
0.0223846435546875,
-0.001399993896484375,
0.01197052001953125,
-0.0206451416015625,
0.00495147705078125,
0.0240936279296875,
0.0032444000244140625,
0.0022983551025390625,
0.05401611328125,
-0.004131317138671875,
0.045074462890625,
0.03387451171875,
0.025970458984375,
0.053192138671875,
-0.0217742919921875,
-0.0194091796875,
0.0154266357421875,
0.03155517578125,
-0.012786865234375,
0.0151214599609375,
0.024688720703125,
-0.00267791748046875,
0.031158447265625,
0.007343292236328125,
0.07403564453125,
-0.004184722900390625,
0.0109100341796875,
0.0267333984375,
-0.029052734375,
0.06573486328125,
0.0033969879150390625,
-0.00044536590576171875,
0.00984954833984375,
0.00330352783203125,
-0.0082855224609375,
-0.01296234130859375,
-0.0004596710205078125,
0.01473236083984375,
-0.018585205078125,
0.01007843017578125,
0.0256500244140625,
0.0031948089599609375,
-0.0411376953125,
-0.004253387451171875,
0.029388427734375,
-0.0005536079406738281,
-0.01010894775390625,
0.03472900390625,
-0.02801513671875,
-0.00391387939453125,
-0.042083740234375,
-0.016571044921875,
-0.0102081298828125,
-0.01100921630859375,
0.0206146240234375,
0.012969970703125,
0.06109619140625,
0.0244903564453125,
0.024078369140625,
-0.031585693359375,
0.01331329345703125,
-0.006961822509765625,
0.005359649658203125,
-0.03387451171875,
0.03265380859375,
0.0333251953125,
-0.04833984375,
0.0237274169921875,
-0.0032501220703125,
-0.01479339599609375,
-0.0165557861328125,
-0.054962158203125,
0.0572509765625,
-0.034515380859375,
-0.002696990966796875,
0.0231170654296875,
0.02294921875,
-0.01009368896484375,
0.005001068115234375,
0.04388427734375,
-0.056549072265625,
-0.0545654296875,
0.0233306884765625,
-0.060089111328125,
-0.00991058349609375,
-0.00649261474609375,
-0.031585693359375,
0.09783935546875,
0.00313568115234375,
-0.0014400482177734375,
-0.002422332763671875,
0.05059814453125,
-0.00572967529296875,
0.04815673828125,
-0.0171051025390625,
0.0172119140625,
-0.03350830078125,
-0.0306549072265625,
-0.0239105224609375,
0.0266265869140625,
-0.03619384765625,
-0.0179290771484375,
0.04693603515625,
0.016632080078125,
-0.03094482421875,
-0.022979736328125,
0.00957489013671875,
0.03863525390625,
0.0087890625,
0.0265655517578125,
-0.024200439453125,
-0.00018215179443359375,
0.0038394927978515625,
-0.031585693359375,
0.018218994140625,
-0.0142822265625,
-0.0369873046875,
0.01702880859375,
0.0181121826171875,
0.0310821533203125,
-0.01372528076171875,
0.057647705078125,
-0.0297088623046875,
-0.01181793212890625,
0.0518798828125,
-0.07293701171875,
0.032073974609375,
0.0150299072265625,
0.032501220703125,
-0.0310211181640625,
0.01030731201171875,
-0.0216217041015625,
0.043365478515625,
-0.00768280029296875,
0.00817108154296875,
0.0233154296875,
-0.0021533966064453125,
0.04547119140625,
0.0162506103515625,
-0.006427764892578125,
0.034149169921875,
0.0269775390625,
0.0218048095703125,
0.050262451171875,
0.02685546875,
0.00562286376953125,
0.01751708984375,
0.04107666015625,
0.050994873046875,
-0.035308837890625,
-0.016082763671875,
0.0205535888671875,
0.0069427490234375,
-0.01357269287109375,
-0.00846099853515625,
0.0031185150146484375,
-0.06927490234375,
-0.0292510986328125,
-0.059967041015625,
0.00934600830078125,
0.07562255859375,
0.02703857421875,
-0.0035247802734375,
-0.0133056640625,
-0.045074462890625,
-0.004772186279296875,
-0.04119873046875,
-0.00318145751953125,
0.012481689453125,
0.0299530029296875,
0.01094818115234375,
0.025726318359375,
0.0364990234375,
0.00968170166015625,
-0.03424072265625,
0.046783447265625,
-0.007526397705078125,
0.04583740234375,
-0.0748291015625,
-0.047637939453125,
0.0192413330078125,
0.05743408203125,
-0.02752685546875,
-0.00888824462890625,
0.05133056640625,
0.042144775390625,
-0.0897216796875,
-0.03302001953125,
-0.0038585662841796875,
-0.04449462890625,
0.056365966796875,
-0.03472900390625,
0.009613037109375,
0.005218505859375,
-0.03857421875,
-0.004367828369140625,
-0.030914306640625,
0.0594482421875,
0.0005578994750976562,
0.0199127197265625,
0.00823974609375,
-0.033233642578125,
-0.0191802978515625,
0.01348876953125,
0.053192138671875,
0.0299072265625,
-0.02227783203125,
-0.003582000732421875,
-0.011444091796875,
-0.035247802734375,
0.0014219284057617188,
0.03265380859375,
-0.0217742919921875,
0.0242919921875,
-0.0250701904296875,
-0.0265350341796875,
0.0007419586181640625,
0.0233154296875,
-0.00882720947265625,
-0.002685546875,
0.0191650390625,
-0.017730712890625,
-0.0079498291015625,
-0.0174560546875,
-0.00670623779296875,
0.047576904296875,
0.0017147064208984375,
0.050018310546875,
-0.03253173828125,
0.0309600830078125,
-0.00676727294921875,
-0.0021076202392578125,
0.0113983154296875,
0.006961822509765625,
0.0198822021484375,
0.0034332275390625,
-0.0113983154296875,
-0.0237884521484375,
0.0335693359375,
-0.0024318695068359375,
0.0325927734375,
-0.057342529296875,
-0.006298065185546875,
-0.017303466796875,
0.009368896484375,
0.0025920867919921875,
0.0255889892578125,
-0.03741455078125,
-0.0440673828125,
-0.06402587890625,
0.0025920867919921875,
0.01483917236328125,
-0.005466461181640625,
-0.034576416015625,
0.035064697265625,
0.03485107421875,
0.0007929801940917969,
0.05963134765625,
-0.046142578125,
0.1063232421875,
0.0469970703125,
-0.054473876953125,
-0.05401611328125,
0.0035419464111328125,
-0.00714874267578125,
-0.040985107421875,
0.0307159423828125,
0.0276947021484375,
-0.00972747802734375,
-0.0193328857421875,
-0.01898193359375,
-0.0269927978515625,
-0.0119476318359375,
-0.045318603515625,
-0.016998291015625,
-0.01318359375,
-0.00711822509765625,
-0.01079559326171875,
-0.01995849609375,
-0.01442718505859375,
-0.034027099609375,
-0.01004791259765625,
0.0106658935546875,
-0.0006031990051269531,
-0.01131439208984375,
0.0099945068359375,
0.006378173828125,
0.05157470703125,
0.0216217041015625,
-0.04315185546875,
0.0178985595703125,
-0.026611328125,
0.01203155517578125,
0.033935546875,
-0.054443359375,
-0.01238250732421875,
0.001087188720703125,
-0.0104827880859375,
-0.0706787109375,
-0.05670166015625,
0.040557861328125,
-0.039703369140625,
0.016754150390625,
0.032012939453125,
-0.0275421142578125,
0.0076751708984375,
0.00502777099609375,
0.036529541015625,
0.06207275390625,
-0.004901885986328125,
-0.04803466796875,
-0.0095672607421875,
-0.00743865966796875,
0.023406982421875,
-0.01120758056640625,
-0.01013946533203125,
-0.049346923828125,
0.0073089599609375,
-0.00812530517578125,
0.01074981689453125,
0.030487060546875,
-0.035980224609375,
-0.0826416015625,
0.0094451904296875,
-0.0104522705078125,
-0.041717529296875,
-0.01184844970703125,
0.002361297607421875,
-0.0130767822265625,
0.046722412109375,
0.01296234130859375,
-0.0185546875,
-0.0117340087890625,
0.0102691650390625,
-0.005077362060546875,
0.004123687744140625,
-0.0008454322814941406,
-0.01142120361328125,
-0.005786895751953125,
0.020263671875,
0.0226898193359375,
-0.025482177734375,
0.0160980224609375,
-0.0092620849609375,
0.040435791015625,
0.053741455078125,
0.00568389892578125,
-0.0175323486328125,
0.006359100341796875,
-0.07861328125,
-0.00913238525390625,
0.00820159912109375,
-0.03851318359375,
0.0053558349609375,
0.0845947265625,
0.0697021484375,
0.0297393798828125,
-0.037261962890625,
0.016845703125,
0.0030803680419921875,
-0.0002930164337158203,
0.005832672119140625,
0.005382537841796875,
-0.031280517578125,
-0.0185699462890625,
0.005954742431640625,
-0.0203857421875,
-0.0188446044921875,
0.002826690673828125,
-0.03900146484375,
0.0016336441040039062,
0.0007071495056152344,
-0.0140838623046875,
-0.034515380859375,
0.04876708984375,
0.04779052734375,
-0.04266357421875,
-0.0129547119140625,
-0.0112152099609375,
-0.0184478759765625,
0.01654052734375,
-0.03753662109375,
-0.032867431640625,
0.058837890625,
-0.0035400390625,
-0.01480865478515625,
0.02325439453125,
-0.02813720703125,
0.0148468017578125,
0.0391845703125,
-0.01108551025390625,
0.0010862350463867188,
0.0051116943359375,
0.00424957275390625,
0.0006594657897949219,
0.00443267822265625,
0.0010232925415039062,
-0.00229644775390625,
-0.007080078125,
-0.034515380859375,
-0.006351470947265625,
-0.0000680088996887207,
0.00637054443359375,
-0.021148681640625,
0.045379638671875,
-0.03521728515625,
0.00939178466796875,
0.01195526123046875,
-0.0391845703125,
-0.019439697265625,
-0.001926422119140625,
-0.0266876220703125,
-0.019073486328125,
0.007633209228515625
] |
9780265246131e04428d72a15cae515d536bb732
|
Wordpress Stackexchange
Q: How to properly turn off REVISIONS and AUTOSAVE for whole site and optionally for a custom post type only Is there a hook/function combination that can be added to my theme's functions.php to properly disable REVISIONS and AUTOSAVE for the entire wordpress installation? What about if just for a certain custom post type? Searching online gives various hacks from deregistering scripts to tampering with core files. What's the acceptable/correct way to do this?
A: This should be placed in your wp-config.php (and no where else):
define( 'AUTOSAVE_INTERVAL', 60*60*60*24*365 ); // Set autosave interval to 1x per year
define( 'EMPTY_TRASH_DAYS', 0 ); // Empty trash now: Zero days
define( 'WP_POST_REVISIONS', false ); // Do not save andy revisions
|
Q: How to properly turn off REVISIONS and AUTOSAVE for whole site and optionally for a custom post type only Is there a hook/function combination that can be added to my theme's functions.php to properly disable REVISIONS and AUTOSAVE for the entire wordpress installation? What about if just for a certain custom post type? Searching online gives various hacks from deregistering scripts to tampering with core files. What's the acceptable/correct way to do this?
A: This should be placed in your wp-config.php (and no where else):
define( 'AUTOSAVE_INTERVAL', 60*60*60*24*365 ); // Set autosave interval to 1x per year
define( 'EMPTY_TRASH_DAYS', 0 ); // Empty trash now: Zero days
define( 'WP_POST_REVISIONS', false ); // Do not save andy revisions
A: I'm also looking for how to disable autosave. But here's what I was told in a Trac ticket:
If you really need this feature you should manage the sequential IDs yourself in a custom field and then implement custom URL routing. It shouldn't be too hard to pull that off.
A: Placing the defines in wp-config.php is fine until you turn WP_DEBUG on when you will get 'already defined' PHP notices in the debug.log every couple of minutes. Others claim placing these defines above the ABSPATH define will help.
However, I can categorically confirm the best place to put your defines is in a plugin, because the activated plugins are loaded before the WP default defines.
The default defines are protected with if exists tests, hence your plugin loaded defines will take precedence and will not cause a clash nor the repetitive PHP notices in the debug log.
|
wordpress
|
{
"language": "en",
"length": 267,
"provenance": "stackexchange_00019.jsonl.gz:419028",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/48884"
}
|
[
0.0306396484375,
-0.0306396484375,
0.005199432373046875,
-0.0298004150390625,
-0.03118896484375,
-0.0113983154296875,
0.0178985595703125,
-0.002025604248046875,
0.00022673606872558594,
0.00618743896484375,
-0.0226287841796875,
-0.043975830078125,
0.032073974609375,
-0.03472900390625,
0.0106201171875,
-0.04034423828125,
0.049102783203125,
-0.039093017578125,
0.01462554931640625,
-0.0218658447265625,
0.01325225830078125,
0.0067291259765625,
0.0380859375,
0.0557861328125,
0.0138397216796875,
0.03948974609375,
0.0272064208984375,
-0.01117706298828125,
0.0174102783203125,
0.006565093994140625,
0.033294677734375,
-0.035888671875,
0.01262664794921875,
0.01523590087890625,
-0.0123291015625,
0.031585693359375,
-0.01122283935546875,
0.027252197265625,
0.0211944580078125,
0.00550079345703125,
0.006603240966796875,
-0.00390625,
-0.0110931396484375,
-0.025115966796875,
-0.0426025390625,
0.0000438690185546875,
-0.0225067138671875,
-0.0171661376953125,
0.036376953125,
-0.0251312255859375,
-0.00833892822265625,
0.037933349609375,
0.0194854736328125,
-0.0035533905029296875,
-0.021942138671875,
-0.0135498046875,
-0.019378662109375,
0.039642333984375,
0.05572509765625,
-0.00684356689453125,
-0.047149658203125,
-0.039581298828125,
0.01375579833984375,
-0.050201416015625,
-0.0162200927734375,
-0.0106658935546875,
0.013702392578125,
0.0292510986328125,
-0.08447265625,
-0.045318603515625,
0.044403076171875,
-0.045623779296875,
0.022735595703125,
-0.0213470458984375,
-0.000018894672393798828,
-0.00223541259765625,
0.01343536376953125,
0.0096893310546875,
0.0028553009033203125,
-0.0046539306640625,
0.01374053955078125,
-0.0235595703125,
0.0167236328125,
-0.042724609375,
0.0325927734375,
0.00180816650390625,
-0.00962066650390625,
0.0010089874267578125,
-0.0222015380859375,
-0.043182373046875,
-0.0233306884765625,
-0.00412750244140625,
-0.07080078125,
-0.0015802383422851562,
-0.0024394989013671875,
-0.040283203125,
0.03411865234375,
0.04693603515625,
0.00412750244140625,
-0.0195770263671875,
0.0057830810546875,
-0.036895751953125,
-0.0237884521484375,
-0.0166473388671875,
-0.0048980712890625,
0.056854248046875,
-0.01275634765625,
-0.050811767578125,
0.00467681884765625,
0.01366424560546875,
0.031768798828125,
-0.0269775390625,
-0.00931549072265625,
-0.0162506103515625,
-0.0047149658203125,
0.020294189453125,
-0.0274810791015625,
0.0287628173828125,
-0.01418304443359375,
0.0131683349609375,
0.01049041748046875,
0.031524658203125,
-0.0132598876953125,
-0.0173492431640625,
0.008453369140625,
-0.019622802734375,
-0.020233154296875,
-0.0107574462890625,
-0.0020656585693359375,
0.019927978515625,
-0.040924072265625,
0.005542755126953125,
0.10186767578125,
0.026824951171875,
0.0240325927734375,
-0.024749755859375,
0.007686614990234375,
-0.01351165771484375,
-0.0175933837890625,
0.046295166015625,
-0.0240325927734375,
-0.036834716796875,
0.012725830078125,
-0.027618408203125,
-0.01522064208984375,
0.00051116943359375,
0.0263519287109375,
0.037689208984375,
-0.0203857421875,
-0.016632080078125,
-0.00860595703125,
0.013031005859375,
0.049713134765625,
-0.01052093505859375,
0.006072998046875,
-0.06329345703125,
0.0113067626953125,
-0.04705810546875,
0.0145263671875,
-0.046966552734375,
-0.024261474609375,
-0.01202392578125,
0.027099609375,
-0.00833892822265625,
-0.049072265625,
0.03656005859375,
-0.01080322265625,
-0.0182952880859375,
0.0298919677734375,
-0.036285400390625,
0.03125,
-0.031890869140625,
0.02783203125,
-0.0073699951171875,
-0.007404327392578125,
0.0322265625,
0.00354766845703125,
-0.0283966064453125,
0.009246826171875,
0.034942626953125,
-0.0029144287109375,
-0.0143280029296875,
0.0050506591796875,
0.0104522705078125,
-0.047515869140625,
0.034942626953125,
-0.0111541748046875,
0.05517578125,
0.02532958984375,
0.0169677734375,
-0.00750732421875,
-0.01678466796875,
-0.01031494140625,
0.023223876953125,
0.00684356689453125,
-0.020111083984375,
-0.02874755859375,
-0.0004730224609375,
-0.01345062255859375,
-0.00975799560546875,
0.007099151611328125,
-0.041290283203125,
-0.021240234375,
-0.03912353515625,
-0.1165771484375,
-0.043548583984375,
-0.0347900390625,
0.0293426513671875,
-0.011810302734375,
0.040283203125,
0.020416259765625,
0.00336456298828125,
-0.030670166015625,
-0.0012226104736328125,
0.01070404052734375,
-0.006969451904296875,
-0.0124969482421875,
0.046783447265625,
0.01119232177734375,
0.016693115234375,
0.0216522216796875,
-0.01373291015625,
0.02178955078125,
0.005886077880859375,
0.051605224609375,
-0.0209503173828125,
-0.0289154052734375,
-0.0279388427734375,
0.024017333984375,
-0.0162506103515625,
-0.028778076171875,
0.0643310546875,
-0.0093536376953125,
-0.022979736328125,
-0.0418701171875,
-0.007843017578125,
-0.052337646484375,
-0.062744140625,
-0.0218963623046875,
0.07489013671875,
0.01861572265625,
0.0032444000244140625,
-0.023162841796875,
0.0255126953125,
-0.01299285888671875,
-0.04364013671875,
0.00431060791015625,
0.018951416015625,
0.0012464523315429688,
0.01433563232421875,
0.019683837890625,
-0.01540374755859375,
0.0273895263671875,
-0.040740966796875,
0.01238250732421875,
0.036376953125,
-0.03326416015625,
0.0160064697265625,
0.051788330078125,
-0.044586181640625,
-0.002834320068359375,
-0.04498291015625,
0.006320953369140625,
-0.0430908203125,
0.0198516845703125,
-0.01314544677734375,
0.0287628173828125,
0.0281829833984375,
-0.027496337890625,
-0.005786895751953125,
0.0223846435546875,
0.01467132568359375,
-0.00041294097900390625,
0.0007085800170898438,
0.052520751953125,
-0.007114410400390625,
-0.029205322265625,
0.0079345703125,
0.0146484375,
-0.0003070831298828125,
-0.037353515625,
-0.0085906982421875,
0.01654052734375,
-0.005695343017578125,
0.0171661376953125,
-0.0765380859375,
0.03533935546875,
-0.0273895263671875,
-0.041168212890625,
-0.0382080078125,
0.01068115234375,
-0.015350341796875,
-0.040496826171875,
-0.00829315185546875,
0.007965087890625,
-0.024169921875,
-0.0183868408203125,
-0.06549072265625,
0.04681396484375,
-0.0355224609375,
0.053680419921875,
0.08795166015625,
0.0023040771484375,
0.016632080078125,
0.013641357421875,
0.00717926025390625,
0.004550933837890625,
0.0241241455078125,
-0.00472259521484375,
0.008270263671875,
-0.09716796875,
-0.041168212890625,
0.0189208984375,
0.01331329345703125,
0.00940704345703125,
0.000263214111328125,
0.000013947486877441406,
0.0289306640625,
-0.0019283294677734375,
-0.00020456314086914062,
-0.0138092041015625,
-0.0295257568359375,
0.0079498291015625,
-0.02252197265625,
0.007625579833984375,
-0.01309967041015625,
-0.0112762451171875,
0.00786590576171875,
-0.0227203369140625,
-0.03350830078125,
-0.0290069580078125,
-0.060638427734375,
-0.037200927734375,
-0.006069183349609375,
0.0164642333984375,
0.0018863677978515625,
0.004268646240234375,
0.12890625,
0.0247955322265625,
-0.0592041015625,
0.002109527587890625,
-0.0445556640625,
-0.0550537109375,
0.023468017578125,
-0.023773193359375,
-0.01157379150390625,
0.002227783203125,
0.0045013427734375,
-0.00556182861328125,
-0.01517486572265625,
0.019775390625,
-0.027191162109375,
-0.0004420280456542969,
-0.06500244140625,
0.0159759521484375,
0.05133056640625,
-0.02545166015625,
0.0181732177734375,
0.08502197265625,
-0.02093505859375,
-0.043792724609375,
0.0051116943359375,
-0.05120849609375,
-0.0023193359375,
0.029083251953125,
-0.0266571044921875,
-0.0141754150390625,
0.0122528076171875,
0.00234222412109375,
0.005283355712890625,
0.03790283203125,
-0.00786590576171875,
-0.0216064453125,
0.0006527900695800781,
0.00859832763671875,
-0.0228118896484375,
0.048614501953125,
-0.001865386962890625,
0.05841064453125,
0.03424072265625,
0.014739990234375,
-0.00844573974609375,
-0.01264190673828125,
-0.06512451171875,
-0.0523681640625,
0.0091400146484375,
-0.090087890625,
-0.0030994415283203125,
-0.04327392578125,
0.013702392578125,
-0.0168609619140625,
0.060821533203125,
0.007442474365234375,
0.0205535888671875,
-0.0267333984375,
-0.008270263671875,
-0.022735595703125,
-0.048553466796875,
-0.060333251953125,
0.01401519775390625,
-0.09417724609375,
0.041259765625,
0.0026264190673828125,
-0.0248870849609375,
-0.023712158203125,
-0.042236328125,
-0.05615234375,
-0.040802001953125,
0.0224761962890625,
-0.06976318359375,
0.00832366943359375,
0.0198822021484375,
-0.005229949951171875,
-0.016265869140625,
-0.00681304931640625,
-0.060333251953125,
-0.095703125,
-0.00988006591796875,
-0.0177001953125,
0.06689453125,
0.00988006591796875,
-0.0080108642578125,
-0.020416259765625,
0.051544189453125,
0.032440185546875,
0.00525665283203125,
0.0341796875,
0.0022525787353515625,
0.006175994873046875,
0.0017442703247070312,
0.0426025390625,
-0.0399169921875,
-0.0204010009765625,
-0.019622802734375,
-0.02655029296875,
0.0005288124084472656,
-0.0154266357421875,
-0.0061187744140625,
0.01015472412109375,
-0.0294036865234375,
-0.03094482421875,
-0.01345062255859375,
-0.050323486328125,
0.00852203369140625,
-0.0202484130859375,
-0.028228759765625,
-0.019775390625,
-0.05816650390625,
0.043701171875,
0.004352569580078125,
0.008941650390625,
-0.00136566162109375,
0.07611083984375,
0.01468658447265625,
-0.02349853515625,
-0.008209228515625,
0.0207061767578125,
0.0236968994140625,
-0.03204345703125,
0.02587890625,
-0.022064208984375,
-0.01507568359375,
0.06536865234375,
-0.038421630859375,
-0.01010894775390625,
-0.045166015625,
0.036773681640625,
-0.01409149169921875,
-0.005771636962890625,
-0.006420135498046875,
-0.048553466796875,
0.08251953125,
0.0283355712890625,
-0.0005335807800292969,
-0.009490966796875,
0.0286102294921875,
0.0400390625,
-0.01456451416015625,
-0.00774383544921875,
-0.0296630859375,
0.0096893310546875,
0.0024929046630859375,
0.01546478271484375,
0.05657958984375,
0.040802001953125,
-0.0004944801330566406,
0.02410888671875,
0.03680419921875,
0.004627227783203125,
-0.001438140869140625,
0.035369873046875,
-0.017791748046875,
0.0309600830078125,
0.0207366943359375,
0.00524139404296875,
-0.03887939453125,
-0.0084991455078125,
0.007904052734375,
-0.0292816162109375,
-0.06414794921875,
-0.0181884765625,
-0.00476837158203125,
0.036285400390625,
0.032989501953125,
-0.0232086181640625,
0.04205322265625,
0.0270538330078125,
-0.00852203369140625,
0.0017642974853515625,
-0.0399169921875,
0.025146484375,
-0.044921875,
0.01300811767578125,
0.037261962890625,
-0.033233642578125,
0.00890350341796875,
0.0013332366943359375,
0.0723876953125,
-0.03515625,
-0.023895263671875,
0.054931640625,
0.0423583984375,
0.01201629638671875,
-0.00628662109375,
0.0220489501953125,
0.0165557861328125,
-0.029541015625,
0.01064300537109375,
-0.034393310546875,
-0.055694580078125,
0.01519775390625,
0.033203125,
-0.0153045654296875,
0.0092315673828125,
0.0211181640625,
0.0194091796875,
0.005603790283203125,
0.0467529296875,
0.01995849609375,
-0.041015625,
-0.02490234375,
-0.0016603469848632812,
0.0278778076171875,
-0.026275634765625,
-0.01462554931640625,
-0.015899658203125,
-0.05474853515625,
-0.0248565673828125,
0.019744873046875,
-0.03863525390625,
-0.01416015625,
0.0005321502685546875,
-0.051483154296875,
-0.049346923828125,
0.0235595703125,
-0.007770538330078125,
0.0256195068359375,
-0.018646240234375,
-0.04241943359375,
0.00727081298828125,
-0.031768798828125,
0.0004963874816894531,
-0.019866943359375,
0.01470184326171875,
0.03656005859375,
0.0226593017578125,
0.0418701171875,
-0.0012683868408203125,
-0.036376953125,
0.0008463859558105469,
-0.0496826171875,
-0.016143798828125,
-0.041961669921875,
-0.08245849609375,
-0.0328369140625,
-0.021575927734375,
0.00046634674072265625,
0.01593017578125,
0.0012502670288085938,
-0.010498046875,
-0.00452423095703125,
0.004825592041015625,
-0.01019287109375,
0.00542449951171875,
-0.013641357421875,
0.02618408203125,
0.0003428459167480469,
0.037933349609375,
0.004474639892578125,
0.0073394775390625,
-0.0007929801940917969,
-0.0267791748046875,
0.0294036865234375,
-0.01776123046875,
-0.06005859375,
-0.030975341796875,
-0.036590576171875,
0.02447509765625,
0.0684814453125,
-0.0213165283203125,
-0.006740570068359375,
-0.0209197998046875,
0.0230865478515625,
-0.0306854248046875,
0.031524658203125,
-0.0300445556640625,
-0.01088714599609375,
-0.0206451416015625,
0.006198883056640625,
0.00774383544921875,
0.0257568359375,
-0.0404052734375,
0.028472900390625,
0.0252838134765625,
0.026397705078125,
-0.048797607421875,
-0.0240478515625,
0.01056671142578125,
0.01971435546875,
-0.0016002655029296875,
0.0362548828125,
0.01486968994140625,
0.036865234375,
0.0239715576171875,
0.0467529296875,
-0.04766845703125,
-0.05230712890625,
0.033447265625,
0.018951416015625,
-0.039398193359375,
0.006885528564453125,
-0.0206146240234375,
0.039337158203125,
0.042572021484375,
0.0819091796875,
-0.10064697265625,
0.04669189453125,
0.052490234375,
-0.0029277801513671875,
0.0221405029296875,
-0.00933074951171875,
-0.01312255859375,
-0.0181884765625,
-0.00571441650390625,
-0.07598876953125,
-0.058349609375,
-0.046417236328125,
-0.0281219482421875,
-0.0097503662109375,
0.0022430419921875,
0.0008153915405273438,
0.0034770965576171875,
-0.016998291015625,
0.01291656494140625,
0.0257110595703125,
0.01163482666015625,
-0.0311431884765625,
0.0036754608154296875,
-0.0010242462158203125,
-0.034820556640625,
-0.0870361328125,
-0.0260467529296875,
-0.0110015869140625,
-0.00522613525390625,
0.030670166015625,
-0.0311737060546875,
0.0169677734375,
0.052215576171875,
-0.0438232421875,
0.035919189453125,
0.00876617431640625,
-0.046234130859375,
-0.041595458984375,
-0.03326416015625,
0.0224151611328125,
0.0080718994140625,
-0.06256103515625,
0.027008056640625,
-0.03643798828125,
-0.036041259765625,
-0.00814056396484375,
0.00914764404296875,
0.0860595703125,
-0.019683837890625,
-0.0243072509765625,
0.0535888671875,
-0.006404876708984375,
-0.046905517578125,
-0.03521728515625,
0.0222930908203125,
-0.065673828125,
-0.0191497802734375,
-0.0283660888671875,
-0.019317626953125,
-0.0202178955078125,
-0.059173583984375,
-0.0217132568359375,
0.1268310546875,
-0.030059814453125,
-0.01114654541015625,
0.006801605224609375,
0.059783935546875,
0.000797271728515625,
0.07196044921875,
-0.034881591796875,
0.069580078125,
0.01824951171875,
0.01129913330078125,
-0.056640625,
-0.0045928955078125,
-0.0155792236328125,
0.0313720703125,
0.0171356201171875,
0.01049041748046875,
-0.01800537109375,
-0.0053863525390625,
0.0271453857421875,
0.020751953125,
-0.007106781005859375,
0.0428466796875,
0.004608154296875,
0.01509857177734375,
0.0174560546875,
-0.03509521484375,
0.022003173828125,
0.0003180503845214844,
-0.015625,
0.029144287109375,
0.00804901123046875,
0.010040283203125,
-0.00394439697265625,
-0.0249176025390625,
-0.042633056640625,
0.0023403167724609375,
0.01345062255859375,
0.0310516357421875,
0.0198974609375,
0.0005087852478027344,
0.064453125,
-0.0618896484375,
-0.0147247314453125,
-0.0173187255859375,
0.061431884765625,
0.028533935546875,
-0.043670654296875,
0.04949951171875,
0.0019931793212890625,
-0.053497314453125,
0.0170745849609375,
-0.0113372802734375,
-0.0101165771484375,
0.0345458984375,
0.0039520263671875,
0.017669677734375,
0.0267791748046875,
-0.0129241943359375,
0.00875091552734375,
0.03192138671875,
0.00909423828125,
-0.00699615478515625,
-0.043060302734375,
0.01261138916015625,
-0.01003265380859375,
-0.0179290771484375,
-0.006916046142578125,
0.0015592575073242188,
-0.03619384765625,
0.00876617431640625,
-0.0020236968994140625,
-0.005290985107421875,
0.0279541015625,
0.0008683204650878906,
0.01317596435546875,
0.0256805419921875,
-0.00843048095703125,
0.0100555419921875,
-0.034759521484375,
-0.045379638671875,
-0.0009613037109375,
0.006572723388671875,
0.0657958984375,
-0.0096282958984375,
0.06365966796875,
0.0026493072509765625,
-0.0094146728515625,
0.05706787109375,
0.0004475116729736328,
-0.000004291534423828125,
-0.034912109375,
-0.053619384765625,
0.01274871826171875,
0.02716064453125,
0.0264892578125,
-0.0205841064453125,
0.07135009765625,
0.034149169921875,
-0.07464599609375,
-0.0270538330078125,
-0.0030612945556640625,
-0.02838134765625,
0.00229644775390625,
-0.0179443359375,
0.0121612548828125,
0.033050537109375,
0.00823974609375,
-0.025390625,
0.0416259765625,
0.033172607421875,
0.003643035888671875,
0.0169219970703125,
0.00650787353515625,
-0.02813720703125,
-0.0268707275390625,
-0.0265960693359375,
0.01898193359375,
0.019683837890625,
-0.0160064697265625,
-0.004627227783203125,
-0.0200347900390625,
0.00885009765625,
-0.0266876220703125,
-0.0033626556396484375,
-0.0089569091796875,
0.054962158203125,
-0.0038471221923828125,
0.0020751953125,
-0.0033817291259765625,
-0.006961822509765625,
-0.0037689208984375,
-0.043121337890625,
0.014923095703125,
-0.024505615234375,
-0.06036376953125,
-0.040802001953125,
-0.03955078125,
0.0406494140625,
0.0164947509765625,
0.06866455078125,
-0.012451171875,
0.0242767333984375,
0.004566192626953125,
0.016632080078125,
-0.035797119140625,
-0.01062774658203125,
-0.008026123046875,
-0.037109375,
-0.003124237060546875,
0.019683837890625,
-0.049163818359375,
0.0379638671875,
0.01177215576171875,
-0.025482177734375,
0.050933837890625,
-0.039581298828125,
0.00542449951171875,
-0.03155517578125,
-0.05322265625,
-0.043853759765625,
-0.0249481201171875,
-0.0088043212890625,
0.0015249252319335938,
0.0006527900695800781,
-0.03173828125,
-0.0292816162109375,
0.011566162109375,
0.016387939453125,
-0.0222930908203125,
0.022552490234375,
-0.00429534912109375,
0.0159149169921875,
0.0311279296875,
0.00699615478515625,
-0.0021343231201171875,
0.00794219970703125,
-0.0151214599609375,
-0.029632568359375,
0.0284576416015625,
-0.0114288330078125,
-0.00930023193359375,
-0.05218505859375,
-0.0161285400390625,
0.0152435302734375,
0.0167388916015625,
-0.020050048828125,
-0.01044464111328125,
0.01088714599609375,
-0.01580810546875,
-0.0194091796875,
-0.0002799034118652344,
-0.007602691650390625,
-0.016754150390625,
-0.03289794921875,
0.018707275390625,
-0.03497314453125,
-0.036712646484375,
-0.031402587890625,
0.006565093994140625,
0.033203125,
0.01157379150390625,
-0.0736083984375,
0.04864501953125,
-0.04010009765625,
0.052490234375,
-0.0115509033203125,
-0.0166015625,
-0.0158233642578125,
0.006397247314453125,
0.0130767822265625,
-0.048583984375,
-0.04058837890625,
0.0667724609375,
-0.031341552734375,
0.0033779144287109375,
0.036346435546875,
-0.003936767578125,
-0.056640625,
-0.009796142578125,
-0.0214080810546875,
0.037445068359375,
-0.00982666015625,
-0.0261993408203125,
0.00656890869140625,
0.0322265625,
-0.0004038810729980469,
-0.042083740234375,
-0.0184783935546875,
0.018951416015625,
0.017242431640625,
-0.02984619140625,
0.0114898681640625,
0.027191162109375,
-0.017913818359375,
-0.01198577880859375,
0.030303955078125,
0.004314422607421875,
-0.0172882080078125,
-0.050933837890625,
0.02130126953125,
-0.004329681396484375,
0.02545166015625,
-0.0027790069580078125,
-0.031585693359375,
-0.0226593017578125,
0.0156707763671875,
0.0156707763671875,
0.0256195068359375,
-0.01291656494140625,
0.0675048828125,
-0.04730224609375,
0.03289794921875,
-0.00032639503479003906,
-0.02508544921875,
0.0281524658203125,
0.007259368896484375,
0.01165008544921875,
0.0535888671875,
-0.0246734619140625,
0.0005946159362792969,
-0.0302581787109375,
-0.048553466796875,
-0.023712158203125,
0.035919189453125,
-0.036163330078125,
-0.020477294921875,
0.111083984375,
0.05828857421875,
0.035797119140625,
-0.01311492919921875,
0.03167724609375,
-0.000016033649444580078,
-0.026092529296875,
0.0236358642578125,
-0.004276275634765625,
0.00455474853515625,
0.023956298828125,
-0.0027904510498046875,
0.00876617431640625,
-0.005908966064453125,
-0.01354217529296875,
-0.0090179443359375,
-0.0242767333984375,
-0.021942138671875,
-0.0184783935546875,
-0.033447265625,
0.05450439453125,
-0.0161285400390625,
-0.01091766357421875,
-0.006687164306640625,
-0.002857208251953125,
-0.02288818359375,
-0.009002685546875,
0.02850341796875,
0.0214996337890625,
0.031646728515625,
-0.056884765625,
0.009979248046875,
-0.006092071533203125,
0.0124969482421875,
-0.049591064453125,
-0.017852783203125,
-0.0155487060546875,
0.007762908935546875,
0.0009207725524902344,
-0.0013227462768554688,
-0.00922393798828125,
-0.002429962158203125,
0.01226043701171875,
0.0302276611328125,
0.00856781005859375,
0.01763916015625,
-0.003265380859375,
0.0212249755859375,
-0.05023193359375,
0.005260467529296875,
-0.040008544921875,
-0.029449462890625,
0.01055908203125,
0.0196380615234375,
0.006305694580078125,
-0.003940582275390625,
0.01319122314453125,
0.0015745162963867188,
0.0030536651611328125,
0.005794525146484375
] |
64434e56d57dc940a9d030c57b9329b87608354d
|
Wordpress Stackexchange
Q: What are the benefits of using wp_enqueue_script? Is there any real benefit to using wp_enqueue_script on small self-managed sites? For instance, Modernizr, why enqueue it through a function rather than call it directly inside the document head?
I can see the benefit on large sites, where you may move around directories or have multiple people mucking around in the files, or in a publicly available theme with numerous unknowns, but what's the benefit on a small site like a personal blog that never - or rarely - changes and has a single user? It just seems like extra lines of code in that case.
A: **YES**
1. It only loads scripts when needed
Important for load speed.
2. It safely handles dependencies.
Reduces errors, duplicate loading and js clashing.
3. It handles load order and placement
Tell it where to load and when.
4. Its handles $src properly
Moving the site around, perfect.
5. It has versioning
Helps with caching and ..well versioning.
The "extra lines of code" is irrelevant, especially compared to the benefits of doing it right.
|
Q: What are the benefits of using wp_enqueue_script? Is there any real benefit to using wp_enqueue_script on small self-managed sites? For instance, Modernizr, why enqueue it through a function rather than call it directly inside the document head?
I can see the benefit on large sites, where you may move around directories or have multiple people mucking around in the files, or in a publicly available theme with numerous unknowns, but what's the benefit on a small site like a personal blog that never - or rarely - changes and has a single user? It just seems like extra lines of code in that case.
A: **YES**
1. It only loads scripts when needed
Important for load speed.
2. It safely handles dependencies.
Reduces errors, duplicate loading and js clashing.
3. It handles load order and placement
Tell it where to load and when.
4. Its handles $src properly
Moving the site around, perfect.
5. It has versioning
Helps with caching and ..well versioning.
The "extra lines of code" is irrelevant, especially compared to the benefits of doing it right.
A: *
*Are you using a Theme that you control?
If not, then every time the Theme updates, you'll lose your modifications to the header. Or else, you'll have to fork the Theme, or maintain/backport your changes every time the Theme updates.
*Do you only use Plugins under your control?
If not, then you'll have to check for script conflicts every time you activate or update a Plugin that uses a script.
*Are you using a core-bundled script?
If so, then you'll have to check for core script conflicts every time you update core, as well as every time you update a Plugin that enqueues a core-bundled script.
*Do you use a caching Plugin?
If so, then you lose some or all of the benefits of script concatenation/minimizing/caching, since your script is hard-coded in the document head rather than enqueued.
|
wordpress
|
{
"language": "en",
"length": 320,
"provenance": "stackexchange_00019.jsonl.gz:419089",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49098"
}
|
[
0.035430908203125,
-0.00971221923828125,
-0.032623291015625,
-0.0609130859375,
0.0008592605590820312,
-0.033782958984375,
-0.0024261474609375,
0.04119873046875,
-0.0357666015625,
0.0227203369140625,
-0.005931854248046875,
0.0308685302734375,
-0.0258026123046875,
-0.0153656005859375,
-0.0010538101196289062,
-0.0341796875,
0.05621337890625,
-0.0226593017578125,
0.0145263671875,
0.0182647705078125,
-0.0067901611328125,
0.05987548828125,
-0.014190673828125,
0.060760498046875,
0.01107025146484375,
-0.06524658203125,
0.08026123046875,
0.0247650146484375,
-0.00722503662109375,
-0.017578125,
0.0081329345703125,
0.0054168701171875,
0.005771636962890625,
0.00438690185546875,
0.0152740478515625,
0.0279388427734375,
0.040985107421875,
-0.0033168792724609375,
0.03155517578125,
0.0177459716796875,
0.00856781005859375,
-0.00618743896484375,
0.046234130859375,
0.01113128662109375,
-0.00664520263671875,
0.00130462646484375,
-0.0101470947265625,
-0.032470703125,
-0.019561767578125,
-0.0310516357421875,
0.044097900390625,
0.0014181137084960938,
0.06732177734375,
-0.0005855560302734375,
-0.00926971435546875,
0.022918701171875,
-0.0207061767578125,
-0.02508544921875,
0.01325225830078125,
0.0173187255859375,
0.006702423095703125,
-0.0019989013671875,
0.0141754150390625,
-0.02642822265625,
-0.030303955078125,
-0.01398468017578125,
-0.06842041015625,
-0.006076812744140625,
-0.0306854248046875,
-0.04351806640625,
0.020965576171875,
-0.02349853515625,
-0.003917694091796875,
-0.0222320556640625,
-0.01629638671875,
0.0225830078125,
0.0189361572265625,
0.0017194747924804688,
0.017181396484375,
-0.0006604194641113281,
-0.02874755859375,
-0.0266571044921875,
-0.03759765625,
-0.04833984375,
0.0269775390625,
-0.0056915283203125,
-0.00919342041015625,
0.0173492431640625,
-0.0167388916015625,
-0.027099609375,
-0.0247039794921875,
-0.0518798828125,
0.0046844482421875,
0.004344940185546875,
-0.0169525146484375,
-0.0188751220703125,
0.03460693359375,
0.0226287841796875,
0.02728271484375,
0.053314208984375,
0.03387451171875,
-0.06549072265625,
0.0797119140625,
-0.031280517578125,
-0.0018510818481445312,
0.0584716796875,
0.00919342041015625,
-0.03314208984375,
0.004138946533203125,
-0.0081634521484375,
-0.006988525390625,
-0.0034351348876953125,
0.0187835693359375,
-0.0177001953125,
0.00811767578125,
-0.0038661956787109375,
-0.0203094482421875,
0.042022705078125,
-0.00589752197265625,
0.021575927734375,
0.0259857177734375,
0.04705810546875,
0.01335906982421875,
-0.010650634765625,
-0.0214996337890625,
-0.0227813720703125,
0.0109405517578125,
-0.058258056640625,
-0.002803802490234375,
0.0281982421875,
-0.01458740234375,
-0.01654052734375,
0.0269317626953125,
0.04205322265625,
-0.00475311279296875,
-0.020843505859375,
0.012115478515625,
0.00630950927734375,
-0.007305145263671875,
-0.019256591796875,
0.01178741455078125,
-0.0211944580078125,
-0.00640869140625,
-0.0179443359375,
0.0029506683349609375,
-0.011260986328125,
0.021026611328125,
0.04962158203125,
0.006565093994140625,
0.0106964111328125,
0.0003781318664550781,
0.0287933349609375,
0.009857177734375,
-0.021881103515625,
0.015777587890625,
-0.0283966064453125,
-0.03759765625,
0.0017690658569335938,
0.0248870849609375,
0.0180206298828125,
-0.026336669921875,
-0.0083160400390625,
0.00860595703125,
-0.048553466796875,
-0.042724609375,
-0.0001061558723449707,
0.0189056396484375,
0.003810882568359375,
0.0273284912109375,
-0.01123809814453125,
-0.0212860107421875,
-0.06134033203125,
0.04998779296875,
-0.0000457763671875,
-0.0220489501953125,
0.051788330078125,
0.0108642578125,
0.048004150390625,
0.04534912109375,
-0.0074005126953125,
-0.007251739501953125,
-0.045684814453125,
0.103759765625,
-0.043853759765625,
-0.043975830078125,
0.01812744140625,
0.00960540771484375,
0.0653076171875,
0.021453857421875,
0.027496337890625,
0.056976318359375,
-0.0176239013671875,
-0.0419921875,
0.0067291259765625,
0.015899658203125,
-0.004673004150390625,
0.0162353515625,
-0.0008454322814941406,
0.022857666015625,
-0.0391845703125,
0.09381103515625,
0.006732940673828125,
0.031829833984375,
-0.055023193359375,
-0.03765869140625,
0.004848480224609375,
-0.0230255126953125,
0.031402587890625,
0.010345458984375,
0.0191802978515625,
-0.006237030029296875,
0.00507354736328125,
0.0122833251953125,
-0.049346923828125,
-0.03564453125,
0.0023746490478515625,
-0.0303497314453125,
0.0712890625,
0.0030155181884765625,
0.01050567626953125,
0.0272216796875,
-0.052001953125,
0.0450439453125,
0.01067352294921875,
-0.0024929046630859375,
-0.0150604248046875,
-0.024322509765625,
-0.003662109375,
-0.016387939453125,
0.0069732666015625,
0.0152587890625,
0.032958984375,
0.03125,
0.06805419921875,
-0.0010862350463867188,
-0.037384033203125,
-0.04547119140625,
-0.07574462890625,
0.00696563720703125,
0.054046630859375,
0.03594970703125,
0.04339599609375,
-0.0186767578125,
-0.01071929931640625,
0.029083251953125,
-0.060516357421875,
0.0025424957275390625,
-0.005374908447265625,
-0.0367431640625,
-0.01702880859375,
0.01016998291015625,
-0.007526397705078125,
0.040191650390625,
-0.048095703125,
-0.0321044921875,
0.061431884765625,
-0.005157470703125,
0.03948974609375,
-0.00627899169921875,
0.02099609375,
-0.01549530029296875,
0.0075225830078125,
0.034576416015625,
-0.014923095703125,
0.0030956268310546875,
-0.0091705322265625,
0.00591278076171875,
0.00847625732421875,
0.00177764892578125,
-0.03021240234375,
0.01580810546875,
-0.0248565673828125,
0.01093292236328125,
0.0285186767578125,
-0.004756927490234375,
-0.0212860107421875,
-0.01291656494140625,
-0.0100555419921875,
0.0169830322265625,
0.014801025390625,
-0.0212249755859375,
-0.01023101806640625,
-0.0592041015625,
-0.01013946533203125,
-0.0076904296875,
-0.035888671875,
0.0141448974609375,
0.032440185546875,
0.041656494140625,
-0.000911712646484375,
0.0310211181640625,
0.0074005126953125,
-0.00302886962890625,
0.0204620361328125,
0.025390625,
-0.048583984375,
0.06890869140625,
-0.01336669921875,
-0.0011453628540039062,
0.00212860107421875,
0.04638671875,
0.055755615234375,
0.008758544921875,
-0.0001806020736694336,
0.01233673095703125,
0.0301361083984375,
0.0191802978515625,
-0.0015745162963867188,
0.00662994384765625,
0.02337646484375,
-0.0692138671875,
-0.01468658447265625,
0.0273895263671875,
0.049591064453125,
0.0030918121337890625,
-0.0257720947265625,
-0.00650787353515625,
0.042236328125,
-0.0743408203125,
-0.09375,
-0.059722900390625,
-0.0489501953125,
0.0313720703125,
-0.03912353515625,
0.0013790130615234375,
0.01203155517578125,
-0.0362548828125,
0.033782958984375,
-0.0212860107421875,
-0.0296478271484375,
-0.0421142578125,
-0.04937744140625,
-0.058135986328125,
0.039093017578125,
0.0101318359375,
0.022735595703125,
0.00611114501953125,
0.020721435546875,
0.005550384521484375,
-0.031585693359375,
0.0072784423828125,
0.003376007080078125,
-0.019287109375,
-0.013214111328125,
0.050628662109375,
-0.0638427734375,
-0.04010009765625,
0.01506805419921875,
-0.0623779296875,
0.0051727294921875,
-0.002330780029296875,
-0.0021266937255859375,
-0.0303955078125,
0.016937255859375,
0.016937255859375,
-0.006622314453125,
0.012420654296875,
0.031005859375,
0.0158843994140625,
-0.0287628173828125,
-0.003490447998046875,
0.0014829635620117188,
-0.02947998046875,
-0.043060302734375,
0.0179290771484375,
-0.024200439453125,
-0.00716400146484375,
-0.018798828125,
0.017303466796875,
-0.0172882080078125,
-0.032684326171875,
-0.04180908203125,
0.0767822265625,
0.018585205078125,
0.0660400390625,
-0.0094451904296875,
0.05078125,
-0.01910400390625,
0.0010585784912109375,
0.008148193359375,
0.01094818115234375,
-0.001934051513671875,
-0.026031494140625,
-0.041534423828125,
0.00821685791015625,
0.0281219482421875,
-0.00904083251953125,
0.03570556640625,
-0.0222930908203125,
-0.00859832763671875,
-0.020660400390625,
0.055450439453125,
-0.00910186767578125,
-0.0177764892578125,
0.0209503173828125,
0.033050537109375,
-0.07366943359375,
-0.03076171875,
-0.0278167724609375,
-0.0029888153076171875,
-0.0250701904296875,
0.0133209228515625,
-0.0292205810546875,
0.007633209228515625,
-0.0310211181640625,
0.030792236328125,
-0.01239776611328125,
-0.040252685546875,
0.0399169921875,
-0.058197021484375,
0.044219970703125,
-0.027679443359375,
0.0416259765625,
-0.054107666015625,
-0.01418304443359375,
-0.05072021484375,
-0.0555419921875,
-0.002899169921875,
-0.0223388671875,
0.04376220703125,
0.01084136962890625,
-0.018341064453125,
0.01500701904296875,
0.045074462890625,
-0.0213165283203125,
0.0260162353515625,
0.01235198974609375,
0.01160430908203125,
-0.0004646778106689453,
0.0235137939453125,
0.01654052734375,
-0.02130126953125,
-0.000759124755859375,
-0.037139892578125,
-0.08740234375,
-0.056396484375,
-0.01299285888671875,
-0.013092041015625,
0.0184173583984375,
-0.034088134765625,
-0.039459228515625,
-0.03521728515625,
-0.0020732879638671875,
0.0028533935546875,
0.00008231401443481445,
-0.0073699951171875,
-0.0416259765625,
-0.0116424560546875,
0.0335693359375,
-0.0011806488037109375,
0.0185089111328125,
-0.0024776458740234375,
0.04107666015625,
0.0203399658203125,
-0.0321044921875,
-0.00577545166015625,
0.032928466796875,
0.019561767578125,
-0.0205841064453125,
0.06243896484375,
-0.00461578369140625,
-0.0012712478637695312,
0.043243408203125,
-0.011383056640625,
0.027557373046875,
-0.002597808837890625,
0.030364990234375,
0.013702392578125,
0.00677490234375,
-0.00789642333984375,
0.006855010986328125,
-0.024444580078125,
0.0249786376953125,
-0.014678955078125,
-0.0168304443359375,
-0.0233001708984375,
0.03179931640625,
-0.01454925537109375,
0.0272064208984375,
-0.037689208984375,
-0.019287109375,
-0.0030002593994140625,
-0.0176544189453125,
0.03753662109375,
0.0179290771484375,
-0.003574371337890625,
0.0035247802734375,
0.04693603515625,
0.00927734375,
0.02740478515625,
0.0033054351806640625,
0.0162200927734375,
0.03570556640625,
0.020751953125,
0.009185791015625,
0.0019779205322265625,
-0.0038280487060546875,
0.0445556640625,
0.0102691650390625,
-0.03936767578125,
-0.02764892578125,
0.0180816650390625,
0.045318603515625,
-0.006732940673828125,
-0.00771331787109375,
0.0274658203125,
0.017181396484375,
-0.015716552734375,
-0.0185546875,
-0.052215576171875,
0.0287017822265625,
-0.048065185546875,
0.005420684814453125,
-0.01088714599609375,
-0.012451171875,
-0.0214385986328125,
0.046875,
-0.038360595703125,
0.019866943359375,
-0.0028133392333984375,
0.02447509765625,
0.0179290771484375,
0.019012451171875,
0.005687713623046875,
0.0121612548828125,
0.006771087646484375,
0.006694793701171875,
0.0195159912109375,
-0.028839111328125,
0.00963592529296875,
-0.0038967132568359375,
0.0018520355224609375,
-0.026763916015625,
-0.0281982421875,
0.0733642578125,
0.00858306884765625,
-0.025360107421875,
0.0643310546875,
0.05950927734375,
-0.01548004150390625,
-0.03680419921875,
-0.03765869140625,
0.041717529296875,
0.0231781005859375,
0.0257415771484375,
-0.00890350341796875,
-0.0004642009735107422,
0.008544921875,
-0.03173828125,
0.0255889892578125,
-0.024932861328125,
-0.01812744140625,
-0.0227508544921875,
0.0115966796875,
-0.01422882080078125,
-0.0182647705078125,
-0.058197021484375,
0.00605010986328125,
-0.03179931640625,
0.03802490234375,
-0.016143798828125,
-0.0101776123046875,
-0.037109375,
0.014892578125,
-0.0123291015625,
0.0289306640625,
0.00021505355834960938,
-0.01261138916015625,
-0.01279449462890625,
-0.0186004638671875,
-0.055877685546875,
-0.0251007080078125,
-0.0550537109375,
-0.04534912109375,
-0.0189971923828125,
0.0161895751953125,
0.0014963150024414062,
0.005886077880859375,
-0.01319122314453125,
-0.0430908203125,
-0.0281219482421875,
0.01088714599609375,
0.019073486328125,
0.0147247314453125,
-0.032623291015625,
0.0216064453125,
0.07427978515625,
-0.03204345703125,
0.0154266357421875,
0.0125732421875,
0.03912353515625,
-0.015899658203125,
0.006511688232421875,
-0.036285400390625,
0.005466461181640625,
-0.0170135498046875,
0.01861572265625,
-0.006458282470703125,
-0.01169586181640625,
-0.010589599609375,
0.040435791015625,
0.0228424072265625,
0.009124755859375,
-0.0016565322875976562,
-0.046539306640625,
0.035614013671875,
0.028289794921875,
0.03192138671875,
-0.00033783912658691406,
-0.002758026123046875,
-0.027557373046875,
-0.0435791015625,
0.0511474609375,
-0.0035839080810546875,
0.026641845703125,
-0.011505126953125,
-0.0474853515625,
0.0699462890625,
0.1119384765625,
0.0021038055419921875,
0.03424072265625,
0.029632568359375,
-0.0113983154296875,
-0.00988006591796875,
0.0018930435180664062,
-0.0261688232421875,
-0.01491546630859375,
0.0176849365234375,
-0.020965576171875,
-0.01470184326171875,
-0.0117340087890625,
-0.014739990234375,
0.0233001708984375,
0.011260986328125,
0.075927734375,
-0.0394287109375,
0.0282745361328125,
0.03662109375,
-0.01354217529296875,
-0.0161590576171875,
-0.0269622802734375,
0.0096282958984375,
-0.024871826171875,
0.0704345703125,
-0.0013980865478515625,
-0.01206207275390625,
0.023468017578125,
-0.03985595703125,
-0.027557373046875,
-0.027496337890625,
0.01049041748046875,
0.0355224609375,
-0.039520263671875,
0.0760498046875,
0.029876708984375,
0.02911376953125,
0.00264739990234375,
0.004241943359375,
-0.0089874267578125,
-0.0352783203125,
-0.038604736328125,
-0.0100860595703125,
-0.0297088623046875,
-0.00640869140625,
-0.0080413818359375,
-0.0007123947143554688,
0.01308441162109375,
0.048675537109375,
-0.0292205810546875,
0.0264739990234375,
0.0204010009765625,
-0.0161895751953125,
0.005832672119140625,
-0.038970947265625,
0.022552490234375,
0.0079803466796875,
-0.033782958984375,
0.0233917236328125,
0.00830078125,
-0.0682373046875,
-0.0046844482421875,
-0.042449951171875,
0.03265380859375,
-0.025054931640625,
-0.00664520263671875,
-0.0145416259765625,
0.0089111328125,
0.038055419921875,
0.00438690185546875,
-0.002880096435546875,
-0.06732177734375,
-0.08349609375,
-0.0041961669921875,
-0.11016845703125,
-0.0180206298828125,
-0.042724609375,
-0.011260986328125,
0.116455078125,
-0.0290069580078125,
-0.0078887939453125,
0.032684326171875,
0.04791259765625,
-0.0223236083984375,
0.03466796875,
0.0151214599609375,
0.00868988037109375,
-0.031494140625,
0.017578125,
-0.001438140869140625,
-0.00830078125,
0.0128936767578125,
0.051727294921875,
0.0250244140625,
0.0018596649169921875,
0.023895263671875,
-0.022216796875,
-0.0005297660827636719,
0.050537109375,
-0.0006923675537109375,
-0.0285491943359375,
0.0012483596801757812,
0.032562255859375,
-0.00756072998046875,
-0.06304931640625,
0.01043701171875,
-0.058135986328125,
-0.01398468017578125,
0.0218048095703125,
0.006397247314453125,
-0.01093292236328125,
-0.0118408203125,
-0.0360107421875,
-0.06378173828125,
0.025390625,
0.0225982666015625,
0.046844482421875,
-0.022125244140625,
0.03802490234375,
-0.02197265625,
-0.0031566619873046875,
-0.057403564453125,
-0.01529693603515625,
0.004505157470703125,
-0.0280914306640625,
0.03778076171875,
0.0178070068359375,
0.00140380859375,
0.08575439453125,
-0.0192718505859375,
0.0125885009765625,
0.0180206298828125,
-0.021728515625,
0.003757476806640625,
0.0242767333984375,
0.047027587890625,
-0.01345062255859375,
-0.033203125,
0.0298004150390625,
0.00902557373046875,
-0.00760650634765625,
-0.0010690689086914062,
0.00859832763671875,
0.00012254714965820312,
0.01004791259765625,
-0.0279693603515625,
-0.0006804466247558594,
-0.020050048828125,
-0.020751953125,
0.025726318359375,
-0.01934814453125,
-0.0167083740234375,
0.00344085693359375,
0.002716064453125,
0.0247344970703125,
0.0109100341796875,
0.0022830963134765625,
-0.01544952392578125,
0.01056671142578125,
-0.0032978057861328125,
0.0205841064453125,
0.034210205078125,
-0.00910186767578125,
-0.01275634765625,
0.0006728172302246094,
-0.009307861328125,
0.0274200439453125,
0.01277923583984375,
0.021728515625,
-0.038360595703125,
-0.03521728515625,
0.042938232421875,
0.03826904296875,
0.038238525390625,
-0.00608062744140625,
0.053070068359375,
0.0279998779296875,
-0.0560302734375,
0.004077911376953125,
0.054351806640625,
-0.0135040283203125,
0.052764892578125,
0.0038852691650390625,
0.0289764404296875,
0.022369384765625,
-0.0296783447265625,
-0.057861328125,
0.04949951171875,
0.047454833984375,
-0.03515625,
0.0083160400390625,
-0.004199981689453125,
-0.043304443359375,
0.033905029296875,
0.00504302978515625,
0.030242919921875,
-0.0098724365234375,
0.01360321044921875,
-0.041900634765625,
0.03125,
0.03839111328125,
-0.016265869140625,
0.0194244384765625,
0.043914794921875,
-0.0095977783203125,
0.0367431640625,
0.005664825439453125,
0.013275146484375,
0.005008697509765625,
-0.00376129150390625,
-0.01690673828125,
0.052703857421875,
0.0052642822265625,
-0.03997802734375,
-0.0270843505859375,
-0.008636474609375,
0.0220184326171875,
0.00562286376953125,
0.041229248046875,
-0.006439208984375,
0.005279541015625,
0.06781005859375,
-0.0562744140625,
0.0498046875,
0.046417236328125,
-0.00946044921875,
-0.0504150390625,
-0.0103912353515625,
-0.00797271728515625,
-0.02545166015625,
0.0164337158203125,
0.02392578125,
-0.004505157470703125,
-0.0079193115234375,
-0.0003437995910644531,
0.03302001953125,
0.01531219482421875,
-0.014373779296875,
-0.0484619140625,
-0.0269775390625,
0.0081939697265625,
-0.0162353515625,
-0.01200103759765625,
-0.031951904296875,
0.03125,
-0.021148681640625,
-0.01538848876953125,
-0.06707763671875,
0.0026111602783203125,
-0.019622802734375,
-0.0228729248046875,
0.009002685546875,
0.0634765625,
0.0413818359375,
0.015167236328125,
-0.026153564453125,
0.0161895751953125,
0.01328277587890625,
-0.00010329484939575195,
-0.00241851806640625,
-0.01468658447265625,
-0.0297393798828125,
0.0416259765625,
0.033416748046875,
0.02227783203125,
0.027313232421875,
-0.0044403076171875,
-0.0244598388671875,
-0.035797119140625,
-0.0176239013671875,
-0.0247344970703125,
-0.041412353515625,
-0.0118408203125,
-0.00965118408203125,
-0.0193023681640625,
-0.039459228515625,
-0.0087127685546875,
-0.0010366439819335938,
-0.0010852813720703125,
0.002887725830078125,
-0.037841796875,
0.0611572265625,
-0.0452880859375,
-0.035400390625,
-0.02264404296875,
0.042083740234375,
-0.01450347900390625,
-0.0175323486328125,
-0.06024169921875,
-0.07806396484375,
-0.032012939453125,
0.08465576171875,
-0.039337158203125,
0.044219970703125,
0.064697265625,
-0.03924560546875,
-0.0028476715087890625,
0.039703369140625,
0.0400390625,
0.09979248046875,
-0.03924560546875,
-0.00975799560546875,
0.01364898681640625,
0.016387939453125,
-0.0023403167724609375,
-0.024810791015625,
-0.00449371337890625,
0.04144287109375,
-0.00574493408203125,
-0.04498291015625,
0.0291290283203125,
0.02130126953125,
-0.0391845703125,
-0.036376953125,
0.034576416015625,
-0.01361846923828125,
-0.0211944580078125,
-0.06500244140625,
-0.0159149169921875,
0.004039764404296875,
0.037689208984375,
-0.0164642333984375,
-0.035125732421875,
-0.0595703125,
0.0202484130859375,
0.0109710693359375,
0.032623291015625,
0.033935546875,
-0.005237579345703125,
-0.038299560546875,
-0.0160064697265625,
-0.0316162109375,
0.009552001953125,
-0.000009119510650634766,
0.007843017578125,
0.0426025390625,
0.048248291015625,
-0.01390838623046875,
0.04888916015625,
-0.0064697265625,
-0.0257110595703125,
-0.04241943359375,
0.0231781005859375,
-0.0247650146484375,
0.015411376953125,
0.0975341796875,
0.041107177734375,
0.027130126953125,
-0.034881591796875,
-0.037078857421875,
0.01556396484375,
-0.01490020751953125,
-0.0261077880859375,
0.0130767822265625,
-0.056488037109375,
-0.00621795654296875,
-0.032196044921875,
-0.004352569580078125,
0.01025390625,
-0.06927490234375,
-0.03314208984375,
-0.0192108154296875,
-0.036834716796875,
0.00322723388671875,
0.0017795562744140625,
-0.055572509765625,
0.0797119140625,
-0.01435089111328125,
0.045379638671875,
0.01395416259765625,
0.042022705078125,
0.05169677734375,
0.04718017578125,
-0.016143798828125,
0.01142120361328125,
-0.033203125,
0.0020961761474609375,
-0.01076507568359375,
-0.0164794921875,
-0.019805908203125,
0.005828857421875,
0.0240020751953125,
0.03759765625,
-0.0089569091796875,
0.047332763671875,
-0.0008611679077148438,
0.051055908203125,
-0.006595611572265625,
-0.02630615234375,
-0.035552978515625,
0.0145263671875,
-0.037017822265625,
0.03387451171875,
-0.019012451171875,
0.01552581787109375,
0.020233154296875,
0.004199981689453125,
0.0053558349609375,
-0.0117950439453125,
0.034637451171875,
-0.01059722900390625,
0.007221221923828125,
-0.0460205078125,
-0.0159759521484375,
0.01128387451171875
] |
88fb9e5c839bbbf5e4f65c9a506ea5072ddaef06
|
Wordpress Stackexchange
Q: Remove HTML editor and visual/HTML tabs from TinyMCE Is it possible to remove the Visual \ HTML tabs from wp_editor and display only the TinyMCE editor?
Basically, right now, I'm using wp_editor to display the smallest possible TinyMCE editor I can - only one button is needed, italics.
What I'd like to do is make that smaller by removing the Visual \ HTML tabs. Our authors won't ever need the HTML editor and the custom buttons I'm creating will only be accessible from the visual editor.
NOTE: For reasons found here, I can't use the teeny argument of wp_editor.
Thanks in advance,
A: I was hunting for a way to disable the 'Text' tab for all users, and nowhere did I see the filter below mentioned.
This worked for me:
function my_editor_settings($settings) {
$settings['quicktags'] = false;
return $settings;
}
add_filter('wp_editor_settings', 'my_editor_settings');
|
Q: Remove HTML editor and visual/HTML tabs from TinyMCE Is it possible to remove the Visual \ HTML tabs from wp_editor and display only the TinyMCE editor?
Basically, right now, I'm using wp_editor to display the smallest possible TinyMCE editor I can - only one button is needed, italics.
What I'd like to do is make that smaller by removing the Visual \ HTML tabs. Our authors won't ever need the HTML editor and the custom buttons I'm creating will only be accessible from the visual editor.
NOTE: For reasons found here, I can't use the teeny argument of wp_editor.
Thanks in advance,
A: I was hunting for a way to disable the 'Text' tab for all users, and nowhere did I see the filter below mentioned.
This worked for me:
function my_editor_settings($settings) {
$settings['quicktags'] = false;
return $settings;
}
add_filter('wp_editor_settings', 'my_editor_settings');
A: Just set 'quicktags' parameter of the settings array to false.
wp_editor('', 'some-id', array('quicktags' => false) );
A: The code provided by ungestaltbar works great, but I wanted it to work for bbPress (2.2.x) as well. I found this to be very easy and clean as well;
In the template files (only copy the files you need from
wp-content/plugins/bbpress/templates/default/bbpress to your theme folder, into a folder called bbpress, for example wp-content/themes/mytheme/bbpress) you'll find numerous calls to:
bbp_the_content( array( 'context' => 'reply' ) );
In your template files replace a call like this with (ie. add: 'quicktags' => false);
bbp_the_content( array( 'context' => 'reply', 'quicktags' => false ) );
The calls can be found in all form-xyz.php files.
A: Here is a simple, yet clean way
// Remove visual option and tabs
add_filter( 'user_can_richedit' , '__return_false', 50 );
A: You can hide both from view using this code in your theme's functions.php file:
//Hide Post Page Options from ALL users
function hide_all_post_page_options() {
global $post;
$hide_all_post_options = "<style type=\"text/css\"> #content-html, #content-tmce { display: none !important; }</style>";
print($hide_all_post_options);
}
add_action( 'admin_head', 'hide_all_post_page_options' );
A: add_filter( 'admin_footer', 'removes_editor_visual_tab', 99 );
function removes_editor_visual_tab()
{
?>
<style type="text/css">
a#content-tmce, a#content-tmce:hover {
display:none;
}
</style>';
<script type="text/javascript">
jQuery(document).ready(function() {
document.getElementById("content-tmce").onclick = 'none';
});
</script>'
<?php
}
|
wordpress
|
{
"language": "en",
"length": 352,
"provenance": "stackexchange_00019.jsonl.gz:419107",
"question_score": "12",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49173"
}
|
[
0.026275634765625,
-0.00690460205078125,
-0.020751953125,
0.0246124267578125,
0.0136566162109375,
-0.051788330078125,
0.06072998046875,
-0.0236358642578125,
0.032318115234375,
0.05816650390625,
0.051971435546875,
-0.050201416015625,
0.0143890380859375,
-0.04559326171875,
-0.0577392578125,
0.00609588623046875,
0.0224151611328125,
-0.01904296875,
0.0197296142578125,
-0.0051727294921875,
0.00701904296875,
0.0071868896484375,
0.0251617431640625,
-0.014678955078125,
-0.0002923011779785156,
0.0012216567993164062,
0.052154541015625,
-0.046630859375,
-0.0166015625,
-0.0416259765625,
-0.005397796630859375,
0.037109375,
0.0021724700927734375,
0.07037353515625,
-0.08294677734375,
0.03399658203125,
-0.0230255126953125,
0.03851318359375,
0.00693511962890625,
0.00627899169921875,
0.015716552734375,
-0.006153106689453125,
-0.0035400390625,
-0.0330810546875,
-0.0253753662109375,
-0.0006909370422363281,
0.01544189453125,
-0.0126495361328125,
0.0015954971313476562,
-0.03717041015625,
-0.0025768280029296875,
0.02642822265625,
0.029327392578125,
-0.0704345703125,
-0.0012083053588867188,
0.01194000244140625,
-0.01216888427734375,
-0.016632080078125,
-0.00701904296875,
0.05712890625,
0.032318115234375,
0.03619384765625,
-0.0263671875,
-0.0121612548828125,
-0.01165771484375,
0.003726959228515625,
-0.0305328369140625,
0.0009703636169433594,
0.004161834716796875,
0.0106964111328125,
0.002185821533203125,
-0.02734375,
0.0170440673828125,
-0.043426513671875,
0.0140838623046875,
0.0382080078125,
-0.038421630859375,
-0.0046234130859375,
0.03680419921875,
-0.0180816650390625,
-0.002666473388671875,
-0.01654052734375,
-0.05487060546875,
-0.0089263916015625,
0.01447296142578125,
0.033538818359375,
-0.00373077392578125,
-0.02642822265625,
-0.00695037841796875,
0.010009765625,
-0.008880615234375,
-0.0357666015625,
-0.007904052734375,
0.06292724609375,
-0.005828857421875,
-0.002902984619140625,
0.0191802978515625,
-0.00868988037109375,
0.006744384765625,
-0.00958251953125,
0.063720703125,
-0.07818603515625,
0.055908203125,
-0.0211029052734375,
0.03155517578125,
0.0147247314453125,
-0.035491943359375,
0.01200103759765625,
0.0716552734375,
0.038299560546875,
0.020233154296875,
0.0158233642578125,
-0.027313232421875,
-0.0016088485717773438,
-0.0030078887939453125,
0.011627197265625,
-0.048797607421875,
0.02972412109375,
-0.02679443359375,
0.033477783203125,
-0.015716552734375,
0.02349853515625,
-0.0258941650390625,
-0.030670166015625,
-0.03369140625,
-0.060028076171875,
0.008941650390625,
0.0082855224609375,
0.034637451171875,
-0.0036983489990234375,
-0.0582275390625,
0.004665374755859375,
0.0615234375,
0.053924560546875,
0.049652099609375,
-0.0198974609375,
0.0076446533203125,
-0.021942138671875,
-0.006839752197265625,
0.022125244140625,
-0.012176513671875,
-0.0179290771484375,
0.026824951171875,
-0.024566650390625,
-0.0157470703125,
0.03033447265625,
0.0229034423828125,
0.0005269050598144531,
-0.0254669189453125,
-0.049224853515625,
0.004383087158203125,
-0.03314208984375,
0.0217742919921875,
0.020538330078125,
-0.005626678466796875,
-0.04827880859375,
0.04022216796875,
-0.047760009765625,
0.01788330078125,
-0.04736328125,
0.0240020751953125,
-0.0062713623046875,
0.01328277587890625,
-0.0291748046875,
-0.03302001953125,
-0.014129638671875,
-0.06439208984375,
-0.004688262939453125,
0.03076171875,
0.028350830078125,
-0.0181427001953125,
-0.031097412109375,
0.028533935546875,
0.02935791015625,
-0.0005674362182617188,
0.046539306640625,
-0.00305938720703125,
0.0213775634765625,
0.024261474609375,
0.002277374267578125,
-0.0175018310546875,
-0.04644775390625,
0.07415771484375,
-0.035552978515625,
-0.0699462890625,
0.0163116455078125,
-0.0147552490234375,
0.05572509765625,
0.050048828125,
0.0183563232421875,
0.02105712890625,
-0.0198822021484375,
0.034515380859375,
-0.03570556640625,
0.03411865234375,
-0.03985595703125,
-0.0293121337890625,
-0.033050537109375,
-0.0031681060791015625,
0.0018768310546875,
0.0679931640625,
-0.023223876953125,
0.033660888671875,
-0.06829833984375,
-0.0906982421875,
-0.0098419189453125,
-0.024566650390625,
0.04150390625,
-0.023345947265625,
0.0008254051208496094,
0.017669677734375,
-0.0141448974609375,
-0.03070068359375,
0.0308837890625,
0.006103515625,
0.00977325439453125,
-0.00011098384857177734,
0.054840087890625,
0.020782470703125,
0.043853759765625,
0.05255126953125,
-0.0294036865234375,
0.06591796875,
0.0193023681640625,
0.019073486328125,
-0.049896240234375,
0.00524139404296875,
-0.0235595703125,
0.047882080078125,
-0.028350830078125,
0.0411376953125,
0.023101806640625,
0.016326904296875,
0.034210205078125,
-0.018402099609375,
-0.004871368408203125,
-0.009796142578125,
-0.05877685546875,
0.00672149658203125,
0.03460693359375,
0.06201171875,
0.0243682861328125,
-0.0248870849609375,
-0.048187255859375,
0.049896240234375,
-0.02374267578125,
0.0190887451171875,
-0.03955078125,
0.017547607421875,
0.04119873046875,
0.0257568359375,
0.0048980712890625,
0.01398468017578125,
-0.0172271728515625,
0.058013916015625,
0.00965118408203125,
0.0182037353515625,
0.035247802734375,
0.00923919677734375,
0.00476837158203125,
-0.0010309219360351562,
0.042572021484375,
0.00838470458984375,
-0.00452423095703125,
0.05084228515625,
0.0001302957534790039,
0.04541015625,
0.043914794921875,
-0.027069091796875,
-0.007904052734375,
0.00626373291015625,
0.0195159912109375,
-0.01442718505859375,
0.006900787353515625,
0.043609619140625,
-0.020599365234375,
-0.02386474609375,
-0.003643035888671875,
0.000010669231414794922,
0.00780487060546875,
-0.029632568359375,
-0.00794219970703125,
0.01444244384765625,
-0.013092041015625,
0.0139923095703125,
-0.043060302734375,
0.027252197265625,
-0.0391845703125,
0.00823211669921875,
-0.0211639404296875,
-0.003467559814453125,
0.021820068359375,
-0.0185699462890625,
0.0251007080078125,
0.01016998291015625,
-0.0206298828125,
0.048828125,
-0.01544189453125,
0.0277252197265625,
0.00649261474609375,
0.045501708984375,
0.05419921875,
0.00695037841796875,
-0.00955963134765625,
0.0275115966796875,
-0.054779052734375,
0.00746917724609375,
0.023193359375,
0.020111083984375,
0.0202178955078125,
-0.060455322265625,
0.0307464599609375,
0.007419586181640625,
-0.00855255126953125,
-0.0186309814453125,
-0.0433349609375,
-0.02667236328125,
0.00811767578125,
-0.05029296875,
0.0137939453125,
0.02947998046875,
-0.0240478515625,
-0.05340576171875,
0.0305633544921875,
-0.036590576171875,
0.004055023193359375,
0.053985595703125,
-0.019927978515625,
-0.0045013427734375,
-0.00415802001953125,
-0.006580352783203125,
0.015533447265625,
-0.0295562744140625,
0.0019445419311523438,
-0.0032978057861328125,
0.0174560546875,
0.0247039794921875,
0.033111572265625,
0.0162506103515625,
-0.0294342041015625,
0.0557861328125,
-0.051300048828125,
-0.0231170654296875,
0.056976318359375,
0.016448974609375,
-0.057098388671875,
-0.0102386474609375,
0.0008587837219238281,
-0.040191650390625,
-0.01031494140625,
0.031646728515625,
-0.0097808837890625,
0.0234375,
0.01201629638671875,
0.049468994140625,
-0.001155853271484375,
-0.041229248046875,
0.0195159912109375,
0.031280517578125,
-0.035491943359375,
-0.0188140869140625,
0.01812744140625,
-0.0184173583984375,
0.0296173095703125,
-0.01482391357421875,
-0.02081298828125,
0.00299072265625,
0.036895751953125,
0.043212890625,
0.0447998046875,
0.025390625,
0.032379150390625,
0.0050201416015625,
-0.010955810546875,
0.0031948089599609375,
-0.05792236328125,
0.02960205078125,
-0.03155517578125,
0.019561767578125,
-0.0061492919921875,
-0.026031494140625,
-0.009185791015625,
-0.0159759521484375,
-0.006618499755859375,
0.03973388671875,
0.0265045166015625,
-0.0374755859375,
0.0292816162109375,
-0.0254364013671875,
-0.0088653564453125,
-0.033935546875,
0.0248870849609375,
-0.03875732421875,
-0.00705718994140625,
-0.0167388916015625,
0.01290130615234375,
-0.014373779296875,
-0.044586181640625,
-0.0265960693359375,
-0.00982666015625,
-0.06622314453125,
0.028656005859375,
-0.0068511962890625,
-0.01128387451171875,
-0.06048583984375,
0.02789306640625,
-0.07073974609375,
-0.02301025390625,
0.0465087890625,
0.017425537109375,
-0.00867462158203125,
0.0252532958984375,
-0.0114288330078125,
-0.00548553466796875,
-0.032440185546875,
0.005523681640625,
-0.059783935546875,
-0.00128936767578125,
-0.051300048828125,
0.03399658203125,
0.003997802734375,
0.027496337890625,
-0.01187896728515625,
0.0379638671875,
-0.021636962890625,
0.004364013671875,
0.00152587890625,
0.03668212890625,
-0.0189666748046875,
-0.0169677734375,
-0.005176544189453125,
-0.040740966796875,
0.0265045166015625,
-0.004795074462890625,
-0.0408935546875,
0.006053924560546875,
-0.048309326171875,
-0.0146331787109375,
0.004405975341796875,
-0.039642333984375,
-0.051727294921875,
-0.035247802734375,
-0.047943115234375,
-0.0009646415710449219,
-0.0171051025390625,
-0.0171966552734375,
-0.029022216796875,
-0.054229736328125,
0.0655517578125,
0.061981201171875,
-0.00007003545761108398,
-0.0131378173828125,
0.0281982421875,
0.012664794921875,
-0.055694580078125,
-0.00032782554626464844,
0.0202789306640625,
0.048553466796875,
0.03680419921875,
-0.033203125,
-0.0179901123046875,
-0.042999267578125,
0.018768310546875,
0.020263671875,
0.0264739990234375,
-0.080078125,
0.06451416015625,
-0.0124664306640625,
0.002490997314453125,
0.015472412109375,
-0.0217132568359375,
0.03936767578125,
0.00640869140625,
0.0206451416015625,
-0.00852203369140625,
0.0287628173828125,
0.0137939453125,
0.01959228515625,
-0.04095458984375,
-0.01123809814453125,
-0.005466461181640625,
-0.018310546875,
0.0919189453125,
0.035614013671875,
0.0211639404296875,
0.01412200927734375,
0.0026397705078125,
0.0277557373046875,
-0.019195556640625,
-0.0078887939453125,
0.002655029296875,
-0.0254669189453125,
0.005313873291015625,
0.011260986328125,
-0.0292816162109375,
-0.02587890625,
0.006237030029296875,
-0.035736083984375,
-0.00359344482421875,
-0.0294647216796875,
-0.029449462890625,
0.008575439453125,
0.052337646484375,
-0.0007534027099609375,
0.01222991943359375,
0.038299560546875,
0.00974273681640625,
-0.0115203857421875,
0.0096588134765625,
0.015716552734375,
-0.02764892578125,
-0.04547119140625,
-0.057891845703125,
-0.0296173095703125,
-0.0223388671875,
0.0154571533203125,
0.0137786865234375,
-0.063720703125,
0.0296173095703125,
0.00392913818359375,
0.01531219482421875,
-0.0290679931640625,
0.0297393798828125,
-0.0006761550903320312,
0.02362060546875,
0.01535797119140625,
0.005157470703125,
-0.0027751922607421875,
-0.036285400390625,
-0.024078369140625,
0.0263519287109375,
0.044525146484375,
0.005947113037109375,
-0.0181732177734375,
-0.00637054443359375,
-0.036224365234375,
0.00888824462890625,
0.01064300537109375,
-0.037353515625,
-0.043731689453125,
0.004772186279296875,
0.0274658203125,
0.00461578369140625,
-0.031402587890625,
-0.00399017333984375,
-0.00550079345703125,
-0.017822265625,
-0.0059967041015625,
0.05938720703125,
-0.049468994140625,
-0.0097808837890625,
-0.0042877197265625,
-0.00304412841796875,
0.01557159423828125,
-0.018707275390625,
-0.10369873046875,
-0.06695556640625,
0.0085601806640625,
0.0106048583984375,
0.050567626953125,
-0.0226593017578125,
0.01373291015625,
-0.0251922607421875,
0.0036373138427734375,
-0.043121337890625,
0.00836944580078125,
0.0341796875,
0.0241546630859375,
-0.0305938720703125,
0.0118865966796875,
-0.058258056640625,
-0.00847625732421875,
-0.06085205078125,
-0.04656982421875,
-0.04022216796875,
-0.0178680419921875,
0.02996826171875,
0.01374053955078125,
0.0283660888671875,
-0.016357421875,
0.0037555694580078125,
0.0270538330078125,
0.0037078857421875,
0.037384033203125,
-0.006473541259765625,
0.06048583984375,
-0.0294036865234375,
0.08282470703125,
0.005252838134765625,
0.01177978515625,
-0.030548095703125,
-0.0276336669921875,
0.049102783203125,
-0.0325927734375,
-0.044097900390625,
-0.041015625,
-0.04400634765625,
-0.039947509765625,
-0.0008416175842285156,
-0.0288238525390625,
0.0019464492797851562,
-0.0059661865234375,
-0.003238677978515625,
-0.0255889892578125,
-0.0013437271118164062,
0.0042572021484375,
0.028961181640625,
-0.0262908935546875,
-0.0172576904296875,
0.0084381103515625,
-0.019256591796875,
0.015625,
0.0169677734375,
-0.01534271240234375,
0.007122039794921875,
0.01058197021484375,
0.0128631591796875,
0.011474609375,
0.0308837890625,
-0.00571441650390625,
0.037384033203125,
0.0203399658203125,
0.01506805419921875,
0.02947998046875,
0.0097808837890625,
-0.01415252685546875,
0.0024929046630859375,
0.0335693359375,
0.007495880126953125,
0.0004513263702392578,
0.03192138671875,
-0.0217437744140625,
-0.0005435943603515625,
0.06817626953125,
0.08892822265625,
-0.07843017578125,
-0.00872039794921875,
0.0472412109375,
-0.0135040283203125,
-0.0168914794921875,
-0.036041259765625,
-0.0150909423828125,
-0.085693359375,
0.07110595703125,
0.00274658203125,
-0.013214111328125,
0.00818634033203125,
-0.0156097412109375,
0.00011283159255981445,
-0.0283203125,
0.053375244140625,
0.005275726318359375,
-0.02154541015625,
-0.0103302001953125,
0.020172119140625,
-0.00774383544921875,
-0.016326904296875,
0.027801513671875,
-0.007442474365234375,
-0.02178955078125,
-0.07135009765625,
-0.017242431640625,
0.0236968994140625,
-0.051239013671875,
0.030609130859375,
-0.0189666748046875,
-0.0213470458984375,
0.026397705078125,
-0.053497314453125,
0.04644775390625,
0.00014913082122802734,
-0.064697265625,
0.01812744140625,
0.003284454345703125,
-0.00687408447265625,
-0.0024394989013671875,
-0.03759765625,
0.0016851425170898438,
-0.03350830078125,
0.030364990234375,
0.003116607666015625,
0.05279541015625,
0.036102294921875,
0.019287109375,
-0.05340576171875,
0.02398681640625,
-0.006237030029296875,
-0.006832122802734375,
-0.03814697265625,
-0.035491943359375,
-0.04736328125,
-0.0147857666015625,
-0.05419921875,
-0.03924560546875,
0.0526123046875,
-0.058990478515625,
-0.08807373046875,
0.11669921875,
0.046783447265625,
0.05194091796875,
-0.0026302337646484375,
0.03265380859375,
-0.06427001953125,
-0.0009450912475585938,
-0.0034809112548828125,
0.022613525390625,
0.039154052734375,
-0.005184173583984375,
0.018096923828125,
0.003215789794921875,
0.015045166015625,
0.03472900390625,
0.03125,
-0.006084442138671875,
0.00482177734375,
0.0053558349609375,
0.042755126953125,
0.052154541015625,
-0.0106048583984375,
0.00262451171875,
0.01187896728515625,
-0.0244140625,
0.01061248779296875,
0.00225830078125,
0.025726318359375,
-0.035430908203125,
-0.016571044921875,
0.0291290283203125,
0.018157958984375,
0.0153961181640625,
0.01568603515625,
0.01108551025390625,
0.00829315185546875,
-0.0012845993041992188,
0.0005083084106445312,
-0.055145263671875,
0.0023288726806640625,
0.0182952880859375,
0.013397216796875,
-0.0765380859375,
-0.07073974609375,
-0.0241241455078125,
0.0263519287109375,
0.021697998046875,
-0.048553466796875,
0.0012722015380859375,
0.0044097900390625,
-0.01512908935546875,
-0.0185699462890625,
-0.02728271484375,
0.01727294921875,
0.020050048828125,
0.0015735626220703125,
-0.02191162109375,
-0.0037021636962890625,
-0.06036376953125,
0.0251922607421875,
0.0384521484375,
0.002132415771484375,
-0.02056884765625,
-0.025238037109375,
0.0076446533203125,
0.00257110595703125,
-0.019256591796875,
-0.00830841064453125,
-0.007328033447265625,
-0.00577545166015625,
0.0433349609375,
0.01318359375,
-0.00537872314453125,
-0.015594482421875,
0.0036334991455078125,
-0.00003510713577270508,
0.03424072265625,
0.01174163818359375,
-0.0036907196044921875,
-0.0322265625,
-0.0206298828125,
0.014923095703125,
0.013214111328125,
0.0291748046875,
0.038299560546875,
0.051513671875,
-0.0155181884765625,
-0.0423583984375,
0.0212249755859375,
-0.0209197998046875,
0.041107177734375,
-0.04071044921875,
-0.0006861686706542969,
-0.01058197021484375,
0.033721923828125,
0.035980224609375,
0.01102447509765625,
0.028045654296875,
0.010955810546875,
-0.01459503173828125,
0.0015544891357421875,
-0.0193939208984375,
-0.0248870849609375,
-0.021148681640625,
-0.0253448486328125,
-0.024688720703125,
0.01151275634765625,
-0.00955963134765625,
0.011016845703125,
-0.01352691650390625,
0.02838134765625,
-0.028106689453125,
0.03546142578125,
-0.00304412841796875,
-0.0207977294921875,
0.019073486328125,
-0.01473236083984375,
0.007617950439453125,
0.0096893310546875,
0.003078460693359375,
0.0204315185546875,
-0.0280303955078125,
0.009674072265625,
-0.01031494140625,
0.0172271728515625,
0.000044405460357666016,
0.04925537109375,
0.00031948089599609375,
-0.02862548828125,
-0.0194244384765625,
0.0011091232299804688,
0.043609619140625,
0.0036106109619140625,
-0.02642822265625,
0.01052093505859375,
-0.0430908203125,
-0.0269012451171875,
-0.0167694091796875,
0.04205322265625,
-0.008758544921875,
0.089599609375,
-0.0233612060546875,
0.00403594970703125,
-0.0240936279296875,
0.060882568359375,
-0.046051025390625,
-0.037750244140625,
0.0633544921875,
0.0234375,
0.01305389404296875,
-0.0321044921875,
-0.050384521484375,
0.0293426513671875,
0.008758544921875,
-0.0023555755615234375,
0.016876220703125,
0.005462646484375,
0.00853729248046875,
-0.012115478515625,
0.013092041015625,
-0.00719451904296875,
-0.021331787109375,
-0.023223876953125,
-0.0025043487548828125,
0.0155487060546875,
0.0186309814453125,
-0.0031185150146484375,
0.0291900634765625,
0.0229034423828125,
-0.0269317626953125,
0.020538330078125,
-0.0239715576171875,
0.0186614990234375,
0.020721435546875,
0.0208740234375,
-0.033294677734375,
0.0234527587890625,
0.00023221969604492188,
-0.01523590087890625,
0.0340576171875,
-0.00481414794921875,
0.038116455078125,
-0.08843994140625,
-0.0008182525634765625,
0.000720977783203125,
0.032379150390625,
0.002033233642578125,
0.0012607574462890625,
0.01117706298828125,
0.002704620361328125,
-0.033203125,
0.0006184577941894531,
-0.0190582275390625,
-0.01042938232421875,
-0.00983428955078125,
0.016632080078125,
-0.00998687744140625,
-0.0675048828125,
-0.08685302734375,
-0.00103759765625,
0.0188140869140625,
-0.0020809173583984375,
-0.032440185546875,
0.01971435546875,
-0.0247039794921875,
0.039093017578125,
-0.01739501953125,
0.03192138671875,
-0.040771484375,
-0.05157470703125,
-0.0312042236328125,
-0.042083740234375,
-0.057586669921875,
0.07354736328125,
-0.031402587890625,
0.00746917724609375,
0.037017822265625,
-0.01248931884765625,
-0.028167724609375,
-0.0006947517395019531,
0.0016422271728515625,
0.034881591796875,
-0.033355712890625,
-0.01287841796875,
0.02093505859375,
0.003505706787109375,
-0.00379180908203125,
-0.059906005859375,
-0.033203125,
-0.0073699951171875,
0.0238494873046875,
0.0404052734375,
-0.0379638671875,
-0.023712158203125,
-0.060211181640625,
-0.11346435546875,
-0.0004458427429199219,
0.0276336669921875,
-0.061065673828125,
0.046234130859375,
0.02301025390625,
-0.02130126953125,
-0.0093994140625,
0.0231781005859375,
-0.00490570068359375,
0.048370361328125,
-0.00968170166015625,
0.0262298583984375,
0.03656005859375,
0.0088043212890625,
0.01000213623046875,
-0.04150390625,
0.009765625,
-0.019805908203125,
0.029052734375,
0.020416259765625,
-0.016021728515625,
0.015838623046875,
0.0298004150390625,
-0.032867431640625,
-0.053375244140625,
-0.0179595947265625,
-0.03985595703125,
-0.0093841552734375,
-0.0369873046875,
-0.05181884765625,
-0.031646728515625,
0.0687255859375,
0.0657958984375,
0.0265045166015625,
-0.0185089111328125,
-0.017242431640625,
-0.0201263427734375,
-0.01629638671875,
-0.003826141357421875,
0.020111083984375,
-0.05767822265625,
-0.00046896934509277344,
0.006267547607421875,
0.0156097412109375,
0.025482177734375,
-0.0361328125,
-0.023681640625,
-0.0250701904296875,
-0.01226806640625,
0.0270538330078125,
-0.062347412109375,
0.034454345703125,
0.01227569580078125,
-0.023834228515625,
-0.007965087890625,
-0.01380157470703125,
-0.01172637939453125,
-0.0100250244140625,
0.01617431640625,
-0.01551055908203125,
-0.032684326171875,
-0.032196044921875,
0.056121826171875,
-0.0300140380859375,
0.035308837890625,
-0.0697021484375,
-0.01436614990234375,
-0.00870513916015625,
-0.0085906982421875,
0.0029735565185546875,
-0.0162506103515625,
-0.01219940185546875,
-0.01207733154296875,
-0.0007967948913574219,
-0.005558013916015625,
-0.0311431884765625,
0.0025482177734375,
-0.0246124267578125,
0.00391387939453125,
-0.0012912750244140625,
0.018310546875,
0.021514892578125,
-0.0026607513427734375,
0.01324462890625,
0.028778076171875,
0.0350341796875,
-0.0100250244140625,
0.01751708984375,
-0.02685546875,
0.020965576171875,
0.00530242919921875
] |
7188d944fba938c54a60bb6c53a3b442a039809d
|
Wordpress Stackexchange
Q: How to consolidate multiple static page templates into one dynamic one? I have a group of themes that a client needs consolidated into one. Everything is fairly straight forward, except each theme has theme-specific page templates. Instead of pooling all the template files together in the new master theme, how can I reduce them down to one dynamic template that displays differently depending on a chosen theme option?
When searching myself I came across the template_include filter, which looks like it could be used to override the template that is used, but I'm not sure this is the right solution or how it would be implemented in this case.
Another idea I have would be to just use conditional includes inside the "master" template.
Any suggestions would be much appreciated.
A: Personally, I build everything within index.php of each template. I then do conditional checks.
Example:
if(is_front_page()){
// Home page layout
} elseif(is_page()){
// General page layout
if(is_page('contact')){
// Page layout specific to the contact page
} elseif(is_page('about')){
// Page layout specific to the about page
}
}
Read more on conditional tags.
|
Q: How to consolidate multiple static page templates into one dynamic one? I have a group of themes that a client needs consolidated into one. Everything is fairly straight forward, except each theme has theme-specific page templates. Instead of pooling all the template files together in the new master theme, how can I reduce them down to one dynamic template that displays differently depending on a chosen theme option?
When searching myself I came across the template_include filter, which looks like it could be used to override the template that is used, but I'm not sure this is the right solution or how it would be implemented in this case.
Another idea I have would be to just use conditional includes inside the "master" template.
Any suggestions would be much appreciated.
A: Personally, I build everything within index.php of each template. I then do conditional checks.
Example:
if(is_front_page()){
// Home page layout
} elseif(is_page()){
// General page layout
if(is_page('contact')){
// Page layout specific to the contact page
} elseif(is_page('about')){
// Page layout specific to the about page
}
}
Read more on conditional tags.
|
wordpress
|
{
"language": "en",
"length": 184,
"provenance": "stackexchange_00019.jsonl.gz:419115",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49193"
}
|
[
0.022918701171875,
0.00049591064453125,
-0.0283355712890625,
-0.060302734375,
0.0135650634765625,
0.003093719482421875,
-0.015777587890625,
0.0005784034729003906,
-0.005893707275390625,
0.00537872314453125,
-0.025634765625,
-0.00637054443359375,
-0.013824462890625,
-0.0149688720703125,
0.00719451904296875,
-0.05084228515625,
0.0295257568359375,
-0.032318115234375,
0.01174163818359375,
-0.01428985595703125,
0.03228759765625,
-0.01529693603515625,
0.0007224082946777344,
0.06488037109375,
0.00189971923828125,
-0.052215576171875,
0.04718017578125,
-0.0136260986328125,
-0.0223541259765625,
-0.045257568359375,
0.0012502670288085938,
0.057647705078125,
0.0157318115234375,
-0.0111236572265625,
0.046051025390625,
0.01947021484375,
0.0308074951171875,
-0.018798828125,
0.01486968994140625,
0.0125885009765625,
0.01070404052734375,
-0.00960540771484375,
0.0257110595703125,
0.02490234375,
0.00762176513671875,
-0.037139892578125,
0.005382537841796875,
-0.07318115234375,
0.037353515625,
-0.00936126708984375,
0.022003173828125,
-0.0177764892578125,
0.031341552734375,
-0.027069091796875,
-0.044921875,
-0.031707763671875,
0.0012559890747070312,
-0.0199432373046875,
0.025634765625,
0.0094757080078125,
-0.01013946533203125,
-0.001338958740234375,
0.0235748291015625,
-0.0202178955078125,
0.00018155574798583984,
-0.0228118896484375,
-0.04327392578125,
0.02886962890625,
-0.01291656494140625,
-0.00872802734375,
0.0182952880859375,
-0.01438140869140625,
0.0038394927978515625,
-0.027679443359375,
-0.00494384765625,
0.033905029296875,
-0.00390625,
0.006103515625,
0.0096588134765625,
0.004413604736328125,
-0.0140380859375,
0.0209808349609375,
-0.05767822265625,
-0.0657958984375,
0.0169219970703125,
-0.033599853515625,
-0.01409912109375,
0.0020046234130859375,
-0.02069091796875,
-0.0238494873046875,
-0.0229949951171875,
-0.00502777099609375,
-0.0007967948913574219,
-0.01727294921875,
-0.0285186767578125,
-0.0020122528076171875,
0.017364501953125,
0.05169677734375,
-0.0261688232421875,
0.01093292236328125,
0.0005826950073242188,
-0.052825927734375,
0.047332763671875,
-0.056976318359375,
-0.0022430419921875,
0.033477783203125,
0.0180511474609375,
0.072021484375,
0.046966552734375,
0.031341552734375,
0.023223876953125,
0.019439697265625,
-0.0182647705078125,
-0.01320648193359375,
-0.0235595703125,
0.0171051025390625,
-0.0521240234375,
0.00951385498046875,
-0.01061248779296875,
0.0210723876953125,
0.0099029541015625,
0.0220794677734375,
0.0279541015625,
-0.01593017578125,
-0.0132293701171875,
0.004009246826171875,
-0.017608642578125,
-0.06622314453125,
0.00501251220703125,
-0.01800537109375,
-0.03033447265625,
0.0272369384765625,
0.048126220703125,
0.03289794921875,
0.01158905029296875,
-0.00634765625,
0.029571533203125,
-0.0005273818969726562,
0.0012750625610351562,
-0.00868988037109375,
0.0157318115234375,
-0.01221466064453125,
-0.025238037109375,
0.00467681884765625,
-0.01202392578125,
0.026580810546875,
0.039764404296875,
0.0226287841796875,
-0.0386962890625,
-0.0350341796875,
0.0186309814453125,
-0.002521514892578125,
0.029083251953125,
-0.0318603515625,
0.0299072265625,
-0.07098388671875,
0.00922393798828125,
-0.04156494140625,
0.036376953125,
-0.020416259765625,
0.01306915283203125,
-0.0016813278198242188,
0.00856781005859375,
-0.006984710693359375,
-0.0136566162109375,
-0.0202484130859375,
-0.0014629364013671875,
-0.004467010498046875,
0.00408172607421875,
-0.0299224853515625,
-0.010101318359375,
0.01132965087890625,
-0.005771636962890625,
0.0008258819580078125,
0.0138092041015625,
0.03363037109375,
-0.020416259765625,
0.030242919921875,
-0.00374603271484375,
0.0152587890625,
-0.002094268798828125,
-0.0367431640625,
0.0128021240234375,
0.0010957717895507812,
-0.087890625,
0.01788330078125,
0.0093841552734375,
0.048614501953125,
0.0122222900390625,
-0.0038547515869140625,
0.07830810546875,
0.01001739501953125,
-0.0242462158203125,
0.03424072265625,
0.01029205322265625,
-0.0189056396484375,
-0.006031036376953125,
0.0034389495849609375,
-0.003665924072265625,
-0.03680419921875,
-0.01064300537109375,
0.018402099609375,
-0.0013875961303710938,
0.006687164306640625,
0.0172576904296875,
-0.0051727294921875,
0.0042572021484375,
0.0297698974609375,
-0.042388916015625,
0.006450653076171875,
0.031097412109375,
-0.024322509765625,
-0.019775390625,
-0.0005068778991699219,
-0.0107269287109375,
0.00582122802734375,
0.015411376953125,
-0.041046142578125,
0.0194854736328125,
-0.02374267578125,
0.04058837890625,
0.0247955322265625,
0.000904083251953125,
0.0379638671875,
0.020294189453125,
-0.01097869873046875,
-0.02655029296875,
-0.0190277099609375,
-0.0435791015625,
0.0328369140625,
-0.0947265625,
0.041168212890625,
-0.006237030029296875,
-0.0110931396484375,
-0.0447998046875,
0.0235595703125,
-0.0227508544921875,
0.004123687744140625,
-0.0211944580078125,
0.030975341796875,
0.020172119140625,
0.046661376953125,
-0.00621795654296875,
0.0309600830078125,
0.05487060546875,
-0.0501708984375,
-0.0121002197265625,
0.029876708984375,
0.0013647079467773438,
0.025146484375,
-0.0168304443359375,
-0.01131439208984375,
0.0171051025390625,
-0.1263427734375,
-0.0117950439453125,
0.04315185546875,
-0.01171875,
-0.03228759765625,
-0.01788330078125,
0.02880859375,
0.0082244873046875,
-0.0305328369140625,
-0.0230560302734375,
-0.0028057098388671875,
0.02679443359375,
-0.0155181884765625,
0.0048675537109375,
-0.00437164306640625,
-0.01488494873046875,
-0.010650634765625,
0.020050048828125,
-0.033660888671875,
0.0161895751953125,
0.00928497314453125,
-0.04046630859375,
0.06768798828125,
-0.029693603515625,
-0.005298614501953125,
0.01953125,
0.0150299072265625,
-0.0089111328125,
0.043609619140625,
-0.0406494140625,
-0.022918701171875,
-0.0083770751953125,
-0.053253173828125,
-0.024627685546875,
0.009124755859375,
0.043548583984375,
0.038360595703125,
0.005840301513671875,
0.0772705078125,
0.00856781005859375,
0.0716552734375,
0.0083465576171875,
0.00859832763671875,
0.035736083984375,
-0.05963134765625,
0.038330078125,
-0.048004150390625,
0.0634765625,
0.06121826171875,
-0.028045654296875,
0.024139404296875,
-0.0355224609375,
0.055023193359375,
0.0013055801391601562,
-0.0290374755859375,
-0.03729248046875,
-0.04901123046875,
-0.007442474365234375,
-0.0141448974609375,
0.010589599609375,
0.029937744140625,
-0.006282806396484375,
-0.025421142578125,
0.012115478515625,
-0.003955841064453125,
-0.003131866455078125,
0.005504608154296875,
0.010894775390625,
-0.01727294921875,
0.007190704345703125,
0.0206756591796875,
-0.00411224365234375,
-0.0270233154296875,
0.0288238525390625,
0.00969696044921875,
0.039306640625,
-0.02752685546875,
-0.08917236328125,
-0.0296173095703125,
-0.07958984375,
0.031402587890625,
-0.01537322998046875,
0.0115814208984375,
-0.01082611083984375,
0.0843505859375,
0.0016841888427734375,
-0.0830078125,
-0.008941650390625,
0.04315185546875,
-0.006359100341796875,
0.035064697265625,
0.0330810546875,
-0.03314208984375,
0.00836944580078125,
0.0218353271484375,
-0.052947998046875,
-0.00835418701171875,
0.0043487548828125,
-0.0271453857421875,
-0.03509521484375,
-0.04132080078125,
-0.040374755859375,
0.047821044921875,
0.055145263671875,
-0.03753662109375,
0.0110626220703125,
-0.056396484375,
-0.0555419921875,
0.01493072509765625,
-0.0640869140625,
0.0205535888671875,
0.050140380859375,
-0.0164337158203125,
0.017608642578125,
-0.0147705078125,
0.01959228515625,
0.01419830322265625,
0.00670623779296875,
0.01203155517578125,
-0.0117645263671875,
-0.0174560546875,
-0.00479888916015625,
-0.0335693359375,
0.0172271728515625,
-0.0259552001953125,
0.01776123046875,
-0.0007052421569824219,
-0.006526947021484375,
-0.00347137451171875,
0.00629425048828125,
0.01194000244140625,
-0.03802490234375,
0.04583740234375,
-0.01898193359375,
0.004482269287109375,
-0.03448486328125,
-0.01885986328125,
-0.01404571533203125,
0.0726318359375,
-0.0799560546875,
-0.0272064208984375,
-0.00798797607421875,
0.01479339599609375,
0.00177764892578125,
-0.02069091796875,
-0.0283355712890625,
-0.040435791015625,
-0.055389404296875,
0.01776123046875,
-0.01551055908203125,
-0.024200439453125,
-0.023223876953125,
-0.004474639892578125,
-0.0282440185546875,
-0.03363037109375,
0.00656890869140625,
0.0169525146484375,
-0.015228271484375,
0.03106689453125,
-0.04522705078125,
0.046356201171875,
-0.00502777099609375,
-0.036407470703125,
-0.007537841796875,
-0.005260467529296875,
-0.0183258056640625,
0.010284423828125,
0.0291290283203125,
-0.02630615234375,
0.00774383544921875,
0.0278778076171875,
0.0031566619873046875,
0.05059814453125,
-0.01873779296875,
0.020843505859375,
0.0129241943359375,
-0.054656982421875,
-0.000012874603271484375,
-0.03094482421875,
0.00563812255859375,
-0.0166015625,
-0.036163330078125,
0.01528167724609375,
-0.035308837890625,
-0.00489044189453125,
-0.00930023193359375,
-0.031982421875,
-0.03668212890625,
0.0006623268127441406,
0.04547119140625,
0.0196075439453125,
0.040191650390625,
-0.019256591796875,
-0.00838470458984375,
-0.0101470947265625,
0.01369476318359375,
-0.00597381591796875,
-0.0256195068359375,
0.0301055908203125,
0.06671142578125,
0.002410888671875,
-0.022491455078125,
-0.08306884765625,
0.026519775390625,
0.025909423828125,
0.016754150390625,
0.0227203369140625,
0.005847930908203125,
-0.00905609130859375,
0.01110076904296875,
0.010040283203125,
-0.0069580078125,
-0.0013322830200195312,
0.07598876953125,
-0.032958984375,
-0.0533447265625,
0.041046142578125,
-0.037506103515625,
-0.0177764892578125,
0.05462646484375,
-0.01702880859375,
-0.004878997802734375,
-0.017425537109375,
0.0638427734375,
0.006320953369140625,
-0.0262298583984375,
-0.0721435546875,
-0.04168701171875,
0.002193450927734375,
-0.0005130767822265625,
0.0171356201171875,
0.02099609375,
0.00026488304138183594,
0.0179290771484375,
0.00646209716796875,
0.004070281982421875,
0.00702667236328125,
0.01462554931640625,
-0.01216888427734375,
0.011749267578125,
0.037017822265625,
-0.017913818359375,
-0.00484466552734375,
0.00319671630859375,
0.036468505859375,
-0.0019388198852539062,
-0.0531005859375,
-0.004016876220703125,
-0.0143890380859375,
-0.0295867919921875,
0.0032024383544921875,
-0.0055389404296875,
0.0443115234375,
-0.00429534912109375,
-0.0057525634765625,
0.00337982177734375,
-0.006694793701171875,
-0.0248870849609375,
-0.044036865234375,
-0.00726318359375,
-0.0096282958984375,
-0.0096893310546875,
0.04193115234375,
-0.01105499267578125,
0.00244140625,
0.0162200927734375,
-0.0210418701171875,
0.027191162109375,
0.0228118896484375,
0.003711700439453125,
0.004070281982421875,
0.0266571044921875,
0.0134124755859375,
-0.03472900390625,
0.02197265625,
-0.007640838623046875,
-0.031890869140625,
0.041717529296875,
0.044921875,
-0.00567626953125,
0.00307464599609375,
-0.02740478515625,
-0.032928466796875,
0.0157318115234375,
-0.002109527587890625,
-0.0198822021484375,
-0.0302276611328125,
-0.0014448165893554688,
-0.0212249755859375,
-0.0011281967163085938,
-0.022735595703125,
-0.0274658203125,
0.0275726318359375,
-0.015472412109375,
0.03326416015625,
0.034332275390625,
-0.04888916015625,
0.02142333984375,
0.032928466796875,
-0.033203125,
0.0022068023681640625,
0.0211944580078125,
-0.10113525390625,
-0.064697265625,
0.010986328125,
0.0019550323486328125,
0.00992584228515625,
-0.01110076904296875,
0.029327392578125,
0.00569915771484375,
-0.04327392578125,
0.033935546875,
0.02838134765625,
0.034210205078125,
-0.001026153564453125,
-0.0643310546875,
0.00543212890625,
-0.09979248046875,
-0.01519012451171875,
-0.08062744140625,
-0.0679931640625,
-0.061492919921875,
0.0223388671875,
-0.01499176025390625,
0.0026111602783203125,
-0.00039196014404296875,
0.0062713623046875,
-0.0172882080078125,
0.0281829833984375,
0.00911712646484375,
0.022430419921875,
-0.0163116455078125,
0.080078125,
-0.0022335052490234375,
0.0682373046875,
0.00832366943359375,
0.015533447265625,
-0.057403564453125,
-0.00878143310546875,
0.0003483295440673828,
-0.018646240234375,
-0.013214111328125,
0.0214691162109375,
-0.06231689453125,
0.00684356689453125,
0.062164306640625,
-0.00152587890625,
0.0212249755859375,
-0.045318603515625,
-0.00989532470703125,
-0.0219879150390625,
0.058349609375,
-0.068115234375,
-0.015167236328125,
0.0276947021484375,
-0.007259368896484375,
0.023223876953125,
0.00351715087890625,
-0.0264434814453125,
0.03765869140625,
-0.01152801513671875,
0.03900146484375,
0.01334381103515625,
-0.0654296875,
0.064697265625,
0.0611572265625,
0.009124755859375,
0.035308837890625,
0.0009584426879882812,
0.000698089599609375,
0.0233001708984375,
0.03436279296875,
0.018157958984375,
-0.015472412109375,
0.0135955810546875,
-0.00865936279296875,
-0.0081634521484375,
-0.0180816650390625,
-0.0120849609375,
0.01445770263671875,
0.07830810546875,
0.046234130859375,
-0.09906005859375,
0.00652313232421875,
-0.0017347335815429688,
-0.012420654296875,
0.004062652587890625,
0.00905609130859375,
0.01824951171875,
0.0076751708984375,
0.0019063949584960938,
0.049774169921875,
-0.006572723388671875,
0.006195068359375,
0.00891876220703125,
-0.00963592529296875,
-0.035552978515625,
0.04022216796875,
0.005397796630859375,
-0.01122283935546875,
0.0239715576171875,
-0.0006432533264160156,
0.0308837890625,
-0.0186004638671875,
0.017669677734375,
-0.0161590576171875,
0.012237548828125,
-0.030853271484375,
0.004608154296875,
-0.0469970703125,
0.0047607421875,
-0.01299285888671875,
0.01184844970703125,
0.01456451416015625,
0.050567626953125,
-0.021087646484375,
0.007465362548828125,
0.0290985107421875,
-0.022125244140625,
-0.0287017822265625,
-0.017364501953125,
-0.00461578369140625,
-0.025390625,
-0.00539398193359375,
0.00681304931640625,
-0.03729248046875,
-0.0133819580078125,
-0.0021762847900390625,
0.006206512451171875,
0.08465576171875,
-0.0135498046875,
-0.03314208984375,
0.04168701171875,
0.004779815673828125,
-0.0438232421875,
0.0162506103515625,
0.046234130859375,
-0.06634521484375,
-0.05877685546875,
0.038238525390625,
-0.045562744140625,
-0.04254150390625,
0.0025005340576171875,
-0.07550048828125,
0.07403564453125,
-0.0223541259765625,
0.055267333984375,
0.02105712890625,
0.0250701904296875,
-0.0255584716796875,
-0.0159759521484375,
-0.01201629638671875,
0.05584716796875,
-0.0157318115234375,
0.0648193359375,
-0.00316619873046875,
0.0015153884887695312,
0.044647216796875,
0.0274810791015625,
0.01084136962890625,
-0.0066986083984375,
0.0094757080078125,
0.0022430419921875,
0.037628173828125,
0.025848388671875,
-0.00963592529296875,
0.0099334716796875,
-0.047882080078125,
0.0048675537109375,
-0.037872314453125,
-0.042236328125,
0.004375457763671875,
-0.0283355712890625,
-0.06683349609375,
-0.0167388916015625,
0.009368896484375,
0.01280975341796875,
0.027618408203125,
0.001911163330078125,
-0.03955078125,
0.00897216796875,
0.037445068359375,
-0.00811767578125,
0.012847900390625,
0.007232666015625,
0.0149383544921875,
-0.0081634521484375,
-0.00021886825561523438,
-0.01092529296875,
0.042327880859375,
0.011077880859375,
-0.0236053466796875,
-0.004497528076171875,
-0.0007410049438476562,
0.013153076171875,
0.00008720159530639648,
-0.03271484375,
0.0277557373046875,
0.01751708984375,
0.047637939453125,
0.0175933837890625,
0.037200927734375,
-0.042755126953125,
-0.0380859375,
0.029754638671875,
0.05810546875,
-0.02496337890625,
-0.059326171875,
0.01006317138671875,
-0.01131439208984375,
0.0224761962890625,
0.0079345703125,
0.0208282470703125,
0.0023250579833984375,
0.033935546875,
0.0103302001953125,
-0.017333984375,
-0.01247406005859375,
-0.01328277587890625,
0.0011606216430664062,
0.0102996826171875,
0.031585693359375,
0.0194854736328125,
-0.08941650390625,
0.053070068359375,
0.027557373046875,
0.0682373046875,
-0.004230499267578125,
0.10601806640625,
0.016754150390625,
-0.03973388671875,
-0.00894927978515625,
0.039306640625,
0.0005974769592285156,
-0.00460052490234375,
-0.032318115234375,
-0.039794921875,
-0.0028076171875,
0.031280517578125,
0.0014514923095703125,
-0.0195465087890625,
0.0182037353515625,
0.0258331298828125,
-0.0172882080078125,
-0.0181121826171875,
0.0123443603515625,
-0.025634765625,
0.0474853515625,
-0.0038509368896484375,
-0.01064300537109375,
-0.02490234375,
-0.0418701171875,
-0.026031494140625,
0.017791748046875,
0.023101806640625,
-0.009124755859375,
-0.0014600753784179688,
0.00518035888671875,
-0.036956787109375,
0.0167236328125,
-0.003948211669921875,
0.014007568359375,
0.0181427001953125,
-0.0947265625,
-0.0162200927734375,
-0.051300048828125,
-0.045135498046875,
0.043212890625,
0.039215087890625,
-0.01434326171875,
0.006267547607421875,
0.0197296142578125,
0.014373779296875,
0.016998291015625,
-0.00524139404296875,
-0.016326904296875,
-0.0017023086547851562,
0.05126953125,
-0.00032830238342285156,
-0.041107177734375,
-0.0160369873046875,
-0.01181793212890625,
0.0197906494140625,
0.0022373199462890625,
0.10577392578125,
-0.0217742919921875,
0.00812530517578125,
0.03204345703125,
0.0036792755126953125,
0.0095367431640625,
0.0037078857421875,
0.06707763671875,
-0.024322509765625,
-0.01528167724609375,
-0.019500732421875,
-0.0249481201171875,
0.000988006591796875,
0.032379150390625,
-0.0298614501953125,
-0.02398681640625,
0.0195159912109375,
0.02777099609375,
0.0123748779296875,
0.01062774658203125,
-0.004398345947265625,
-0.00005143880844116211,
0.01219940185546875,
0.0088653564453125,
0.0293731689453125,
0.041290283203125,
-0.006481170654296875,
0.04693603515625,
0.01229095458984375,
-0.03814697265625,
0.0178680419921875,
-0.054779052734375,
0.006717681884765625,
0.0157470703125,
0.05224609375,
-0.048431396484375,
0.021820068359375,
-0.0016469955444335938,
0.0212554931640625,
0.00394439697265625,
0.050933837890625,
0.0298614501953125,
-0.01947021484375,
-0.0135650634765625,
-0.0030517578125,
-0.01270294189453125,
-0.06396484375,
-0.00884246826171875,
0.044891357421875,
-0.01038360595703125,
0.0137939453125,
-0.035919189453125,
-0.02081298828125,
-0.031768798828125,
0.0153656005859375,
0.028289794921875,
-0.01038360595703125,
-0.007251739501953125,
-0.0458984375,
-0.0386962890625,
0.025360107421875,
-0.0032291412353515625,
0.000614166259765625,
-0.0156402587890625,
-0.016265869140625,
-0.00867462158203125,
-0.00720977783203125,
-0.01435089111328125,
-0.001922607421875,
0.033538818359375,
-0.0163421630859375,
0.0008115768432617188,
-0.044952392578125,
-0.002101898193359375,
-0.029449462890625,
-0.0021839141845703125,
0.039337158203125,
-0.007144927978515625,
-0.005695343017578125,
-0.007106781005859375,
0.0037479400634765625,
0.053619384765625,
-0.07171630859375,
-0.023834228515625,
0.037689208984375,
-0.023223876953125,
0.012420654296875,
-0.019866943359375,
-0.011566162109375,
0.00180816650390625,
0.0034847259521484375,
0.01335906982421875,
-0.02410888671875,
-0.007221221923828125,
-0.03814697265625,
-0.0416259765625,
0.0675048828125,
0.005908966064453125,
-0.028106689453125,
-0.0753173828125,
0.026031494140625,
0.00806427001953125,
-0.053009033203125,
-0.0445556640625,
-0.00550079345703125,
0.01129150390625,
0.06292724609375,
0.02716064453125,
0.041534423828125,
0.042938232421875,
0.02374267578125,
-0.010162353515625,
0.01074981689453125,
-0.0170440673828125,
0.0235595703125,
0.0172271728515625,
-0.0228271484375,
0.0260772705078125,
0.01277923583984375,
-0.047943115234375,
-0.0248870849609375,
-0.000022709369659423828,
0.000035762786865234375,
-0.01611328125,
-0.035552978515625,
-0.0191802978515625,
-0.0204620361328125,
0.059722900390625,
0.041046142578125,
0.0177154541015625,
-0.02777099609375,
0.00948333740234375,
0.0189971923828125,
-0.045135498046875,
0.00890350341796875,
0.031219482421875,
-0.0589599609375,
-0.0007338523864746094,
0.01026153564453125,
-0.0323486328125,
0.0020923614501953125,
-0.0305633544921875,
-0.0499267578125,
0.01532745361328125,
-0.0355224609375,
0.0201568603515625,
-0.036865234375,
0.00408935546875,
0.0211181640625,
-0.0159759521484375,
-0.005954742431640625,
-0.035888671875,
0.0306396484375,
-0.0142974853515625,
-0.057220458984375,
0.0164794921875,
0.054290771484375,
-0.07586669921875,
-0.0214996337890625,
0.004032135009765625,
0.0214385986328125,
-0.0277862548828125,
-0.016998291015625,
-0.015655517578125,
0.045257568359375,
0.019683837890625,
0.03411865234375,
-0.04339599609375,
0.09246826171875,
0.02813720703125,
0.07525634765625,
-0.012298583984375,
0.07861328125,
0.0012569427490234375,
0.042266845703125,
-0.00362396240234375,
-0.004482269287109375,
0.01416015625,
-0.031890869140625,
-0.009002685546875,
-0.0138397216796875,
0.00009489059448242188,
-0.058746337890625,
0.003910064697265625,
-0.01751708984375,
0.00958251953125,
0.01380157470703125
] |
1843d22fb191350cd8a406358b389fe3420934cf
|
Wordpress Stackexchange
Q: How can I send a welcome email to a user AFTER they login for the first time? What I want to do is after a user creates an account... they log in for the first time it will kick off a welcome email to the user that will give them an overview of the site and suggestions of what they should do to get the most out of the site.
I'm not sure where this would go... any help would be great.
A: You can create custom usermeta for has_logged_in or something like that and then check it when the user logs in to see if it exists and is properly set. If so, no email sent, otherwise, email sent. You could take the opposite approach and create usermeta for not_has_logged_in or something like that and then check that on login to see if it exists and if it does, email is sent.
|
Q: How can I send a welcome email to a user AFTER they login for the first time? What I want to do is after a user creates an account... they log in for the first time it will kick off a welcome email to the user that will give them an overview of the site and suggestions of what they should do to get the most out of the site.
I'm not sure where this would go... any help would be great.
A: You can create custom usermeta for has_logged_in or something like that and then check it when the user logs in to see if it exists and is properly set. If so, no email sent, otherwise, email sent. You could take the opposite approach and create usermeta for not_has_logged_in or something like that and then check that on login to see if it exists and if it does, email is sent.
A: Check out this welcome pack plugin for new user accounts.
http://wordpress.org/extend/plugins/welcome-pack/
A: If you are looking for a plugin that allows you to do that, you can check out Profile Builder, two of its features being email confirmation and email customization.
|
wordpress
|
{
"language": "en",
"length": 196,
"provenance": "stackexchange_00019.jsonl.gz:419121",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49213"
}
|
[
0.0163421630859375,
-0.00506591796875,
-0.01287841796875,
-0.0008325576782226562,
-0.0163421630859375,
-0.0330810546875,
0.01061248779296875,
-0.0218353271484375,
-0.02685546875,
0.049560546875,
-0.0031585693359375,
0.012908935546875,
0.027069091796875,
-0.01401519775390625,
-0.0000336766242980957,
-0.012176513671875,
0.0022754669189453125,
0.025604248046875,
0.015533447265625,
-0.018585205078125,
0.022613525390625,
-0.005886077880859375,
-0.015106201171875,
0.01419830322265625,
-0.00650787353515625,
0.03143310546875,
0.06646728515625,
-0.031280517578125,
0.0124664306640625,
-0.00276947021484375,
0.011810302734375,
-0.0364990234375,
0.01143646240234375,
0.02813720703125,
-0.0204010009765625,
0.0231475830078125,
0.01110076904296875,
0.014190673828125,
0.03668212890625,
0.002288818359375,
0.039703369140625,
-0.01419830322265625,
-0.004909515380859375,
0.018646240234375,
-0.01180267333984375,
-0.036224365234375,
0.0462646484375,
-0.0256500244140625,
0.0195465087890625,
0.00832366943359375,
0.00859832763671875,
-0.01232147216796875,
0.014923095703125,
0.014556884765625,
-0.01427459716796875,
0.0008802413940429688,
0.005580902099609375,
-0.0246124267578125,
0.01141357421875,
0.0068206787109375,
-0.0015764236450195312,
0.0177001953125,
0.0175323486328125,
-0.007595062255859375,
-0.030059814453125,
0.0025424957275390625,
-0.011962890625,
0.0134735107421875,
-0.02294921875,
-0.05511474609375,
-0.007659912109375,
-0.0166168212890625,
-0.01611328125,
-0.01038360595703125,
-0.0280303955078125,
0.03302001953125,
0.0157470703125,
0.015655517578125,
0.00534820556640625,
0.012847900390625,
-0.048583984375,
-0.01409149169921875,
-0.03204345703125,
-0.06146240234375,
0.018890380859375,
-0.0210418701171875,
-0.0213165283203125,
0.017333984375,
0.0012607574462890625,
-0.0189971923828125,
-0.0084381103515625,
0.04461669921875,
0.005756378173828125,
-0.0057373046875,
-0.05615234375,
-0.01396942138671875,
0.041259765625,
0.053314208984375,
-0.00296783447265625,
-0.0352783203125,
-0.036529541015625,
-0.00009173154830932617,
-0.07440185546875,
-0.0004508495330810547,
0.00518798828125,
0.0245819091796875,
-0.0218048095703125,
-0.020599365234375,
0.006748199462890625,
0.02105712890625,
-0.011444091796875,
0.0025043487548828125,
0.0019216537475585938,
-0.038665771484375,
0.0180511474609375,
0.019317626953125,
-0.0040283203125,
0.043426513671875,
0.01264190673828125,
0.039306640625,
-0.0072784423828125,
0.008148193359375,
0.031829833984375,
0.01158905029296875,
-0.00732421875,
0.0010242462158203125,
-0.00868988037109375,
-0.03985595703125,
-0.0272216796875,
0.0081634521484375,
-0.0196380615234375,
0.05108642578125,
0.0267791748046875,
-0.01409912109375,
-0.02325439453125,
-0.018341064453125,
0.031463623046875,
0.01314544677734375,
0.0009775161743164062,
0.0247344970703125,
0.002506256103515625,
-0.050323486328125,
-0.034210205078125,
0.002262115478515625,
-0.01568603515625,
0.0248260498046875,
0.01007080078125,
0.0080718994140625,
-0.01149749755859375,
-0.0538330078125,
0.004352569580078125,
-0.0247802734375,
-0.0340576171875,
0.020843505859375,
0.0252227783203125,
0.04248046875,
-0.0252227783203125,
0.035858154296875,
0.005123138427734375,
0.052825927734375,
0.040252685546875,
-0.00804901123046875,
-0.00390625,
-0.0157623291015625,
-0.044708251953125,
-0.00494384765625,
-0.038970947265625,
-0.010955810546875,
0.0311279296875,
-0.013946533203125,
0.00853729248046875,
0.04296875,
0.03857421875,
-0.0030231475830078125,
0.0035343170166015625,
-0.0120697021484375,
0.0019474029541015625,
0.006679534912109375,
0.0110931396484375,
-0.0017299652099609375,
0.006420135498046875,
-0.0162506103515625,
0.0137176513671875,
-0.005252838134765625,
0.00388336181640625,
-0.0004673004150390625,
0.0009245872497558594,
-0.00666046142578125,
-0.001983642578125,
0.0162200927734375,
-0.042694091796875,
0.05194091796875,
-0.002651214599609375,
0.0000457763671875,
-0.023406982421875,
-0.033477783203125,
-0.005985260009765625,
-0.0089569091796875,
-0.02947998046875,
0.03729248046875,
0.059539794921875,
-0.027496337890625,
0.058685302734375,
-0.051025390625,
-0.0171356201171875,
0.0249786376953125,
-0.0222015380859375,
0.0173797607421875,
0.0014019012451171875,
0.00795745849609375,
0.004398345947265625,
0.01824951171875,
-0.007366180419921875,
-0.04974365234375,
-0.033050537109375,
-0.01611328125,
-0.0280914306640625,
0.034454345703125,
-0.0225677490234375,
0.045745849609375,
-0.0330810546875,
-0.06170654296875,
-0.026763916015625,
-0.004787445068359375,
0.0048370361328125,
-0.004901885986328125,
-0.0234375,
-0.0069732666015625,
-0.021240234375,
-0.00046706199645996094,
-0.0190582275390625,
0.04400634765625,
0.019287109375,
0.0036792755126953125,
-0.036590576171875,
0.00853729248046875,
-0.0029811859130859375,
-0.0230865478515625,
-0.0179290771484375,
0.03326416015625,
0.025238037109375,
-0.007175445556640625,
-0.0132598876953125,
0.0286102294921875,
0.0097808837890625,
-0.0304107666015625,
0.01091766357421875,
0.0205535888671875,
0.013580322265625,
0.05926513671875,
-0.047943115234375,
-0.004375457763671875,
0.0019855499267578125,
-0.07080078125,
-0.0019140243530273438,
0.03631591796875,
0.03887939453125,
0.00974273681640625,
-0.0311737060546875,
0.01507568359375,
0.0019969940185546875,
-0.028961181640625,
-0.048919677734375,
0.0022602081298828125,
-0.0205230712890625,
0.0011081695556640625,
-0.0014009475708007812,
-0.01053619384765625,
-0.0196533203125,
0.0053253173828125,
0.022491455078125,
-0.052154541015625,
-0.006954193115234375,
-0.00518798828125,
0.06817626953125,
0.0479736328125,
-0.045867919921875,
-0.0265960693359375,
0.048370361328125,
0.02471923828125,
-0.03900146484375,
-0.03289794921875,
0.0006165504455566406,
-0.0118255615234375,
0.011322021484375,
0.03350830078125,
0.04217529296875,
-0.040802001953125,
0.0300445556640625,
0.0157623291015625,
0.0328369140625,
0.00043892860412597656,
-0.017303466796875,
0.043243408203125,
-0.04168701171875,
-0.040679931640625,
-0.1199951171875,
-0.007343292236328125,
0.01084136962890625,
-0.037628173828125,
-0.0284881591796875,
0.0657958984375,
0.03338623046875,
-0.01070404052734375,
-0.0277099609375,
0.0089569091796875,
-0.03912353515625,
0.0225067138671875,
0.0006861686706542969,
-0.08465576171875,
0.06011962890625,
0.0572509765625,
0.0142364501953125,
0.06427001953125,
-0.03509521484375,
-0.039764404296875,
-0.0162506103515625,
-0.001194000244140625,
-0.0013179779052734375,
-0.0177764892578125,
-0.034576416015625,
-0.07098388671875,
-0.02587890625,
-0.006755828857421875,
-0.027130126953125,
0.0219573974609375,
0.01285552978515625,
0.01439666748046875,
-0.0002593994140625,
-0.031402587890625,
-0.039306640625,
-0.038482666015625,
-0.044921875,
0.00931549072265625,
-0.005496978759765625,
-0.0139923095703125,
-0.0092315673828125,
0.04168701171875,
-0.00917816162109375,
-0.034332275390625,
-0.0224456787109375,
0.0183868408203125,
0.004123687744140625,
-0.0247650146484375,
-0.04058837890625,
0.014678955078125,
0.012786865234375,
0.0059661865234375,
0.00945281982421875,
-0.0016002655029296875,
-0.00890350341796875,
-0.0173492431640625,
0.004215240478515625,
-0.0230865478515625,
-0.0159149169921875,
-0.0214080810546875,
-0.00782012939453125,
-0.0088043212890625,
-0.0203399658203125,
-0.04949951171875,
0.05340576171875,
0.014007568359375,
-0.0184783935546875,
-0.084716796875,
0.0185394287109375,
-0.045654296875,
-0.0161590576171875,
-0.064697265625,
-0.0380859375,
-0.0176544189453125,
0.0380859375,
-0.0293121337890625,
0.003971099853515625,
-0.03564453125,
-0.07952880859375,
-0.007320404052734375,
0.0322265625,
-0.0219573974609375,
-0.040435791015625,
-0.0256500244140625,
0.0183258056640625,
-0.0238494873046875,
-0.0007152557373046875,
-0.08502197265625,
-0.064208984375,
0.06048583984375,
-0.01062774658203125,
0.0007486343383789062,
-0.038421630859375,
-0.0270538330078125,
-0.0012884140014648438,
0.10455322265625,
0.022979736328125,
0.0187225341796875,
-0.0172576904296875,
-0.0179595947265625,
-0.046905517578125,
0.0220184326171875,
-0.0819091796875,
0.029998779296875,
-0.064208984375,
0.006534576416015625,
-0.0000025033950805664062,
-0.0220947265625,
-0.0284881591796875,
-0.0233612060546875,
-0.0200653076171875,
-0.042694091796875,
0.0019130706787109375,
0.003376007080078125,
0.036224365234375,
-0.0199737548828125,
0.01593017578125,
-0.018280029296875,
0.0238494873046875,
-0.0521240234375,
-0.0031890869140625,
-0.004070281982421875,
-0.00945281982421875,
0.0210418701171875,
0.029693603515625,
-0.01490020751953125,
0.020050048828125,
0.0221405029296875,
-0.01422882080078125,
0.006732940673828125,
-0.02972412109375,
0.0011806488037109375,
0.0157928466796875,
0.0077667236328125,
-0.041290283203125,
-0.002597808837890625,
-0.0003883838653564453,
-0.0257110595703125,
-0.036407470703125,
0.03936767578125,
-0.017669677734375,
0.0458984375,
-0.0028362274169921875,
-0.00516510009765625,
-0.00218963623046875,
-0.0264129638671875,
-0.0233306884765625,
0.0285491943359375,
-0.004276275634765625,
0.00017189979553222656,
-0.036712646484375,
-0.045745849609375,
-0.0288543701171875,
-0.0052642822265625,
0.0037288665771484375,
0.0285491943359375,
0.02423095703125,
0.0096893310546875,
-0.0019254684448242188,
-0.0008692741394042969,
0.01398468017578125,
0.03643798828125,
0.032745361328125,
0.00994110107421875,
-0.005214691162109375,
-0.039276123046875,
0.055328369140625,
0.026031494140625,
0.0284881591796875,
-0.04638671875,
0.076904296875,
-0.0160064697265625,
0.00492095947265625,
0.0254364013671875,
-0.0137939453125,
0.00547027587890625,
-0.0125579833984375,
0.00313568115234375,
0.01496124267578125,
0.0304107666015625,
-0.003692626953125,
-0.00449371337890625,
-0.0086669921875,
0.0014209747314453125,
-0.04779052734375,
0.0269622802734375,
0.018524169921875,
-0.028717041015625,
-0.0154876708984375,
0.00458526611328125,
-0.046051025390625,
-0.034576416015625,
-0.01079559326171875,
0.0212554931640625,
-0.051788330078125,
0.0213165283203125,
0.0144805908203125,
-0.01434326171875,
-0.01068115234375,
0.028411865234375,
-0.0248565673828125,
0.08087158203125,
0.034332275390625,
-0.022216796875,
0.0012674331665039062,
-0.02264404296875,
0.037109375,
-0.00641632080078125,
-0.03619384765625,
0.054840087890625,
0.033355712890625,
-0.0092315673828125,
0.00847625732421875,
-0.0311279296875,
-0.006023406982421875,
-0.047821044921875,
-0.0147857666015625,
-0.0275421142578125,
-0.006317138671875,
0.03424072265625,
0.0157623291015625,
-0.07037353515625,
0.05810546875,
0.0120086669921875,
0.0311126708984375,
0.0325927734375,
0.0291748046875,
0.0209503173828125,
0.01617431640625,
-0.02923583984375,
0.02130126953125,
-0.01290130615234375,
-0.028167724609375,
-0.035614013671875,
0.0209808349609375,
0.036529541015625,
-0.027984619140625,
0.0115814208984375,
0.0226593017578125,
0.0033473968505859375,
0.0004086494445800781,
0.041290283203125,
0.0029449462890625,
-0.054962158203125,
-0.0228729248046875,
-0.0240325927734375,
-0.0197296142578125,
-0.04052734375,
0.027252197265625,
-0.0247039794921875,
-0.00510406494140625,
0.0242156982421875,
-0.047637939453125,
0.031494140625,
-0.041046142578125,
-0.039703369140625,
-0.00007456541061401367,
-0.0203704833984375,
-0.01369476318359375,
-0.042938232421875,
-0.002349853515625,
-0.01296234130859375,
0.0007114410400390625,
0.0185699462890625,
0.000995635986328125,
-0.02252197265625,
-0.0380859375,
0.0286102294921875,
-0.047637939453125,
0.00791168212890625,
0.0130615234375,
-0.0286407470703125,
-0.08941650390625,
0.00335693359375,
-0.053314208984375,
-0.0038814544677734375,
-0.056060791015625,
-0.065185546875,
-0.0489501953125,
0.0013980865478515625,
0.01983642578125,
0.0187835693359375,
0.005916595458984375,
-0.0182342529296875,
-0.00970458984375,
0.004547119140625,
0.0272979736328125,
0.029022216796875,
-0.0323486328125,
0.053924560546875,
0.0167388916015625,
0.034881591796875,
0.01047515869140625,
0.036712646484375,
0.00637054443359375,
-0.01922607421875,
-0.0161895751953125,
-0.0069732666015625,
0.0012655258178710938,
-0.004245758056640625,
0.043853759765625,
0.0002646446228027344,
0.043670654296875,
0.0085296630859375,
-0.0211029052734375,
-0.0215911865234375,
-0.01233673095703125,
-0.0200958251953125,
0.0496826171875,
0.030242919921875,
-0.016845703125,
0.033416748046875,
-0.002452850341796875,
0.022003173828125,
-0.00447845458984375,
-0.03302001953125,
0.001811981201171875,
0.0189666748046875,
0.00724029541015625,
-0.01128387451171875,
-0.011077880859375,
0.033966064453125,
0.038421630859375,
-0.0038967132568359375,
0.031463623046875,
0.0209197998046875,
0.025970458984375,
0.0270538330078125,
-0.055755615234375,
0.01488494873046875,
0.006984710693359375,
0.052337646484375,
-0.009979248046875,
-0.005542755126953125,
0.0633544921875,
-0.02435302734375,
-0.0032825469970703125,
0.0736083984375,
0.059112548828125,
-0.10040283203125,
-0.0008502006530761719,
-0.00675201416015625,
-0.0009093284606933594,
0.0269622802734375,
0.00021529197692871094,
0.01433563232421875,
-0.0209197998046875,
0.064453125,
0.00948333740234375,
0.02191162109375,
0.046356201171875,
-0.0307769775390625,
-0.0027675628662109375,
-0.00820159912109375,
0.02203369140625,
-0.00470733642578125,
-0.0201263427734375,
-0.021728515625,
0.02435302734375,
-0.0177459716796875,
-0.03094482421875,
0.0158843994140625,
0.018035888671875,
-0.001796722412109375,
-0.046875,
0.0269012451171875,
-0.01300048828125,
0.002681732177734375,
0.0165557861328125,
-0.0119476318359375,
0.027069091796875,
0.01490020751953125,
-0.015625,
0.00789642333984375,
-0.00902557373046875,
-0.0209197998046875,
0.007404327392578125,
-0.0182952880859375,
-0.00864410400390625,
0.03948974609375,
-0.0274810791015625,
0.01519775390625,
-0.0034389495849609375,
-0.004360198974609375,
-0.0185089111328125,
-0.0426025390625,
0.01007080078125,
0.01788330078125,
-0.02081298828125,
0.031494140625,
0.045440673828125,
-0.01409149169921875,
-0.0478515625,
-0.01061248779296875,
-0.04522705078125,
0.03564453125,
-0.03887939453125,
0.01418304443359375,
0.01052093505859375,
-0.044158935546875,
-0.061004638671875,
0.012725830078125,
-0.0078125,
0.02886962890625,
-0.00902557373046875,
0.00353240966796875,
0.0214385986328125,
-0.0105438232421875,
-0.0197601318359375,
0.06243896484375,
0.0142974853515625,
0.05230712890625,
-0.04461669921875,
-0.0134429931640625,
0.0167388916015625,
0.038299560546875,
0.0604248046875,
0.043914794921875,
-0.0182342529296875,
-0.0193328857421875,
-0.0244903564453125,
-0.0177001953125,
-0.060028076171875,
0.0572509765625,
0.009613037109375,
0.034332275390625,
0.073974609375,
-0.031829833984375,
0.02789306640625,
0.0352783203125,
-0.003711700439453125,
0.0252838134765625,
0.002788543701171875,
-0.0208587646484375,
0.002475738525390625,
0.025787353515625,
-0.0489501953125,
0.016571044921875,
0.0159759521484375,
0.057830810546875,
-0.01107025146484375,
0.01088714599609375,
-0.01044464111328125,
0.0259246826171875,
0.043060302734375,
-0.025634765625,
0.042877197265625,
-0.00507354736328125,
0.02069091796875,
0.020904541015625,
0.024139404296875,
0.01335906982421875,
-0.0146636962890625,
0.0103912353515625,
0.021392822265625,
-0.036865234375,
0.056884765625,
-0.056915283203125,
0.008819580078125,
-0.1446533203125,
-0.057464599609375,
0.0255126953125,
0.0953369140625,
-0.0304107666015625,
-0.0036144256591796875,
0.00778961181640625,
0.03265380859375,
0.04779052734375,
-0.004741668701171875,
0.06732177734375,
-0.0008015632629394531,
0.01435089111328125,
-0.0108184814453125,
-0.000965118408203125,
0.0244903564453125,
0.0084991455078125,
0.01000213623046875,
0.0251922607421875,
-0.0263671875,
0.01100921630859375,
0.0046234130859375,
0.0165557861328125,
0.001773834228515625,
-0.043731689453125,
-0.033966064453125,
0.0213775634765625,
0.0256805419921875,
0.0416259765625,
-0.0119171142578125,
-0.03765869140625,
0.031402587890625,
-0.00365447998046875,
0.032470703125,
0.058319091796875,
0.0011930465698242188,
0.00860595703125,
-0.0056915283203125,
-0.01415252685546875,
0.0012006759643554688,
-0.00628662109375,
-0.0282440185546875,
-0.01263427734375,
-0.00960540771484375,
-0.044525146484375,
0.0279541015625,
-0.0033779144287109375,
0.00769805908203125,
0.0011539459228515625,
-0.0162353515625,
-0.0300750732421875,
0.0460205078125,
0.01910400390625,
-0.038818359375,
0.023162841796875,
-0.01467132568359375,
-0.06402587890625,
0.05413818359375,
-0.030059814453125,
0.12384033203125,
-0.031646728515625,
-0.07049560546875,
-0.004497528076171875,
-0.037445068359375,
-0.024017333984375,
0.0092315673828125,
0.025390625,
-0.0215301513671875,
0.034027099609375,
0.049285888671875,
0.0006189346313476562,
0.0013666152954101562,
-0.0224151611328125,
0.0172882080078125,
-0.03363037109375,
0.0208892822265625,
-0.0032176971435546875,
-0.078857421875,
-0.04156494140625,
-0.05035400390625,
0.0199737548828125,
0.0308380126953125,
0.02874755859375,
0.030731201171875,
0.04132080078125,
-0.0254974365234375,
0.043701171875,
-0.041168212890625,
-0.05804443359375,
0.07659912109375,
-0.0150299072265625,
-0.0289459228515625,
-0.00832366943359375,
-0.09454345703125,
0.060211181640625,
0.00592041015625,
0.03277587890625,
0.0634765625,
0.0134429931640625,
-0.0166473388671875,
-0.01080322265625,
0.017822265625,
-0.0221099853515625,
-0.048126220703125,
-0.05035400390625,
0.0015249252319335938,
0.00977325439453125,
-0.003948211669921875,
0.00021219253540039062,
0.036773681640625,
-0.0272064208984375,
-0.03173828125,
-0.0033054351806640625,
-0.03924560546875,
-0.0275421142578125,
0.01287078857421875,
0.035308837890625,
-0.00667572021484375,
0.0001652240753173828,
-0.01396942138671875,
0.0145416259765625,
0.0070343017578125,
0.0268402099609375,
0.01348876953125,
0.02532958984375,
0.01343536376953125,
0.040069580078125,
0.0406494140625,
-0.033538818359375,
0.0102996826171875,
0.0222015380859375,
-0.01232147216796875,
0.02655029296875,
-0.07757568359375,
-0.041229248046875,
-0.054290771484375,
0.0183258056640625,
0.0190887451171875,
0.00656890869140625,
-0.042236328125,
-0.012115478515625,
0.054046630859375,
0.031219482421875,
-0.00550079345703125,
-0.0716552734375,
0.03607177734375,
-0.031890869140625,
0.08544921875,
-0.007053375244140625,
-0.0294952392578125,
0.013641357421875,
0.00968170166015625,
-0.0521240234375,
-0.032257080078125,
-0.033721923828125,
0.00829315185546875,
-0.02471923828125,
-0.037872314453125,
0.0032329559326171875,
0.032135009765625,
-0.019195556640625,
-0.037017822265625,
-0.0648193359375,
0.020538330078125,
-0.07666015625,
-0.03192138671875,
-0.00901031494140625,
-0.0233917236328125,
-0.00470733642578125,
-0.042327880859375,
0.014801025390625,
-0.07861328125,
-0.0210113525390625,
-0.0009312629699707031,
0.012847900390625,
0.0231475830078125,
-0.02899169921875,
-0.092529296875,
0.057861328125,
-0.01593017578125,
-0.03570556640625,
-0.051483154296875,
0.01727294921875,
-0.0161895751953125,
-0.0125885009765625,
-0.0177459716796875,
-0.01251220703125,
-0.00045180320739746094,
0.04827880859375,
-0.0211029052734375,
0.00351715087890625,
0.033111572265625,
-0.0411376953125,
-0.0295867919921875,
-0.0212554931640625,
0.017608642578125,
-0.01181793212890625,
-0.00504302978515625,
0.0145416259765625,
0.0155792236328125,
0.055938720703125,
-0.003345489501953125,
-0.0033283233642578125,
-0.0011281967163085938,
-0.06170654296875,
-0.0210418701171875,
-0.02899169921875,
0.01438140869140625,
-0.0009889602661132812,
0.0506591796875,
0.019378662109375,
0.01183319091796875,
-0.0169830322265625,
-0.048004150390625,
-0.034454345703125,
-0.01415252685546875,
-0.0184173583984375,
0.0207672119140625,
-0.07928466796875,
0.016876220703125,
-0.00638580322265625,
-0.006927490234375,
0.0079803466796875,
-0.034820556640625,
-0.00905609130859375,
-0.01433563232421875,
0.01428985595703125,
0.041259765625,
-0.030242919921875,
-0.053009033203125,
0.037384033203125,
-0.01971435546875,
-0.00018393993377685547,
0.0174407958984375,
0.0236968994140625,
0.005706787109375,
0.048187255859375,
0.032073974609375,
0.01554107666015625,
-0.01137542724609375,
-0.00830841064453125,
0.0318603515625,
-0.0124664306640625,
0.0047760009765625,
-0.0404052734375,
0.02581787109375,
0.0267333984375,
-0.01543426513671875,
0.0282440185546875,
0.0070953369140625,
0.029144287109375,
-0.0156707763671875,
0.028900146484375,
-0.027099609375,
-0.049774169921875,
-0.053436279296875,
0.051055908203125,
-0.02398681640625,
-0.0009765625,
0.00951385498046875,
-0.006542205810546875,
0.005645751953125,
0.0445556640625,
0.06597900390625,
-0.03131103515625,
0.041229248046875,
0.0244903564453125,
0.049896240234375,
0.01186370849609375
] |
1ffd49f610276fe5fb90f3fdd5a8b8f4f88e7c03
|
Wordpress Stackexchange
Q: Show different theme for admin? I'd like to test some theme changes on my live site, but I obviously don't want regular users seeing any errors that may arise from it. I'd like to just duplicate my theme folder and if I'm logged in as admin, then that theme is shown to me, otherwise, the old theme is shown to my users.
Is there a plugin to do this?
A: I just wrote this quick plugin and it seems to work. Let me know if there is a better way.
<?php
/*
Plugin Name: Theme Switch if Admin
Description: Display different theme to user if logged in as admin
Author: Kyle Barber
*/
add_filter('template', 'change_theme');
add_filter('option_template', 'change_theme');
add_filter('option_stylesheet', 'change_theme');
function change_theme($theme) {
if ( current_user_can('manage_options') ) {
$theme = 'twentyeleven';
}
return $theme;
}
|
Q: Show different theme for admin? I'd like to test some theme changes on my live site, but I obviously don't want regular users seeing any errors that may arise from it. I'd like to just duplicate my theme folder and if I'm logged in as admin, then that theme is shown to me, otherwise, the old theme is shown to my users.
Is there a plugin to do this?
A: I just wrote this quick plugin and it seems to work. Let me know if there is a better way.
<?php
/*
Plugin Name: Theme Switch if Admin
Description: Display different theme to user if logged in as admin
Author: Kyle Barber
*/
add_filter('template', 'change_theme');
add_filter('option_template', 'change_theme');
add_filter('option_stylesheet', 'change_theme');
function change_theme($theme) {
if ( current_user_can('manage_options') ) {
$theme = 'twentyeleven';
}
return $theme;
}
A: You got switch_theme() and current_user_can( 'manage_options' );, which will only trigger for admin accounts.
|
wordpress
|
{
"language": "en",
"length": 150,
"provenance": "stackexchange_00019.jsonl.gz:419124",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49223"
}
|
[
0.0197601318359375,
-0.00469970703125,
0.00745391845703125,
-0.01045989990234375,
-0.0090789794921875,
-0.0210723876953125,
0.018768310546875,
-0.049407958984375,
-0.037445068359375,
0.0152130126953125,
-0.005908966064453125,
0.0149078369140625,
-0.0170745849609375,
-0.022308349609375,
0.01316070556640625,
-0.037933349609375,
0.008270263671875,
-0.00014352798461914062,
0.0005660057067871094,
-0.0106964111328125,
-0.0184783935546875,
0.019287109375,
-0.0184173583984375,
0.026397705078125,
0.015411376953125,
-0.033599853515625,
0.07086181640625,
-0.01021575927734375,
0.020111083984375,
-0.003932952880859375,
0.0160675048828125,
-0.03021240234375,
0.002223968505859375,
0.041595458984375,
-0.00039458274841308594,
0.016387939453125,
-0.004726409912109375,
0.0268096923828125,
0.025238037109375,
0.01314544677734375,
0.0213623046875,
0.001026153564453125,
-0.0033321380615234375,
0.03546142578125,
-0.0183563232421875,
-0.05926513671875,
0.0322265625,
-0.0175323486328125,
-0.0128936767578125,
-0.0029659271240234375,
0.052337646484375,
-0.0245513916015625,
0.066162109375,
-0.0096588134765625,
-0.0168914794921875,
0.00476837158203125,
-0.0114288330078125,
-0.0044097900390625,
0.039093017578125,
-0.015869140625,
-0.0305938720703125,
-0.04449462890625,
0.0263519287109375,
-0.0255889892578125,
-0.00829315185546875,
0.0025177001953125,
-0.005157470703125,
0.0258636474609375,
-0.05718994140625,
-0.02490234375,
0.022491455078125,
-0.035430908203125,
0.013519287109375,
-0.027130126953125,
-0.0330810546875,
0.023162841796875,
-0.015625,
-0.00994873046875,
0.03265380859375,
-0.033935546875,
0.00234222412109375,
0.0016622543334960938,
-0.017913818359375,
-0.03961181640625,
0.027069091796875,
0.006435394287109375,
-0.0134735107421875,
-0.0189208984375,
-0.02728271484375,
0.0263214111328125,
-0.023712158203125,
-0.0237884521484375,
0.00098419189453125,
0.023773193359375,
0.003376007080078125,
-0.00279998779296875,
0.0229034423828125,
0.06671142578125,
-0.01763916015625,
0.0015468597412109375,
-0.033599853515625,
-0.016571044921875,
-0.0241241455078125,
-0.02880859375,
-0.03460693359375,
-0.01129150390625,
0.036407470703125,
0.02447509765625,
-0.0016717910766601562,
0.0254669189453125,
-0.02325439453125,
0.0297698974609375,
-0.017486572265625,
-0.040374755859375,
-0.007022857666015625,
0.0287628173828125,
-0.0323486328125,
0.00927734375,
0.01424407958984375,
0.018218994140625,
0.0033969879150390625,
0.0301055908203125,
0.0248260498046875,
-0.02325439453125,
-0.006710052490234375,
-0.00690460205078125,
-0.03399658203125,
-0.047119140625,
-0.0033550262451171875,
-0.00521087646484375,
-0.0229339599609375,
0.006496429443359375,
0.055328369140625,
0.052276611328125,
0.025726318359375,
-0.00577545166015625,
-0.00612640380859375,
0.040802001953125,
-0.0018329620361328125,
0.0177459716796875,
-0.02154541015625,
-0.0237274169921875,
0.01983642578125,
-0.0244140625,
-0.0171051025390625,
0.04302978515625,
0.00481414794921875,
-0.0045013427734375,
-0.01320648193359375,
-0.06671142578125,
0.0016603469848632812,
-0.0531005859375,
-0.02459716796875,
0.019866943359375,
0.048126220703125,
0.01508331298828125,
0.00989532470703125,
0.00038051605224609375,
0.02410888671875,
0.030181884765625,
0.00667572021484375,
0.0009336471557617188,
0.0231781005859375,
0.01136016845703125,
-0.0138092041015625,
-0.0105743408203125,
-0.0105133056640625,
0.0088653564453125,
0.0189666748046875,
-0.050323486328125,
0.037139892578125,
0.001224517822265625,
0.064697265625,
-0.0096282958984375,
-0.0113983154296875,
0.0177764892578125,
-0.004550933837890625,
0.053070068359375,
0.02764892578125,
-0.0191802978515625,
0.01203155517578125,
-0.0166015625,
0.07373046875,
-0.004901885986328125,
-0.0214996337890625,
-0.0252227783203125,
0.00920867919921875,
-0.0033779144287109375,
0.027191162109375,
0.01314544677734375,
0.0208740234375,
0.007312774658203125,
0.018585205078125,
-0.0074310302734375,
-0.0002760887145996094,
-0.003429412841796875,
-0.02142333984375,
0.0269317626953125,
-0.0204010009765625,
-0.0292510986328125,
-0.00269317626953125,
0.0167236328125,
-0.0217132568359375,
-0.004940032958984375,
-0.0701904296875,
-0.00222015380859375,
-0.0222015380859375,
0.043853759765625,
0.036346435546875,
0.03643798828125,
-0.0232086181640625,
-0.00446319580078125,
0.0107421875,
-0.054351806640625,
-0.04473876953125,
-0.0013475418090820312,
-0.019073486328125,
0.018798828125,
-0.0011196136474609375,
0.0318603515625,
0.0225830078125,
-0.0186767578125,
0.00908660888671875,
-0.006809234619140625,
0.010986328125,
-0.006992340087890625,
-0.0173797607421875,
-0.0145111083984375,
-0.0033359527587890625,
0.01360321044921875,
-0.007537841796875,
0.0386962890625,
0.034881591796875,
0.0215301513671875,
-0.0305023193359375,
-0.019622802734375,
-0.01375579833984375,
-0.08184814453125,
0.014251708984375,
0.056854248046875,
0.0290679931640625,
0.0213775634765625,
-0.00445556640625,
0.0189056396484375,
0.07745361328125,
-0.0087432861328125,
0.01096343994140625,
0.00884246826171875,
0.01074981689453125,
0.030853271484375,
0.007720947265625,
-0.0021190643310546875,
0.012786865234375,
-0.03045654296875,
0.0084381103515625,
0.0274505615234375,
-0.01171875,
0.004291534423828125,
-0.033355712890625,
0.00806427001953125,
0.002532958984375,
0.01288604736328125,
-0.0025177001953125,
-0.0040130615234375,
0.0208282470703125,
-0.0222625732421875,
-0.01446533203125,
-0.0287322998046875,
-0.03839111328125,
0.0006775856018066406,
0.03497314453125,
-0.01491546630859375,
0.0006494522094726562,
0.03839111328125,
-0.0015497207641601562,
0.03546142578125,
-0.049285888671875,
-0.01824951171875,
0.045745849609375,
0.035125732421875,
-0.036468505859375,
0.00951385498046875,
-0.06317138671875,
-0.0108489990234375,
-0.02032470703125,
-0.044525146484375,
-0.0094146728515625,
-0.002727508544921875,
0.024169921875,
-0.0012998580932617188,
0.019775390625,
0.018402099609375,
-0.03533935546875,
0.061187744140625,
-0.032257080078125,
-0.01505279541015625,
-0.003726959228515625,
-0.033416748046875,
0.0426025390625,
-0.048980712890625,
0.010498046875,
0.04150390625,
-0.006328582763671875,
0.00516510009765625,
0.02105712890625,
0.0010805130004882812,
0.025390625,
0.0159912109375,
0.0108795166015625,
0.0222320556640625,
-0.0452880859375,
0.01474761962890625,
0.0142669677734375,
-0.01556396484375,
0.01174163818359375,
-0.030548095703125,
-0.022064208984375,
0.0019741058349609375,
-0.044891357421875,
-0.0228271484375,
-0.06329345703125,
-0.05242919921875,
0.01036834716796875,
0.005237579345703125,
-0.0173797607421875,
0.01019287109375,
0.016204833984375,
0.0259552001953125,
0.034454345703125,
-0.04779052734375,
-0.050689697265625,
-0.043487548828125,
-0.0478515625,
-0.015228271484375,
-0.00545501708984375,
-0.026824951171875,
-0.005828857421875,
0.07501220703125,
0.007534027099609375,
-0.0560302734375,
-0.0011768341064453125,
0.055908203125,
0.007843017578125,
0.0261993408203125,
0.0396728515625,
-0.052886962890625,
-0.005443572998046875,
0.00960540771484375,
0.0022792816162109375,
0.01318359375,
-0.0204925537109375,
-0.017974853515625,
-0.01629638671875,
-0.02935791015625,
-0.00016236305236816406,
-0.030181884765625,
0.007579803466796875,
-0.00319671630859375,
-0.0123291015625,
-0.05194091796875,
-0.02337646484375,
-0.0078582763671875,
-0.06439208984375,
0.04156494140625,
0.01427459716796875,
-0.006946563720703125,
0.0330810546875,
-0.0185394287109375,
0.0091705322265625,
-0.013275146484375,
-0.00818634033203125,
-0.02587890625,
0.050262451171875,
0.0137939453125,
0.028594970703125,
-0.0142974853515625,
-0.044158935546875,
-0.041748046875,
-0.004459381103515625,
-0.04449462890625,
0.0187530517578125,
-0.015411376953125,
0.045684814453125,
0.0185546875,
-0.0716552734375,
0.0438232421875,
-0.0186004638671875,
0.022064208984375,
-0.04791259765625,
-0.0279541015625,
-0.007518768310546875,
0.11749267578125,
-0.0794677734375,
0.00033974647521972656,
0.02520751953125,
0.0103607177734375,
0.0067596435546875,
0.017852783203125,
-0.0802001953125,
-0.022918701171875,
-0.12042236328125,
-0.0034542083740234375,
-0.0184783935546875,
-0.033050537109375,
-0.0288238525390625,
0.0083770751953125,
-0.07489013671875,
-0.047454833984375,
0.0195770263671875,
0.0218048095703125,
0.01316070556640625,
-0.0153961181640625,
0.006855010986328125,
-0.0235595703125,
0.01465606689453125,
-0.013214111328125,
-0.0946044921875,
-0.0190277099609375,
-0.0184326171875,
0.08837890625,
0.0301055908203125,
-0.01197052001953125,
-0.03253173828125,
0.03662109375,
0.003963470458984375,
0.058197021484375,
-0.01328277587890625,
0.004638671875,
0.04052734375,
-0.04058837890625,
0.006732940673828125,
-0.0174102783203125,
-0.01390838623046875,
-0.03326416015625,
-0.033294677734375,
-0.0023670196533203125,
-0.0119476318359375,
4.172325134277344e-7,
0.00922393798828125,
-0.0306549072265625,
0.00565338134765625,
-0.02044677734375,
-0.0190582275390625,
-0.01515960693359375,
0.004978179931640625,
-0.020111083984375,
0.00942230224609375,
0.018341064453125,
0.0227508544921875,
-0.01904296875,
-0.033416748046875,
0.017852783203125,
0.0623779296875,
0.02374267578125,
-0.01409149169921875,
-0.04486083984375,
0.0321044921875,
0.051971435546875,
-0.013641357421875,
-0.0022678375244140625,
-0.01214599609375,
-0.05902099609375,
0.07061767578125,
-0.0033245086669921875,
-0.005443572998046875,
-0.00864410400390625,
0.05230712890625,
-0.015655517578125,
-0.037200927734375,
0.0245208740234375,
-0.0333251953125,
0.030975341796875,
-0.00485992431640625,
-0.0029449462890625,
-0.022735595703125,
-0.01061248779296875,
0.0352783203125,
0.01499176025390625,
-0.0008831024169921875,
-0.038055419921875,
-0.041748046875,
0.01018524169921875,
-0.02471923828125,
0.01800537109375,
0.026092529296875,
-0.00791168212890625,
0.028045654296875,
0.0188446044921875,
-0.01123809814453125,
0.003635406494140625,
0.050201416015625,
-0.0007562637329101562,
0.017608642578125,
0.006870269775390625,
-0.01947021484375,
-0.055389404296875,
-0.01416778564453125,
0.0992431640625,
-0.0015726089477539062,
-0.053924560546875,
-0.005458831787109375,
-0.01235198974609375,
0.03826904296875,
0.03887939453125,
-0.020782470703125,
0.0209197998046875,
-0.0012531280517578125,
-0.003925323486328125,
-0.00920867919921875,
0.0053863525390625,
-0.040557861328125,
-0.030609130859375,
0.0279541015625,
0.0024013519287109375,
-0.0123748779296875,
0.0634765625,
0.028411865234375,
0.0004069805145263672,
0.04168701171875,
-0.0193939208984375,
0.024322509765625,
0.0220489501953125,
-0.001422882080078125,
0.01611328125,
0.01261138916015625,
0.006366729736328125,
-0.03643798828125,
0.0255126953125,
-0.007778167724609375,
0.0210418701171875,
0.01009368896484375,
0.0021839141845703125,
0.0097198486328125,
-0.00936126708984375,
0.0263824462890625,
0.004856109619140625,
-0.00463104248046875,
0.0193328857421875,
-0.049346923828125,
-0.0550537109375,
-0.0282440185546875,
0.03466796875,
0.056671142578125,
-0.042388916015625,
-0.0282440185546875,
-0.0246124267578125,
-0.023773193359375,
-0.005664825439453125,
-0.004383087158203125,
-0.08087158203125,
0.051788330078125,
0.0592041015625,
-0.0611572265625,
-0.01303863525390625,
0.005413055419921875,
-0.066162109375,
-0.0433349609375,
-0.00356292724609375,
-0.007373809814453125,
0.017303466796875,
-0.0053253173828125,
0.049591064453125,
0.0006537437438964844,
-0.055419921875,
-0.0105438232421875,
0.0017557144165039062,
0.03643798828125,
0.00830078125,
-0.10400390625,
0.0335693359375,
-0.08416748046875,
0.00914764404296875,
-0.057159423828125,
-0.0748291015625,
-0.04241943359375,
-0.002864837646484375,
0.01131439208984375,
0.0029430389404296875,
0.005535125732421875,
-0.022979736328125,
-0.01021575927734375,
0.0259552001953125,
0.03656005859375,
0.039337158203125,
-0.006900787353515625,
0.040496826171875,
-0.0064239501953125,
0.0182037353515625,
-0.001445770263671875,
-0.006443023681640625,
-0.04034423828125,
0.0137481689453125,
-0.004482269287109375,
0.004779815673828125,
0.0082550048828125,
0.0173797607421875,
0.0009031295776367188,
-0.0175323486328125,
0.05926513671875,
0.0029659271240234375,
0.0145263671875,
-0.00838470458984375,
0.0017337799072265625,
-0.0258331298828125,
0.0110321044921875,
-0.0181884765625,
0.0014371871948242188,
-0.006359100341796875,
-0.0221405029296875,
-0.0243072509765625,
-0.002193450927734375,
-0.0239715576171875,
0.0307769775390625,
-0.002300262451171875,
-0.0010633468627929688,
0.03350830078125,
-0.07061767578125,
0.06781005859375,
0.07318115234375,
0.01019287109375,
0.032073974609375,
-0.0032405853271484375,
0.01236724853515625,
-0.00597381591796875,
-0.0132293701171875,
0.02410888671875,
0.01151275634765625,
0.0274810791015625,
-0.0021610260009765625,
0.0139923095703125,
0.024566650390625,
-0.0166473388671875,
0.004413604736328125,
0.10498046875,
0.052398681640625,
-0.1248779296875,
-0.0011205673217773438,
-0.012054443359375,
0.0090484619140625,
0.02862548828125,
0.0080718994140625,
-0.00260162353515625,
-0.046051025390625,
0.01473236083984375,
-0.00913238525390625,
0.00934600830078125,
0.005939483642578125,
-0.0211181640625,
-0.024078369140625,
-0.0226593017578125,
0.0141448974609375,
0.0177001953125,
0.0000010132789611816406,
0.0211029052734375,
0.005706787109375,
0.005939483642578125,
-0.0158538818359375,
-0.0021572113037109375,
-0.00478363037109375,
-0.04339599609375,
-0.062347412109375,
-0.0175628662109375,
-0.007259368896484375,
-0.01128387451171875,
-0.0024776458740234375,
0.043304443359375,
0.046478271484375,
0.05743408203125,
0.0027408599853515625,
-0.005527496337890625,
0.0221099853515625,
0.0261688232421875,
0.00447845458984375,
-0.007534027099609375,
0.019256591796875,
0.003894805908203125,
-0.041290283203125,
0.02069091796875,
-0.033477783203125,
-0.0165252685546875,
-0.011322021484375,
-0.00017249584197998047,
0.065673828125,
0.0114593505859375,
-0.03753662109375,
0.0261383056640625,
0.01090240478515625,
-0.02508544921875,
0.015228271484375,
0.04351806640625,
-0.06243896484375,
-0.0309295654296875,
0.0288238525390625,
-0.00989532470703125,
-0.00897216796875,
0.0244598388671875,
-0.06488037109375,
0.06964111328125,
-0.017486572265625,
0.0254058837890625,
0.0157012939453125,
0.023529052734375,
-0.0172271728515625,
-0.0016326904296875,
-0.0257415771484375,
0.057769775390625,
-0.0084991455078125,
0.00594329833984375,
-0.0406494140625,
0.021453857421875,
-0.00879669189453125,
-0.010345458984375,
0.0234527587890625,
0.0233612060546875,
-0.04083251953125,
0.0188446044921875,
0.03692626953125,
0.0149078369140625,
0.0002110004425048828,
0.0550537109375,
-0.022918701171875,
0.058624267578125,
0.0112152099609375,
-0.043701171875,
0.01422882080078125,
0.0013494491577148438,
-0.0784912109375,
0.028839111328125,
0.01378631591796875,
0.01435089111328125,
0.018402099609375,
-0.0018491744995117188,
-0.06719970703125,
0.0237884521484375,
0.04827880859375,
-0.0123291015625,
-0.0032901763916015625,
0.0036754608154296875,
0.007747650146484375,
-0.0235137939453125,
0.0179290771484375,
-0.024200439453125,
0.036865234375,
0.0011644363403320312,
-0.02850341796875,
-0.01030731201171875,
0.00501251220703125,
-0.031036376953125,
-0.0244140625,
-0.0211639404296875,
0.042083740234375,
-0.0298004150390625,
0.026214599609375,
0.0203857421875,
0.025390625,
-0.0256500244140625,
0.00299835205078125,
-0.01019287109375,
0.02191162109375,
-0.035888671875,
-0.0306854248046875,
0.01474761962890625,
0.003276824951171875,
-0.00803375244140625,
0.01358795166015625,
-0.01007843017578125,
-0.004978179931640625,
0.0203704833984375,
-0.017181396484375,
-0.007389068603515625,
0.0240478515625,
0.020782470703125,
-0.008575439453125,
-0.0169677734375,
0.0009965896606445312,
0.009674072265625,
-0.047943115234375,
0.047027587890625,
0.0233306884765625,
0.02880859375,
-0.0134124755859375,
0.047454833984375,
0.01168060302734375,
-0.0016565322875976562,
0.0045318603515625,
0.0035877227783203125,
-0.020233154296875,
-0.01511383056640625,
-0.034881591796875,
-0.033477783203125,
-0.00954437255859375,
0.033905029296875,
-0.0257110595703125,
-0.042388916015625,
-0.0182647705078125,
0.01483154296875,
0.005474090576171875,
-0.027435302734375,
0.004730224609375,
-0.007625579833984375,
0.017578125,
-0.047698974609375,
0.042205810546875,
-0.00766754150390625,
0.006816864013671875,
-0.00786590576171875,
0.01277923583984375,
0.0277099609375,
-0.027069091796875,
0.03759765625,
-0.0022220611572265625,
-0.0311126708984375,
-0.034454345703125,
-0.0237579345703125,
0.02972412109375,
0.00412750244140625,
-0.058380126953125,
0.0012063980102539062,
-0.038238525390625,
-0.04034423828125,
0.01091766357421875,
0.026123046875,
-0.0195465087890625,
0.0298309326171875,
0.0021266937255859375,
0.01947021484375,
-0.007396697998046875,
-0.040191650390625,
0.020660400390625,
-0.02642822265625,
-0.0009026527404785156,
0.00792694091796875,
-0.07659912109375,
-0.06512451171875,
-0.0621337890625,
0.07366943359375,
0.023345947265625,
0.07061767578125,
-0.0263519287109375,
0.047515869140625,
-0.0187225341796875,
0.0269012451171875,
-0.059539794921875,
-0.052978515625,
0.09326171875,
-0.0267486572265625,
-0.034912109375,
0.005390167236328125,
-0.05975341796875,
0.00499725341796875,
0.038787841796875,
0.006591796875,
0.0106658935546875,
-0.01059722900390625,
0.025604248046875,
-0.01605224609375,
-0.00814056396484375,
-0.02294921875,
-0.05059814453125,
-0.04046630859375,
0.0283966064453125,
0.0021953582763671875,
0.002086639404296875,
-0.0540771484375,
0.00174713134765625,
-0.01136016845703125,
-0.01352691650390625,
-0.00836944580078125,
0.041412353515625,
-0.04425048828125,
0.027069091796875,
-0.016998291015625,
-0.0322265625,
0.01800537109375,
-0.019500732421875,
0.0250396728515625,
-0.005069732666015625,
0.09149169921875,
-0.00728607177734375,
-0.019500732421875,
0.0079803466796875,
0.01007080078125,
0.0151824951171875,
-0.053924560546875,
0.0024509429931640625,
0.05133056640625,
0.0026035308837890625,
-0.00258636474609375,
-0.032470703125,
-0.04034423828125,
-0.0650634765625,
0.01727294921875,
0.02899169921875,
0.0006709098815917969,
-0.0166778564453125,
-0.06427001953125,
0.036285400390625,
0.058807373046875,
0.004421234130859375,
-0.0654296875,
0.02569580078125,
-0.042999267578125,
0.08953857421875,
-0.0009088516235351562,
-0.02288818359375,
0.007282257080078125,
0.03302001953125,
-0.0157470703125,
0.011199951171875,
-0.04254150390625,
-0.0251007080078125,
-0.016021728515625,
-0.019439697265625,
0.021697998046875,
0.01490020751953125,
0.0021839141845703125,
-0.0220184326171875,
-0.055389404296875,
0.034515380859375,
-0.05328369140625,
0.002094268798828125,
0.004482269287109375,
0.016265869140625,
-0.037750244140625,
-0.0382080078125,
0.0198974609375,
0.003948211669921875,
-0.0321044921875,
0.0006380081176757812,
-0.0237579345703125,
0.004863739013671875,
-0.036163330078125,
-0.05419921875,
0.0103759765625,
0.01409149169921875,
-0.03704833984375,
-0.0152435302734375,
0.021087646484375,
-0.0164031982421875,
0.0012483596801757812,
0.0021953582763671875,
-0.038909912109375,
0.0173492431640625,
0.0262451171875,
0.022796630859375,
0.003643035888671875,
0.022186279296875,
0.03955078125,
-0.0484619140625,
0.0214996337890625,
-0.004856109619140625,
-0.00839996337890625,
-0.006256103515625,
-0.0214385986328125,
0.0262451171875,
0.03961181640625,
-0.01016998291015625,
-0.05572509765625,
0.00882720947265625,
-0.0208892822265625,
-0.01580810546875,
-0.0281829833984375,
-0.01873779296875,
-0.0169677734375,
0.07574462890625,
0.045562744140625,
0.0169677734375,
-0.0281982421875,
-0.06683349609375,
-0.038818359375,
-0.0307159423828125,
0.00270843505859375,
0.04248046875,
-0.10748291015625,
0.0219573974609375,
0.050567626953125,
-0.040283203125,
0.008697509765625,
0.0247802734375,
-0.056854248046875,
0.01404571533203125,
-0.0015935897827148438,
-0.0004265308380126953,
-0.0806884765625,
-0.04486083984375,
0.0869140625,
-0.03216552734375,
0.0134429931640625,
-0.002910614013671875,
0.035858154296875,
0.04644775390625,
0.006122589111328125,
0.01287078857421875,
-0.00344085693359375,
-0.03302001953125,
0.016265869140625,
0.00010848045349121094,
0.01244354248046875,
-0.037078857421875,
-0.01480865478515625,
0.014434814453125,
0.00519561767578125,
-0.0374755859375,
-0.0108489990234375,
0.0400390625,
0.0079345703125,
-0.039703369140625,
0.08966064453125,
-0.006015777587890625,
0.032623291015625,
-0.006763458251953125,
0.03125,
-0.03997802734375,
-0.002735137939453125,
-0.01369476318359375,
-0.0474853515625,
0.005584716796875,
-0.01776123046875,
0.0406494140625,
-0.052276611328125,
0.0274810791015625,
0.00543212890625,
0.031097412109375,
0.038665771484375
] |
3811ecf104463805cbc3bad287a1711b8fe7f859
|
Wordpress Stackexchange
Q: Modify built-in post type properties I have an unusual situation where I need to make the built-in post type 'page' non-hierarchical.
I printed the post type object with var_dump(get_post_type_object('page')); die; and I got this:
object(stdClass)#164 (26) {
["labels"]=>
...
}
["description"]=>
string(0) ""
["publicly_queryable"]=>
bool(false)
["exclude_from_search"]=>
bool(false)
["capability_type"]=>
string(4) "page"
["map_meta_cap"]=>
bool(true)
["_builtin"]=>
bool(true)
["_edit_link"]=>
string(16) "post.php?post=%d"
["hierarchical"]=>
bool(true)
....
}
How might I go about modifying the post-type object so that ["hierarchical"]=>bool(false)?
A: This is a pretty late answer, but I was looking to do something similar and figured it out. I wanted to get nav_menu_items into an RSS feed, which required changing the built in nav_menu_item post type property publicly_queryable.
Anyway, it was actually pretty simple, here's a generic function to do it:
function change_wp_object() {
$object = get_post_type_object('post_type');
$object->property = true;
}
add_action('init','change_wp_object');
And that's it. I've got it in a plugin. If you want to see the list of available properties to change, throw in
echo '<pre>'.print_r($object, 1).'</pre>';
to get a nicely formatted output of all the properties.
In your case you'd use
$object-> hierarchical = false;
Hope that helps someone!
|
Q: Modify built-in post type properties I have an unusual situation where I need to make the built-in post type 'page' non-hierarchical.
I printed the post type object with var_dump(get_post_type_object('page')); die; and I got this:
object(stdClass)#164 (26) {
["labels"]=>
...
}
["description"]=>
string(0) ""
["publicly_queryable"]=>
bool(false)
["exclude_from_search"]=>
bool(false)
["capability_type"]=>
string(4) "page"
["map_meta_cap"]=>
bool(true)
["_builtin"]=>
bool(true)
["_edit_link"]=>
string(16) "post.php?post=%d"
["hierarchical"]=>
bool(true)
....
}
How might I go about modifying the post-type object so that ["hierarchical"]=>bool(false)?
A: This is a pretty late answer, but I was looking to do something similar and figured it out. I wanted to get nav_menu_items into an RSS feed, which required changing the built in nav_menu_item post type property publicly_queryable.
Anyway, it was actually pretty simple, here's a generic function to do it:
function change_wp_object() {
$object = get_post_type_object('post_type');
$object->property = true;
}
add_action('init','change_wp_object');
And that's it. I've got it in a plugin. If you want to see the list of available properties to change, throw in
echo '<pre>'.print_r($object, 1).'</pre>';
to get a nicely formatted output of all the properties.
In your case you'd use
$object-> hierarchical = false;
Hope that helps someone!
A: What about:
function wp1482371_page_post_type_args( $args, $post_type ) {
if ( $post_type == "pages" ) {
$args['hierarchical'] = false
);
}
return $args;
}
add_filter( 'register_post_type_args', 'wp1482371_page_post_type_args', 20, 2 );
A: As far as I can tell, there is no (good) way to change the core post types. The alternative of course is to make your own custom post type. If you have a bunch of posts that are the core post type of page, you could run a MySQL query to convert them all at once to the new post type, once created, if you need to. Or, you could possibly change the way your theme displays a list of pages.
To make a new post type that is not hierarchical:
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'nonhierarchical_page',
array(
'labels' => array(
'name' => __( 'NHPages' ),
'singular_name' => __( 'NHPage' )
),
'public' => true,
'hierarchical' => false
)
);
}
|
wordpress
|
{
"language": "en",
"length": 341,
"provenance": "stackexchange_00019.jsonl.gz:419134",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49251"
}
|
[
0.0594482421875,
-0.0185089111328125,
0.0177764892578125,
-0.027557373046875,
-0.0052947998046875,
-0.027618408203125,
0.02508544921875,
-0.0207672119140625,
-0.0018301010131835938,
-0.0228424072265625,
-0.0010633468627929688,
-0.01071929931640625,
-0.0287017822265625,
-0.041412353515625,
0.029144287109375,
-0.0230255126953125,
0.038665771484375,
-0.01078033447265625,
0.048187255859375,
-0.00614166259765625,
0.007305145263671875,
0.01309967041015625,
0.0389404296875,
0.033416748046875,
0.04168701171875,
-0.04058837890625,
0.024505615234375,
-0.0253448486328125,
0.03857421875,
-0.00881195068359375,
0.0298309326171875,
-0.00368499755859375,
0.0155181884765625,
0.0286865234375,
-0.0240936279296875,
0.00908660888671875,
0.0003657341003417969,
0.0223236083984375,
0.02056884765625,
0.00482177734375,
0.0155181884765625,
-0.002819061279296875,
-0.0261077880859375,
0.0120391845703125,
-0.0433349609375,
-0.046112060546875,
0.012481689453125,
0.0010766983032226562,
0.04119873046875,
-0.039703369140625,
-0.02630615234375,
0.05224609375,
-0.0036144256591796875,
-0.046966552734375,
-0.0171051025390625,
-0.0151824951171875,
-0.0072174072265625,
-0.0273284912109375,
0.033843994140625,
0.01654052734375,
-0.027313232421875,
-0.027191162109375,
0.01338958740234375,
-0.053192138671875,
0.00211334228515625,
0.01262664794921875,
-0.00537109375,
-0.0023326873779296875,
-0.0450439453125,
0.01214599609375,
0.035888671875,
-0.04998779296875,
-0.003948211669921875,
-0.0137481689453125,
0.0126953125,
-0.00438690185546875,
-0.0264892578125,
-0.0153350830078125,
0.0232391357421875,
0.02020263671875,
0.055267333984375,
0.0440673828125,
-0.0634765625,
0.0210723876953125,
0.000039517879486083984,
0.0428466796875,
-0.004825592041015625,
-0.0458984375,
-0.04736328125,
0.01277923583984375,
-0.037445068359375,
0.0095062255859375,
-0.0139312744140625,
-0.0184173583984375,
-0.02789306640625,
-0.0021724700927734375,
0.007434844970703125,
0.0170440673828125,
-0.01491546630859375,
0.04815673828125,
-0.0242156982421875,
-0.0228424072265625,
0.057708740234375,
-0.034942626953125,
0.033599853515625,
0.0145721435546875,
-0.006847381591796875,
-0.006786346435546875,
0.059661865234375,
0.026031494140625,
0.00934600830078125,
0.06219482421875,
0.0075225830078125,
0.015960693359375,
-0.035980224609375,
0.027679443359375,
-0.01861572265625,
0.00690460205078125,
-0.021942138671875,
0.050567626953125,
0.023345947265625,
0.0260162353515625,
0.007144927978515625,
0.002689361572265625,
-0.00502777099609375,
0.0105438232421875,
-0.0223236083984375,
-0.03582763671875,
0.0249481201171875,
0.007266998291015625,
-0.035552978515625,
0.006237030029296875,
0.09552001953125,
0.029449462890625,
0.01093292236328125,
-0.01337432861328125,
0.007366180419921875,
-0.033966064453125,
-0.0372314453125,
0.0204010009765625,
0.010986328125,
-0.01342010498046875,
0.0117340087890625,
-0.01226043701171875,
-0.021453857421875,
0.030853271484375,
0.039215087890625,
0.0175933837890625,
-0.0308837890625,
-0.08990478515625,
0.020721435546875,
-0.00513458251953125,
0.031707763671875,
0.02825927734375,
-0.03350830078125,
-0.020477294921875,
0.025115966796875,
-0.035186767578125,
-0.00531768798828125,
-0.055328369140625,
0.01410675048828125,
-0.00360870361328125,
0.01904296875,
-0.0021419525146484375,
-0.004261016845703125,
-0.001201629638671875,
-0.01082611083984375,
0.00717926025390625,
0.0267791748046875,
0.032501220703125,
0.0302276611328125,
-0.017181396484375,
-0.0081787109375,
-0.0022258758544921875,
-0.0123138427734375,
-0.00888824462890625,
-0.01348114013671875,
0.005229949951171875,
0.016693115234375,
0.0165863037109375,
-0.01187896728515625,
-0.0308685302734375,
0.01557159423828125,
-0.00232696533203125,
-0.052398681640625,
0.032684326171875,
0.0064544677734375,
0.0181427001953125,
0.0126495361328125,
-0.007381439208984375,
0.061614990234375,
0.016204833984375,
-0.06268310546875,
0.0240020751953125,
0.021820068359375,
0.004848480224609375,
-0.0207977294921875,
-0.00505828857421875,
-0.0029735565185546875,
-0.0186614990234375,
-0.01082611083984375,
0.0177764892578125,
-0.031341552734375,
-0.005615234375,
-0.02569580078125,
-0.03448486328125,
-0.00014102458953857422,
0.037567138671875,
0.025299072265625,
0.03326416015625,
0.00348663330078125,
0.0133819580078125,
-0.0108795166015625,
-0.0160369873046875,
-0.033935546875,
-0.01230621337890625,
0.004383087158203125,
0.0005812644958496094,
-0.01007080078125,
-0.0028285980224609375,
-0.00994110107421875,
-0.0190582275390625,
-0.0043182373046875,
0.0374755859375,
0.05615234375,
0.0228271484375,
0.0038547515869140625,
-0.0020236968994140625,
0.07354736328125,
0.04766845703125,
-0.0032825469970703125,
-0.03314208984375,
0.03985595703125,
0.0248565673828125,
-0.01419830322265625,
-0.01157379150390625,
0.0192108154296875,
-0.08551025390625,
0.0264129638671875,
0.05987548828125,
0.0202484130859375,
-0.0035648345947265625,
-0.043365478515625,
-0.0111236572265625,
0.030364990234375,
0.0106964111328125,
0.012054443359375,
-0.0089263916015625,
-0.0188140869140625,
0.024139404296875,
-0.042022705078125,
0.033477783203125,
0.0335693359375,
-0.01120758056640625,
-0.00028324127197265625,
0.060638427734375,
0.010955810546875,
0.018768310546875,
0.0018606185913085938,
0.01467132568359375,
-0.0170745849609375,
0.00689697265625,
0.0022525787353515625,
0.0007691383361816406,
0.08123779296875,
-0.00679779052734375,
0.048828125,
0.0306243896484375,
-0.05010986328125,
0.005352020263671875,
0.0186309814453125,
0.01068878173828125,
0.006511688232421875,
0.046356201171875,
-0.007755279541015625,
0.00768280029296875,
-0.0140533447265625,
-0.0038013458251953125,
-0.011383056640625,
0.007076263427734375,
-0.0132904052734375,
0.00003361701965332031,
-0.00304412841796875,
-0.01042938232421875,
-0.002536773681640625,
-0.020294189453125,
0.012359619140625,
-0.0035076141357421875,
0.005611419677734375,
0.01076507568359375,
0.025177001953125,
-0.004642486572265625,
-0.0423583984375,
0.0543212890625,
-0.049652099609375,
-0.01812744140625,
0.0103302001953125,
-0.04962158203125,
0.029510498046875,
-0.034759521484375,
0.039276123046875,
0.059326171875,
0.023406982421875,
-0.0118560791015625,
0.006092071533203125,
-0.0016508102416992188,
0.0004811286926269531,
0.024871826171875,
0.0004076957702636719,
0.01433563232421875,
-0.047943115234375,
0.040191650390625,
0.019805908203125,
-0.007114410400390625,
0.054931640625,
-0.02337646484375,
-0.00077056884765625,
0.014404296875,
-0.089599609375,
-0.087158203125,
0.0016641616821289062,
-0.0250701904296875,
-0.0214996337890625,
0.01763916015625,
-0.0263519287109375,
0.017578125,
0.030517578125,
0.0037326812744140625,
0.049072265625,
-0.0106201171875,
-0.045166015625,
-0.0028476715087890625,
-0.05670166015625,
-0.04327392578125,
-0.008697509765625,
-0.0242767333984375,
0.01049041748046875,
0.060150146484375,
0.0179443359375,
-0.0391845703125,
0.006336212158203125,
0.052947998046875,
-0.0262603759765625,
-0.0014705657958984375,
0.00733184814453125,
-0.01000213623046875,
0.01629638671875,
0.00039005279541015625,
0.019317626953125,
0.0279083251953125,
-0.031524658203125,
-0.021575927734375,
-0.0202789306640625,
0.0240936279296875,
0.019683837890625,
-0.01422119140625,
0.004711151123046875,
0.038238525390625,
0.01139068603515625,
-0.020782470703125,
-0.046417236328125,
-0.0282745361328125,
-0.04730224609375,
0.0291900634765625,
-0.01227569580078125,
0.03375244140625,
-0.0015497207641601562,
0.04840087890625,
-0.0094451904296875,
0.0192108154296875,
-0.0014295578002929688,
-0.00887298583984375,
0.0003483295440673828,
-0.020111083984375,
-0.0191497802734375,
0.00362396240234375,
0.031829833984375,
-0.003482818603515625,
-0.01308441162109375,
0.002086639404296875,
0.0226593017578125,
0.03759765625,
-0.03936767578125,
0.0009670257568359375,
-0.0229949951171875,
0.0211944580078125,
-0.056060791015625,
0.03582763671875,
-0.045928955078125,
-0.01157379150390625,
-0.01412200927734375,
0.0732421875,
-0.0413818359375,
-0.0186614990234375,
-0.02642822265625,
0.0293426513671875,
-0.046478271484375,
-0.10992431640625,
-0.019317626953125,
0.0017747879028320312,
-0.03228759765625,
0.00812530517578125,
0.006244659423828125,
-0.033050537109375,
-0.029937744140625,
0.042999267578125,
-0.046417236328125,
-0.0032405853271484375,
0.0182647705078125,
0.0272979736328125,
-0.0163116455078125,
0.01474761962890625,
-0.0227203369140625,
0.0117034912109375,
-0.0272369384765625,
0.01187896728515625,
-0.1065673828125,
-0.0203399658203125,
-0.005176544189453125,
0.055328369140625,
-0.019317626953125,
-0.0030574798583984375,
-0.052734375,
0.02484130859375,
0.0129852294921875,
-0.0017614364624023438,
0.0013227462768554688,
-0.0092010498046875,
-0.037445068359375,
0.0042266845703125,
0.00881195068359375,
-0.03375244140625,
-0.00762176513671875,
-0.00213623046875,
-0.0185394287109375,
0.0088043212890625,
-0.021026611328125,
-0.0204620361328125,
0.016021728515625,
-0.0261688232421875,
-0.0416259765625,
-0.06085205078125,
-0.052947998046875,
0.01290130615234375,
-0.046722412109375,
0.003292083740234375,
-0.07122802734375,
-0.043182373046875,
0.044342041015625,
0.03289794921875,
-0.006618499755859375,
-0.0062713623046875,
0.02349853515625,
0.00557708740234375,
-0.040802001953125,
-0.021270751953125,
0.015777587890625,
-0.00926971435546875,
0.00110626220703125,
0.041961669921875,
-0.01104736328125,
0.03363037109375,
0.0004744529724121094,
-0.036285400390625,
0.01290130615234375,
-0.004482269287109375,
0.0121612548828125,
0.0185394287109375,
-0.00344085693359375,
0.01432037353515625,
0.017852783203125,
0.0008130073547363281,
0.059722900390625,
0.010589599609375,
-0.0250091552734375,
0.01397705078125,
0.0231781005859375,
-0.0248870849609375,
-0.0059967041015625,
-0.0176239013671875,
-0.033233642578125,
0.030242919921875,
0.035308837890625,
-0.0098876953125,
0.00414276123046875,
0.0009937286376953125,
0.0040740966796875,
-0.045806884765625,
0.03302001953125,
0.01338958740234375,
0.0418701171875,
-0.031097412109375,
0.046356201171875,
0.0174560546875,
0.0069732666015625,
-0.0072021484375,
0.006458282470703125,
-0.017364501953125,
-0.0208740234375,
-0.04168701171875,
-0.039581298828125,
0.0137939453125,
0.039520263671875,
0.0088348388671875,
-0.01605224609375,
0.036712646484375,
0.05279541015625,
-0.0115509033203125,
-0.0170135498046875,
-0.0411376953125,
0.033966064453125,
-0.04656982421875,
-0.011810302734375,
0.0250701904296875,
-0.0059661865234375,
0.00435638427734375,
0.046356201171875,
0.028167724609375,
0.0206451416015625,
-0.031494140625,
0.0249481201171875,
0.057220458984375,
-0.0245513916015625,
0.0013980865478515625,
0.045440673828125,
-0.0128021240234375,
-0.02996826171875,
0.023529052734375,
-0.030792236328125,
-0.04736328125,
0.00948333740234375,
0.05621337890625,
-0.02313232421875,
0.0010967254638671875,
0.004764556884765625,
-0.0178985595703125,
0.0023746490478515625,
0.0218505859375,
0.0394287109375,
-0.01122283935546875,
-0.006793975830078125,
0.020660400390625,
0.0308990478515625,
-0.0179595947265625,
0.0257720947265625,
-0.039154052734375,
0.014404296875,
-0.006671905517578125,
-0.040618896484375,
-0.0404052734375,
-0.01251220703125,
0.0211639404296875,
-0.09814453125,
-0.030731201171875,
0.01971435546875,
-0.046173095703125,
-0.0313720703125,
0.00010883808135986328,
-0.024993896484375,
-0.01091766357421875,
-0.030181884765625,
0.037750244140625,
-0.0185089111328125,
0.0036029815673828125,
-0.0224761962890625,
0.00292205810546875,
0.049346923828125,
0.035675048828125,
-0.00368499755859375,
-0.0032863616943359375,
-0.03143310546875,
-0.0233306884765625,
-0.030426025390625,
-0.029510498046875,
-0.035736083984375,
0.0005002021789550781,
-0.01503753662109375,
0.0243682861328125,
-0.0039215087890625,
-0.006191253662109375,
-0.0003161430358886719,
0.0052337646484375,
-0.01424407958984375,
0.005275726318359375,
-0.0168914794921875,
0.11614990234375,
-0.05206298828125,
0.06640625,
0.003726959228515625,
0.039886474609375,
-0.056182861328125,
0.01239013671875,
0.0313720703125,
-0.062164306640625,
-0.032928466796875,
-0.020782470703125,
-0.0288543701171875,
0.0015010833740234375,
0.0014467239379882812,
-0.006740570068359375,
0.032257080078125,
-0.01763916015625,
-0.00044918060302734375,
-0.028717041015625,
-0.00691986083984375,
-0.048431396484375,
0.032623291015625,
-0.040191650390625,
0.002864837646484375,
0.006732940673828125,
-0.003414154052734375,
-0.02294921875,
0.00911712646484375,
0.0157928466796875,
0.00926971435546875,
-0.00121307373046875,
-0.04364013671875,
0.0197601318359375,
0.040863037109375,
0.0121612548828125,
0.05462646484375,
0.0096588134765625,
0.042388916015625,
0.018096923828125,
-0.0369873046875,
0.035064697265625,
0.0220184326171875,
0.0745849609375,
-0.0216217041015625,
-0.023284912109375,
0.05047607421875,
-0.046539306640625,
0.06976318359375,
0.0218658447265625,
0.07684326171875,
-0.0809326171875,
0.061981201171875,
0.0435791015625,
-0.0031185150146484375,
0.09490966796875,
0.0306243896484375,
0.00795745849609375,
0.00963592529296875,
-0.0653076171875,
0.018096923828125,
-0.0340576171875,
-0.01395416259765625,
0.03558349609375,
-0.020843505859375,
-0.003993988037109375,
0.0295562744140625,
0.0301971435546875,
0.04168701171875,
0.0008883476257324219,
-0.01470184326171875,
0.03955078125,
0.004795074462890625,
0.03131103515625,
-0.00860595703125,
-0.049468994140625,
-0.08154296875,
-0.02642822265625,
0.032958984375,
-0.0516357421875,
0.01085662841796875,
0.01910400390625,
-0.0022869110107421875,
0.034942626953125,
-0.0012950897216796875,
-0.017578125,
0.01654052734375,
-0.034637451171875,
-0.036865234375,
-0.03204345703125,
-0.00162506103515625,
0.044464111328125,
-0.00548553466796875,
0.0274505615234375,
-0.01131439208984375,
-0.0226287841796875,
-0.01629638671875,
-0.04266357421875,
0.070068359375,
-0.00286102294921875,
-0.0294036865234375,
0.002330780029296875,
-0.00804901123046875,
0.0014543533325195312,
0.0017042160034179688,
0.032806396484375,
-0.04754638671875,
-0.034423828125,
0.0204315185546875,
-0.0418701171875,
-0.038177490234375,
-0.01416778564453125,
-0.0391845703125,
0.077880859375,
0.0223846435546875,
-0.00516510009765625,
-0.0063934326171875,
0.038543701171875,
-0.02215576171875,
0.0374755859375,
-0.039154052734375,
0.053955078125,
0.01488494873046875,
0.070068359375,
-0.04052734375,
-0.009979248046875,
0.0302734375,
0.0364990234375,
0.017059326171875,
0.003993988037109375,
-0.0284423828125,
-0.0169219970703125,
0.0034008026123046875,
0.0246734619140625,
0.0036983489990234375,
0.037872314453125,
-0.00536346435546875,
0.03533935546875,
0.0143280029296875,
-0.067626953125,
0.02301025390625,
-0.06427001953125,
-0.012725830078125,
0.0003719329833984375,
0.0099029541015625,
0.0069580078125,
-0.01200103759765625,
0.0153656005859375,
-0.031341552734375,
-0.0164337158203125,
0.00878143310546875,
-0.0007915496826171875,
0.0301361083984375,
0.01123046875,
0.0235748291015625,
0.00884246826171875,
0.0026187896728515625,
-0.0027446746826171875,
0.04547119140625,
-0.0009212493896484375,
-0.0176239013671875,
-0.0021190643310546875,
0.005908966064453125,
-0.0103912353515625,
-0.011016845703125,
-0.0259552001953125,
0.01983642578125,
0.00949859619140625,
0.048248291015625,
0.042449951171875,
0.029266357421875,
-0.0215301513671875,
0.0310211181640625,
0.08563232421875,
0.06488037109375,
-0.054840087890625,
-0.038055419921875,
0.0238189697265625,
0.033355712890625,
0.0025272369384765625,
0.0259552001953125,
0.024505615234375,
0.0113067626953125,
0.068115234375,
-0.0221405029296875,
-0.002872467041015625,
0.0283050537109375,
0.03399658203125,
0.0153350830078125,
-0.01097869873046875,
-0.06585693359375,
-0.041900634765625,
-0.0235137939453125,
-0.0284881591796875,
0.01139068603515625,
0.06365966796875,
0.0293426513671875,
0.0675048828125,
-0.02655029296875,
-0.03363037109375,
-0.0035991668701171875,
-0.02801513671875,
-0.0008192062377929688,
0.01055145263671875,
-0.01511383056640625,
0.00446319580078125,
0.00690460205078125,
0.0343017578125,
0.03631591796875,
0.03741455078125,
0.044952392578125,
0.0273895263671875,
-0.00989532470703125,
0.0248260498046875,
0.105712890625,
-0.00281524658203125,
-0.0187225341796875,
-0.0225830078125,
0.00037384033203125,
0.0103759765625,
0.0067291259765625,
0.005275726318359375,
0.033935546875,
0.009796142578125,
0.0361328125,
0.036346435546875,
0.012664794921875,
0.033111572265625,
0.05096435546875,
0.011444091796875,
0.0299072265625,
0.0638427734375,
-0.08013916015625,
-0.0165863037109375,
-0.006351470947265625,
-0.0672607421875,
0.042755126953125,
0.036895751953125,
-0.01288604736328125,
-0.004589080810546875,
0.0214080810546875,
0.0038700103759765625,
0.014892578125,
0.00323486328125,
-0.01192474365234375,
0.039154052734375,
0.048065185546875,
0.022857666015625,
-0.00635528564453125,
-0.004390716552734375,
-0.004772186279296875,
0.01123809814453125,
-0.00533294677734375,
0.0462646484375,
-0.01042938232421875,
0.01090240478515625,
-0.047149658203125,
0.05487060546875,
-0.10137939453125,
-0.0174102783203125,
-0.00872039794921875,
-0.01568603515625,
-0.0075225830078125,
0.0270843505859375,
-0.007343292236328125,
-0.0171356201171875,
0.06427001953125,
-0.04156494140625,
0.031494140625,
-0.04058837890625,
0.0105133056640625,
-0.0880126953125,
0.0018825531005859375,
-0.027801513671875,
0.011016845703125,
-0.033843994140625,
-0.049285888671875,
0.06329345703125,
0.0160369873046875,
-0.00440216064453125,
0.052734375,
0.005596160888671875,
-0.0196380615234375,
0.038818359375,
-0.04473876953125,
0.031219482421875,
0.0282135009765625,
0.0116119384765625,
0.02117919921875,
0.04522705078125,
-0.0169219970703125,
0.02252197265625,
0.022369384765625,
-0.01026153564453125,
0.035247802734375,
-0.078125,
-0.024078369140625,
-0.032196044921875,
-0.0084686279296875,
-0.03265380859375,
-0.0224151611328125,
0.0036144256591796875,
-0.00921630859375,
-0.0182647705078125,
0.01380157470703125,
-0.01273345947265625,
-0.044769287109375,
-0.007610321044921875,
0.00013625621795654297,
-0.020355224609375,
-0.0302276611328125,
-0.00707244873046875,
0.00921630859375,
0.033905029296875,
0.0248870849609375,
-0.0809326171875,
0.0306396484375,
0.010894775390625,
0.03729248046875,
0.004360198974609375,
-0.0062255859375,
-0.00592803955078125,
0.0259857177734375,
-0.0252532958984375,
0.0084381103515625,
-0.03802490234375,
-0.006549835205078125,
-0.009918212890625,
0.041900634765625,
0.0660400390625,
-0.04864501953125,
0.015777587890625,
0.0107574462890625,
0.03570556640625,
0.07159423828125,
0.027130126953125,
-0.0239715576171875,
0.003635406494140625,
-0.00792694091796875,
-0.017578125,
-0.04718017578125,
0.02587890625,
-0.0975341796875,
-0.038818359375,
0.03314208984375,
-0.0233306884765625,
-0.007396697998046875,
-0.041900634765625,
-0.02740478515625,
0.046905517578125,
0.024871826171875,
-0.024627685546875,
-0.0168914794921875,
-0.017059326171875,
0.00736236572265625,
0.033111572265625,
0.002193450927734375,
-0.0313720703125,
-0.05133056640625,
0.00841522216796875,
0.023468017578125,
0.039886474609375,
0.01274871826171875,
0.014984130859375,
-0.04345703125,
0.022491455078125,
-0.01338958740234375,
0.0338134765625,
-0.03802490234375,
0.0292816162109375,
0.0027637481689453125,
0.01087188720703125,
-0.01416015625,
0.004878997802734375,
0.026519775390625,
0.01505279541015625,
0.0028247833251953125,
0.03009033203125,
-0.0340576171875,
-0.003681182861328125,
0.07257080078125,
0.021453857421875,
0.0333251953125,
-0.01027679443359375,
-0.034881591796875,
-0.05438232421875,
-0.043975830078125,
-0.01209259033203125,
0.0171661376953125,
-0.06573486328125,
0.0221099853515625,
0.0052337646484375,
0.0214691162109375,
-0.0184326171875,
-0.030303955078125,
0.001308441162109375,
-0.029205322265625,
0.041656494140625,
0.006397247314453125,
0.018341064453125,
-0.01529693603515625,
-0.0272064208984375,
0.009246826171875,
-0.015625,
0.00632476806640625,
0.004352569580078125,
-0.022918701171875,
0.053680419921875,
-0.06829833984375,
0.006671905517578125,
-0.01444244384765625,
0.0279083251953125,
-0.0222015380859375,
0.00029206275939941406,
-0.01751708984375,
0.033843994140625,
-0.024658203125,
0.00705718994140625,
0.0140533447265625,
0.003292083740234375,
-0.0156402587890625,
0.0249786376953125,
0.01282501220703125,
0.0299835205078125,
-0.0006437301635742188,
0.01806640625,
-0.031494140625,
0.045440673828125,
0.0097503662109375,
-0.0238494873046875,
0.037506103515625,
-0.0005221366882324219,
-0.00464630126953125,
0.0010919570922851562,
-0.033050537109375,
-0.057861328125,
0.0232391357421875,
0.021331787109375,
-0.00632476806640625,
0.0312042236328125
] |
2689e420636270261c4728bacbdf0e7398e0c133
|
Wordpress Stackexchange
Q: show author image in posts I need to display author image along with posts. I used the following code to display posts with author image.
$the_query = new WP_Query("post_type=post&paged=".get_query_var('paged'));
while ( $the_query->have_posts() ) : $the_query->the_post();
<?php the_excerpt(); ?>
<p><?php the_author_image(); ?></p>
<?php endwhile; ?>
But the author image didn't display. I couldn't track the error. How can i do this?
A: I know this is old, but I just came across it shortly before I came across the solution.
To display the author image inside the loop, just use this code:
<?php echo get_avatar( get_the_author_meta( 'ID' ) , 32 ); ?>
Where '32' is the size of the image. If it's outside the loop, then just specify the author's user ID.
|
Q: show author image in posts I need to display author image along with posts. I used the following code to display posts with author image.
$the_query = new WP_Query("post_type=post&paged=".get_query_var('paged'));
while ( $the_query->have_posts() ) : $the_query->the_post();
<?php the_excerpt(); ?>
<p><?php the_author_image(); ?></p>
<?php endwhile; ?>
But the author image didn't display. I couldn't track the error. How can i do this?
A: I know this is old, but I just came across it shortly before I came across the solution.
To display the author image inside the loop, just use this code:
<?php echo get_avatar( get_the_author_meta( 'ID' ) , 32 ); ?>
Where '32' is the size of the image. If it's outside the loop, then just specify the author's user ID.
A: If you are not using it inside a normal loop, get the author ID a different way and use the function like this:
the_author_image($authorid);
Basically you need to supply the author ID to the function if it is not in a proper loop. If you are having trouble getting the ID from your query let me know.
A: Note the answers here are for the built-in Gravatar photo. If you want to choose/set photos for your authors you'll need a plugin or write your own as miahelf mentions.
A: Upload a specific image for author requires 2 things:
*
*extend the get_the_author_meta() function
*link the implementation of the extension to media file management system in WP
Please Note that get_the_author_image() is deprecated and will not work for WP > 3.0
|
wordpress
|
{
"language": "en",
"length": 253,
"provenance": "stackexchange_00019.jsonl.gz:419137",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49264"
}
|
[
0.07537841796875,
0.014984130859375,
0.054595947265625,
-0.01324462890625,
0.0211181640625,
-0.0217132568359375,
0.042572021484375,
-0.07818603515625,
0.022674560546875,
0.07305908203125,
-0.064453125,
0.0208282470703125,
0.00034737586975097656,
0.020294189453125,
-0.06158447265625,
-0.035614013671875,
0.05267333984375,
-0.025604248046875,
0.0694580078125,
0.032073974609375,
0.00844573974609375,
0.06231689453125,
0.048675537109375,
-0.0232086181640625,
0.03424072265625,
-0.03814697265625,
0.10247802734375,
-0.030029296875,
0.0205535888671875,
-0.020843505859375,
0.02862548828125,
-0.0097198486328125,
-0.0106353759765625,
0.040863037109375,
-0.0014867782592773438,
0.024017333984375,
-0.0254364013671875,
0.03546142578125,
0.040802001953125,
-0.009521484375,
-0.00925445556640625,
0.0114593505859375,
-0.027496337890625,
0.0123748779296875,
-0.03289794921875,
-0.04290771484375,
0.001956939697265625,
-0.0291900634765625,
0.012451171875,
0.0160064697265625,
0.01708984375,
0.01849365234375,
0.0133514404296875,
0.025848388671875,
-0.016571044921875,
-0.01039886474609375,
0.0264434814453125,
-0.006923675537109375,
0.036468505859375,
-0.08673095703125,
-0.0626220703125,
0.0033893585205078125,
0.050445556640625,
0.0286407470703125,
0.017120361328125,
0.016937255859375,
0.0311737060546875,
0.0144500732421875,
0.004070281982421875,
-0.0105438232421875,
-0.0157012939453125,
-0.016571044921875,
-0.01039886474609375,
-0.03045654296875,
-0.0306549072265625,
-0.0013170242309570312,
-0.0200958251953125,
-0.0499267578125,
0.01256561279296875,
-0.017120361328125,
-0.0302886962890625,
0.008056640625,
-0.05523681640625,
0.004467010498046875,
0.0059356689453125,
0.0357666015625,
-0.0259857177734375,
-0.0167236328125,
-0.037689208984375,
0.00669097900390625,
-0.02850341796875,
-0.03155517578125,
-0.0024280548095703125,
0.0227203369140625,
-0.0034008026123046875,
-0.01502227783203125,
0.046844482421875,
0.040863037109375,
-0.00670623779296875,
0.0083770751953125,
-0.01100921630859375,
-0.0291900634765625,
0.0236053466796875,
-0.035980224609375,
0.01074981689453125,
0.0272216796875,
0.0069122314453125,
0.007762908935546875,
0.035675048828125,
0.038360595703125,
0.005168914794921875,
0.0101470947265625,
-0.039886474609375,
-0.037017822265625,
-0.0118255615234375,
0.045166015625,
-0.057525634765625,
-0.0097503662109375,
0.012786865234375,
-0.0232086181640625,
0.007904052734375,
0.0291595458984375,
-0.006771087646484375,
-0.0072021484375,
0.00879669189453125,
0.00891876220703125,
-0.01335906982421875,
-0.032135009765625,
0.01065826416015625,
0.0006051063537597656,
-0.049530029296875,
0.0080413818359375,
0.060821533203125,
0.0224609375,
0.0247955322265625,
-0.0284576416015625,
-0.022613525390625,
-0.035064697265625,
0.015960693359375,
-0.002391815185546875,
-0.044036865234375,
0.0014123916625976562,
0.06915283203125,
-0.0214691162109375,
-0.035736083984375,
0.0290679931640625,
-0.00612640380859375,
0.0126190185546875,
-0.006931304931640625,
-0.0567626953125,
-0.0087127685546875,
-0.035430908203125,
-0.0264434814453125,
0.00855255126953125,
0.09490966796875,
0.00641632080078125,
0.04364013671875,
-0.0245208740234375,
0.022979736328125,
0.027587890625,
0.042236328125,
0.02484130859375,
0.01380157470703125,
0.004032135009765625,
0.01245880126953125,
-0.05224609375,
-0.049896240234375,
0.0004363059997558594,
0.020904541015625,
-0.024078369140625,
0.030426025390625,
-0.00815582275390625,
0.0384521484375,
0.0186767578125,
-0.01427459716796875,
0.01739501953125,
0.0101318359375,
0.0025615692138671875,
-0.0045928955078125,
0.032562255859375,
-0.018707275390625,
-0.0413818359375,
-0.00942230224609375,
-0.03265380859375,
-0.04327392578125,
0.0229644775390625,
0.0169830322265625,
0.041412353515625,
-0.0005545616149902344,
0.0048828125,
0.0222625732421875,
0.035186767578125,
-0.03802490234375,
0.00345611572265625,
-0.005542755126953125,
-0.01538848876953125,
0.0042724609375,
-0.0096282958984375,
0.003803253173828125,
0.01678466796875,
0.01258087158203125,
-0.0262603759765625,
0.020843505859375,
-0.0015153884887695312,
-0.060638427734375,
0.0173187255859375,
-0.033477783203125,
0.0257568359375,
0.0277862548828125,
0.034820556640625,
0.0107421875,
0.0093841552734375,
-0.0161895751953125,
-0.02587890625,
-0.0222015380859375,
0.0260162353515625,
-0.0086212158203125,
-0.0185089111328125,
0.0101470947265625,
0.005207061767578125,
0.00029468536376953125,
0.0094146728515625,
-0.013946533203125,
0.014068603515625,
0.0677490234375,
-0.012481689453125,
-0.0235443115234375,
-0.039825439453125,
0.0185089111328125,
0.0111083984375,
-0.057464599609375,
0.055206298828125,
0.00849151611328125,
-0.005222320556640625,
-0.042449951171875,
-0.0067596435546875,
-0.00579833984375,
-0.01983642578125,
0.00028967857360839844,
0.04852294921875,
0.0218658447265625,
0.006038665771484375,
-0.0262603759765625,
-0.00434112548828125,
0.044403076171875,
0.0308990478515625,
0.039093017578125,
-0.03533935546875,
0.0050506591796875,
0.005237579345703125,
0.0187225341796875,
-0.0233001708984375,
0.038665771484375,
-0.10382080078125,
0.0176544189453125,
0.050445556640625,
-0.0003025531768798828,
0.0276031494140625,
-0.030548095703125,
0.0367431640625,
-0.0118865966796875,
0.0191497802734375,
0.0162200927734375,
-0.022125244140625,
-0.0219268798828125,
0.02105712890625,
-0.006999969482421875,
-0.006683349609375,
-0.046600341796875,
-0.005008697509765625,
0.028289794921875,
0.04034423828125,
0.01251220703125,
0.036773681640625,
-0.0572509765625,
-0.0002799034118652344,
-0.00966644287109375,
-0.0003039836883544922,
-0.00031065940856933594,
0.01165008544921875,
-0.01806640625,
-0.0151824951171875,
0.0091400146484375,
0.000043272972106933594,
-0.00974273681640625,
-0.0096435546875,
0.052581787109375,
0.0087738037109375,
-0.006893157958984375,
-0.00701904296875,
0.01580810546875,
0.042266845703125,
0.000003814697265625,
0.0196990966796875,
-0.035491943359375,
0.0178375244140625,
0.01611328125,
-0.067626953125,
0.0784912109375,
-0.0418701171875,
0.04931640625,
0.06591796875,
-0.0208740234375,
0.051605224609375,
-0.0007686614990234375,
-0.036376953125,
-0.006866455078125,
0.0294189453125,
0.0165252685546875,
-0.0294342041015625,
0.007537841796875,
0.027252197265625,
0.0297393798828125,
0.0261993408203125,
-0.007293701171875,
-0.034881591796875,
-0.019805908203125,
0.0250091552734375,
-0.0894775390625,
-0.064453125,
-0.01322174072265625,
-0.085693359375,
-0.05792236328125,
-0.011474609375,
-0.058349609375,
0.032501220703125,
0.01187896728515625,
0.0004181861877441406,
-0.0340576171875,
-0.018646240234375,
-0.0704345703125,
-0.06781005859375,
-0.08697509765625,
-0.004970550537109375,
-0.01363372802734375,
0.0399169921875,
0.00177764892578125,
0.03656005859375,
0.0032482147216796875,
-0.07855224609375,
-0.03753662109375,
0.046295166015625,
-0.0024280548095703125,
0.0250244140625,
-0.01092529296875,
0.01380157470703125,
-0.0263824462890625,
0.0008287429809570312,
0.0169525146484375,
0.023712158203125,
-0.020660400390625,
0.004199981689453125,
-0.0147247314453125,
-0.0221099853515625,
0.0217132568359375,
0.035888671875,
0.004764556884765625,
-0.007965087890625,
0.055694580078125,
-0.035552978515625,
-0.033843994140625,
-0.0270843505859375,
-0.0550537109375,
0.011322021484375,
0.0225830078125,
0.01099395751953125,
-0.0345458984375,
0.037322998046875,
0.011383056640625,
0.0114593505859375,
-0.03363037109375,
0.00543212890625,
0.0479736328125,
0.0234527587890625,
0.0419921875,
0.006992340087890625,
-0.0276947021484375,
-0.02032470703125,
0.002349853515625,
-0.03277587890625,
0.0214691162109375,
-0.03125,
0.029510498046875,
-0.044189453125,
-0.01413726806640625,
0.046661376953125,
0.018646240234375,
0.01505279541015625,
-0.01384735107421875,
-0.043121337890625,
-0.016510009765625,
0.05535888671875,
0.0183258056640625,
-0.01824951171875,
-0.004909515380859375,
0.005573272705078125,
-0.05908203125,
-0.016510009765625,
-0.037322998046875,
0.024169921875,
-0.042816162109375,
0.005931854248046875,
-0.01132965087890625,
-0.0266265869140625,
0.002811431884765625,
-0.013336181640625,
-0.0138397216796875,
-0.01403045654296875,
0.005157470703125,
0.00943756103515625,
-0.015472412109375,
0.038726806640625,
-0.03314208984375,
0.03839111328125,
-0.0197601318359375,
-0.027099609375,
-0.1395263671875,
-0.0291595458984375,
-0.0008158683776855469,
0.10693359375,
-0.0281524658203125,
0.0207672119140625,
-0.04974365234375,
0.0714111328125,
-0.023651123046875,
0.042724609375,
-0.005016326904296875,
0.0177764892578125,
0.013153076171875,
-0.0218505859375,
0.00013077259063720703,
-0.022613525390625,
-0.00539398193359375,
-0.026702880859375,
-0.0249786376953125,
-0.0122528076171875,
-0.045379638671875,
-0.03326416015625,
-0.021453857421875,
-0.017852783203125,
-0.006008148193359375,
-0.040679931640625,
0.0119476318359375,
0.033966064453125,
0.00907135009765625,
0.0093231201171875,
-0.059326171875,
-0.0260162353515625,
0.049591064453125,
0.0255126953125,
-0.013885498046875,
-0.011383056640625,
0.07293701171875,
0.017791748046875,
-0.0341796875,
-0.02020263671875,
-0.0025787353515625,
0.031494140625,
-0.010650634765625,
0.034271240234375,
0.0255126953125,
-0.0298919677734375,
0.0287322998046875,
0.00360107421875,
-0.0098876953125,
0.00194549560546875,
0.03912353515625,
-0.0302734375,
-0.0462646484375,
0.042633056640625,
-0.046142578125,
0.026519775390625,
0.01406097412109375,
-0.003444671630859375,
-0.0283203125,
0.0260467529296875,
0.0440673828125,
-0.0304718017578125,
0.03265380859375,
-0.01824951171875,
-0.036346435546875,
0.00531768798828125,
-0.001071929931640625,
0.0535888671875,
0.0072021484375,
0.01617431640625,
0.01458740234375,
0.036895751953125,
0.0250396728515625,
-0.0023517608642578125,
-0.0281982421875,
-0.006587982177734375,
0.04376220703125,
-0.0261688232421875,
0.01715087890625,
0.01366424560546875,
-0.0080718994140625,
0.072265625,
0.030914306640625,
-0.0229339599609375,
0.0021114349365234375,
0.0037403106689453125,
0.058197021484375,
-0.016387939453125,
-0.003215789794921875,
0.02935791015625,
0.006839752197265625,
-0.002620697021484375,
0.0006589889526367188,
-0.01493072509765625,
-0.01007843017578125,
-0.0258026123046875,
0.0255126953125,
-0.004184722900390625,
0.0224151611328125,
0.0228271484375,
0.0860595703125,
-0.027862548828125,
0.06500244140625,
-0.01959228515625,
0.029815673828125,
-0.0006546974182128906,
0.0443115234375,
0.0216064453125,
-0.006793975830078125,
0.004314422607421875,
0.017852783203125,
-0.0169525146484375,
-0.038848876953125,
0.01690673828125,
0.0006327629089355469,
0.043975830078125,
0.001941680908203125,
-0.0267486572265625,
0.032501220703125,
-0.0301055908203125,
0.0008320808410644531,
0.0258636474609375,
0.0023250579833984375,
-0.02001953125,
-0.035247802734375,
-0.019744873046875,
0.037384033203125,
0.0008254051208496094,
-0.032470703125,
0.0009908676147460938,
-0.0034503936767578125,
0.035064697265625,
-0.0159759521484375,
-0.009490966796875,
0.0290374755859375,
0.029083251953125,
-0.033416748046875,
-0.040191650390625,
-0.0122528076171875,
0.05133056640625,
0.010650634765625,
-0.0231781005859375,
-0.032257080078125,
0.0330810546875,
0.00859832763671875,
0.01003265380859375,
-0.042572021484375,
0.0157623291015625,
0.002819061279296875,
-0.01007843017578125,
0.07562255859375,
0.0102996826171875,
-0.06829833984375,
0.03863525390625,
-0.044036865234375,
0.0095672607421875,
0.031341552734375,
-0.034454345703125,
-0.056488037109375,
-0.06353759765625,
0.001110076904296875,
0.03515625,
-0.00925445556640625,
-0.0188751220703125,
-0.0121917724609375,
0.01288604736328125,
0.0033779144287109375,
0.06646728515625,
0.0006175041198730469,
0.048065185546875,
-0.0017938613891601562,
0.04229736328125,
0.0164337158203125,
0.0270538330078125,
-0.0297393798828125,
-0.0182037353515625,
-0.0115509033203125,
-0.0584716796875,
-0.0011243820190429688,
0.0195465087890625,
0.0093536376953125,
0.0098876953125,
-0.01560211181640625,
0.01222991943359375,
-0.00799560546875,
-0.0172119140625,
-0.01062774658203125,
-0.000965118408203125,
0.026458740234375,
0.039886474609375,
-0.0015573501586914062,
0.0268096923828125,
-0.011627197265625,
0.02862548828125,
-0.016326904296875,
-0.00972747802734375,
-0.006591796875,
0.0017719268798828125,
-0.03558349609375,
0.057373046875,
-0.0161285400390625,
0.03680419921875,
0.11090087890625,
0.01364898681640625,
0.056304931640625,
0.051605224609375,
0.01265716552734375,
0.0023975372314453125,
0.01123046875,
-0.0290985107421875,
-0.0268096923828125,
0.0108489990234375,
0.01361083984375,
0.01047515869140625,
0.00811004638671875,
-0.006824493408203125,
0.00965118408203125,
-0.005222320556640625,
0.0513916015625,
0.00678253173828125,
0.00693511962890625,
0.039031982421875,
-0.0119476318359375,
0.0164031982421875,
-0.00786590576171875,
-0.0031414031982421875,
-0.000438690185546875,
0.07952880859375,
-0.00917816162109375,
0.0065765380859375,
0.0567626953125,
0.004276275634765625,
0.011566162109375,
-0.0295867919921875,
0.065673828125,
0.010040283203125,
-0.0806884765625,
0.01406097412109375,
0.0556640625,
-0.01158905029296875,
-0.03363037109375,
0.01137542724609375,
0.008575439453125,
0.00873565673828125,
-0.02294921875,
0.055694580078125,
-0.0261688232421875,
0.039276123046875,
0.022369384765625,
0.038116455078125,
0.00027251243591308594,
0.0482177734375,
0.00366973876953125,
0.00015604496002197266,
0.0273284912109375,
-0.0537109375,
0.044769287109375,
-0.0257415771484375,
-0.0017042160034179688,
0.045440673828125,
-0.06549072265625,
0.0158843994140625,
0.0007982254028320312,
0.01104736328125,
-0.01751708984375,
-0.009368896484375,
0.080810546875,
-0.0246429443359375,
-0.03564453125,
0.00850677490234375,
0.036712646484375,
-0.01385498046875,
0.0290069580078125,
0.035919189453125,
-0.04522705078125,
-0.0158538818359375,
0.032806396484375,
-0.01995849609375,
-0.01342010498046875,
-0.0024890899658203125,
-0.07586669921875,
0.0335693359375,
-0.0005445480346679688,
0.03216552734375,
0.00299835205078125,
-0.01081085205078125,
0.0028591156005859375,
-0.03778076171875,
-0.0350341796875,
0.021209716796875,
-0.0228729248046875,
0.055450439453125,
-0.07061767578125,
-0.01092529296875,
0.002574920654296875,
0.0338134765625,
0.08428955078125,
0.0133514404296875,
-0.055755615234375,
-0.01390838623046875,
0.0170440673828125,
0.019683837890625,
-0.0300750732421875,
0.05889892578125,
0.015777587890625,
0.02099609375,
0.01346588134765625,
-0.0086517333984375,
0.04150390625,
-0.03271484375,
-0.03802490234375,
0.035675048828125,
0.004848480224609375,
0.0199737548828125,
-0.006137847900390625,
-0.0051116943359375,
-0.033782958984375,
-0.019378662109375,
0.038299560546875,
-0.060302734375,
0.0262908935546875,
0.043853759765625,
0.037017822265625,
-0.0131072998046875,
-0.056060791015625,
0.00583648681640625,
0.04498291015625,
0.018646240234375,
0.01195526123046875,
-0.0028228759765625,
0.01290130615234375,
-0.0005779266357421875,
0.0189971923828125,
0.01512908935546875,
0.048675537109375,
-0.0118560791015625,
0.0298614501953125,
0.003993988037109375,
0.005908966064453125,
-0.073974609375,
-0.0131683349609375,
0.0374755859375,
0.058563232421875,
-0.042266845703125,
-0.0137481689453125,
0.017486572265625,
-0.006656646728515625,
-0.01499176025390625,
-0.0004787445068359375,
-0.00963592529296875,
-0.004428863525390625,
0.00688934326171875,
-0.04046630859375,
0.0054168701171875,
0.0220184326171875,
0.03082275390625,
-0.00927734375,
0.01068878173828125,
-0.03619384765625,
-0.0186767578125,
-0.016265869140625,
-0.0103912353515625,
-0.0080108642578125,
0.019622802734375,
0.030303955078125,
0.0180816650390625,
0.034576416015625,
0.004108428955078125,
-0.0270843505859375,
0.0302581787109375,
-0.0004875659942626953,
0.041290283203125,
-0.05572509765625,
-0.004058837890625,
-0.0164642333984375,
0.04449462890625,
0.034210205078125,
-0.0239715576171875,
0.01532745361328125,
0.00890350341796875,
-0.06097412109375,
-0.003940582275390625,
0.058319091796875,
-0.00917816162109375,
-0.00614166259765625,
-0.0238037109375,
0.03594970703125,
0.04388427734375,
0.0114898681640625,
-0.0102386474609375,
0.01708984375,
0.05975341796875,
-0.0382080078125,
0.0260162353515625,
-0.013641357421875,
-0.026702880859375,
-0.00708770751953125,
0.002727508544921875,
0.028076171875,
-0.0235443115234375,
-0.08514404296875,
0.0082244873046875,
-0.04058837890625,
-0.07379150390625,
0.032806396484375,
0.036163330078125,
-0.039764404296875,
0.0299835205078125,
-0.02239990234375,
0.00318145751953125,
-0.0241241455078125,
-0.01293182373046875,
0.0200347900390625,
0.00615692138671875,
0.0002467632293701172,
0.0006585121154785156,
-0.049652099609375,
-0.03460693359375,
-0.0177001953125,
0.033935546875,
0.00464630126953125,
0.0011072158813476562,
0.0188446044921875,
0.0198974609375,
-0.01708984375,
0.018829345703125,
-0.0745849609375,
-0.03973388671875,
0.050750732421875,
-0.050933837890625,
-0.0254974365234375,
0.0115966796875,
-0.0279388427734375,
0.038116455078125,
0.02093505859375,
0.00290679931640625,
0.0232696533203125,
-0.002231597900390625,
0.01148223876953125,
0.0006885528564453125,
-0.0195159912109375,
-0.023162841796875,
-0.0084075927734375,
-0.028656005859375,
-0.01383209228515625,
0.036224365234375,
-0.007080078125,
-0.028533935546875,
-0.00858306884765625,
0.04718017578125,
-0.03839111328125,
0.0261993408203125,
-0.00023484230041503906,
0.04241943359375,
0.04156494140625,
0.0198974609375,
-0.04632568359375,
-0.0214385986328125,
-0.005451202392578125,
0.00598907470703125,
-0.004840850830078125,
0.03204345703125,
0.0048065185546875,
-0.021270751953125,
0.0129852294921875,
-0.00562286376953125,
0.032806396484375,
-0.0280914306640625,
-0.0012445449829101562,
0.024932861328125,
0.007190704345703125,
-0.0178070068359375,
0.0180206298828125,
-0.0176849365234375,
-0.019073486328125,
0.007106781005859375,
0.017822265625,
0.0154266357421875,
-0.01824951171875,
-0.061065673828125,
-0.01451873779296875,
0.030792236328125,
0.00975799560546875,
-0.038177490234375,
0.005710601806640625,
-0.0125885009765625,
0.01375579833984375,
-0.01255035400390625,
-0.0187835693359375,
0.023895263671875,
0.072509765625,
-0.0185089111328125,
0.0124664306640625,
-0.022216796875,
-0.041168212890625,
-0.013427734375,
0.01311492919921875,
0.036651611328125,
-0.0265045166015625,
-0.007293701171875,
0.044403076171875,
0.03857421875,
0.0751953125,
-0.0023059844970703125,
-0.021820068359375,
-0.036865234375,
0.042694091796875,
-0.03662109375,
-0.0472412109375,
0.048187255859375,
-0.05133056640625,
-0.01486968994140625,
-0.0202484130859375,
0.038818359375,
0.0418701171875,
-0.001018524169921875,
-0.033966064453125,
0.044647216796875,
-0.002716064453125,
-0.0220947265625,
-0.013397216796875,
0.01861572265625,
-0.01238250732421875,
0.01189422607421875,
0.01203155517578125,
-0.043792724609375,
0.0009584426879882812,
-0.00827789306640625,
0.01172637939453125,
-0.0263214111328125,
0.04278564453125,
-0.0287322998046875,
-0.048370361328125,
-0.01020050048828125,
-0.002712249755859375,
-0.0096435546875,
0.01105499267578125,
-0.017791748046875,
0.00560760498046875,
0.02703857421875,
-0.038330078125,
-0.04168701171875,
-0.01352691650390625,
-0.002162933349609375,
-0.050262451171875,
-0.0176544189453125,
0.0264892578125,
0.0174560546875,
0.04302978515625,
0.0268402099609375,
-0.0024700164794921875,
-0.037841796875,
0.009063720703125,
-0.01332855224609375,
-0.0200653076171875,
-0.0257720947265625,
0.0119476318359375,
-0.061553955078125,
-0.034698486328125,
0.0039215087890625,
-0.042144775390625,
0.0005054473876953125,
-0.0114593505859375,
-0.05706787109375,
0.0014829635620117188,
-0.055206298828125,
0.0059661865234375,
-0.048858642578125,
0.0206451416015625,
0.010040283203125,
-0.0186004638671875,
0.0186767578125,
-0.0219879150390625,
-0.006000518798828125,
0.01611328125,
0.004222869873046875,
-0.0027599334716796875,
0.020172119140625,
0.0022106170654296875,
0.00988006591796875,
0.005859375,
-0.01360321044921875,
-0.00650787353515625,
0.0178070068359375,
-0.0224761962890625,
0.033172607421875,
0.001163482666015625,
0.013214111328125,
0.007785797119140625,
0.044647216796875,
0.01131439208984375,
0.0307769775390625,
-0.038330078125,
0.0181884765625,
-0.019317626953125,
0.01483917236328125,
-0.031158447265625,
0.015289306640625,
-0.01041412353515625,
0.0002048015594482422,
0.02166748046875,
-0.003498077392578125,
0.032989501953125,
0.0006341934204101562,
0.00861358642578125,
-0.0019359588623046875,
-0.00858306884765625,
0.027313232421875
] |
3d46334229af6dfa768fa266181d355d27be66cf
|
Wordpress Stackexchange
Q: WordPress adding tags into plugin content We've written a plugin that shows reviews upon usage of a shortcode. On some sites, Wordpress is adding <br> tags throughout the shortcode content, and others it does not.
The shortcode works here (Nearby Now).
The shortcode has tags inserted here (Dent Biz).
There's a couple of articles here and here that recommend adding tho following code to the functions.php file.
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);
I've tried this on the 2nd site above (Dent Biz), but it doesn't fix the problem. Also, I've tried disabling all other plugins on the site with no success. I would hope there was an easy way to prevent WordPress from molesting the html returned by the plugin.
Any help would be appreciated!
A: It turns out that the Infocus theme was the culprit. Deactivating it immediately solved the problem.
Their support forum recommended using the [raw][/raw] shortcode surrounding our shortcode, which allowed us to use our plugin with the Infocus theme.
[raw][recentreviews radius="15" count="3" zoomlevel="10"][/raw]
|
Q: WordPress adding tags into plugin content We've written a plugin that shows reviews upon usage of a shortcode. On some sites, Wordpress is adding <br> tags throughout the shortcode content, and others it does not.
The shortcode works here (Nearby Now).
The shortcode has tags inserted here (Dent Biz).
There's a couple of articles here and here that recommend adding tho following code to the functions.php file.
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);
I've tried this on the 2nd site above (Dent Biz), but it doesn't fix the problem. Also, I've tried disabling all other plugins on the site with no success. I would hope there was an easy way to prevent WordPress from molesting the html returned by the plugin.
Any help would be appreciated!
A: It turns out that the Infocus theme was the culprit. Deactivating it immediately solved the problem.
Their support forum recommended using the [raw][/raw] shortcode surrounding our shortcode, which allowed us to use our plugin with the Infocus theme.
[raw][recentreviews radius="15" count="3" zoomlevel="10"][/raw]
|
wordpress
|
{
"language": "en",
"length": 173,
"provenance": "stackexchange_00019.jsonl.gz:419151",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49305"
}
|
[
0.019775390625,
-0.001239776611328125,
-0.0163726806640625,
0.0222320556640625,
0.01273345947265625,
-0.03289794921875,
0.054168701171875,
-0.032928466796875,
-0.05072021484375,
0.03106689453125,
-0.04278564453125,
0.0231781005859375,
-0.011566162109375,
-0.0019359588623046875,
0.0205078125,
-0.04266357421875,
0.009429931640625,
0.0182342529296875,
0.00885772705078125,
-0.00754547119140625,
-0.030487060546875,
0.0008530616760253906,
0.01503753662109375,
-0.03607177734375,
0.0163421630859375,
0.009796142578125,
0.1002197265625,
-0.00901031494140625,
0.035247802734375,
0.0071563720703125,
0.0240631103515625,
-0.061553955078125,
0.06903076171875,
0.0283660888671875,
-0.128662109375,
0.036773681640625,
-0.02490234375,
0.01175689697265625,
-0.045928955078125,
0.038604736328125,
0.0203399658203125,
-0.01120758056640625,
0.0726318359375,
0.00408935546875,
0.0269775390625,
-0.020538330078125,
0.039337158203125,
-0.07684326171875,
-0.03570556640625,
-0.02044677734375,
0.040863037109375,
0.0081634521484375,
0.06610107421875,
-0.056793212890625,
-0.00605010986328125,
-0.0168304443359375,
-0.0275421142578125,
-0.00780487060546875,
0.02532958984375,
0.032684326171875,
-0.0005712509155273438,
-0.0180206298828125,
0.006923675537109375,
-0.039794921875,
0.007167816162109375,
-0.0199432373046875,
0.0073089599609375,
0.0306854248046875,
-0.01654052734375,
0.0068206787109375,
0.025360107421875,
-0.00909423828125,
-0.00394439697265625,
-0.023712158203125,
0.00495147705078125,
-0.0007257461547851562,
0.016204833984375,
-0.006267547607421875,
-0.0057373046875,
0.00211334228515625,
0.03948974609375,
0.005413055419921875,
0.0160980224609375,
0.00928497314453125,
-0.004451751708984375,
0.01476287841796875,
-0.0011272430419921875,
-0.01300811767578125,
-0.0177764892578125,
-0.0011463165283203125,
-0.0238800048828125,
-0.007328033447265625,
-0.03704833984375,
0.040557861328125,
-0.0037670135498046875,
0.0073699951171875,
0.0090789794921875,
0.0206146240234375,
0.00939178466796875,
0.04693603515625,
-0.01009368896484375,
-0.041046142578125,
0.05938720703125,
-0.040313720703125,
0.006542205810546875,
-0.0084381103515625,
-0.0241546630859375,
0.00640106201171875,
0.0679931640625,
0.054840087890625,
-0.00034308433532714844,
0.06011962890625,
-0.0265655517578125,
-0.020538330078125,
-0.0140228271484375,
0.0132904052734375,
-0.05767822265625,
0.0249481201171875,
-0.00030517578125,
0.023193359375,
0.0026226043701171875,
0.00835418701171875,
-0.01776123046875,
0.0207672119140625,
-0.0025482177734375,
0.0113372802734375,
-0.002391815185546875,
-0.0113525390625,
-0.0706787109375,
-0.004425048828125,
0.01163482666015625,
0.046783447265625,
-0.0012121200561523438,
0.0293731689453125,
-0.0272979736328125,
0.0011262893676757812,
0.020416259765625,
-0.026336669921875,
-0.01560211181640625,
0.00885009765625,
-0.0147552490234375,
0.01751708984375,
0.022430419921875,
-0.057647705078125,
0.0309906005859375,
0.0099334716796875,
0.01267242431640625,
0.0400390625,
0.00531005859375,
-0.06964111328125,
0.09979248046875,
-0.04107666015625,
0.08197021484375,
-0.0036468505859375,
-0.02691650390625,
-0.045745849609375,
0.0772705078125,
-0.061492919921875,
-0.047332763671875,
-0.08734130859375,
0.017364501953125,
-0.0323486328125,
-0.00228118896484375,
-0.0277862548828125,
-0.060211181640625,
0.032745361328125,
-0.0352783203125,
-0.0067138671875,
0.021453857421875,
0.0288238525390625,
0.005615234375,
-0.032867431640625,
-0.035369873046875,
0.01654052734375,
0.0053253173828125,
0.028839111328125,
0.00827789306640625,
0.051025390625,
0.04449462890625,
0.00274658203125,
-0.003444671630859375,
-0.0298004150390625,
0.131591796875,
-0.030242919921875,
-0.09735107421875,
0.0261077880859375,
0.0279541015625,
0.1292724609375,
0.0256500244140625,
0.0278472900390625,
0.048828125,
-0.02655029296875,
0.01342010498046875,
0.0040283203125,
0.03045654296875,
-0.0474853515625,
-0.040618896484375,
-0.0166473388671875,
-0.0090179443359375,
-0.004856109619140625,
0.005970001220703125,
-0.01313018798828125,
0.007659912109375,
-0.0019083023071289062,
-0.025665283203125,
0.0027027130126953125,
-0.0214385986328125,
0.0289154052734375,
0.0200653076171875,
-0.006988525390625,
-0.01215362548828125,
-0.045013427734375,
-0.0031452178955078125,
0.02142333984375,
-0.021575927734375,
0.017608642578125,
-0.01490020751953125,
0.01959228515625,
0.0201416015625,
0.005615234375,
0.056121826171875,
-0.0033740997314453125,
0.04736328125,
0.010467529296875,
0.00949859619140625,
-0.01427459716796875,
-0.025115966796875,
-0.02276611328125,
-0.04241943359375,
0.0218505859375,
-0.06683349609375,
0.0270538330078125,
0.0008487701416015625,
0.016387939453125,
-0.03924560546875,
-0.0033130645751953125,
-0.0008149147033691406,
-0.038970947265625,
0.0028247833251953125,
0.03363037109375,
0.04644775390625,
0.05010986328125,
0.01432037353515625,
-0.01531219482421875,
0.06304931640625,
-0.045135498046875,
0.028228759765625,
-0.0322265625,
0.01129150390625,
0.0577392578125,
-0.00408172607421875,
0.0215606689453125,
0.005199432373046875,
0.003185272216796875,
-0.007114410400390625,
0.02374267578125,
-0.044647216796875,
-0.035125732421875,
0.0240020751953125,
-0.0269317626953125,
0.0304718017578125,
-0.059295654296875,
-0.041717529296875,
-0.0281829833984375,
0.0396728515625,
0.01245880126953125,
0.0577392578125,
0.048828125,
-0.01141357421875,
-0.006500244140625,
0.0026264190673828125,
0.0034160614013671875,
-0.00591278076171875,
0.03143310546875,
0.03564453125,
0.031707763671875,
-0.05419921875,
-0.0023860931396484375,
0.0174407958984375,
0.035675048828125,
-0.00948333740234375,
0.039520263671875,
-0.01258087158203125,
-0.01837158203125,
-0.0219879150390625,
-0.0264892578125,
-0.02020263671875,
-0.0233154296875,
-0.0251617431640625,
-0.00402069091796875,
-0.002132415771484375,
0.053466796875,
-0.01275634765625,
0.0252838134765625,
0.012359619140625,
0.003208160400390625,
0.013458251953125,
-0.06787109375,
0.07037353515625,
-0.059539794921875,
0.042816162109375,
0.08428955078125,
-0.0183868408203125,
0.00963592529296875,
0.0003666877746582031,
0.005702972412109375,
-0.034576416015625,
0.01148223876953125,
-0.005779266357421875,
0.018310546875,
-0.062042236328125,
0.0582275390625,
0.04022216796875,
0.01485443115234375,
0.01904296875,
-0.0176544189453125,
-0.017822265625,
0.032257080078125,
-0.05560302734375,
-0.043426513671875,
0.023162841796875,
-0.04547119140625,
-0.00870513916015625,
0.0291290283203125,
-0.038116455078125,
-0.0118865966796875,
0.0709228515625,
-0.0003845691680908203,
-0.038330078125,
-0.0233001708984375,
-0.052825927734375,
-0.06427001953125,
-0.051177978515625,
0.036224365234375,
-0.010101318359375,
0.00855255126953125,
0.0118408203125,
0.01262664794921875,
0.00925445556640625,
-0.044921875,
0.0204315185546875,
0.024444580078125,
-0.01198577880859375,
0.01044464111328125,
0.0086669921875,
-0.0277557373046875,
-0.007228851318359375,
-0.0020275115966796875,
-0.033721923828125,
0.01256561279296875,
0.00363922119140625,
-0.01506805419921875,
-0.006103515625,
0.016510009765625,
0.0155029296875,
0.010894775390625,
0.01727294921875,
0.024078369140625,
0.01197052001953125,
-0.0252227783203125,
0.00897979736328125,
0.00855255126953125,
-0.015899658203125,
-0.0140228271484375,
-0.00806427001953125,
-0.0247955322265625,
-0.01259613037109375,
0.0019779205322265625,
0.030731201171875,
0.017822265625,
0.0977783203125,
-0.004482269287109375,
-0.030914306640625,
-0.03167724609375,
-0.0201873779296875,
-0.0821533203125,
-0.0266876220703125,
-0.037689208984375,
0.0160369873046875,
-0.04107666015625,
0.011688232421875,
-0.0254974365234375,
0.0143890380859375,
-0.053009033203125,
0.0305328369140625,
0.01470184326171875,
-0.0227203369140625,
0.04754638671875,
-0.036773681640625,
-0.01097869873046875,
-0.04608154296875,
0.0428466796875,
-0.0362548828125,
-0.003742218017578125,
0.0070343017578125,
0.003772735595703125,
0.0008993148803710938,
0.0182952880859375,
-0.058258056640625,
-0.0237274169921875,
-0.040496826171875,
-0.006683349609375,
-0.0201873779296875,
-0.00803375244140625,
-0.0166778564453125,
0.00743865966796875,
-0.00681304931640625,
-0.038909912109375,
0.03265380859375,
-0.020599365234375,
0.025543212890625,
-0.016571044921875,
0.0033245086669921875,
-0.0369873046875,
-0.0208740234375,
-0.0094451904296875,
-0.05096435546875,
0.00386810302734375,
-0.0294036865234375,
0.026214599609375,
0.021759033203125,
-0.03082275390625,
-0.0197296142578125,
0.0233612060546875,
0.0110626220703125,
-0.0038738250732421875,
0.0218963623046875,
0.014678955078125,
-0.007190704345703125,
-0.006336212158203125,
0.0103607177734375,
-0.01245880126953125,
0.004688262939453125,
0.01088714599609375,
0.0033245086669921875,
0.039581298828125,
-0.0301055908203125,
-0.01364898681640625,
0.01438140869140625,
-0.03411865234375,
-0.03875732421875,
-0.040496826171875,
0.0104217529296875,
0.0032405853271484375,
-0.0121612548828125,
0.005035400390625,
-0.031646728515625,
-0.0070343017578125,
-0.0278472900390625,
-0.028228759765625,
-0.0243072509765625,
0.034332275390625,
0.0406494140625,
0.03448486328125,
0.01508331298828125,
-0.0256805419921875,
0.048126220703125,
0.06549072265625,
0.0014171600341796875,
0.045867919921875,
0.049530029296875,
-0.04571533203125,
0.054962158203125,
0.038665771484375,
0.040802001953125,
-0.053375244140625,
0.08868408203125,
-0.007564544677734375,
0.00835418701171875,
0.019744873046875,
0.0159912109375,
-0.01053619384765625,
0.00394439697265625,
-0.0160369873046875,
-0.01200103759765625,
-0.003589630126953125,
0.0160675048828125,
0.0033206939697265625,
0.022857666015625,
-0.0120849609375,
-0.046173095703125,
0.0123443603515625,
0.06134033203125,
-0.01189422607421875,
0.038055419921875,
-0.01544952392578125,
0.00904083251953125,
-0.0192108154296875,
-0.007488250732421875,
0.01187896728515625,
-0.0028018951416015625,
-0.035125732421875,
0.045867919921875,
-0.045379638671875,
-0.03778076171875,
0.021026611328125,
-0.0131072998046875,
0.0309600830078125,
0.006412506103515625,
-0.03466796875,
-0.010894775390625,
-0.00023996829986572266,
0.00421905517578125,
0.002902984619140625,
0.024322509765625,
0.01110076904296875,
0.012847900390625,
-0.004962921142578125,
0.0147705078125,
0.030242919921875,
0.0101776123046875,
-0.0204315185546875,
-0.03076171875,
-0.0224456787109375,
-0.022247314453125,
0.0411376953125,
-0.032012939453125,
-0.052398681640625,
0.0121917724609375,
0.01434326171875,
-0.004924774169921875,
0.04779052734375,
-0.0024814605712890625,
0.0297393798828125,
-0.0014600753784179688,
-0.02313232421875,
-0.0107421875,
0.0189056396484375,
-0.047119140625,
-0.00348663330078125,
0.005435943603515625,
0.0172271728515625,
-0.0108642578125,
-0.0302276611328125,
0.0440673828125,
0.0022563934326171875,
-0.0086822509765625,
-0.00384521484375,
-0.00801849365234375,
0.0168914794921875,
-0.03515625,
0.006450653076171875,
0.061431884765625,
0.037261962890625,
-0.005847930908203125,
-0.01483917236328125,
-0.003627777099609375,
-0.0072479248046875,
0.051300048828125,
-0.045867919921875,
0.005161285400390625,
0.00435638427734375,
-0.0225677490234375,
-0.03704833984375,
-0.01186370849609375,
-0.03179931640625,
0.018951416015625,
-0.03271484375,
-0.0008907318115234375,
0.0244598388671875,
-0.029205322265625,
0.036865234375,
-0.01132965087890625,
-0.0005950927734375,
-0.036163330078125,
0.006877899169921875,
0.04290771484375,
0.0350341796875,
-0.060546875,
-0.0214996337890625,
-0.038421630859375,
-0.01018524169921875,
0.035003662109375,
-0.00977325439453125,
-0.0216064453125,
-0.03546142578125,
-0.001918792724609375,
0.0233001708984375,
-0.056121826171875,
-0.045623779296875,
0.001361846923828125,
0.031097412109375,
0.0238189697265625,
0.06817626953125,
-0.040252685546875,
0.017242431640625,
0.040618896484375,
0.0110931396484375,
-0.0094451904296875,
0.0037174224853515625,
0.0222625732421875,
-0.0218353271484375,
0.024627685546875,
-0.0253143310546875,
-0.046905517578125,
-0.007213592529296875,
-0.03326416015625,
0.026153564453125,
0.032196044921875,
-0.007305145263671875,
0.0479736328125,
0.016815185546875,
0.0225982666015625,
-0.0032176971435546875,
-0.01163482666015625,
-0.0121612548828125,
0.0340576171875,
0.036865234375,
-0.0062103271484375,
0.0200042724609375,
-0.0176544189453125,
0.017486572265625,
-0.02496337890625,
-0.013671875,
-0.00897216796875,
0.01299285888671875,
0.041534423828125,
0.019683837890625,
0.04718017578125,
-0.0264129638671875,
0.0206146240234375,
0.05242919921875,
-0.002414703369140625,
-0.0026073455810546875,
0.021087646484375,
0.041748046875,
0.018035888671875,
0.0513916015625,
-0.012237548828125,
-0.0107574462890625,
0.0027313232421875,
-0.02789306640625,
0.0223846435546875,
0.028106689453125,
0.016265869140625,
-0.0655517578125,
0.0287933349609375,
-0.012542724609375,
-0.0027618408203125,
0.0458984375,
-0.0125732421875,
-0.030059814453125,
-0.0389404296875,
0.081298828125,
-0.0275115966796875,
-0.008087158203125,
0.031829833984375,
0.0014753341674804688,
-0.01161956787109375,
-0.027801513671875,
0.038787841796875,
0.013275146484375,
-0.040069580078125,
0.0169525146484375,
0.0207977294921875,
-0.0020999908447265625,
-0.0219268798828125,
-0.007740020751953125,
0.040557861328125,
-0.0501708984375,
-0.0616455078125,
0.025238037109375,
0.01300811767578125,
-0.0263824462890625,
-0.00318145751953125,
-0.01641845703125,
0.021026611328125,
0.04803466796875,
-0.032012939453125,
0.0173797607421875,
0.0146942138671875,
-0.0076751708984375,
-0.00457763671875,
-0.022064208984375,
0.003467559814453125,
0.0304718017578125,
-0.026947021484375,
0.00829315185546875,
-0.00429534912109375,
0.00592041015625,
0.0033740997314453125,
-0.026947021484375,
0.0013904571533203125,
0.004467010498046875,
-0.01514434814453125,
0.012176513671875,
0.008148193359375,
0.00972747802734375,
-0.041656494140625,
0.0227813720703125,
-0.0225677490234375,
-0.0011959075927734375,
-0.03375244140625,
-0.02349853515625,
-0.0066375732421875,
-0.08038330078125,
-0.1158447265625,
0.0799560546875,
0.0193023681640625,
0.0615234375,
0.0004329681396484375,
0.01128387451171875,
-0.05328369140625,
-0.05010986328125,
-0.03338623046875,
0.061676025390625,
0.031097412109375,
0.03057861328125,
-0.04083251953125,
-0.01093292236328125,
0.01552581787109375,
0.0484619140625,
0.013702392578125,
-0.0037689208984375,
0.024169921875,
0.0259552001953125,
0.07098388671875,
-0.01531982421875,
-0.036651611328125,
0.0168914794921875,
0.00676727294921875,
-0.037567138671875,
-0.0004818439483642578,
0.03350830078125,
0.039154052734375,
-0.0411376953125,
-0.0235137939453125,
0.0231475830078125,
0.01061248779296875,
0.00800323486328125,
-0.022674560546875,
0.01349639892578125,
0.0001589059829711914,
-0.0165252685546875,
-0.0080413818359375,
0.015350341796875,
-0.0111541748046875,
0.051971435546875,
0.03155517578125,
-0.053741455078125,
-0.04779052734375,
-0.0280303955078125,
0.044158935546875,
0.002414703369140625,
0.058074951171875,
0.01464080810546875,
0.0175323486328125,
0.0975341796875,
-0.0215606689453125,
0.0243072509765625,
0.02777099609375,
-0.020538330078125,
-0.0215301513671875,
0.0085296630859375,
0.01517486572265625,
-0.043365478515625,
-0.043792724609375,
0.0867919921875,
0.0186920166015625,
0.006107330322265625,
-0.0119781494140625,
0.0135498046875,
0.0140380859375,
-0.02618408203125,
-0.0297393798828125,
-0.03759765625,
-0.034515380859375,
0.00897979736328125,
0.005863189697265625,
-0.02691650390625,
0.00251007080078125,
0.038116455078125,
0.0220947265625,
0.0299835205078125,
-0.01837158203125,
-0.058258056640625,
-0.027587890625,
0.0140838623046875,
-0.004619598388671875,
0.040283203125,
-0.0101470947265625,
0.0765380859375,
-0.0156402587890625,
-0.0181427001953125,
-0.0203857421875,
0.0239410400390625,
0.01100921630859375,
0.00946044921875,
-0.0276336669921875,
0.0012235641479492188,
0.019561767578125,
0.024078369140625,
-0.000396728515625,
-0.01180267333984375,
0.00600433349609375,
0.0277099609375,
-0.01239776611328125,
-0.0152435302734375,
0.04449462890625,
-0.006256103515625,
-0.05035400390625,
-0.03961181640625,
-0.035614013671875,
0.04345703125,
0.0083160400390625,
0.04632568359375,
-0.00002562999725341797,
0.035430908203125,
-0.01322174072265625,
0.01522064208984375,
-0.003002166748046875,
-0.0213775634765625,
-0.0030841827392578125,
-0.0064239501953125,
-0.00914764404296875,
0.01468658447265625,
-0.049530029296875,
0.007053375244140625,
-0.06610107421875,
-0.05670166015625,
0.0361328125,
0.038299560546875,
-0.0310516357421875,
0.029388427734375,
0.0007791519165039062,
-0.041351318359375,
0.0242767333984375,
-0.005283355712890625,
0.017425537109375,
0.021148681640625,
-0.01032257080078125,
-0.014129638671875,
-0.00811004638671875,
-0.00885772705078125,
0.0075836181640625,
0.0537109375,
0.0196380615234375,
0.04803466796875,
-0.0124359130859375,
0.0186614990234375,
-0.0086517333984375,
-0.026641845703125,
0.01085662841796875,
-0.0120391845703125,
-0.0018768310546875,
0.013946533203125,
-0.0072021484375,
-0.00614166259765625,
-0.01824951171875,
0.00438690185546875,
0.037017822265625,
-0.03802490234375,
0.012298583984375,
-0.0180206298828125,
0.006862640380859375,
-0.02850341796875,
0.07025146484375,
-0.003620147705078125,
0.00250244140625,
-0.049346923828125,
-0.018951416015625,
0.043548583984375,
0.039764404296875,
-0.01007843017578125,
0.04180908203125,
0.037811279296875,
0.040557861328125,
0.006549835205078125,
0.00745391845703125,
-0.005985260009765625,
0.030029296875,
-0.005954742431640625,
-0.01702880859375,
-0.00975799560546875,
-0.03131103515625,
0.006336212158203125,
-0.0013360977172851562,
0.04022216796875,
-0.0184783935546875,
-0.017974853515625,
0.01611328125,
0.05474853515625,
0.06146240234375,
0.01055145263671875,
0.04229736328125,
0.01113128662109375,
-0.0034542083740234375,
-0.007595062255859375,
0.0224761962890625,
-0.0321044921875,
-0.02703857421875,
0.00817108154296875,
0.00894927978515625,
-0.00383758544921875,
-0.03289794921875,
-0.078125,
0.01739501953125,
0.01136016845703125,
-0.0086517333984375,
-0.04156494140625,
-0.00403594970703125,
-0.000038564205169677734,
0.0762939453125,
-0.035980224609375,
-0.00753021240234375,
-0.01244354248046875,
0.0003802776336669922,
-0.031951904296875,
-0.053955078125,
-0.05517578125,
0.052398681640625,
-0.05413818359375,
0.004638671875,
0.0204315185546875,
-0.01435089111328125,
0.0022830963134765625,
0.01306915283203125,
0.0168304443359375,
0.0693359375,
-0.006267547607421875,
-0.0178375244140625,
0.025970458984375,
-0.0282135009765625,
-0.0035800933837890625,
-0.0203094482421875,
0.0071868896484375,
-0.050048828125,
-0.0200653076171875,
-0.01514434814453125,
-0.0116119384765625,
-0.007686614990234375,
-0.0538330078125,
-0.064453125,
0.0268402099609375,
0.005619049072265625,
-0.0247802734375,
-0.0026569366455078125,
-0.015655517578125,
-0.01181793212890625,
-0.0255279541015625,
-0.0138397216796875,
-0.00861358642578125,
-0.0209197998046875,
0.02911376953125,
0.01222991943359375,
0.0270538330078125,
0.006374359130859375,
0.0063018798828125,
-0.0222930908203125,
0.01352691650390625,
-0.0007691383361816406,
-0.013427734375,
0.02252197265625,
-0.01342010498046875,
0.0204925537109375,
0.008209228515625,
-0.07025146484375,
-0.03131103515625,
-0.0171356201171875,
0.031646728515625,
0.0214385986328125,
-0.061431884765625,
-0.0276031494140625,
-0.0292816162109375,
0.032379150390625,
0.016357421875,
0.006687164306640625,
-0.0177001953125,
0.004627227783203125,
-0.0095062255859375,
0.0016765594482421875,
-0.004669189453125,
-0.00023555755615234375,
-0.031219482421875,
-0.0196380615234375,
-0.0079345703125,
0.0027484893798828125,
-0.0116119384765625,
-0.0256195068359375,
-0.032684326171875,
-0.0229644775390625,
-0.0207366943359375,
0.00853729248046875,
-0.01348114013671875,
-0.027130126953125,
0.05816650390625,
-0.033721923828125,
-0.009124755859375,
0.01788330078125,
0.01458740234375,
0.0304412841796875,
0.0120697021484375,
-0.01239776611328125,
-0.00991058349609375,
0.007965087890625,
0.038177490234375,
0.0164337158203125,
0.050537109375,
-0.0246124267578125,
0.0019121170043945312,
0.01666259765625,
-0.006938934326171875,
-0.01220703125,
-0.0271148681640625,
-0.0036907196044921875,
0.0218505859375,
-0.033050537109375,
0.036956787109375,
-0.016845703125,
-0.0159454345703125,
-0.0263671875,
0.01551055908203125,
-0.00936126708984375,
0.0012998580932617188,
0.00885009765625,
-0.0194854736328125,
0.0209503173828125,
0.0262451171875,
0.052764892578125,
-0.030059814453125,
0.05157470703125,
0.00518798828125,
0.033935546875,
0.0244140625
] |
9d26030a52399de64764dbdc9f9767b368de147e
|
Wordpress Stackexchange
Q: How to query for most viewed posts and show top 5 Here is how I am getting the views for one post:
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "0 View";
}
return $count.' Views';
}
Let's say I want to find the most viewed posts from 5,000 posts and I want to show the top 5 most viewed posts.
How can I make a query to achieve this?
A: View this section of the Codex to learn how to create a custom query:
http://codex.wordpress.org/Class_Reference/WP_Query
Your query will be something like:
$query = new WP_Query( array(
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'posts_per_page' => 5
) );
By default, the ordering will be highest to lowest, thus giving you the "top" 5.
|
Q: How to query for most viewed posts and show top 5 Here is how I am getting the views for one post:
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "0 View";
}
return $count.' Views';
}
Let's say I want to find the most viewed posts from 5,000 posts and I want to show the top 5 most viewed posts.
How can I make a query to achieve this?
A: View this section of the Codex to learn how to create a custom query:
http://codex.wordpress.org/Class_Reference/WP_Query
Your query will be something like:
$query = new WP_Query( array(
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'posts_per_page' => 5
) );
By default, the ordering will be highest to lowest, thus giving you the "top" 5.
A: View this section of the Codex to learn how to create a custom query: http://codex.wordpress.org/Class_Reference/WP_Query
this code will work
$query = new WP_Query( array(
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'posts_per_page' => 5
) );
|
wordpress
|
{
"language": "en",
"length": 169,
"provenance": "stackexchange_00019.jsonl.gz:419160",
"question_score": "10",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49330"
}
|
[
0.05731201171875,
-0.03619384765625,
0.048187255859375,
-0.01369476318359375,
-0.016876220703125,
0.0050201416015625,
0.03924560546875,
-0.03460693359375,
0.031646728515625,
0.0016202926635742188,
-0.0218048095703125,
-0.034271240234375,
-0.038543701171875,
-0.0288543701171875,
-0.0281982421875,
-0.055908203125,
0.053863525390625,
-0.024993896484375,
0.03240966796875,
0.0146026611328125,
-0.003368377685546875,
0.02581787109375,
0.07147216796875,
0.045989990234375,
0.004825592041015625,
0.0171661376953125,
0.04168701171875,
-0.04632568359375,
-0.01165771484375,
-0.039276123046875,
0.01161956787109375,
0.042449951171875,
-0.00423431396484375,
-0.0264892578125,
0.069580078125,
-0.028411865234375,
0.03875732421875,
-0.0151214599609375,
0.036834716796875,
-0.01280975341796875,
0.0068511962890625,
0.028656005859375,
0.00025343894958496094,
-0.006134033203125,
-0.030181884765625,
-0.0149078369140625,
-0.006744384765625,
-0.013519287109375,
0.005115509033203125,
-0.06903076171875,
-0.004302978515625,
0.031890869140625,
0.02783203125,
-0.044677734375,
-0.0121307373046875,
0.0382080078125,
0.0173797607421875,
0.006763458251953125,
0.041259765625,
-0.047637939453125,
-0.0528564453125,
-0.002811431884765625,
0.042694091796875,
-0.00083160400390625,
-0.03204345703125,
0.00936126708984375,
0.041656494140625,
-0.0015888214111328125,
0.0113372802734375,
-0.04376220703125,
-0.0113525390625,
0.03466796875,
0.01079559326171875,
-0.019317626953125,
0.0033588409423828125,
-0.0189056396484375,
0.0095977783203125,
-0.01515960693359375,
-0.0017614364624023438,
0.00940704345703125,
-0.0034618377685546875,
-0.0109100341796875,
-0.03619384765625,
0.01580810546875,
-0.00567626953125,
0.046051025390625,
-0.023193359375,
-0.01922607421875,
-0.043182373046875,
-0.035186767578125,
-0.0231781005859375,
-0.0236053466796875,
-0.0687255859375,
0.006542205810546875,
0.003643035888671875,
-0.023681640625,
-0.0141448974609375,
-0.0032176971435546875,
-0.01422882080078125,
-0.0367431640625,
0.00470733642578125,
-0.03167724609375,
-0.044769287109375,
0.0063323974609375,
0.004180908203125,
-0.00707244873046875,
0.0195465087890625,
0.051544189453125,
0.04815673828125,
0.05682373046875,
0.00431060791015625,
0.004482269287109375,
0.00592803955078125,
0.0213623046875,
-0.048858642578125,
-0.0178985595703125,
-0.031768798828125,
-0.0134735107421875,
-0.0189361572265625,
-0.01209259033203125,
0.0255889892578125,
0.0247650146484375,
-0.03326416015625,
-0.01352691650390625,
0.0189666748046875,
-0.0095062255859375,
-0.03271484375,
0.01245880126953125,
-0.03143310546875,
0.0738525390625,
-0.018798828125,
-0.016937255859375,
0.0200347900390625,
0.005710601806640625,
-0.0216522216796875,
-0.041900634765625,
0.0292816162109375,
-0.019378662109375,
-0.012725830078125,
0.026641845703125,
-0.0282135009765625,
-0.022369384765625,
0.0261688232421875,
-0.023681640625,
0.0186309814453125,
0.00524139404296875,
0.0272979736328125,
0.026824951171875,
-0.007373809814453125,
-0.049041748046875,
0.048797607421875,
0.009918212890625,
0.007419586181640625,
0.00424957275390625,
-0.0218048095703125,
0.0218963623046875,
-0.019378662109375,
0.00179290771484375,
-0.0139617919921875,
0.00690460205078125,
0.0699462890625,
0.005870819091796875,
-0.0198516845703125,
0.0203704833984375,
-0.035491943359375,
-0.0027332305908203125,
-0.04827880859375,
-0.016754150390625,
0.0074462890625,
0.046905517578125,
0.0229644775390625,
-0.037689208984375,
-0.0171356201171875,
-0.022186279296875,
-0.035675048828125,
-0.0143585205078125,
0.005672454833984375,
-0.015899658203125,
0.008148193359375,
0.0202484130859375,
-0.0244903564453125,
-0.038970947265625,
-0.040252685546875,
0.0117034912109375,
-0.015594482421875,
0.0181121826171875,
0.021636962890625,
0.031524658203125,
-0.01500701904296875,
0.0310821533203125,
0.01181793212890625,
0.02313232421875,
-0.0144500732421875,
0.0411376953125,
0.007610321044921875,
-0.036895751953125,
-0.01230621337890625,
-0.0090484619140625,
0.003124237060546875,
-0.0271759033203125,
-0.0096282958984375,
0.01285552978515625,
-0.0201416015625,
0.013641357421875,
-0.040283203125,
-0.0114288330078125,
-0.00872802734375,
0.0311431884765625,
0.00689697265625,
0.040985107421875,
0.0233612060546875,
0.0242767333984375,
-0.040252685546875,
-0.01093292236328125,
-0.01727294921875,
-0.0052337646484375,
0.008392333984375,
0.0015649795532226562,
-0.019683837890625,
-0.0017976760864257812,
-0.038848876953125,
-0.01806640625,
-0.053009033203125,
0.03643798828125,
0.05218505859375,
-0.041900634765625,
-0.0156707763671875,
-0.04986572265625,
0.0248870849609375,
-0.0176544189453125,
-0.038177490234375,
0.0596923828125,
0.029571533203125,
0.021392822265625,
-0.023529052734375,
-0.006961822509765625,
-0.005985260009765625,
-0.051910400390625,
0.00653076171875,
0.06060791015625,
0.04217529296875,
0.01024627685546875,
0.00664520263671875,
0.002574920654296875,
-0.00832366943359375,
-0.05279541015625,
0.0265655517578125,
-0.034881591796875,
0.012481689453125,
0.0360107421875,
0.0164031982421875,
-0.0098419189453125,
0.01305389404296875,
-0.0311431884765625,
0.035400390625,
0.00482940673828125,
0.018310546875,
0.0565185546875,
-0.050506591796875,
0.022705078125,
-0.020294189453125,
-0.007022857666015625,
0.00274658203125,
-0.01934814453125,
0.003162384033203125,
0.0472412109375,
0.00457000732421875,
0.027587890625,
-0.0223388671875,
0.03692626953125,
0.007442474365234375,
-0.0223541259765625,
-0.0162200927734375,
-0.02197265625,
-0.0035877227783203125,
-0.0183868408203125,
-0.05731201171875,
0.039794921875,
0.0175628662109375,
-0.04144287109375,
-0.00748443603515625,
0.010986328125,
-0.01093292236328125,
-0.005786895751953125,
0.01031494140625,
-0.0177001953125,
0.002758026123046875,
0.01611328125,
0.038330078125,
0.04742431640625,
0.04241943359375,
0.046630859375,
0.01313018798828125,
0.031585693359375,
0.0225982666015625,
0.024139404296875,
0.005748748779296875,
-0.115966796875,
0.08349609375,
-0.08380126953125,
0.08306884765625,
0.09039306640625,
-0.0243988037109375,
0.035858154296875,
-0.00562286376953125,
0.0203399658203125,
-0.01548004150390625,
0.00582122802734375,
-0.018402099609375,
-0.00640106201171875,
-0.054290771484375,
0.0041046142578125,
0.0311431884765625,
0.0799560546875,
-0.017333984375,
-0.04345703125,
0.006443023681640625,
0.046478271484375,
-0.063232421875,
-0.0858154296875,
0.034393310546875,
-0.06378173828125,
-0.0184173583984375,
0.003688812255859375,
-0.042877197265625,
0.0014362335205078125,
0.01317596435546875,
-0.0160369873046875,
-0.03094482421875,
0.033905029296875,
-0.042388916015625,
0.0015926361083984375,
-0.03326416015625,
0.0097198486328125,
-0.01091766357421875,
0.0150604248046875,
0.0038623809814453125,
0.05377197265625,
0.0010156631469726562,
-0.03912353515625,
-0.0031147003173828125,
0.0099945068359375,
-0.024322509765625,
-0.00592803955078125,
0.0255126953125,
-0.0126190185546875,
-0.03948974609375,
0.0241546630859375,
-0.00542449951171875,
0.01146697998046875,
-0.019805908203125,
-0.017913818359375,
-0.006488800048828125,
-0.01385498046875,
0.023529052734375,
0.00251007080078125,
-0.0273590087890625,
0.0018453598022460938,
0.03271484375,
-0.03839111328125,
0.02606201171875,
-0.0229644775390625,
-0.00628662109375,
-0.0137176513671875,
-0.007781982421875,
-0.002063751220703125,
-0.0255889892578125,
0.0037937164306640625,
0.0305633544921875,
-0.0146942138671875,
0.00007975101470947266,
-0.012908935546875,
0.017425537109375,
0.0240478515625,
0.055267333984375,
-0.0285491943359375,
0.0233917236328125,
0.002780914306640625,
-0.0018968582153320312,
0.0012874603271484375,
0.023834228515625,
-0.014373779296875,
-0.012451171875,
-0.0614013671875,
-0.02557373046875,
0.07000732421875,
0.069091796875,
0.0205230712890625,
-0.0031795501708984375,
-0.06927490234375,
-0.0165252685546875,
0.069580078125,
-0.031341552734375,
-0.0330810546875,
-0.0035610198974609375,
-0.0262298583984375,
0.0372314453125,
0.030975341796875,
-0.0158538818359375,
-0.0129241943359375,
-0.0906982421875,
0.0171051025390625,
-0.0168914794921875,
-0.02423095703125,
-0.0350341796875,
-0.0079803466796875,
-0.07879638671875,
-0.034423828125,
0.058441162109375,
0.01378631591796875,
0.0275115966796875,
0.027435302734375,
0.0021209716796875,
0.03143310546875,
-0.061614990234375,
0.016815185546875,
0.0132598876953125,
-0.004070281982421875,
-0.0010747909545898438,
0.0012569427490234375,
-0.00681304931640625,
0.0085906982421875,
0.006107330322265625,
0.03875732421875,
-0.003772735595703125,
0.0234222412109375,
-0.00934600830078125,
0.006591796875,
0.0084991455078125,
0.00847625732421875,
0.0038928985595703125,
-0.01374053955078125,
-0.0148468017578125,
-0.05419921875,
-0.014678955078125,
-0.043182373046875,
-0.040283203125,
0.00281524658203125,
-0.037109375,
-0.0001710653305053711,
-0.0753173828125,
-0.035675048828125,
-0.03521728515625,
0.0111846923828125,
-0.0125274658203125,
-0.0211181640625,
-0.036834716796875,
-0.08367919921875,
0.03594970703125,
0.0224609375,
-0.006866455078125,
0.0120086669921875,
0.09344482421875,
0.00817108154296875,
-0.033355712890625,
-0.081298828125,
-0.0212860107421875,
0.019805908203125,
0.0192718505859375,
0.0247344970703125,
0.025238037109375,
-0.00402069091796875,
0.004611968994140625,
0.014373779296875,
0.0225982666015625,
-0.0146026611328125,
0.03680419921875,
-0.0163726806640625,
-0.011383056640625,
0.0198516845703125,
-0.01192474365234375,
-0.0006356239318847656,
0.01338958740234375,
-0.016021728515625,
-0.017425537109375,
0.005825042724609375,
0.015472412109375,
-0.023345947265625,
0.0491943359375,
0.0191802978515625,
0.0016069412231445312,
-0.012176513671875,
-0.0168609619140625,
0.044281005859375,
0.01316070556640625,
0.0023975372314453125,
0.0010843276977539062,
0.053436279296875,
-0.0078582763671875,
0.0198974609375,
0.045257568359375,
-0.01220703125,
-0.00475311279296875,
0.060302734375,
-0.03173828125,
-0.026519775390625,
-0.0013828277587890625,
0.03216552734375,
-0.01113128662109375,
-0.060028076171875,
0.00785064697265625,
-0.033172607421875,
-0.0198974609375,
0.001903533935546875,
0.028839111328125,
0.058929443359375,
-0.004154205322265625,
-0.02484130859375,
-0.04144287109375,
-0.03070068359375,
-0.01540374755859375,
-0.07867431640625,
-0.0237884521484375,
0.003269195556640625,
-0.022003173828125,
0.0020046234130859375,
0.07391357421875,
-0.052703857421875,
0.0594482421875,
-0.00047206878662109375,
0.01468658447265625,
0.0076446533203125,
0.0201568603515625,
0.020782470703125,
0.003528594970703125,
-0.002288818359375,
-0.00466156005859375,
0.00762176513671875,
-0.00414276123046875,
-0.01397705078125,
0.0166168212890625,
-0.0168304443359375,
0.00217437744140625,
0.01727294921875,
0.00868988037109375,
0.025543212890625,
-0.03741455078125,
-0.0010557174682617188,
0.0108489990234375,
0.004058837890625,
-0.0310516357421875,
-0.00241851806640625,
0.034210205078125,
0.043731689453125,
0.01568603515625,
-0.0288543701171875,
0.015625,
0.01050567626953125,
-0.06842041015625,
0.0129852294921875,
-0.005138397216796875,
-0.007099151611328125,
0.017913818359375,
0.00981903076171875,
-0.0108642578125,
-0.05169677734375,
-0.0416259765625,
-0.01346588134765625,
-0.01055908203125,
0.07720947265625,
-0.012939453125,
0.074462890625,
-0.01219940185546875,
-0.0521240234375,
-0.004001617431640625,
0.01462554931640625,
0.033538818359375,
0.0064544677734375,
-0.0275115966796875,
-0.006988525390625,
-0.04742431640625,
-0.023345947265625,
0.05224609375,
0.0020923614501953125,
-0.01177215576171875,
-0.01232147216796875,
0.00860595703125,
0.0227203369140625,
-0.011474609375,
-0.058807373046875,
-0.00799560546875,
-0.01464080810546875,
0.004917144775390625,
-0.00476837158203125,
-0.0300445556640625,
0.0831298828125,
-0.006237030029296875,
0.05267333984375,
0.020538330078125,
0.059234619140625,
-0.0016412734985351562,
-0.0291900634765625,
0.007755279541015625,
0.0157928466796875,
-0.018890380859375,
-0.006015777587890625,
-0.0053558349609375,
-0.0335693359375,
0.0487060546875,
-0.006351470947265625,
0.040924072265625,
-0.0367431640625,
0.01259613037109375,
-0.019134521484375,
-0.00397491455078125,
-0.057342529296875,
-0.0026683807373046875,
0.0263214111328125,
0.0063323974609375,
0.0000026226043701171875,
-0.01561737060546875,
-0.01149749755859375,
-0.01111602783203125,
0.02105712890625,
-0.00528717041015625,
-0.0287628173828125,
-0.00627899169921875,
0.0193939208984375,
0.06634521484375,
-0.0016660690307617188,
0.056976318359375,
0.0335693359375,
0.0282135009765625,
0.0221405029296875,
-0.02655029296875,
0.0182647705078125,
-0.00408935546875,
0.0026702880859375,
-0.03668212890625,
0.027679443359375,
0.0027942657470703125,
0.00604248046875,
-0.038818359375,
-0.00514984130859375,
-0.017333984375,
-0.0227813720703125,
-0.00481414794921875,
-0.0138092041015625,
0.00836944580078125,
-0.0042572021484375,
0.0061492919921875,
0.021514892578125,
0.00495147705078125,
0.037933349609375,
-0.01016998291015625,
-0.0011835098266601562,
0.0213775634765625,
-0.0245208740234375,
0.010772705078125,
0.00841522216796875,
0.007205963134765625,
-0.0163726806640625,
-0.0255126953125,
-0.03369140625,
0.00251007080078125,
-0.009979248046875,
-0.0215301513671875,
-0.007904052734375,
0.01873779296875,
-0.00007003545761108398,
-0.0582275390625,
0.033203125,
-0.04302978515625,
0.012451171875,
0.00365447998046875,
0.018524169921875,
-0.014678955078125,
0.06536865234375,
-0.035308837890625,
0.0219573974609375,
0.0361328125,
-0.05078125,
0.006641387939453125,
-0.006969451904296875,
0.01239776611328125,
0.0244903564453125,
-0.013824462890625,
0.00812530517578125,
-0.01485443115234375,
-0.0189666748046875,
-0.0022983551025390625,
-0.006885528564453125,
0.05963134765625,
-0.045379638671875,
-0.01471710205078125,
0.0244140625,
0.0048370361328125,
-0.00855255126953125,
0.0166473388671875,
0.06317138671875,
-0.0237579345703125,
-0.00043845176696777344,
0.03240966796875,
-0.0014982223510742188,
-0.06298828125,
-0.0240325927734375,
-0.0404052734375,
0.07098388671875,
-0.03857421875,
0.0127716064453125,
0.05096435546875,
0.020233154296875,
-0.0380859375,
-0.005115509033203125,
-0.0325927734375,
0.058929443359375,
-0.046112060546875,
0.07220458984375,
-0.03466796875,
0.005664825439453125,
0.03460693359375,
0.0288543701171875,
0.09381103515625,
0.0144805908203125,
-0.054595947265625,
-0.0300445556640625,
0.0655517578125,
0.06103515625,
0.023162841796875,
0.03369140625,
-0.035186767578125,
0.06744384765625,
0.05810546875,
-0.0723876953125,
0.01971435546875,
0.0279693603515625,
-0.03070068359375,
0.01471710205078125,
-0.0015802383422851562,
-0.02569580078125,
0.01788330078125,
0.01363372802734375,
-0.046966552734375,
0.0115203857421875,
0.0296173095703125,
0.00004410743713378906,
0.01194000244140625,
0.032257080078125,
0.053375244140625,
-0.09771728515625,
-0.032196044921875,
-0.0243988037109375,
0.040771484375,
0.0233306884765625,
0.0225067138671875,
0.0254669189453125,
0.020050048828125,
0.045684814453125,
-0.049346923828125,
0.0067291259765625,
-0.020751953125,
-0.023223876953125,
0.0845947265625,
0.035064697265625,
0.032501220703125,
-0.0576171875,
-0.03717041015625,
0.037017822265625,
0.10760498046875,
-0.038604736328125,
-0.014678955078125,
0.0167694091796875,
-0.0222625732421875,
-0.033355712890625,
-0.0225067138671875,
-0.032958984375,
0.031646728515625,
0.0209808349609375,
-0.046417236328125,
-0.026763916015625,
0.0164337158203125,
0.03814697265625,
-0.0158538818359375,
-0.053009033203125,
0.005199432373046875,
-0.04876708984375,
-0.0019969940185546875,
-0.024993896484375,
0.004909515380859375,
-0.0025234222412109375,
0.0135040283203125,
-0.005290985107421875,
-0.005161285400390625,
0.0164794921875,
-0.0006656646728515625,
0.0038852691650390625,
-0.0158233642578125,
-0.0021266937255859375,
-0.021240234375,
-0.039031982421875,
-0.0306549072265625,
0.040374755859375,
0.00008207559585571289,
-0.0167388916015625,
0.046142578125,
0.06573486328125,
-0.03900146484375,
-0.037261962890625,
0.03680419921875,
-0.0053863525390625,
-0.035247802734375,
-0.01080322265625,
-0.039337158203125,
0.01123046875,
-0.004642486572265625,
-0.005023956298828125,
0.0116119384765625,
0.0250701904296875,
0.009674072265625,
0.0283966064453125,
0.0070343017578125,
0.0067596435546875,
0.028717041015625,
-0.007793426513671875,
0.025177001953125,
0.00968170166015625,
-0.0892333984375,
0.006328582763671875,
-0.0421142578125,
-0.0643310546875,
0.02880859375,
0.031280517578125,
-0.045440673828125,
0.03759765625,
0.004688262939453125,
0.0033206939697265625,
0.0279388427734375,
-0.01238250732421875,
0.004215240478515625,
0.0207366943359375,
0.03973388671875,
0.0034046173095703125,
-0.067626953125,
-0.04541015625,
-0.01654052734375,
0.030792236328125,
0.024993896484375,
0.029266357421875,
0.0254058837890625,
0.0278472900390625,
-0.01122283935546875,
0.01500701904296875,
-0.004482269287109375,
-0.0136260986328125,
0.0292510986328125,
0.00179290771484375,
-0.0197601318359375,
-0.016845703125,
0.0296630859375,
-0.015960693359375,
0.06622314453125,
-0.031494140625,
-0.047088623046875,
0.007076263427734375,
0.035491943359375,
-0.01434326171875,
0.01385498046875,
-0.00988006591796875,
0.013275146484375,
-0.0309295654296875,
-0.043853759765625,
0.041351318359375,
0.0128021240234375,
-0.00290679931640625,
0.0220184326171875,
0.01337432861328125,
-0.0372314453125,
0.037139892578125,
-0.0191192626953125,
0.05206298828125,
0.037933349609375,
-0.0275115966796875,
0.02386474609375,
0.00724029541015625,
-0.01461029052734375,
0.0103302001953125,
0.00930023193359375,
-0.01464080810546875,
0.0220947265625,
-0.0538330078125,
-0.0177459716796875,
-0.0288543701171875,
0.0134429931640625,
-0.0166168212890625,
-0.0124664306640625,
-0.0169830322265625,
-0.00397491455078125,
-0.045867919921875,
0.006114959716796875,
-0.006561279296875,
0.00026297569274902344,
-0.017578125,
0.00457763671875,
0.0214385986328125,
0.00939178466796875,
0.013641357421875,
0.005672454833984375,
-0.015594482421875,
-0.02001953125,
0.005313873291015625,
0.0301055908203125,
-0.038848876953125,
-0.0556640625,
-0.0123291015625,
-0.01354217529296875,
0.0103607177734375,
0.03936767578125,
-0.0054473876953125,
0.01212310791015625,
-0.01349639892578125,
-0.005107879638671875,
-0.0051727294921875,
0.0008029937744140625,
-0.010101318359375,
-0.0183868408203125,
0.0058135986328125,
-0.0008544921875,
0.005886077880859375,
0.0281982421875,
0.024322509765625,
0.002826690673828125,
0.0251617431640625,
0.00684356689453125,
-0.031768798828125,
-0.0828857421875,
0.01444244384765625,
-0.07135009765625,
-0.006633758544921875,
-0.005725860595703125,
0.0361328125,
0.06195068359375,
-0.0189208984375,
-0.101806640625,
0.064453125,
-0.04217529296875,
-0.033660888671875,
-0.023681640625,
-0.033416748046875,
0.00742340087890625,
0.019439697265625,
0.004100799560546875,
-0.01410675048828125,
-0.06817626953125,
0.0020427703857421875,
0.028778076171875,
-0.01473236083984375,
0.0546875,
0.0255126953125,
-0.035552978515625,
0.0196075439453125,
0.0017671585083007812,
-0.0221099853515625,
-0.0203399658203125,
0.01450347900390625,
0.00989532470703125,
0.0027561187744140625,
-0.0325927734375,
0.028564453125,
0.00252532958984375,
0.021209716796875,
0.0010576248168945312,
-0.0084228515625,
-0.01629638671875,
-0.0185546875,
0.029205322265625,
0.0157470703125,
0.001556396484375,
-0.03277587890625,
-0.0131378173828125,
-0.04986572265625,
-0.0273590087890625,
-0.014190673828125,
0.018585205078125,
-0.0802001953125,
-0.00685882568359375,
0.049652099609375,
-0.01241302490234375,
-0.0316162109375,
-0.01439666748046875,
-0.051544189453125,
-0.0138092041015625,
-0.0457763671875,
0.009735107421875,
-0.037353515625,
0.04571533203125,
-0.00241851806640625,
-0.026153564453125,
-0.051544189453125,
0.0018987655639648438,
-0.0182342529296875,
-0.05279541015625,
-0.004425048828125,
0.058624267578125,
-0.0164337158203125,
-0.00504302978515625,
0.0179290771484375,
0.041290283203125,
0.01496124267578125,
0.003276824951171875,
-0.05853271484375,
-0.0010204315185546875,
0.0119476318359375,
0.006397247314453125,
0.0235748291015625,
0.0084991455078125,
-0.00909423828125,
0.005535125732421875,
-0.0041656494140625,
-0.017303466796875,
0.049713134765625,
-0.0089874267578125,
0.017120361328125,
0.0018568038940429688,
0.00669097900390625,
0.04205322265625,
-0.00971221923828125,
-0.0007901191711425781,
0.0030765533447265625,
-0.027252197265625,
-0.0290069580078125,
0.0007357597351074219,
0.05706787109375,
-0.0090789794921875,
0.01422119140625
] |
7b241eefb8642193391e67469e82a2bcddc38c7f
|
Wordpress Stackexchange
Q: How can I see the error generated by plugin activation? I'm developing a plugin and upon activation, I get the following error:
The plugin generated xxx characters of unexpected output during activation
How can I see what unexpected output is generated?
I have turned on debugging, but it doesn't help:
define('WP_DEBUG', true);
if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
@ini_set('display_errors', 1);
}
Update
FYI - I have checked that there are no spaces before and after <?php ?>. I've done some digging around and tested various solutions, but I'm still stuck.
A: If a plugin has the error output
The plugin generated xxx characters of unexpected output during activation
then that only means that there is some error output.
Sadly WP can't output anything more than this. Every error output sends a header (as var_dump/var_export/print_r/print/error/printf would output.
In short:
You won't get any more info unless you're diggin´ deeper into the plugins code. Your best bet are above ↑ mentioned functions that you could throw into the plugins code to get a real error output.
Short: Sorry to say that, but it is what it is... :/
|
Q: How can I see the error generated by plugin activation? I'm developing a plugin and upon activation, I get the following error:
The plugin generated xxx characters of unexpected output during activation
How can I see what unexpected output is generated?
I have turned on debugging, but it doesn't help:
define('WP_DEBUG', true);
if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
@ini_set('display_errors', 1);
}
Update
FYI - I have checked that there are no spaces before and after <?php ?>. I've done some digging around and tested various solutions, but I'm still stuck.
A: If a plugin has the error output
The plugin generated xxx characters of unexpected output during activation
then that only means that there is some error output.
Sadly WP can't output anything more than this. Every error output sends a header (as var_dump/var_export/print_r/print/error/printf would output.
In short:
You won't get any more info unless you're diggin´ deeper into the plugins code. Your best bet are above ↑ mentioned functions that you could throw into the plugins code to get a real error output.
Short: Sorry to say that, but it is what it is... :/
|
wordpress
|
{
"language": "en",
"length": 188,
"provenance": "stackexchange_00019.jsonl.gz:419168",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49357"
}
|
[
0.046783447265625,
-0.009185791015625,
-0.051300048828125,
-0.033233642578125,
0.005535125732421875,
-0.035247802734375,
0.0058441162109375,
0.0031604766845703125,
0.01111602783203125,
-0.00916290283203125,
-0.0159454345703125,
-0.0027980804443359375,
-0.05364990234375,
-0.034698486328125,
-0.026397705078125,
-0.046478271484375,
0.03192138671875,
0.006298065185546875,
0.0194854736328125,
-0.0058441162109375,
-0.0033721923828125,
0.015228271484375,
-0.01009368896484375,
0.07806396484375,
0.0174407958984375,
-0.0167999267578125,
0.11602783203125,
-0.017120361328125,
0.0158538818359375,
-0.03704833984375,
0.0251007080078125,
-0.0074615478515625,
-0.005031585693359375,
0.0430908203125,
-0.029937744140625,
-0.0210418701171875,
0.01218414306640625,
0.01274871826171875,
-0.005748748779296875,
0.043701171875,
0.01276397705078125,
0.010955810546875,
0.1004638671875,
-0.028900146484375,
0.045318603515625,
-0.03765869140625,
0.038360595703125,
-0.056915283203125,
-0.004848480224609375,
0.01424407958984375,
0.011260986328125,
0.00287628173828125,
0.0214996337890625,
0.0258636474609375,
-0.031341552734375,
-0.038421630859375,
-0.063720703125,
0.07635498046875,
0.0218658447265625,
0.07513427734375,
0.016082763671875,
0.035797119140625,
-0.04327392578125,
-0.053497314453125,
0.020721435546875,
0.00044417381286621094,
-0.0025119781494140625,
0.0275115966796875,
0.01189422607421875,
0.037872314453125,
0.00583648681640625,
-0.0137786865234375,
-0.01209259033203125,
0.0299530029296875,
-0.027191162109375,
-0.024749755859375,
0.04644775390625,
0.004150390625,
-0.0020160675048828125,
0.020263671875,
0.060943603515625,
0.0031871795654296875,
-0.0199737548828125,
0.03125,
0.00966644287109375,
0.04736328125,
0.0064849853515625,
-0.04559326171875,
-0.01995849609375,
-0.00679779052734375,
-0.01531219482421875,
-0.0166778564453125,
-0.017791748046875,
-0.00958251953125,
-0.0048828125,
-0.033599853515625,
0.0147705078125,
0.0260772705078125,
-0.0367431640625,
0.006862640380859375,
-0.01739501953125,
-0.019866943359375,
0.02899169921875,
-0.03033447265625,
-0.00844573974609375,
0.0243682861328125,
0.0134429931640625,
-0.01030731201171875,
0.00702667236328125,
0.0287628173828125,
-0.0006871223449707031,
0.0018711090087890625,
-0.060882568359375,
-0.07568359375,
0.00435638427734375,
0.0672607421875,
-0.0253143310546875,
-0.01479339599609375,
0.0300140380859375,
0.007061004638671875,
-0.01611328125,
0.018829345703125,
-0.0017385482788085938,
0.003509521484375,
-0.020904541015625,
-0.038482666015625,
-0.006496429443359375,
-0.0208282470703125,
0.00678253173828125,
-0.0092926025390625,
-0.031646728515625,
0.032623291015625,
0.046173095703125,
0.0040740966796875,
-0.0024890899658203125,
-0.01447296142578125,
0.021575927734375,
0.0220794677734375,
0.0005297660827636719,
0.0175323486328125,
-0.0227813720703125,
-0.015045166015625,
0.02020263671875,
-0.0178070068359375,
-0.0302734375,
0.0386962890625,
0.028411865234375,
-0.01238250732421875,
-0.035186767578125,
-0.0684814453125,
-0.036102294921875,
-0.003215789794921875,
-0.00853729248046875,
0.00797271728515625,
0.045562744140625,
-0.0290985107421875,
0.0367431640625,
-0.038818359375,
0.0389404296875,
-0.027191162109375,
0.036895751953125,
-0.0032176971435546875,
0.001308441162109375,
-0.018707275390625,
-0.021942138671875,
-0.017333984375,
-0.036102294921875,
0.00429534912109375,
0.023681640625,
-0.01416778564453125,
0.01004791259765625,
-0.023345947265625,
-0.00421142578125,
-0.024658203125,
-0.00887298583984375,
0.01476287841796875,
-0.036468505859375,
-0.005893707275390625,
0.0391845703125,
0.0187225341796875,
0.01544189453125,
-0.00585174560546875,
0.04669189453125,
0.0261993408203125,
-0.033599853515625,
0.011749267578125,
0.00775146484375,
0.0189971923828125,
0.029632568359375,
0.00939178466796875,
0.014862060546875,
0.0014896392822265625,
-0.0297393798828125,
0.0266876220703125,
-0.024017333984375,
-0.032623291015625,
0.002803802490234375,
0.00676727294921875,
-0.00917816162109375,
0.01290130615234375,
0.0204925537109375,
0.0391845703125,
-0.036712646484375,
-0.01139068603515625,
-0.119384765625,
0.0193939208984375,
-0.042816162109375,
0.049713134765625,
0.004058837890625,
0.0214385986328125,
0.01165008544921875,
-0.003509521484375,
-0.036651611328125,
0.037841796875,
0.00736236572265625,
0.01007080078125,
-0.0173492431640625,
0.0284576416015625,
0.005390167236328125,
0.0197296142578125,
0.02008056640625,
-0.0123443603515625,
0.005695343017578125,
-0.0206146240234375,
0.00653076171875,
-0.02032470703125,
-0.0109405517578125,
-0.019622802734375,
0.03759765625,
-0.01611328125,
0.063232421875,
0.041595458984375,
-0.01983642578125,
0.0178375244140625,
-0.00672149658203125,
-0.0263214111328125,
0.00363922119140625,
-0.067626953125,
0.042938232421875,
0.0361328125,
0.051361083984375,
0.01502227783203125,
0.01171875,
0.0011968612670898438,
0.039215087890625,
-0.0236358642578125,
0.03509521484375,
-0.0242156982421875,
0.0114593505859375,
0.007114410400390625,
-0.01904296875,
-0.0111541748046875,
0.03509521484375,
-0.0213470458984375,
0.0276641845703125,
0.03558349609375,
-0.02484130859375,
-0.051055908203125,
0.004146575927734375,
-0.01291656494140625,
0.022674560546875,
-0.04949951171875,
-0.03851318359375,
-0.010894775390625,
-0.03680419921875,
0.00482940673828125,
-0.02691650390625,
-0.0086669921875,
-0.0083770751953125,
0.0177764892578125,
0.034454345703125,
-0.046630859375,
-0.003173828125,
0.0014467239379882812,
-0.0268707275390625,
0.01261138916015625,
-0.02410888671875,
0.0089874267578125,
-0.00994873046875,
0.0045166015625,
-0.048858642578125,
0.01407623291015625,
-0.01381683349609375,
-0.02197265625,
-0.00432586669921875,
-0.01239776611328125,
0.0038471221923828125,
-0.058837890625,
-0.01355743408203125,
-0.00850677490234375,
0.0196685791015625,
0.06268310546875,
-0.01070404052734375,
0.0292816162109375,
-0.039947509765625,
0.0186309814453125,
0.09747314453125,
-0.06939697265625,
0.06170654296875,
-0.049407958984375,
0.064208984375,
0.050018310546875,
-0.05450439453125,
0.038909912109375,
-0.003108978271484375,
0.027191162109375,
0.0006303787231445312,
-0.002162933349609375,
-0.0193328857421875,
0.0176239013671875,
-0.07427978515625,
-0.01059722900390625,
0.0203704833984375,
0.06488037109375,
-0.02117919921875,
-0.05914306640625,
-0.020111083984375,
0.03173828125,
-0.07110595703125,
-0.06854248046875,
-0.0684814453125,
-0.034881591796875,
0.003871917724609375,
0.0237274169921875,
-0.0154876708984375,
0.012451171875,
0.040771484375,
0.016265869140625,
0.03326416015625,
-0.05029296875,
-0.036407470703125,
-0.047607421875,
-0.07257080078125,
-0.0218658447265625,
0.01255035400390625,
-0.006561279296875,
-0.003742218017578125,
0.01812744140625,
-0.00666046142578125,
-0.0631103515625,
-0.02105712890625,
-0.0023555755615234375,
-0.01873779296875,
-0.0169219970703125,
-0.04058837890625,
0.017608642578125,
-0.00136566162109375,
0.0182647705078125,
-0.02191162109375,
-0.0283203125,
0.037139892578125,
-0.045257568359375,
0.01512908935546875,
0.0081024169921875,
-0.006572723388671875,
-0.0267791748046875,
0.0013761520385742188,
-0.032958984375,
-0.056549072265625,
-0.061004638671875,
0.026763916015625,
0.00170135498046875,
-0.0226593017578125,
0.01186370849609375,
0.00241851806640625,
-0.02264404296875,
0.0195770263671875,
-0.035186767578125,
-0.0233154296875,
-0.022064208984375,
0.0472412109375,
-0.048431396484375,
0.055389404296875,
-0.02923583984375,
-0.04034423828125,
-0.046173095703125,
0.0467529296875,
-0.00298309326171875,
-0.03515625,
-0.0022068023681640625,
0.007598876953125,
-0.0177154541015625,
-0.00176239013671875,
-0.037353515625,
-0.0196075439453125,
-0.002971649169921875,
-0.0845947265625,
-0.038055419921875,
0.01303863525390625,
0.034210205078125,
0.02655029296875,
0.027923583984375,
-0.04217529296875,
-0.02679443359375,
-0.007610321044921875,
0.015625,
-0.013153076171875,
-0.00319671630859375,
-0.00865936279296875,
-0.007221221923828125,
-0.097900390625,
0.0247039794921875,
0.0013942718505859375,
-0.032012939453125,
0.0006976127624511719,
-0.0254669189453125,
-0.054443359375,
-0.048828125,
0.0179901123046875,
0.0178680419921875,
-0.00011301040649414062,
-0.02593994140625,
0.0100555419921875,
-0.046173095703125,
0.0169525146484375,
-0.0211334228515625,
-0.06573486328125,
-0.01496124267578125,
-0.0306396484375,
0.05487060546875,
0.0208892822265625,
-0.0088348388671875,
-0.0204620361328125,
0.040924072265625,
-0.0214385986328125,
0.036834716796875,
0.0118255615234375,
0.0372314453125,
0.0148468017578125,
-0.0196990966796875,
0.0109405517578125,
-0.0285491943359375,
0.00804901123046875,
0.0113067626953125,
-0.03643798828125,
0.0445556640625,
-0.0000883340835571289,
0.0261993408203125,
0.03851318359375,
-0.03802490234375,
-0.0294189453125,
-0.011871337890625,
-0.0006670951843261719,
0.0228424072265625,
-0.01058197021484375,
-0.0012969970703125,
-0.005970001220703125,
-0.01454925537109375,
-0.004302978515625,
-0.043609619140625,
-0.032318115234375,
0.00936126708984375,
0.056671142578125,
0.028778076171875,
0.02069091796875,
0.032928466796875,
-0.0186309814453125,
0.0078277587890625,
0.028961181640625,
0.0218658447265625,
-0.00021982192993164062,
-0.0002460479736328125,
0.02520751953125,
-0.01245880126953125,
0.01308441162109375,
0.01007080078125,
0.0389404296875,
0.0188446044921875,
0.00002956390380859375,
0.006061553955078125,
0.0201416015625,
-0.031158447265625,
0.004467010498046875,
-0.02447509765625,
0.0186767578125,
0.019256591796875,
0.01140594482421875,
-0.057373046875,
0.0626220703125,
0.01044464111328125,
-0.0155487060546875,
0.0220489501953125,
-0.0116119384765625,
0.00007069110870361328,
0.0184173583984375,
0.0017852783203125,
-0.023712158203125,
-0.028900146484375,
-0.0194244384765625,
0.004688262939453125,
0.0208282470703125,
0.005580902099609375,
0.041290283203125,
-0.01580810546875,
-0.0182647705078125,
-0.033111572265625,
-0.01334381103515625,
0.0328369140625,
0.00536346435546875,
-0.052215576171875,
0.0173492431640625,
-0.0022945404052734375,
0.031494140625,
0.030303955078125,
-0.01213836669921875,
0.029296875,
0.006488800048828125,
0.0018320083618164062,
0.005321502685546875,
-0.0067291259765625,
-0.016632080078125,
-0.0289306640625,
0.007724761962890625,
-0.018402099609375,
0.007106781005859375,
0.0262603759765625,
0.0615234375,
-0.0012941360473632812,
0.040618896484375,
-0.026947021484375,
-0.01482391357421875,
-0.00022923946380615234,
0.050048828125,
0.038787841796875,
-0.0692138671875,
-0.00618743896484375,
0.02874755859375,
0.00740814208984375,
-0.054962158203125,
-0.01401519775390625,
-0.0190887451171875,
0.01654052734375,
-0.0196685791015625,
-0.01464080810546875,
0.0828857421875,
0.035369873046875,
-0.00750732421875,
0.0634765625,
-0.00449371337890625,
-0.05096435546875,
-0.04510498046875,
-0.04638671875,
0.0394287109375,
-0.036712646484375,
0.0084228515625,
0.04541015625,
0.044281005859375,
0.06695556640625,
-0.0096435546875,
-0.032989501953125,
0.03204345703125,
0.053466796875,
-0.0247344970703125,
-0.04998779296875,
0.00203704833984375,
-0.03839111328125,
0.001659393310546875,
-0.005596160888671875,
0.0022792816162109375,
0.007366180419921875,
-0.049468994140625,
-0.006603240966796875,
-0.00887298583984375,
0.035491943359375,
-0.0281524658203125,
0.02032470703125,
0.01947021484375,
0.00812530517578125,
-0.049468994140625,
0.01194000244140625,
-0.0097503662109375,
-0.01702880859375,
0.039154052734375,
0.006267547607421875,
-0.04437255859375,
-0.0254364013671875,
0.0023212432861328125,
-0.005687713623046875,
0.01494598388671875,
0.00690460205078125,
-0.0158843994140625,
0.037841796875,
0.024383544921875,
0.012481689453125,
-0.00531005859375,
-0.0035533905029296875,
0.030670166015625,
0.00272369384765625,
0.02471923828125,
0.005275726318359375,
0.0255889892578125,
-0.03985595703125,
0.0187835693359375,
0.0225830078125,
-0.0129852294921875,
-0.026611328125,
0.043853759765625,
-0.0517578125,
-0.0030670166015625,
-0.0174713134765625,
-0.02874755859375,
0.032928466796875,
0.01258087158203125,
-0.01155853271484375,
0.031829833984375,
0.075927734375,
-0.026123046875,
0.048828125,
-0.063720703125,
-0.044952392578125,
0.01499176025390625,
0.041229248046875,
0.007114410400390625,
-0.04119873046875,
-0.020416259765625,
0.033905029296875,
-0.04559326171875,
0.039642333984375,
0.034881591796875,
0.00716400146484375,
0.0230712890625,
-0.007701873779296875,
-0.00879669189453125,
-0.0178375244140625,
0.000244140625,
0.025299072265625,
-0.01532745361328125,
0.037261962890625,
-0.0004169940948486328,
-0.0276031494140625,
0.00458526611328125,
-0.031341552734375,
0.02294921875,
0.061431884765625,
0.06097412109375,
-0.09893798828125,
0.017608642578125,
0.0217437744140625,
-0.0111846923828125,
0.0161895751953125,
-0.00008064508438110352,
-0.0053253173828125,
-0.012298583984375,
0.051605224609375,
-0.00391387939453125,
0.01236724853515625,
0.035736083984375,
0.002414703369140625,
-0.0174407958984375,
-0.006710052490234375,
0.061065673828125,
0.019866943359375,
-0.07037353515625,
0.052093505859375,
0.0303802490234375,
0.0369873046875,
-0.0164031982421875,
0.01495361328125,
-0.016693115234375,
0.017547607421875,
-0.00820159912109375,
0.03509521484375,
-0.038818359375,
0.01509857177734375,
0.0047149658203125,
-0.005458831787109375,
0.0280303955078125,
0.0411376953125,
-0.00524139404296875,
-0.0098724365234375,
0.0161285400390625,
-0.0011663436889648438,
0.06475830078125,
-0.01030731201171875,
-0.0032978057861328125,
0.0535888671875,
-0.05828857421875,
-0.0045166015625,
0.0006914138793945312,
0.035247802734375,
0.009613037109375,
0.046234130859375,
0.0687255859375,
0.01904296875,
-0.05645751953125,
0.04541015625,
-0.0286712646484375,
-0.028350830078125,
-0.034454345703125,
0.020233154296875,
-0.04986572265625,
0.0159454345703125,
-0.0200042724609375,
0.021087646484375,
-0.01036834716796875,
-0.046295166015625,
-0.029327392578125,
0.031036376953125,
0.012847900390625,
-0.0255126953125,
0.01971435546875,
0.01197052001953125,
-0.042327880859375,
-0.0127105712890625,
-0.0462646484375,
0.095458984375,
-0.018035888671875,
0.1043701171875,
-0.0799560546875,
-0.0172119140625,
0.051513671875,
0.0312042236328125,
0.010498046875,
0.005336761474609375,
0.0087127685546875,
0.0151519775390625,
0.0278778076171875,
-0.056610107421875,
-0.0594482421875,
0.05487060546875,
0.0185394287109375,
0.024078369140625,
0.03973388671875,
-0.0200653076171875,
0.04998779296875,
-0.05224609375,
0.02593994140625,
0.03985595703125,
-0.006103515625,
-0.0234527587890625,
0.00836181640625,
0.00377655029296875,
0.003360748291015625,
0.002288818359375,
-0.0070343017578125,
0.038726806640625,
0.0201416015625,
0.049560546875,
0.06451416015625,
-0.04156494140625,
-0.0295562744140625,
-0.0173187255859375,
0.054168701171875,
-0.01024627685546875,
0.0218505859375,
-0.00897979736328125,
0.014373779296875,
0.02825927734375,
-0.0033721923828125,
0.00629425048828125,
0.045196533203125,
-0.038970947265625,
-0.004199981689453125,
-0.01079559326171875,
0.0095062255859375,
-0.03485107421875,
-0.001041412353515625,
0.030487060546875,
0.00887298583984375,
-0.023529052734375,
-0.06744384765625,
0.01171112060546875,
0.0258331298828125,
0.045135498046875,
0.04583740234375,
0.06817626953125,
-0.006450653076171875,
0.04840087890625,
-0.032684326171875,
-0.0246124267578125,
-0.006496429443359375,
0.0219573974609375,
-0.0147857666015625,
-0.036041259765625,
0.03741455078125,
-0.0189971923828125,
-0.035552978515625,
0.0172119140625,
0.0030364990234375,
0.05224609375,
0.01153564453125,
0.040496826171875,
-0.035797119140625,
-0.0196380615234375,
-0.0055084228515625,
0.01070404052734375,
-0.0022945404052734375,
0.006015777587890625,
-0.01849365234375,
-0.0039043426513671875,
0.0001678466796875,
0.010101318359375,
-0.016693115234375,
-0.0606689453125,
0.0213775634765625,
0.03009033203125,
-0.046722412109375,
-0.040679931640625,
-0.00046944618225097656,
-0.00991058349609375,
-0.038787841796875,
-0.040802001953125,
0.0130615234375,
0.05023193359375,
0.0177459716796875,
0.0276641845703125,
-0.0023097991943359375,
0.036712646484375,
-0.0175933837890625,
0.0257568359375,
0.004566192626953125,
-0.01012420654296875,
0.01385498046875,
-0.02978515625,
0.013580322265625,
0.0010223388671875,
-0.06976318359375,
-0.026947021484375,
-0.0341796875,
0.01045989990234375,
0.020416259765625,
0.043853759765625,
0.0233306884765625,
0.00850677490234375,
-0.00843048095703125,
0.01129150390625,
-0.0019330978393554688,
-0.0160369873046875,
0.007343292236328125,
-0.0013179779052734375,
0.01235198974609375,
-0.0006189346313476562,
-0.015960693359375,
-0.0222930908203125,
-0.006862640380859375,
0.0252227783203125,
0.025421142578125,
0.049163818359375,
-0.0082244873046875,
0.03912353515625,
-0.0016651153564453125,
0.0116119384765625,
-0.0171966552734375,
0.0173187255859375,
-0.01386260986328125,
0.0123748779296875,
0.004528045654296875,
-0.0225830078125,
-0.0667724609375,
0.06939697265625,
-0.0214996337890625,
0.007175445556640625,
0.046661376953125,
-0.0026111602783203125,
-0.0050811767578125,
0.022918701171875,
0.0284881591796875,
-0.007720947265625,
-0.04876708984375,
-0.0166168212890625,
0.03179931640625,
0.0049285888671875,
0.0660400390625,
-0.018280029296875,
-0.01122283935546875,
0.011444091796875,
-0.058319091796875,
0.0205230712890625,
-0.0283966064453125,
0.00998687744140625,
0.0311126708984375,
0.00344085693359375,
-0.00968170166015625,
-0.03680419921875,
-0.030242919921875,
0.0178375244140625,
-0.0167236328125,
0.031158447265625,
-0.0330810546875,
0.0166168212890625,
-0.007671356201171875,
-0.0311279296875,
-0.004177093505859375,
-0.034942626953125,
0.0008187294006347656,
-0.004611968994140625,
0.018463134765625,
0.0118560791015625,
-0.01250457763671875,
-0.0014982223510742188,
-0.024932861328125,
-0.0092010498046875,
0.02349853515625,
-0.005977630615234375,
0.0439453125,
0.004482269287109375,
-0.0080718994140625,
0.00695037841796875,
-0.007537841796875,
-0.0013170242309570312,
-0.01099395751953125,
-0.0269927978515625,
0.0023326873779296875,
0.00414276123046875,
0.0100555419921875,
-0.0228118896484375,
-0.01194000244140625,
-0.052154541015625,
-0.06524658203125,
-0.050567626953125,
0.045867919921875,
-0.05322265625,
0.0182037353515625,
0.045562744140625,
-0.029083251953125,
-0.0308380126953125,
0.0042877197265625,
0.0281829833984375,
0.0467529296875,
0.000010669231414794922,
-0.0092926025390625,
-0.01476287841796875,
-0.00882720947265625,
-0.00504302978515625,
-0.021148681640625,
0.01934814453125,
-0.058868408203125,
-0.049285888671875,
0.00765228271484375,
0.0000680088996887207,
0.036102294921875,
-0.034820556640625,
-0.04486083984375,
0.026611328125,
-0.0020503997802734375,
-0.02655029296875,
-0.0197296142578125,
-0.00873565673828125,
0.01456451416015625,
-0.0079193115234375,
-0.0010213851928710938,
0.011474609375,
-0.03314208984375,
0.01108551025390625,
0.0038890838623046875,
-0.025543212890625,
0.0406494140625,
-0.0112152099609375,
-0.021331787109375,
0.01094818115234375,
0.0198974609375,
-0.024932861328125,
-0.039794921875,
0.0180206298828125,
-0.00934600830078125,
0.0188751220703125,
-0.0287322998046875,
-0.01763916015625,
0.009185791015625,
0.0108489990234375,
-0.0182037353515625,
-0.0648193359375,
0.0018262863159179688,
-0.0253143310546875,
0.06854248046875,
0.0028133392333984375,
0.006587982177734375,
-0.0206146240234375,
-0.0321044921875,
0.00010126829147338867,
0.01409912109375,
-0.033203125,
0.010406494140625,
-0.0751953125,
-0.0254669189453125,
-0.0303955078125,
0.0111541748046875,
-0.011871337890625,
0.0034999847412109375,
-0.0027980804443359375,
-0.020660400390625,
0.01666259765625,
-0.0059051513671875,
-0.025787353515625,
-0.08746337890625,
0.018402099609375,
-0.0006537437438964844,
-0.0093994140625,
-0.0028400421142578125,
0.057220458984375,
-0.005218505859375,
0.03436279296875,
-0.005161285400390625,
0.01538848876953125,
-0.08758544921875,
0.020782470703125,
-0.033843994140625,
0.06207275390625,
-0.077880859375,
-0.018310546875,
0.0177001953125,
0.0196685791015625,
-0.0384521484375,
0.0192108154296875,
0.05609130859375,
0.0018205642700195312,
-0.039794921875,
0.0294647216796875,
-0.004596710205078125,
0.00206756591796875,
-0.019744873046875,
0.033111572265625,
-0.005771636962890625,
-0.0193023681640625,
0.017486572265625,
-0.0288848876953125,
0.00157928466796875,
0.011749267578125,
0.037322998046875,
-0.0428466796875,
-0.0011749267578125,
0.024993896484375,
0.043701171875,
0.017578125
] |
2027cad9e813fdbaba43750c862379c40db03bfc
|
Wordpress Stackexchange
Q: How to set a Preset category for custom post types? For Posts you can have a preset category where all Posts fall if not specified otherwise (settings → writing).
Can this be done for custom post types that have a custom taxonomy?
The register_taxonomy does not seem to offer parameters for that.
Thanks again :)
A: Try hooking into the save_post action to check the custom terms when a post gets saved:
add_action( 'save_post', 'set_default_category' );
function set_default_category( $post_id ) {
// Get the terms
$terms = wp_get_post_terms( $post_id, 'your_custom_taxonomy');
// Only set default if no terms are set yet
if (!$terms) {
// Assign the default category
$default_term = get_term_by('slug', 'your_term_slug', 'your_custom_taxonomy');
$taxonomy = 'your_custom_taxonomy';
wp_set_post_terms( $post_id, $default_term, $taxonomy );
}
}
|
Q: How to set a Preset category for custom post types? For Posts you can have a preset category where all Posts fall if not specified otherwise (settings → writing).
Can this be done for custom post types that have a custom taxonomy?
The register_taxonomy does not seem to offer parameters for that.
Thanks again :)
A: Try hooking into the save_post action to check the custom terms when a post gets saved:
add_action( 'save_post', 'set_default_category' );
function set_default_category( $post_id ) {
// Get the terms
$terms = wp_get_post_terms( $post_id, 'your_custom_taxonomy');
// Only set default if no terms are set yet
if (!$terms) {
// Assign the default category
$default_term = get_term_by('slug', 'your_term_slug', 'your_custom_taxonomy');
$taxonomy = 'your_custom_taxonomy';
wp_set_post_terms( $post_id, $default_term, $taxonomy );
}
}
|
wordpress
|
{
"language": "en",
"length": 124,
"provenance": "stackexchange_00019.jsonl.gz:419172",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49369"
}
|
[
0.045562744140625,
0.0036373138427734375,
-0.01116943359375,
-0.040863037109375,
0.035888671875,
-0.023040771484375,
0.035125732421875,
-0.00890350341796875,
-0.045928955078125,
-0.02197265625,
-0.006443023681640625,
-0.0039825439453125,
-0.050567626953125,
-0.031982421875,
0.0289306640625,
-0.05731201171875,
0.0316162109375,
-0.00864410400390625,
0.0396728515625,
-0.0185546875,
0.0183258056640625,
-0.01087188720703125,
0.052947998046875,
0.041900634765625,
0.027374267578125,
-0.006694793701171875,
0.01947021484375,
-0.01169586181640625,
0.009490966796875,
-0.01568603515625,
0.02386474609375,
-0.00457763671875,
0.0142364501953125,
0.01097869873046875,
0.005214691162109375,
0.031890869140625,
0.01288604736328125,
0.0128936767578125,
0.0144195556640625,
0.0249176025390625,
0.0352783203125,
-0.01776123046875,
0.00884246826171875,
0.023956298828125,
-0.00009131431579589844,
-0.034423828125,
0.0316162109375,
-0.04534912109375,
0.0272064208984375,
-0.07867431640625,
0.005397796630859375,
0.0033893585205078125,
0.045013427734375,
-0.0947265625,
-0.040130615234375,
-0.015899658203125,
-0.0186767578125,
-0.0186920166015625,
0.060028076171875,
-0.004878997802734375,
-0.039947509765625,
-0.06671142578125,
0.026702880859375,
-0.037109375,
0.0045623779296875,
-0.0193634033203125,
0.00978851318359375,
0.019073486328125,
-0.0386962890625,
0.00708770751953125,
0.056182861328125,
-0.0254058837890625,
0.04339599609375,
-0.005207061767578125,
0.007358551025390625,
-0.0291290283203125,
0.031829833984375,
0.0296173095703125,
0.00278472900390625,
-0.0034847259521484375,
0.03961181640625,
-0.0330810546875,
0.046051025390625,
0.0114898681640625,
0.0085906982421875,
0.016632080078125,
-0.0038909912109375,
-0.015167236328125,
-0.009490966796875,
-0.049407958984375,
-0.009552001953125,
-0.01113128662109375,
-0.07025146484375,
0.01000213623046875,
0.005001068115234375,
-0.0369873046875,
0.024566650390625,
0.032562255859375,
-0.014617919921875,
0.017333984375,
-0.004974365234375,
-0.043853759765625,
0.042816162109375,
-0.0360107421875,
0.0199737548828125,
-0.00885772705078125,
-0.039825439453125,
-0.0181884765625,
0.048187255859375,
0.055450439453125,
-0.00725555419921875,
0.00928497314453125,
0.016143798828125,
0.011444091796875,
-0.05621337890625,
-0.0298004150390625,
-0.02685546875,
-0.0031280517578125,
-0.00997161865234375,
-0.01529693603515625,
0.02520751953125,
0.0570068359375,
0.0391845703125,
-0.057830810546875,
0.000017583370208740234,
0.006305694580078125,
-0.0241241455078125,
-0.07708740234375,
0.001682281494140625,
0.01245880126953125,
-0.047576904296875,
0.003688812255859375,
0.09881591796875,
0.041778564453125,
0.0304718017578125,
-0.0252532958984375,
0.02496337890625,
-0.007633209228515625,
-0.03155517578125,
0.038360595703125,
0.001880645751953125,
-0.0150146484375,
0.0027923583984375,
-0.018310546875,
0.0280914306640625,
0.018829345703125,
0.0158233642578125,
0.0189971923828125,
-0.003330230712890625,
-0.029937744140625,
0.0457763671875,
-0.044403076171875,
0.056488037109375,
0.008514404296875,
-0.058837890625,
-0.00586700439453125,
0.01476287841796875,
-0.01654052734375,
-0.0609130859375,
-0.0626220703125,
0.01064300537109375,
-0.007232666015625,
0.0205230712890625,
-0.0101318359375,
-0.0287933349609375,
0.036346435546875,
-0.0380859375,
-0.0018110275268554688,
0.0098876953125,
-0.01255035400390625,
0.0290374755859375,
0.02972412109375,
-0.001857757568359375,
-0.01398468017578125,
0.00414276123046875,
-0.03314208984375,
-0.024688720703125,
-0.021270751953125,
0.0440673828125,
-0.0040130615234375,
-0.01485443115234375,
-0.020477294921875,
0.00423431396484375,
0.00951385498046875,
-0.03656005859375,
0.0222625732421875,
0.0034027099609375,
0.056732177734375,
0.036376953125,
0.0140228271484375,
-0.0224609375,
-0.0054931640625,
-0.07086181640625,
-0.0068511962890625,
0.003482818603515625,
0.0099334716796875,
-0.0272979736328125,
-0.0131988525390625,
-0.006229400634765625,
0.01410675048828125,
-0.035552978515625,
-0.042144775390625,
0.0116729736328125,
0.0145416259765625,
-0.020721435546875,
0.0030574798583984375,
-0.01337432861328125,
0.0302734375,
-0.0135040283203125,
-0.01152801513671875,
0.019500732421875,
-0.0292510986328125,
0.007633209228515625,
-0.06402587890625,
-0.03704833984375,
0.00836944580078125,
-0.0208282470703125,
0.0216217041015625,
-0.015869140625,
-0.00795745849609375,
-0.0016508102416992188,
-0.035797119140625,
0.0195465087890625,
0.04620361328125,
0.045867919921875,
0.040557861328125,
-0.03289794921875,
-0.007579803466796875,
0.034881591796875,
0.028228759765625,
-0.035919189453125,
0.017303466796875,
0.049713134765625,
0.0199737548828125,
-0.0350341796875,
0.001251220703125,
0.021942138671875,
-0.01776123046875,
-0.016632080078125,
0.038299560546875,
0.0159454345703125,
0.003490447998046875,
-0.029754638671875,
-0.006549835205078125,
0.056396484375,
0.00945281982421875,
0.0196990966796875,
-0.00714874267578125,
0.0240631103515625,
0.034576416015625,
0.00975799560546875,
-0.0062408447265625,
0.027069091796875,
-0.018035888671875,
0.0477294921875,
0.022308349609375,
-0.02166748046875,
-0.04339599609375,
0.034149169921875,
-0.028839111328125,
0.022308349609375,
-0.01212310791015625,
-0.043365478515625,
0.01224517822265625,
0.0257415771484375,
0.020172119140625,
0.0251007080078125,
0.01910400390625,
-0.038330078125,
0.01953125,
0.00711822509765625,
-0.0252532958984375,
-0.0172882080078125,
0.00856781005859375,
0.07135009765625,
0.01052093505859375,
-0.05841064453125,
0.005069732666015625,
0.0287628173828125,
0.0081024169921875,
-0.00682830810546875,
0.050872802734375,
-0.0038394927978515625,
-0.0115509033203125,
-0.038299560546875,
-0.1094970703125,
0.00363922119140625,
0.0287628173828125,
-0.03961181640625,
-0.0404052734375,
0.00838470458984375,
0.01537322998046875,
-0.0225677490234375,
-0.01068115234375,
-0.0181884765625,
-0.0123138427734375,
0.00962066650390625,
-0.06121826171875,
0.049591064453125,
-0.04315185546875,
0.04461669921875,
0.0733642578125,
-0.016815185546875,
0.0207061767578125,
0.01007843017578125,
0.0189056396484375,
0.0190582275390625,
0.039794921875,
0.00649261474609375,
-0.0438232421875,
-0.0048828125,
-0.01739501953125,
0.011962890625,
0.023590087890625,
-0.00522613525390625,
-0.0298309326171875,
0.0129241943359375,
0.01326751708984375,
0.0012454986572265625,
0.0241546630859375,
0.07080078125,
-0.0006937980651855469,
0.0038433074951171875,
-0.028167724609375,
0.0012712478637695312,
-0.035919189453125,
-0.0225372314453125,
-0.015899658203125,
0.0345458984375,
-0.0517578125,
-0.04437255859375,
-0.043609619140625,
-0.0570068359375,
-0.040008544921875,
0.0079193115234375,
-0.01207733154296875,
0.001285552978515625,
0.09429931640625,
0.020599365234375,
-0.049468994140625,
0.01045989990234375,
-0.00640869140625,
-0.0171356201171875,
0.023529052734375,
0.00164794921875,
-0.0310211181640625,
0.043853759765625,
-0.01160430908203125,
0.0293121337890625,
0.03521728515625,
-0.0161285400390625,
-0.014068603515625,
-0.027801513671875,
0.02862548828125,
-0.007099151611328125,
0.0176849365234375,
0.0302886962890625,
0.01065826416015625,
-0.00485992431640625,
-0.038360595703125,
0.0084686279296875,
-0.0204925537109375,
-0.007198333740234375,
0.02154541015625,
-0.0229339599609375,
0.003559112548828125,
-0.0352783203125,
0.05523681640625,
-0.049835205078125,
-0.01141357421875,
0.01111602783203125,
-0.040679931640625,
0.01276397705078125,
-0.00788116455078125,
-0.0298614501953125,
0.0149993896484375,
-0.0244140625,
-0.040191650390625,
0.0654296875,
0.00487518310546875,
0.007740020751953125,
-0.01181793212890625,
0.02703857421875,
-0.0253753662109375,
-0.09295654296875,
0.035247802734375,
-0.08587646484375,
-0.015869140625,
-0.05340576171875,
-0.0003108978271484375,
-0.0033626556396484375,
0.09674072265625,
-0.039520263671875,
-0.0084381103515625,
-0.005950927734375,
-0.00009369850158691406,
0.002498626708984375,
-0.0220489501953125,
-0.045654296875,
-0.031982421875,
-0.059234619140625,
0.01239013671875,
0.011810302734375,
-0.0259246826171875,
-0.0233612060546875,
0.02362060546875,
-0.05615234375,
-0.0211639404296875,
0.04156494140625,
-0.03350830078125,
0.01317596435546875,
0.0200653076171875,
0.012481689453125,
-0.0120391845703125,
-0.04345703125,
-0.00615692138671875,
-0.072509765625,
-0.0029850006103515625,
-0.0041351318359375,
0.0198974609375,
-0.00421905517578125,
-0.0127410888671875,
-0.0197601318359375,
0.025115966796875,
0.05523681640625,
-0.001186370849609375,
0.0340576171875,
-0.0197296142578125,
-0.018218994140625,
-0.00720977783203125,
0.0241546630859375,
-0.034881591796875,
0.0012769699096679688,
-0.005100250244140625,
-0.0252685546875,
0.0693359375,
-0.0203399658203125,
0.0275421142578125,
-0.0010271072387695312,
-0.038970947265625,
-0.07183837890625,
-0.040924072265625,
-0.03546142578125,
-0.01666259765625,
-0.01226806640625,
-0.020416259765625,
-0.04278564453125,
-0.0518798828125,
0.02435302734375,
-0.0009222030639648438,
0.00797271728515625,
0.00759124755859375,
0.058013916015625,
0.004695892333984375,
-0.00846099853515625,
-0.0210418701171875,
0.0276031494140625,
0.03033447265625,
0.0022125244140625,
0.01126861572265625,
-0.026519775390625,
-0.01526641845703125,
0.049224853515625,
-0.0159454345703125,
-0.019378662109375,
-0.0261077880859375,
0.04339599609375,
0.001712799072265625,
-0.0010118484497070312,
0.0038318634033203125,
-0.044769287109375,
0.06396484375,
0.00508880615234375,
0.00174713134765625,
-0.0130767822265625,
0.022674560546875,
0.051055908203125,
-0.0013990402221679688,
-0.00960540771484375,
-0.047637939453125,
-0.01326751708984375,
0.0174102783203125,
0.039886474609375,
0.0268402099609375,
0.0203704833984375,
0.00492095947265625,
-0.00511932373046875,
-0.022216796875,
-0.0094146728515625,
-0.0126190185546875,
-0.0194244384765625,
0.01959228515625,
0.01152801513671875,
0.006610870361328125,
0.00835418701171875,
-0.018798828125,
0.0166168212890625,
0.0024242401123046875,
-0.033966064453125,
-0.04498291015625,
-0.035186767578125,
-0.007068634033203125,
0.0124053955078125,
0.04205322265625,
-0.002109527587890625,
0.05389404296875,
0.034149169921875,
-0.00437164306640625,
-0.0012912750244140625,
-0.0523681640625,
0.02215576171875,
-0.054656982421875,
-0.0165252685546875,
0.01641845703125,
-0.01412200927734375,
0.003131866455078125,
0.03802490234375,
0.0220794677734375,
0.00342559814453125,
-0.01505279541015625,
0.037384033203125,
0.04443359375,
0.007213592529296875,
0.0255584716796875,
0.0011835098266601562,
-0.0218658447265625,
-0.0233917236328125,
-0.0218048095703125,
-0.03302001953125,
-0.0121307373046875,
-0.0189666748046875,
0.021942138671875,
-0.042083740234375,
-0.0283203125,
0.0657958984375,
-0.0025539398193359375,
0.006710052490234375,
-0.020416259765625,
-0.056976318359375,
-0.025360107421875,
-0.0029506683349609375,
-0.017578125,
0.0033931732177734375,
-0.03314208984375,
-0.01189422607421875,
0.0167083740234375,
-0.03607177734375,
0.0345458984375,
-0.04547119140625,
0.0253448486328125,
-0.011810302734375,
-0.00662994384765625,
-0.059295654296875,
-0.01503753662109375,
0.023773193359375,
-0.0394287109375,
-0.032684326171875,
-0.01546478271484375,
-0.0428466796875,
0.041717529296875,
-0.0183258056640625,
0.03704833984375,
-0.034637451171875,
-0.005275726318359375,
0.0108795166015625,
0.006923675537109375,
0.039398193359375,
-0.0012302398681640625,
-0.055938720703125,
0.01255035400390625,
-0.05322265625,
0.004856109619140625,
-0.018035888671875,
-0.0255279541015625,
-0.0261383056640625,
-0.00775146484375,
0.0391845703125,
0.007343292236328125,
-0.00292205810546875,
-0.0557861328125,
-0.0209197998046875,
0.01439666748046875,
0.03973388671875,
0.0207061767578125,
-0.01515960693359375,
-0.00537109375,
0.014739990234375,
0.0214691162109375,
-0.018798828125,
-0.043731689453125,
-0.018646240234375,
-0.00434112548828125,
-0.02825927734375,
-0.0638427734375,
-0.0056304931640625,
0.0296783447265625,
-0.0293731689453125,
0.060699462890625,
0.048126220703125,
0.01340484619140625,
0.02545166015625,
-0.00626373291015625,
0.0111846923828125,
-0.017486572265625,
-0.015716552734375,
-0.00988006591796875,
0.00426483154296875,
0.0382080078125,
-0.0103302001953125,
0.047088623046875,
-0.0123291015625,
-0.0117340087890625,
0.044403076171875,
-0.049163818359375,
0.04827880859375,
0.0242462158203125,
-0.019561767578125,
0.016387939453125,
-0.0022678375244140625,
-0.0011320114135742188,
0.019622802734375,
-0.0034656524658203125,
0.0117034912109375,
-0.0016431808471679688,
-0.01091766357421875,
-0.025360107421875,
-0.035491943359375,
0.0325927734375,
0.0052032470703125,
-0.013702392578125,
0.0435791015625,
-0.011962890625,
-0.03173828125,
0.0653076171875,
0.042755126953125,
-0.0928955078125,
0.0011005401611328125,
0.029815673828125,
-0.005558013916015625,
-0.0224151611328125,
0.0219268798828125,
-0.006076812744140625,
0.01497650146484375,
0.00974273681640625,
-0.06292724609375,
-0.02777099609375,
0.0017442703247070312,
-0.00396728515625,
-0.010162353515625,
-0.00653076171875,
0.007415771484375,
0.01169586181640625,
-0.0122222900390625,
-0.0021915435791015625,
0.007602691650390625,
0.0011110305786132812,
-0.007404327392578125,
0.0214080810546875,
-0.00439453125,
-0.01113128662109375,
-0.052093505859375,
0.03399658203125,
-0.0145111083984375,
0.00024068355560302734,
0.04168701171875,
-0.030364990234375,
0.01203155517578125,
0.0208587646484375,
-0.00022912025451660156,
0.0032444000244140625,
-0.01416015625,
-0.0733642578125,
-0.02569580078125,
-0.02349853515625,
0.037078857421875,
0.039642333984375,
-0.0643310546875,
0.035125732421875,
-0.0254669189453125,
-0.0251007080078125,
-0.0166015625,
-0.055633544921875,
0.0689697265625,
-0.060943603515625,
0.0112762451171875,
0.00024056434631347656,
0.03179931640625,
0.022216796875,
-0.00890350341796875,
-0.00125885009765625,
-0.035919189453125,
-0.01334381103515625,
-0.0164794921875,
-0.0204010009765625,
0.007007598876953125,
-0.0195770263671875,
-0.049346923828125,
0.0859375,
-0.0298919677734375,
0.005157470703125,
0.0041656494140625,
0.03778076171875,
0.00023639202117919922,
0.034820556640625,
-0.032135009765625,
0.0254669189453125,
0.022125244140625,
0.03302001953125,
-0.039215087890625,
-0.033477783203125,
0.0082550048828125,
0.0416259765625,
0.07562255859375,
0.0200958251953125,
-0.0195159912109375,
0.0171966552734375,
0.057373046875,
0.037353515625,
-0.016387939453125,
0.0228424072265625,
-0.0004596710205078125,
-0.0092620849609375,
0.033966064453125,
0.00218963623046875,
0.030487060546875,
0.021514892578125,
-0.03228759765625,
0.01507568359375,
0.0156402587890625,
0.0182952880859375,
-0.01084136962890625,
0.00893402099609375,
-0.040374755859375,
-0.0024566650390625,
0.03143310546875,
-0.0162353515625,
0.02679443359375,
0.036895751953125,
0.07110595703125,
-0.04547119140625,
0.036376953125,
-0.0382080078125,
0.075439453125,
0.0021820068359375,
0.038665771484375,
0.04241943359375,
0.0141448974609375,
0.06427001953125,
-0.0023651123046875,
0.02215576171875,
0.0089263916015625,
0.0041046142578125,
0.044952392578125,
0.0234375,
0.0236053466796875,
-0.027679443359375,
0.021697998046875,
0.0190582275390625,
0.046722412109375,
-0.04638671875,
-0.047698974609375,
0.025482177734375,
0.04095458984375,
-0.006320953369140625,
0.00644683837890625,
0.0022907257080078125,
-0.003444671630859375,
0.07110595703125,
-0.07208251953125,
-0.013763427734375,
0.0230560302734375,
0.05291748046875,
-0.013946533203125,
-0.01267242431640625,
-0.045562744140625,
-0.05792236328125,
-0.03662109375,
-0.0132598876953125,
0.0027008056640625,
0.0755615234375,
0.046630859375,
0.056854248046875,
-0.035003662109375,
-0.04168701171875,
0.0255889892578125,
0.005100250244140625,
0.008087158203125,
-0.0379638671875,
0.025848388671875,
-0.0155487060546875,
-0.0088958740234375,
0.0016298294067382812,
0.01055145263671875,
0.024322509765625,
0.06060791015625,
0.04791259765625,
-0.02056884765625,
-0.0149078369140625,
0.050445556640625,
-0.014068603515625,
-0.01021575927734375,
-0.03460693359375,
0.01495361328125,
0.02252197265625,
0.00499725341796875,
0.0026950836181640625,
0.002193450927734375,
0.047882080078125,
0.004199981689453125,
0.025238037109375,
0.007503509521484375,
-0.0275421142578125,
0.05535888671875,
-0.01113128662109375,
0.0723876953125,
0.0203094482421875,
-0.06536865234375,
-0.0041961669921875,
-0.06964111328125,
-0.057281494140625,
0.049835205078125,
0.045562744140625,
-0.00274658203125,
-0.008758544921875,
-0.004261016845703125,
-0.037841796875,
0.04351806640625,
0.00876617431640625,
0.004184722900390625,
-0.0243988037109375,
-0.00495147705078125,
-0.03131103515625,
-0.01763916015625,
-0.01369476318359375,
0.0038051605224609375,
0.0269317626953125,
-0.0092620849609375,
0.0496826171875,
-0.004421234130859375,
0.004108428955078125,
-0.0408935546875,
0.058441162109375,
-0.07208251953125,
-0.031036376953125,
0.03363037109375,
0.0110626220703125,
0.00862884521484375,
-0.0016088485717773438,
-0.0030498504638671875,
0.0220947265625,
0.0357666015625,
-0.038726806640625,
0.0119476318359375,
-0.005855560302734375,
0.012298583984375,
-0.0177001953125,
0.05047607421875,
-0.0170440673828125,
-0.02020263671875,
-0.06512451171875,
-0.0237884521484375,
0.0462646484375,
0.0016803741455078125,
-0.03326416015625,
0.0220794677734375,
-0.0142822265625,
-0.0106964111328125,
0.01324462890625,
-0.0199432373046875,
0.0132598876953125,
0.03875732421875,
-0.034576416015625,
-0.044342041015625,
0.02117919921875,
-0.005126953125,
-0.022369384765625,
0.033599853515625,
0.0068359375,
0.0102081298828125,
-0.05133056640625,
-0.004383087158203125,
0.0287017822265625,
0.035400390625,
-0.0281219482421875,
0.0285797119140625,
-0.004596710205078125,
-0.00789642333984375,
0.0301513671875,
-0.034027099609375,
-0.0310821533203125,
-0.0228424072265625,
-0.01024627685546875,
0.0235443115234375,
-0.0035800933837890625,
-0.034637451171875,
-0.05963134765625,
0.01837158203125,
0.06268310546875,
-0.0129547119140625,
-0.0066680908203125,
0.0277099609375,
-0.0770263671875,
0.0377197265625,
0.006229400634765625,
-0.0770263671875,
0.0247039794921875,
0.0295562744140625,
0.0066070556640625,
0.00135040283203125,
-0.036224365234375,
-0.038726806640625,
-0.0265045166015625,
0.0230255126953125,
0.027801513671875,
-0.01421356201171875,
-0.0477294921875,
0.036163330078125,
-0.0011272430419921875,
0.069580078125,
0.001926422119140625,
-0.0235748291015625,
0.01189422607421875,
0.01194000244140625,
-0.0278778076171875,
-0.05169677734375,
0.02593994140625,
-0.06317138671875,
-0.01396942138671875,
-0.0264129638671875,
0.01078033447265625,
0.034820556640625,
-0.027435302734375,
-0.07574462890625,
0.0178070068359375,
-0.024322509765625,
-0.0298614501953125,
-0.048797607421875,
0.024627685546875,
-0.0162353515625,
0.014404296875,
0.00034046173095703125,
-0.0243377685546875,
-0.00823974609375,
0.0188140869140625,
0.020782470703125,
0.0201568603515625,
0.017822265625,
0.0159454345703125,
-0.056182861328125,
-0.0029506683349609375,
-0.0166015625,
0.017303466796875,
0.0276336669921875,
-0.0159912109375,
0.017822265625,
0.033966064453125,
-0.057861328125,
-0.0160369873046875,
-0.0265350341796875,
0.00018727779388427734,
-0.0015325546264648438,
-0.05517578125,
-0.03436279296875,
-0.042266845703125,
0.06414794921875,
0.009368896484375,
0.0193328857421875,
-0.01438140869140625,
-0.060455322265625,
-0.036376953125,
-0.0258026123046875,
-0.002819061279296875,
0.01373291015625,
-0.0494384765625,
0.0311431884765625,
-0.0125885009765625,
0.0033435821533203125,
-0.0292510986328125,
-0.004974365234375,
-0.01036834716796875,
-0.005168914794921875,
0.005428314208984375,
-0.019561767578125,
-0.0178680419921875,
0.064453125,
-0.07568359375,
0.0208282470703125,
-0.01137542724609375,
-0.035064697265625,
-0.0169830322265625,
-0.05389404296875,
-0.0019178390502929688,
-0.01421356201171875,
0.0010509490966796875,
-0.0046234130859375,
-0.00507354736328125,
0.00812530517578125,
-0.00040602684020996094,
0.012664794921875,
0.01218414306640625,
-0.0207977294921875,
0.017608642578125,
0.003993988037109375,
0.0286865234375,
-0.005695343017578125,
0.0268096923828125,
0.034271240234375,
0.020111083984375,
0.00653839111328125,
-0.04034423828125,
-0.0182647705078125,
0.0323486328125,
-0.035858154296875,
-0.004680633544921875,
-0.038177490234375,
-0.0158233642578125,
0.00927734375,
-0.0239105224609375,
0.0006756782531738281,
-0.0160675048828125,
0.005035400390625,
-0.006671905517578125,
-0.01334381103515625,
0.0090179443359375
] |
dd4a95cd42ebe1f56c09f3304b411b2ed646c98f
|
Wordpress Stackexchange
Q: is it possible to get complete wordpress blog post in a rss feed? I want to include images, time and date stamp?
I'm using the google feed-control Api to load rss feeds but only get the title and body text from it.
I would like to render the entire post blog post using rss feed, also if there is a better way to parse a feed other than the google feed control API
http://code.google.com/apis/ajax/playground/#feed_control
Thanks
A: To add your complete content to your RSS feed, go to Admin >> Settings >> Reading >> For each article in a feed, show >> Full text
|
Q: is it possible to get complete wordpress blog post in a rss feed? I want to include images, time and date stamp?
I'm using the google feed-control Api to load rss feeds but only get the title and body text from it.
I would like to render the entire post blog post using rss feed, also if there is a better way to parse a feed other than the google feed control API
http://code.google.com/apis/ajax/playground/#feed_control
Thanks
A: To add your complete content to your RSS feed, go to Admin >> Settings >> Reading >> For each article in a feed, show >> Full text
|
wordpress
|
{
"language": "en",
"length": 104,
"provenance": "stackexchange_00019.jsonl.gz:419189",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49442"
}
|
[
0.047454833984375,
0.01331329345703125,
-0.0025005340576171875,
0.0236053466796875,
0.005283355712890625,
-0.0301361083984375,
0.053009033203125,
-0.05633544921875,
-0.020599365234375,
-0.00438690185546875,
-0.037139892578125,
-0.004261016845703125,
-0.040863037109375,
-0.018157958984375,
0.0028820037841796875,
-0.08270263671875,
0.071533203125,
-0.0509033203125,
0.05950927734375,
0.0181427001953125,
-0.004299163818359375,
0.061248779296875,
0.09228515625,
0.006313323974609375,
0.016265869140625,
0.031219482421875,
0.053466796875,
-0.01219940185546875,
0.00972747802734375,
0.00286865234375,
0.00884246826171875,
-0.0250396728515625,
0.03759765625,
0.0082244873046875,
-0.03271484375,
-0.0194549560546875,
-0.028656005859375,
0.004116058349609375,
-0.0271453857421875,
0.02984619140625,
-0.00704193115234375,
0.003948211669921875,
0.038818359375,
0.0156707763671875,
0.00783538818359375,
-0.0034084320068359375,
-0.011962890625,
-0.0655517578125,
-0.00350189208984375,
-0.0087432861328125,
0.007678985595703125,
0.024932861328125,
0.015899658203125,
-0.0136871337890625,
-0.003635406494140625,
-0.01096343994140625,
0.0296630859375,
0.002674102783203125,
0.05328369140625,
-0.081298828125,
-0.0670166015625,
-0.036468505859375,
0.059417724609375,
0.028289794921875,
0.0083465576171875,
0.01145172119140625,
0.059234619140625,
0.0176239013671875,
-0.0197601318359375,
-0.0167083740234375,
0.01055908203125,
-0.0017290115356445312,
-0.01103973388671875,
-0.04412841796875,
0.00688934326171875,
0.0208587646484375,
-0.03533935546875,
-0.046142578125,
0.0120086669921875,
0.0124359130859375,
0.0115966796875,
0.0157012939453125,
-0.02752685546875,
-0.04095458984375,
0.01149749755859375,
-0.0243682861328125,
-0.008056640625,
-0.013641357421875,
-0.0258026123046875,
-0.039031982421875,
-0.024627685546875,
-0.029876708984375,
-0.08111572265625,
0.0200347900390625,
0.0029850006103515625,
-0.017303466796875,
-0.0138397216796875,
0.01392364501953125,
-0.0191192626953125,
0.035980224609375,
-0.034942626953125,
-0.00798797607421875,
0.0112762451171875,
-0.0260162353515625,
-0.008880615234375,
0.00799560546875,
0.01690673828125,
0.0322265625,
0.04052734375,
0.02752685546875,
-0.0162353515625,
0.047454833984375,
-0.014678955078125,
-0.0322265625,
-0.0216522216796875,
0.0251007080078125,
-0.03179931640625,
0.006069183349609375,
0.0087890625,
-0.00965118408203125,
0.00963592529296875,
0.0216827392578125,
-0.039642333984375,
0.037994384765625,
-0.006256103515625,
0.0030574798583984375,
0.0016851425170898438,
-0.0034503936767578125,
-0.033538818359375,
0.0004315376281738281,
0.0110321044921875,
0.05059814453125,
-0.00859832763671875,
0.0238037109375,
-0.0297393798828125,
-0.004917144775390625,
-0.0166015625,
-0.0208282470703125,
-0.030792236328125,
0.007965087890625,
-0.0235443115234375,
-0.0144500732421875,
0.0305023193359375,
-0.043487548828125,
0.01375579833984375,
0.0159149169921875,
0.004062652587890625,
0.014068603515625,
0.0145111083984375,
0.0211029052734375,
-0.04547119140625,
0.0275115966796875,
0.0079193115234375,
0.03350830078125,
0.02679443359375,
-0.037353515625,
0.04345703125,
-0.039154052734375,
0.057769775390625,
-0.04205322265625,
0.0244903564453125,
-0.00754547119140625,
-0.0114898681640625,
-0.0035572052001953125,
-0.031463623046875,
0.003482818603515625,
-0.0263824462890625,
-0.004161834716796875,
0.024169921875,
-0.0246429443359375,
-0.004070281982421875,
0.01039886474609375,
0.0239105224609375,
0.0081634521484375,
0.00323486328125,
0.01103973388671875,
0.021087646484375,
-0.0293731689453125,
0.01123046875,
0.033538818359375,
-0.0213623046875,
-0.0265045166015625,
0.0286407470703125,
-0.021209716796875,
-0.0139617919921875,
0.004917144775390625,
0.026947021484375,
0.062042236328125,
-0.006439208984375,
0.042144775390625,
0.01751708984375,
0.00492095947265625,
0.0036163330078125,
0.01280975341796875,
-0.0240325927734375,
-0.034912109375,
0.00948333740234375,
0.006191253662109375,
-0.0240631103515625,
0.0040740966796875,
0.0015401840209960938,
0.013824462890625,
-0.02069091796875,
0.038116455078125,
-0.0246734619140625,
0.016357421875,
-0.004566192626953125,
0.0200958251953125,
-0.03045654296875,
0.0251007080078125,
0.0199432373046875,
-0.01251983642578125,
-0.0128631591796875,
-0.0288543701171875,
0.00099945068359375,
-0.004726409912109375,
-0.027313232421875,
0.0223236083984375,
-0.016876220703125,
0.028656005859375,
-0.031341552734375,
-0.045135498046875,
-0.027618408203125,
0.0230255126953125,
0.07501220703125,
-0.0200958251953125,
-0.00799560546875,
-0.028717041015625,
0.047515869140625,
0.0191497802734375,
-0.07598876953125,
0.0109710693359375,
-0.01763916015625,
-0.012542724609375,
-0.035003662109375,
-0.0113677978515625,
0.0243988037109375,
0.0013179779052734375,
0.0208740234375,
0.0261688232421875,
0.0157928466796875,
0.0197601318359375,
0.01419830322265625,
0.019378662109375,
0.0310516357421875,
-0.0220184326171875,
0.01458740234375,
-0.005290985107421875,
0.05255126953125,
0.10223388671875,
-0.00786590576171875,
-0.0100555419921875,
-0.0113372802734375,
-0.0426025390625,
-0.007568359375,
0.041412353515625,
0.02239990234375,
-0.00653839111328125,
-0.0474853515625,
0.050445556640625,
0.00818634033203125,
0.050262451171875,
-0.0220794677734375,
0.0219573974609375,
0.0262603759765625,
0.0457763671875,
0.063720703125,
0.0804443359375,
-0.0450439453125,
0.00551605224609375,
0.00626373291015625,
0.06915283203125,
0.011260986328125,
0.06793212890625,
0.010589599609375,
-0.015777587890625,
0.00756072998046875,
-0.04144287109375,
-0.005451202392578125,
0.020172119140625,
0.0159454345703125,
-0.005077362060546875,
-0.01971435546875,
-0.001262664794921875,
0.0252227783203125,
-0.048309326171875,
0.0035877227783203125,
0.030853271484375,
0.047943115234375,
0.044189453125,
0.04034423828125,
0.036224365234375,
0.004032135009765625,
0.05023193359375,
0.00962066650390625,
-0.0068511962890625,
0.03875732421875,
-0.0628662109375,
0.056976318359375,
-0.007564544677734375,
0.070068359375,
0.07623291015625,
0.009521484375,
0.017608642578125,
0.00627899169921875,
0.00667572021484375,
0.0177001953125,
-0.007381439208984375,
-0.01351165771484375,
-0.005207061767578125,
-0.04034423828125,
0.0299224853515625,
0.0170440673828125,
0.06317138671875,
-0.012451171875,
-0.031280517578125,
-0.0095367431640625,
0.035400390625,
-0.05511474609375,
-0.04486083984375,
0.020111083984375,
-0.07080078125,
-0.04827880859375,
-0.0250396728515625,
-0.051513671875,
0.01435089111328125,
-0.00226593017578125,
-0.01116943359375,
-0.03509521484375,
-0.0081787109375,
-0.063720703125,
-0.039581298828125,
-0.0731201171875,
0.0391845703125,
-0.008392333984375,
0.020843505859375,
0.004787445068359375,
0.038970947265625,
0.0066070556640625,
-0.045806884765625,
-0.0041961669921875,
0.0899658203125,
-0.0240936279296875,
-0.035552978515625,
-0.0206756591796875,
0.007568359375,
0.018768310546875,
-0.0006389617919921875,
-0.01485443115234375,
0.0183563232421875,
-0.00732421875,
-0.0073394775390625,
-0.02593994140625,
-0.022705078125,
-0.0228424072265625,
0.0200958251953125,
0.034149169921875,
-0.00443267822265625,
0.007537841796875,
-0.04827880859375,
-0.02374267578125,
-0.026153564453125,
-0.07366943359375,
-0.05023193359375,
0.039886474609375,
0.02777099609375,
-0.04571533203125,
-0.01123809814453125,
-0.033294677734375,
-0.00798797607421875,
0.054290771484375,
-0.028717041015625,
-0.0225067138671875,
-0.033782958984375,
-0.061126708984375,
-0.01369476318359375,
-0.006404876708984375,
-0.034759521484375,
0.041656494140625,
-0.001346588134765625,
-0.006744384765625,
-0.0303192138671875,
-0.00115966796875,
-0.06365966796875,
-0.00281524658203125,
0.026885986328125,
0.00502777099609375,
0.00949859619140625,
0.0026950836181640625,
-0.02752685546875,
-0.00032520294189453125,
0.045684814453125,
0.0199127197265625,
-0.0252685546875,
-0.044769287109375,
0.002338409423828125,
-0.0261993408203125,
-0.06341552734375,
0.006618499755859375,
-0.00835418701171875,
-0.01358795166015625,
0.006984710693359375,
-0.00934600830078125,
0.005645751953125,
0.01409912109375,
-0.03472900390625,
0.0240020751953125,
-0.020355224609375,
0.0260772705078125,
-0.01311492919921875,
-0.0138702392578125,
-0.01531982421875,
-0.00560760498046875,
-0.036041259765625,
-0.01161956787109375,
-0.00251007080078125,
-0.041839599609375,
-0.02325439453125,
0.0009655952453613281,
0.030303955078125,
0.0152587890625,
-0.036468505859375,
-0.01346588134765625,
0.0274505615234375,
-0.00897979736328125,
0.0265655517578125,
0.01485443115234375,
0.00637054443359375,
0.0110931396484375,
0.0282745361328125,
0.02606201171875,
-0.022613525390625,
-0.018798828125,
-0.0104217529296875,
-0.00016355514526367188,
-0.00951385498046875,
-0.0284881591796875,
-0.0386962890625,
-0.0141448974609375,
-0.008880615234375,
-0.041259765625,
-0.032684326171875,
0.014556884765625,
0.0188446044921875,
0.0026264190673828125,
0.0132293701171875,
-0.0246429443359375,
-0.031494140625,
0.010498046875,
-0.02783203125,
-0.0217437744140625,
0.0208587646484375,
0.058380126953125,
0.01267242431640625,
0.00640869140625,
-0.06878662109375,
-0.0015697479248046875,
0.0460205078125,
-0.00550079345703125,
0.0791015625,
0.0411376953125,
-0.03680419921875,
0.11297607421875,
0.0093536376953125,
0.037261962890625,
-0.0247955322265625,
0.0625,
-0.004978179931640625,
-0.00261688232421875,
0.017364501953125,
0.00988006591796875,
-0.036590576171875,
0.01544189453125,
-0.0258636474609375,
0.0016164779663085938,
-0.00806427001953125,
0.011993408203125,
-0.031768798828125,
0.0423583984375,
0.0033416748046875,
-0.015411376953125,
0.0081024169921875,
0.0033168792724609375,
-0.023590087890625,
0.01183319091796875,
-0.01154327392578125,
-0.0328369140625,
-0.01087188720703125,
0.003543853759765625,
-0.01068115234375,
-0.04058837890625,
-0.0034008026123046875,
-0.00308990478515625,
0.006626129150390625,
-0.019775390625,
0.01100921630859375,
0.00571441650390625,
-0.0262298583984375,
-0.012481689453125,
-0.03387451171875,
-0.02294921875,
0.022430419921875,
0.01200103759765625,
0.027099609375,
0.0052337646484375,
0.05914306640625,
0.07452392578125,
-0.005889892578125,
-0.018707275390625,
-0.0162506103515625,
0.0225677490234375,
-0.056915283203125,
0.022003173828125,
-0.011871337890625,
0.009368896484375,
0.0218353271484375,
0.07232666015625,
-0.02392578125,
0.05450439453125,
-0.01751708984375,
0.0430908203125,
0.0184478759765625,
0.038330078125,
0.01617431640625,
-0.00614166259765625,
-0.0256195068359375,
0.030120849609375,
-0.0253448486328125,
-0.0252227783203125,
-0.0291595458984375,
0.020599365234375,
0.017669677734375,
0.009979248046875,
-0.0164794921875,
0.00827789306640625,
-0.00246429443359375,
-0.01280975341796875,
0.03143310546875,
0.00804901123046875,
-0.019134521484375,
-0.0357666015625,
-0.0295867919921875,
0.04046630859375,
0.0200347900390625,
-0.0031375885009765625,
0.047637939453125,
0.0193023681640625,
0.051666259765625,
0.0131378173828125,
0.006366729736328125,
-0.002422332763671875,
-0.0012598037719726562,
-0.0285186767578125,
-0.04974365234375,
-0.0166168212890625,
-0.00630950927734375,
0.001148223876953125,
-0.018768310546875,
-0.01079559326171875,
0.05474853515625,
0.00567626953125,
0.0015153884887695312,
-0.05352783203125,
0.025390625,
-0.05853271484375,
-0.01126861572265625,
0.050506591796875,
0.01349639892578125,
-0.04302978515625,
0.004917144775390625,
-0.06268310546875,
-0.034759521484375,
-0.032470703125,
-0.02947998046875,
-0.061248779296875,
-0.024627685546875,
-0.01184844970703125,
0.0205841064453125,
-0.0117034912109375,
0.034210205078125,
0.002788543701171875,
0.04791259765625,
-0.01091766357421875,
0.0810546875,
0.00033593177795410156,
0.046661376953125,
-0.00041365623474121094,
0.05145263671875,
0.00786590576171875,
0.018280029296875,
-0.05438232421875,
-0.02166748046875,
-0.0017156600952148438,
-0.0653076171875,
-0.045562744140625,
0.02154541015625,
-0.039459228515625,
0.035400390625,
0.0164337158203125,
0.002452850341796875,
0.0017480850219726562,
-0.037017822265625,
0.0092926025390625,
-0.013336181640625,
0.0345458984375,
-0.032989501953125,
-0.03594970703125,
0.04803466796875,
0.0169830322265625,
0.0085296630859375,
0.00867462158203125,
0.0227203369140625,
-0.0248260498046875,
0.0186309814453125,
-0.0274200439453125,
-0.035614013671875,
-0.01322174072265625,
0.034271240234375,
0.049346923828125,
0.0085296630859375,
0.032440185546875,
0.0241241455078125,
0.01129150390625,
-0.005218505859375,
0.036834716796875,
-0.047760009765625,
-0.060333251953125,
-0.022705078125,
-0.00940704345703125,
-0.007106781005859375,
-0.021026611328125,
-0.01195526123046875,
0.01143646240234375,
0.02398681640625,
0.0557861328125,
-0.035369873046875,
0.0206756591796875,
0.0208740234375,
-0.0184326171875,
0.04296875,
-0.00640106201171875,
0.010528564453125,
-0.0084075927734375,
0.01470947265625,
-0.006137847900390625,
-0.033172607421875,
0.0054168701171875,
-0.0108489990234375,
-0.00982666015625,
0.0029964447021484375,
0.028350830078125,
0.01242828369140625,
-0.053802490234375,
-0.01403045654296875,
0.026336669921875,
-0.0071258544921875,
-0.0081939697265625,
-0.002742767333984375,
-0.01519012451171875,
-0.017974853515625,
-0.032684326171875,
0.01056671142578125,
-0.02886962890625,
0.0222320556640625,
-0.0030460357666015625,
-0.0217437744140625,
-0.0032501220703125,
0.033050537109375,
-0.0271148681640625,
0.005313873291015625,
-0.0018596649169921875,
-0.0284271240234375,
-0.04632568359375,
-0.037872314453125,
-0.003940582275390625,
0.04833984375,
0.0207061767578125,
0.0275115966796875,
0.02239990234375,
-0.035614013671875,
-0.0114288330078125,
-0.026641845703125,
0.062255859375,
-0.0177154541015625,
-0.0168609619140625,
0.00742340087890625,
-0.004055023193359375,
0.004398345947265625,
-0.002414703369140625,
0.0465087890625,
-0.030242919921875,
0.023529052734375,
0.00601959228515625,
0.0169525146484375,
-0.0207061767578125,
-0.004520416259765625,
-0.0849609375,
0.1253662109375,
-0.000988006591796875,
0.045562744140625,
0.010589599609375,
0.044281005859375,
-0.021636962890625,
0.017578125,
-0.0185546875,
0.0191497802734375,
-0.0242919921875,
0.0028362274169921875,
-0.0391845703125,
-0.0010957717895507812,
-0.018585205078125,
0.0208892822265625,
0.01788330078125,
0.00415802001953125,
-0.0120849609375,
-0.03961181640625,
-0.006587982177734375,
0.05657958984375,
0.01348114013671875,
0.00022935867309570312,
-0.01328277587890625,
0.03460693359375,
0.0186767578125,
-0.06658935546875,
0.01346588134765625,
-0.0053863525390625,
-0.0187835693359375,
0.01541900634765625,
-0.00881195068359375,
-0.019561767578125,
0.046966552734375,
-0.031524658203125,
0.0092926025390625,
0.017730712890625,
-0.00862884521484375,
-0.047149658203125,
0.0200958251953125,
0.002948760986328125,
0.055511474609375,
-0.12548828125,
-0.0010881423950195312,
-0.028900146484375,
0.054351806640625,
0.01505279541015625,
0.0478515625,
0.029632568359375,
0.0199737548828125,
0.0634765625,
0.0171356201171875,
0.031524658203125,
0.026031494140625,
-0.0157012939453125,
0.031524658203125,
0.01366424560546875,
0.0080413818359375,
-0.058074951171875,
-0.03179931640625,
0.04400634765625,
0.049102783203125,
-0.032958984375,
-0.0027217864990234375,
0.0085601806640625,
0.00923919677734375,
0.02850341796875,
-0.0192718505859375,
0.039215087890625,
-0.01507568359375,
-0.00768280029296875,
-0.019256591796875,
-0.0111236572265625,
0.0220794677734375,
0.058563232421875,
0.0159759521484375,
0.0167236328125,
-0.036590576171875,
-0.045867919921875,
0.00342559814453125,
-0.0017194747924804688,
-0.0012979507446289062,
0.00951385498046875,
-0.00881195068359375,
0.036041259765625,
-0.040863037109375,
0.0079498291015625,
0.01490020751953125,
0.034149169921875,
0.00942230224609375,
-0.0340576171875,
0.011474609375,
-0.0284423828125,
-0.003559112548828125,
0.0236968994140625,
-0.004718780517578125,
-0.038543701171875,
0.0230865478515625,
0.00473785400390625,
-0.09246826171875,
-0.038421630859375,
0.01079559326171875,
-0.03619384765625,
-0.065185546875,
-0.004669189453125,
-0.05303955078125,
0.03485107421875,
-0.01096343994140625,
0.072021484375,
-0.0076446533203125,
0.03118896484375,
0.0095672607421875,
0.006107330322265625,
0.00954437255859375,
0.01335906982421875,
0.0145111083984375,
0.004238128662109375,
-0.0296783447265625,
0.027557373046875,
-0.07318115234375,
-0.002468109130859375,
-0.03802490234375,
-0.07525634765625,
0.0297088623046875,
0.04779052734375,
-0.0283050537109375,
0.0122833251953125,
-0.01422119140625,
-0.00038623809814453125,
0.01041412353515625,
-0.01486968994140625,
-0.00603485107421875,
0.052703857421875,
0.0209808349609375,
0.0257568359375,
-0.04949951171875,
-0.03106689453125,
-0.0269775390625,
0.033538818359375,
0.0295562744140625,
0.00601959228515625,
0.025543212890625,
0.029449462890625,
-0.005794525146484375,
-0.00147247314453125,
0.0009326934814453125,
0.00774383544921875,
-0.036163330078125,
0.01654052734375,
0.0176849365234375,
-0.012786865234375,
-0.04473876953125,
0.0266265869140625,
0.0240478515625,
-0.020294189453125,
0.033721923828125,
-0.034454345703125,
0.0093231201171875,
-0.0256500244140625,
-0.01129913330078125,
-0.051422119140625,
-0.0121002197265625,
0.004314422607421875,
-0.00542449951171875,
-0.00399017333984375,
-0.022613525390625,
0.01519775390625,
0.0418701171875,
0.029571533203125,
-0.01215362548828125,
0.0212249755859375,
-0.041290283203125,
0.0247802734375,
0.033233642578125,
0.00756072998046875,
0.0036563873291015625,
0.035888671875,
-0.00975799560546875,
0.0267486572265625,
0.0035877227783203125,
0.01495361328125,
0.01873779296875,
-0.019744873046875,
0.0265655517578125,
0.0168914794921875,
0.08184814453125,
0.005596160888671875,
0.021759033203125,
-0.00882720947265625,
0.016265869140625,
-0.0244293212890625,
-0.01629638671875,
-0.0181121826171875,
-0.031951904296875,
-0.034759521484375,
-0.0074615478515625,
-0.027801513671875,
-0.0738525390625,
-0.0291595458984375,
-0.01122283935546875,
-0.0045013427734375,
-0.0369873046875,
0.00460052490234375,
0.0036258697509765625,
-0.0216217041015625,
0.04412841796875,
-0.05419921875,
-0.055389404296875,
0.03424072265625,
0.0802001953125,
-0.005035400390625,
-0.03936767578125,
0.00623321533203125,
0.009979248046875,
-0.0300445556640625,
0.01126861572265625,
0.003337860107421875,
-0.035064697265625,
0.028533935546875,
0.0130462646484375,
0.036712646484375,
0.044464111328125,
0.0423583984375,
-0.004360198974609375,
-0.024017333984375,
0.0283966064453125,
-0.0193023681640625,
-0.06103515625,
0.02593994140625,
-0.064697265625,
-0.0253143310546875,
0.006092071533203125,
-0.043487548828125,
-0.0175933837890625,
-0.045867919921875,
-0.07501220703125,
0.07958984375,
-0.00724029541015625,
-0.04150390625,
-0.045501708984375,
0.02325439453125,
0.037811279296875,
-0.0289306640625,
-0.016082763671875,
-0.000179290771484375,
-0.04833984375,
-0.0115814208984375,
0.0134735107421875,
0.030517578125,
0.0218505859375,
0.0119171142578125,
-0.00553131103515625,
0.018829345703125,
-0.0012311935424804688,
-0.0019550323486328125,
0.0011568069458007812,
-0.0160369873046875,
0.022430419921875,
0.032745361328125,
-0.04248046875,
-0.0118865966796875,
0.004543304443359375,
0.033355712890625,
-0.019683837890625,
-0.049713134765625,
-0.06317138671875,
-0.016510009765625,
0.11663818359375,
0.0736083984375,
0.041351318359375,
-0.06793212890625,
-0.0134735107421875,
-0.010833740234375,
-0.0174407958984375,
0.00629425048828125,
0.015899658203125,
-0.0270843505859375,
0.0163116455078125,
-0.0091552734375,
-0.0006508827209472656,
-0.0136871337890625,
-0.0531005859375,
-0.039581298828125,
-0.024566650390625,
-0.077392578125,
0.003467559814453125,
-0.0133056640625,
0.01044464111328125,
0.045928955078125,
-0.0404052734375,
-0.0224609375,
0.0016880035400390625,
-0.001049041748046875,
0.00438690185546875,
-0.0121307373046875,
-0.0382080078125,
-0.01013946533203125,
0.01044464111328125,
0.0036144256591796875,
-0.0005946159362792969,
-0.006317138671875,
0.0206146240234375,
0.0191192626953125,
-0.01392364501953125,
0.004215240478515625,
0.02044677734375,
0.006744384765625,
0.0141143798828125,
-0.0268707275390625,
-0.01001739501953125,
0.031494140625,
-0.0009822845458984375,
-0.02423095703125,
-0.0208740234375,
0.034393310546875,
-0.0274505615234375,
-0.01262664794921875,
-0.004116058349609375,
-0.043701171875,
-0.01393890380859375,
0.033355712890625,
-0.0182342529296875,
-0.046356201171875,
0.038787841796875,
-0.037841796875,
0.01438140869140625,
0.0091705322265625
] |
a4f1fa8d043c15192e1fe7b740fa33b794e429cb
|
Wordpress Stackexchange
Q: Change locale manually at runtime? I wonder, is there a way to change the locale at runtime using WordPress ?
What I mean, is, I have create a custom URL in order to create an XML file with data for integration with another web application. The URL has also a language portion. Lets say this is my URL
http://example.com/custom/url/en
where last portion of the URL is the english language. In that case what I like is the WordPress to generate an English XML. But how can I instruct the WordPress to change the locale in that point of the execution ?
Note that I have to change the locale because I use also system variables that are translated, such us __(), _e() and so on.
A: I don't know if it's possible to do this within a plugin, because of the constants WP requires defined before a certain point, but check for the requested language in wp-config.php and define the necessary constant:
// split URI
$lang = explode('/', $_SERVER['REQUEST_URI']);
// here change to english if requested
if(array_pop($lang) === 'en'){
define('WPLANG', 'en_US');
// otherwise stick to your default language
}else{
define('WPLANG', 'gr_GR');
}
|
Q: Change locale manually at runtime? I wonder, is there a way to change the locale at runtime using WordPress ?
What I mean, is, I have create a custom URL in order to create an XML file with data for integration with another web application. The URL has also a language portion. Lets say this is my URL
http://example.com/custom/url/en
where last portion of the URL is the english language. In that case what I like is the WordPress to generate an English XML. But how can I instruct the WordPress to change the locale in that point of the execution ?
Note that I have to change the locale because I use also system variables that are translated, such us __(), _e() and so on.
A: I don't know if it's possible to do this within a plugin, because of the constants WP requires defined before a certain point, but check for the requested language in wp-config.php and define the necessary constant:
// split URI
$lang = explode('/', $_SERVER['REQUEST_URI']);
// here change to english if requested
if(array_pop($lang) === 'en'){
define('WPLANG', 'en_US');
// otherwise stick to your default language
}else{
define('WPLANG', 'gr_GR');
}
A: I'm trying to do a similiar thing, and the experts on the wp-hackers mailing list (Otto, Nacin) told me this:
Don't try to change WPLANG, you can't change a define'd constant.
Instead, change the global $locale, or put a filter on 'locale'.
So the best solution is to apply a filter on the 'locale' global variable. The only way to do that is by creating a custom plugin. If you put the following piece of code into your functions.php file, it won't work properly because it will run too late in the WP loading sequence.
Your plugin could look like this (I'm just reusing the URI testing part from OneTrickPony, you can replace it with another conditional testing method):
<?php
/*
Plugin Name: Change locale at runtime
Plugin URI: http://wordpress.stackexchange.com/questions/49451/change-locale-at-runtime
*/
function wpsx_redefine_locale($locale) {
// run your tests on the URI
$lang = explode('/', $_SERVER['REQUEST_URI']);
// here change to english if requested
if(array_pop($lang) === 'en'){
$locale = 'en_US';
// otherwise stick to your default language
}else{
$locale = 'gr_GR';
}
return $locale;
}
add_filter('locale','wpsx_redefine_locale',10);
?>
I hope this can help anyone!
A few more warnings (quoting Andrew Nacin), regarding the cost in terms of performance when switching the locale:
It is possible to "switch out" a locale after the default locale is
loaded, but I would advise against that as it is inefficient, unless
your default language is English, in which case it is not so bad.
Default textdomain files are loaded after plugins_loaded and
setup_theme, but before the theme is loaded and before
after_setup_theme fires. Loading English then re-loading the
textdomain into German on the init hook would be fine,
performance-wise, as English has no mo files. But loading Spanish by
default then switching to German would not.
See http://codex.wordpress.org/Plugin_API/Action_Reference for useful info about the loading sequence.
A: At first, ensure that your desired locale is in a list (under "has a language pack"). If confirmed, then use such code:
//set desired locale
add_filter( 'locale', function($locale) {
if ( !is_admin() )
$locale = "zh_TW";
return $locale;
});
If you haven't chosen that language in WP dashboard, then you might need to use installer hook programatically:
//check if it's not install, then install
add_action('wp', 'my_locale_implemention');
function my_locale_implemention()
{
$my_locale = get_locale(); //get_user_locale
if ( !empty($my_locale) && !in_array( $my_locale, get_available_languages() ) ) {
require_once( ABSPATH . 'wp-admin/includes/file.php' );
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
$language = wp_download_language_pack( $my_locale );
if ( $language ) {
if(empty($_POST)) header("location: ".$_SERVER['REQUEST_URI']); exit; //reload page
}
}
}
|
wordpress
|
{
"language": "en",
"length": 605,
"provenance": "stackexchange_00019.jsonl.gz:419192",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49451"
}
|
[
0.022674560546875,
-0.019775390625,
0.0226287841796875,
0.005626678466796875,
-0.025909423828125,
-0.01554107666015625,
0.0255126953125,
-0.025604248046875,
-0.019195556640625,
0.005512237548828125,
0.01332855224609375,
-0.0085296630859375,
0.00487518310546875,
-0.04449462890625,
0.03472900390625,
-0.0161285400390625,
0.025360107421875,
-0.007480621337890625,
0.0070648193359375,
-0.020294189453125,
-0.0018339157104492188,
-0.0291595458984375,
0.034454345703125,
0.037353515625,
0.041839599609375,
-0.047882080078125,
0.042938232421875,
-0.030517578125,
0.007335662841796875,
-0.0223236083984375,
0.03582763671875,
0.016448974609375,
0.0094451904296875,
0.022552490234375,
-0.01251220703125,
-0.02880859375,
0.02239990234375,
-0.0022945404052734375,
-0.00962066650390625,
0.038543701171875,
0.051788330078125,
-0.0321044921875,
-0.0296478271484375,
0.044403076171875,
-0.0145111083984375,
-0.05718994140625,
0.067626953125,
-0.01528167724609375,
0.0249176025390625,
0.0105438232421875,
0.022003173828125,
0.0031108856201171875,
0.0181121826171875,
-0.04278564453125,
-0.01959228515625,
-0.01155853271484375,
-0.02984619140625,
0.0252838134765625,
-0.0010995864868164062,
0.0026035308837890625,
-0.0008916854858398438,
0.0216827392578125,
0.00897216796875,
0.0140533447265625,
-0.007564544677734375,
0.0007162094116210938,
-0.007965087890625,
0.01441192626953125,
-0.0279083251953125,
-0.02197265625,
0.01507568359375,
-0.0300445556640625,
-0.0214385986328125,
-0.02777099609375,
-0.0178375244140625,
0.03515625,
-0.0204925537109375,
-0.0367431640625,
0.0075225830078125,
0.0030536651611328125,
0.037445068359375,
-0.005489349365234375,
0.018890380859375,
-0.022247314453125,
0.0229644775390625,
-0.007171630859375,
-0.00841522216796875,
-0.0168609619140625,
-0.061767578125,
-0.02264404296875,
-0.036590576171875,
0.0164794921875,
-0.10052490234375,
-0.005123138427734375,
0.004726409912109375,
-0.0139007568359375,
-0.0193939208984375,
0.0299224853515625,
-0.022735595703125,
0.00868988037109375,
-0.006805419921875,
-0.018585205078125,
0.0007176399230957031,
-0.027435302734375,
0.0028629302978515625,
-0.002834320068359375,
-0.007389068603515625,
0.0687255859375,
0.054656982421875,
0.049713134765625,
0.0074920654296875,
0.0305633544921875,
-0.0145111083984375,
-0.034515380859375,
-0.0191650390625,
0.049713134765625,
0.0020904541015625,
-0.01529693603515625,
0.0014390945434570312,
-0.005146026611328125,
-0.005237579345703125,
0.020477294921875,
-0.006561279296875,
-0.0162353515625,
-0.0016946792602539062,
-0.0190887451171875,
-0.00914764404296875,
-0.01023101806640625,
-0.0184478759765625,
0.034515380859375,
-0.043609619140625,
-0.00714874267578125,
0.056549072265625,
0.05767822265625,
0.0235748291015625,
-0.0222930908203125,
0.049896240234375,
0.038909912109375,
0.009674072265625,
0.00865936279296875,
-0.0031070709228515625,
0.0025119781494140625,
0.01263427734375,
-0.005191802978515625,
-0.00959014892578125,
0.002208709716796875,
0.0291595458984375,
0.040374755859375,
-0.023590087890625,
-0.044647216796875,
0.06781005859375,
-0.0264739990234375,
0.036285400390625,
-0.0016765594482421875,
-0.008331298828125,
-0.045166015625,
0.048309326171875,
-0.0479736328125,
-0.005504608154296875,
-0.052581787109375,
-0.0274200439453125,
-0.04486083984375,
-0.0191497802734375,
-0.033843994140625,
-0.055816650390625,
0.05560302734375,
0.003387451171875,
0.004283905029296875,
0.0088958740234375,
-0.0267333984375,
0.013824462890625,
0.02252197265625,
-0.032867431640625,
-0.0233306884765625,
0.00482177734375,
-0.0009140968322753906,
-0.043060302734375,
0.03900146484375,
0.0167083740234375,
0.04083251953125,
0.04608154296875,
-0.00620269775390625,
0.06707763671875,
0.03228759765625,
-0.040069580078125,
-0.0130767822265625,
0.021881103515625,
0.07769775390625,
0.044342041015625,
0.031280517578125,
-0.00261688232421875,
-0.031280517578125,
-0.0205230712890625,
0.03643798828125,
0.0157470703125,
-0.0005130767822265625,
-0.047454833984375,
0.005527496337890625,
-0.01422882080078125,
-0.035614013671875,
0.020538330078125,
-0.01363372802734375,
0.0215301513671875,
0.0132293701171875,
-0.036102294921875,
0.02862548828125,
-0.0262603759765625,
0.032562255859375,
0.035430908203125,
0.00682830810546875,
-0.0102081298828125,
0.0004248619079589844,
0.022308349609375,
-0.07891845703125,
-0.060089111328125,
0.0227203369140625,
0.0006613731384277344,
0.032745361328125,
0.0172271728515625,
0.002094268798828125,
0.046234130859375,
-0.029327392578125,
0.03118896484375,
0.016143798828125,
0.0011320114135742188,
-0.01392364501953125,
-0.0036373138427734375,
-0.00891876220703125,
0.035491943359375,
0.0025577545166015625,
0.031829833984375,
0.005138397216796875,
-0.0139923095703125,
-0.00035190582275390625,
-0.0160064697265625,
-0.017852783203125,
-0.0040740966796875,
-0.08502197265625,
0.0118865966796875,
0.05780029296875,
0.0202178955078125,
-0.00521087646484375,
-0.00975799560546875,
0.005859375,
0.0216522216796875,
0.034210205078125,
0.045196533203125,
-0.010467529296875,
0.0012540817260742188,
0.03851318359375,
-0.041107177734375,
0.01261138916015625,
0.01236724853515625,
-0.060516357421875,
-0.0151519775390625,
0.05169677734375,
-0.0355224609375,
-0.07318115234375,
0.04876708984375,
-0.0020503997802734375,
0.0154266357421875,
0.01526641845703125,
-0.02239990234375,
0.019683837890625,
0.027252197265625,
-0.022064208984375,
0.0032405853271484375,
0.01045989990234375,
-0.0146331787109375,
0.003467559814453125,
0.0141754150390625,
-0.0153350830078125,
-0.002216339111328125,
0.00031638145446777344,
-0.0594482421875,
0.002300262451171875,
-0.0036830902099609375,
0.0310821533203125,
-0.046142578125,
-0.028961181640625,
-0.015777587890625,
0.053009033203125,
-0.0439453125,
-0.03204345703125,
-0.027435302734375,
-0.051361083984375,
-0.0285186767578125,
-0.0177154541015625,
0.0164947509765625,
-0.01251220703125,
0.034515380859375,
-0.0341796875,
-0.031890869140625,
0.021820068359375,
-0.006862640380859375,
-0.051055908203125,
0.05755615234375,
-0.00844573974609375,
0.0091705322265625,
-0.0205841064453125,
0.049530029296875,
0.050384521484375,
0.0010271072387695312,
-0.0166473388671875,
0.0078887939453125,
-0.019134521484375,
-0.0063018798828125,
0.00852203369140625,
-0.0135650634765625,
0.034576416015625,
-0.1043701171875,
0.006717681884765625,
-0.003875732421875,
0.0010700225830078125,
-0.039642333984375,
-0.04010009765625,
-0.038299560546875,
-0.0272064208984375,
-0.07940673828125,
-0.067626953125,
0.028564453125,
-0.01485443115234375,
0.0201416015625,
0.00991058349609375,
0.003025054931640625,
-0.04095458984375,
0.0172271728515625,
-0.0085296630859375,
-0.004055023193359375,
-0.0462646484375,
-0.048248291015625,
-0.07745361328125,
-0.07012939453125,
-0.023040771484375,
0.0175933837890625,
0.0006108283996582031,
0.00335693359375,
0.014739990234375,
0.001468658447265625,
-0.046783447265625,
-0.0118560791015625,
0.045684814453125,
-0.01922607421875,
-0.013153076171875,
0.00006139278411865234,
-0.033935546875,
0.057525634765625,
-0.0266876220703125,
0.0239410400390625,
0.054107666015625,
-0.018524169921875,
0.00342559814453125,
0.007793426513671875,
0.0164031982421875,
0.02825927734375,
-0.022216796875,
-0.0225830078125,
0.0278167724609375,
-0.0019073486328125,
-0.031341552734375,
-0.08172607421875,
0.0198211669921875,
-0.05609130859375,
0.055450439453125,
0.03369140625,
-0.031585693359375,
-0.0005350112915039062,
0.041259765625,
-0.0260467529296875,
-0.0281982421875,
0.053436279296875,
-0.0281829833984375,
0.0264129638671875,
-0.0217742919921875,
-0.058013916015625,
-0.0355224609375,
0.0645751953125,
0.0016222000122070312,
-0.030029296875,
0.018707275390625,
0.003063201904296875,
0.003726959228515625,
-0.033294677734375,
-0.0268096923828125,
-0.007595062255859375,
0.038726806640625,
-0.0225372314453125,
-0.003238677978515625,
0.0281982421875,
-0.0209808349609375,
0.032623291015625,
0.05029296875,
-0.01305389404296875,
-0.01299285888671875,
0.013214111328125,
0.041046142578125,
-0.0592041015625,
-0.05279541015625,
-0.03704833984375,
-0.01367950439453125,
-0.034698486328125,
0.007099151611328125,
-0.0179595947265625,
0.00384521484375,
-0.03582763671875,
0.04681396484375,
-0.01161956787109375,
-0.02862548828125,
0.0233154296875,
-0.00717926025390625,
0.017852783203125,
0.002712249755859375,
0.0199737548828125,
-0.01708984375,
-0.00791168212890625,
-0.0299224853515625,
-0.1033935546875,
-0.0074462890625,
-0.045562744140625,
0.09552001953125,
0.029327392578125,
-0.031097412109375,
-0.0159454345703125,
0.055389404296875,
0.005344390869140625,
0.01236724853515625,
0.0036754608154296875,
-0.003993988037109375,
0.03594970703125,
0.035858154296875,
0.01317596435546875,
-0.0017213821411132812,
-0.0018186569213867188,
0.01276397705078125,
-0.031341552734375,
0.04632568359375,
0.00160980224609375,
-0.00511932373046875,
0.035400390625,
-0.05450439453125,
-0.0582275390625,
-0.036956787109375,
0.003154754638671875,
0.004634857177734375,
0.00782012939453125,
0.005252838134765625,
-0.03204345703125,
-0.045196533203125,
0.047271728515625,
0.0109100341796875,
0.023101806640625,
-0.005565643310546875,
0.074951171875,
-0.0006113052368164062,
-0.029388427734375,
-0.061370849609375,
-0.0167999267578125,
0.0247955322265625,
-0.002941131591796875,
0.04803466796875,
0.03369140625,
-0.017425537109375,
0.071044921875,
0.0114898681640625,
-0.005950927734375,
0.038177490234375,
0.0401611328125,
0.016326904296875,
-0.029510498046875,
0.0338134765625,
0.02606201171875,
-0.1038818359375,
0.01317596435546875,
-0.0003628730773925781,
-0.0008473396301269531,
0.0215606689453125,
0.0139923095703125,
-0.010589599609375,
-0.006763458251953125,
-0.01204681396484375,
-0.0753173828125,
0.0419921875,
0.005748748779296875,
-0.032257080078125,
-0.037139892578125,
0.0254058837890625,
-0.0188140869140625,
-0.005096435546875,
0.0032176971435546875,
0.04425048828125,
0.0275726318359375,
0.037445068359375,
0.0184326171875,
0.047607421875,
0.008636474609375,
-0.01690673828125,
-0.015594482421875,
0.06475830078125,
0.0164794921875,
-0.0120086669921875,
0.0297393798828125,
-0.01122283935546875,
-0.007293701171875,
0.017669677734375,
-0.00576019287109375,
-0.0002715587615966797,
0.00032019615173339844,
0.01904296875,
0.0121612548828125,
-0.013275146484375,
0.00934600830078125,
-0.0263519287109375,
0.00946807861328125,
0.039886474609375,
-0.007633209228515625,
0.0075225830078125,
0.087890625,
-0.0024013519287109375,
0.055938720703125,
-0.01580810546875,
0.004665374755859375,
-0.0004115104675292969,
0.0259552001953125,
0.01201629638671875,
-0.00812530517578125,
0.01177978515625,
-0.00514984130859375,
0.00537872314453125,
0.0078277587890625,
0.03179931640625,
0.037353515625,
0.0033397674560546875,
-0.0482177734375,
-0.044586181640625,
0.017669677734375,
-0.021820068359375,
-0.01374053955078125,
0.038299560546875,
0.0025157928466796875,
-0.05084228515625,
-0.024871826171875,
0.006443023681640625,
0.0350341796875,
-0.0271148681640625,
-0.020233154296875,
-0.004486083984375,
-0.0302886962890625,
-0.0019426345825195312,
0.00008875131607055664,
-0.03143310546875,
0.01708984375,
0.01047515869140625,
-0.015289306640625,
-0.008392333984375,
-0.01168060302734375,
-0.0242919921875,
-0.00713348388671875,
-0.00305938720703125,
-0.0153961181640625,
0.009429931640625,
-0.03265380859375,
-0.00434112548828125,
-0.003444671630859375,
-0.0035190582275390625,
0.0160064697265625,
0.0277862548828125,
0.0303192138671875,
-0.01055908203125,
-0.038055419921875,
-0.0091552734375,
-0.049102783203125,
-0.0265655517578125,
-0.02777099609375,
-0.03814697265625,
-0.0214996337890625,
0.0228424072265625,
0.015655517578125,
0.034576416015625,
-0.0193939208984375,
-0.013092041015625,
-0.0233612060546875,
0.03192138671875,
0.0300140380859375,
0.05072021484375,
-0.005603790283203125,
0.043914794921875,
0.01369476318359375,
0.0177459716796875,
0.00476837158203125,
0.0171356201171875,
-0.024688720703125,
-0.003498077392578125,
-0.01366424560546875,
0.012176513671875,
0.01947021484375,
-0.0017976760864257812,
-0.01094818115234375,
-0.0128936767578125,
0.06298828125,
-0.0006461143493652344,
0.0157012939453125,
-0.0153350830078125,
-0.0008330345153808594,
-0.034271240234375,
0.00789642333984375,
-0.04681396484375,
0.034454345703125,
-0.0352783203125,
-0.049224853515625,
-0.016998291015625,
0.0038909912109375,
0.002719879150390625,
0.01934814453125,
-0.0198516845703125,
-0.01242828369140625,
0.044952392578125,
-0.0144500732421875,
0.0121002197265625,
0.0670166015625,
0.03076171875,
0.0648193359375,
0.04144287109375,
0.03106689453125,
0.018463134765625,
-0.01438140869140625,
-0.0007429122924804688,
0.006862640380859375,
0.006427764892578125,
-0.037933349609375,
-0.01332855224609375,
-0.032440185546875,
-0.0132598876953125,
0.018096923828125,
0.08624267578125,
0.0682373046875,
-0.12939453125,
0.01026153564453125,
0.029327392578125,
0.01335906982421875,
0.00835418701171875,
0.0022144317626953125,
-0.02215576171875,
-0.040740966796875,
0.04461669921875,
-0.0859375,
-0.04815673828125,
-0.00970458984375,
-0.033477783203125,
0.0037555694580078125,
-0.009429931640625,
0.079345703125,
0.027435302734375,
-0.02001953125,
0.01137542724609375,
-0.0089874267578125,
0.0391845703125,
-0.02764892578125,
0.005565643310546875,
0.01129913330078125,
-0.012481689453125,
-0.0828857421875,
0.0096282958984375,
-0.0347900390625,
-0.005001068115234375,
0.0277252197265625,
0.0275115966796875,
0.041259765625,
0.07061767578125,
0.0046234130859375,
0.0023040771484375,
0.0328369140625,
-0.01824951171875,
0.0279541015625,
-0.0287628173828125,
-0.0161590576171875,
0.03680419921875,
-0.026641845703125,
-0.0033550262451171875,
-0.0088653564453125,
0.00969696044921875,
-0.003574371337890625,
0.0004019737243652344,
0.0477294921875,
0.017578125,
-0.027374267578125,
0.01422119140625,
0.034515380859375,
0.0201416015625,
-0.0287933349609375,
-0.0186004638671875,
-0.09442138671875,
-0.07086181640625,
-0.0204010009765625,
-0.07586669921875,
0.0151519775390625,
-0.033843994140625,
-0.05828857421875,
0.08001708984375,
-0.021026611328125,
0.03179931640625,
-0.0109405517578125,
0.035797119140625,
0.02874755859375,
0.0413818359375,
-0.0157623291015625,
0.033233642578125,
0.01212310791015625,
0.0011501312255859375,
-0.030029296875,
0.000011086463928222656,
0.01113128662109375,
0.035186767578125,
0.0298309326171875,
0.002597808837890625,
-0.0037517547607421875,
-0.00366973876953125,
0.01053619384765625,
0.01454925537109375,
-0.020660400390625,
0.0234375,
0.003360748291015625,
0.064208984375,
0.0255279541015625,
-0.05450439453125,
0.02606201171875,
-0.04852294921875,
-0.01007080078125,
0.01277923583984375,
0.00980377197265625,
-0.00661468505859375,
0.01541900634765625,
0.01360321044921875,
-0.039337158203125,
0.01384735107421875,
0.0215301513671875,
-0.01421356201171875,
0.0192108154296875,
0.04022216796875,
0.02862548828125,
-0.0160980224609375,
-0.0242767333984375,
-0.0277557373046875,
0.047882080078125,
-0.0221710205078125,
-0.01210784912109375,
0.020355224609375,
0.017333984375,
-0.0130767822265625,
-0.023468017578125,
-0.023651123046875,
-0.00559234619140625,
-0.00008052587509155273,
0.05389404296875,
0.045379638671875,
0.0214996337890625,
0.01271820068359375,
0.057891845703125,
0.01708984375,
0.048797607421875,
-0.061431884765625,
-0.037078857421875,
-0.00029540061950683594,
-0.0243072509765625,
-0.01494598388671875,
-0.00437164306640625,
-0.0121002197265625,
-0.007595062255859375,
0.01026153564453125,
-0.0023059844970703125,
0.0189971923828125,
0.0257110595703125,
0.00661468505859375,
0.0084991455078125,
0.036376953125,
-0.037017822265625,
0.021148681640625,
-0.0521240234375,
-0.00433349609375,
-0.00296783447265625,
0.06988525390625,
0.0469970703125,
0.016571044921875,
0.001041412353515625,
-0.03485107421875,
-0.014495849609375,
0.039093017578125,
0.00701904296875,
-0.0146942138671875,
-0.0001354217529296875,
-0.0201263427734375,
-0.0196533203125,
0.0061492919921875,
0.0168914794921875,
0.0105133056640625,
0.07781982421875,
0.045684814453125,
-0.060577392578125,
-0.02093505859375,
0.01629638671875,
-0.01873779296875,
-0.020904541015625,
-0.0288543701171875,
0.0310211181640625,
0.01329803466796875,
0.00044155120849609375,
0.00501251220703125,
0.0650634765625,
-0.0190582275390625,
-0.016937255859375,
0.03570556640625,
-0.0096893310546875,
-0.0196533203125,
0.042266845703125,
-0.014129638671875,
0.0843505859375,
0.00875091552734375,
-0.0421142578125,
-0.0104522705078125,
-0.01509857177734375,
-0.046356201171875,
0.0217132568359375,
0.037078857421875,
-0.0220184326171875,
0.0167083740234375,
-0.038330078125,
-0.0013675689697265625,
0.040557861328125,
-0.0284271240234375,
-0.007251739501953125,
-0.0231170654296875,
0.018218994140625,
-0.032135009765625,
-0.04644775390625,
-0.040802001953125,
-0.01303863525390625,
0.048309326171875,
-0.007274627685546875,
0.033111572265625,
-0.00540924072265625,
0.023834228515625,
0.0013513565063476562,
-0.01456451416015625,
0.017608642578125,
-0.00818634033203125,
0.0030689239501953125,
0.0279541015625,
0.029449462890625,
-0.0310821533203125,
-0.0248870849609375,
-0.002254486083984375,
0.0139923095703125,
-0.03924560546875,
0.00841522216796875,
-0.043121337890625,
0.0189208984375,
-0.01239776611328125,
0.059051513671875,
-0.037322998046875,
-0.060028076171875,
-0.044189453125,
0.0166015625,
0.0143280029296875,
0.01209259033203125,
-0.0380859375,
0.0166168212890625,
-0.0360107421875,
-0.01654052734375,
0.032806396484375,
-0.024139404296875,
0.00794219970703125,
0.0222625732421875,
-0.022979736328125,
-0.019287109375,
-0.018524169921875,
-0.02984619140625,
-0.023651123046875,
0.01236724853515625,
0.0209808349609375,
-0.0287933349609375,
0.03253173828125,
-0.053375244140625,
-0.03564453125,
-0.01160430908203125,
-0.0472412109375,
0.0125885009765625,
-0.0191192626953125,
0.01299285888671875,
-0.0027141571044921875,
-0.02923583984375,
-0.0328369140625,
-0.02142333984375,
0.0199127197265625,
0.026611328125,
0.01177215576171875,
-0.01091766357421875,
-0.02154541015625,
-0.0079193115234375,
0.01172637939453125,
-0.00490570068359375,
-0.0271453857421875,
0.00823211669921875,
-0.01227569580078125,
0.0203094482421875,
-0.0302886962890625,
-0.0162353515625,
0.009429931640625,
0.00801849365234375,
-0.05023193359375,
-0.03192138671875,
-0.0295562744140625,
-0.002826690673828125,
-0.0155181884765625,
0.0018062591552734375,
0.0038547515869140625,
0.01256561279296875,
-0.021331787109375,
0.010711669921875,
-0.0206298828125,
0.06121826171875,
-0.0255279541015625,
-0.0256500244140625,
0.0325927734375,
-0.027008056640625,
-0.01551055908203125,
-0.08428955078125,
-0.0009965896606445312,
-0.10711669921875,
0.0103759765625,
0.00151824951171875,
0.005260467529296875,
0.016021728515625,
-0.038238525390625,
-0.0968017578125,
0.0179901123046875,
-0.006195068359375,
-0.037200927734375,
-0.0177154541015625,
0.0256195068359375,
-0.01436614990234375,
0.0010938644409179688,
-0.0068359375,
-0.02386474609375,
0.007049560546875,
0.0009140968322753906,
0.01422119140625,
0.05413818359375,
-0.002819061279296875,
0.02392578125,
-0.006435394287109375,
0.03326416015625,
0.0190277099609375,
0.01678466796875,
0.0141143798828125,
-0.01428985595703125,
0.003955841064453125,
0.0281524658203125,
-0.037078857421875,
-0.051544189453125,
-0.02154541015625,
-0.0002486705780029297,
-0.0149078369140625,
-0.02960205078125,
-0.0255889892578125,
-0.04925537109375,
0.06622314453125,
0.0372314453125,
0.007808685302734375,
0.0009355545043945312,
-0.0019626617431640625,
0.00925445556640625,
-0.00786590576171875,
-0.01263427734375,
0.005992889404296875,
-0.05230712890625,
-0.0222320556640625,
-0.000988006591796875,
0.002506256103515625,
-0.004596710205078125,
0.0012903213500976562,
-0.023468017578125,
-0.00921630859375,
-0.0169830322265625,
-0.0162353515625,
-0.017120361328125,
0.004482269287109375,
0.0743408203125,
-0.040283203125,
0.01806640625,
0.009552001953125,
0.006916046142578125,
0.04083251953125,
0.0205230712890625,
0.0060577392578125,
0.037445068359375,
-0.0100250244140625,
0.0156097412109375,
0.0299072265625,
-0.041748046875,
0.0007405281066894531,
0.001583099365234375,
-0.0211334228515625,
0.01788330078125,
0.00939178466796875,
0.04779052734375,
-0.01039886474609375,
0.0227813720703125,
0.041412353515625,
-0.03369140625,
-0.0338134765625,
-0.020904541015625,
-0.009613037109375,
-0.00865936279296875,
-0.103271484375,
0.048553466796875,
-0.03802490234375,
-0.051361083984375,
0.036468505859375,
-0.006580352783203125,
-0.0218048095703125,
-0.0021953582763671875,
-0.006595611572265625,
-0.03125,
-0.045318603515625,
0.007350921630859375
] |
8ab4f83db362e67aa514ea4b8c02c26ec31466a5
|
Wordpress Stackexchange
Q: Do I need a nonce field for every meta box I add to my custom post type admin? I'm currently working on the admin page of my custom post type, and I got stuck on deciding whether to add a nonce field again for the second metabox or not. I'm very new to custom post types, and searching online about this doesn't really yield that many results.
Any thoughts? Thanks.
A: You could also hook the submit box that never dissapears adding the nonce field to it
add_action( 'post_submitbox_start', 'theme_submitdiv_extra' );
function theme_submitdiv_extra()
{
wp_nonce_field( 'theme_meta_box_nonce', 'meta_box_nonce' );
}
Then, in your save_post action:
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'theme_meta_box_nonce' ) ) return;
|
Q: Do I need a nonce field for every meta box I add to my custom post type admin? I'm currently working on the admin page of my custom post type, and I got stuck on deciding whether to add a nonce field again for the second metabox or not. I'm very new to custom post types, and searching online about this doesn't really yield that many results.
Any thoughts? Thanks.
A: You could also hook the submit box that never dissapears adding the nonce field to it
add_action( 'post_submitbox_start', 'theme_submitdiv_extra' );
function theme_submitdiv_extra()
{
wp_nonce_field( 'theme_meta_box_nonce', 'meta_box_nonce' );
}
Then, in your save_post action:
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'theme_meta_box_nonce' ) ) return;
A: I would recommend so.
You do (and should) have your own nonce with which to check the origin of the data and the intent of the user. If you have just one nonce for a metabox - then you run into problems if that metabox is removed (not the same as hidden). If removed the second metabox will (or at least should) never save since the nonce is longer sent.
Of course from a security point of view, nothing is added by a second nonce - unless you ever wish to only update one metabox and not the other: nonces should be unique to the action.
Edit
As pointed out there is only one form for the post edit screen. So, in theory, you only need one nonce field with which to validate the action and the origin of the data. However, since metaboxes can be removed - by having a nonce field in only one metabox there is no guarantee the nonce will be there. By placing a nonce field in each metabox you can check if data from that metabox has been sent (and is actually from where you think it is) prior to processing any data. E.g:
save_post_call_back($post_id){
//Check this is not an auto-save route
if(nonce of metabox1 present and valid){
//Process data from metabox1
}else{
//Either metabox removed - or invalid nonce. Take no action.
}
if(nonce of metabox2 present and valid){
//Process data from metabox2
}else{
//Either metabox removed - or invalid nonce. Take no action.
}
}
The name of the nonce field should be unique to the metabox (and not clash with any other nonces that are present on the form from other plug-ins).
The nonce value should be unique to the action (and this generally should include the origin of the data (e.g. edit-post as opposed to quick-edit)). I generally include the post ID too.
A: The nonce field is used to validate that the contents of the form came from the location on the current site and not somewhere else.
codex: wp_nonce_field
only one nonce field per form is required, use more that one as not sense for me.
maybe you can investigate and use check_admin_referer() to be sure your request is from an admin page
A: In WP 3.5.2 The whole edit page is wrapped in a form-tag so you should NOT add your own form-tags !! If still do that and try to add another separate custom meta box it will fail when saving and only lead you to wp-admin home when trying to save!!
Also Do NOT add the NONCE field either as there is only supposed to be one per form (this also might make it fail!!) And the page edit already has a nonce field!
Edit:
The thing is 1) since there is only one Form-tag for the whole edit screen, as the correct answer author has admitted, and 2) it automatically has an nonce added to it. Why would you have to add more? It will always have the nonce no matter what...
The intent is in my view to edit the page by content or meta data eg. one nonce field... Also when I tried to add more it doesn't even work with multiple meta-boxes!! One will work and the other will fail and only redirect the user to wp-admin home!
|
wordpress
|
{
"language": "en",
"length": 674,
"provenance": "stackexchange_00019.jsonl.gz:419194",
"question_score": "18",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49453"
}
|
[
0.060272216796875,
-0.01557159423828125,
0.0051422119140625,
-0.037445068359375,
0.00872802734375,
-0.0273895263671875,
0.03619384765625,
0.003086090087890625,
-0.01222991943359375,
0.04547119140625,
0.00371551513671875,
-0.0002803802490234375,
0.0097503662109375,
-0.023468017578125,
-0.0286712646484375,
-0.018310546875,
0.01349639892578125,
-0.0202789306640625,
0.00249481201171875,
-0.01337432861328125,
-0.0006966590881347656,
-0.013092041015625,
0.015655517578125,
-0.0794677734375,
0.040618896484375,
-0.083984375,
0.06878662109375,
-0.028717041015625,
0.0438232421875,
-0.0174560546875,
0.028045654296875,
-0.0060577392578125,
0.0234832763671875,
0.03662109375,
-0.060577392578125,
0.00618743896484375,
-0.01531219482421875,
0.0123443603515625,
-0.01245880126953125,
0.02978515625,
-0.0041351318359375,
0.003116607666015625,
0.0184173583984375,
0.01416778564453125,
-0.0224151611328125,
-0.0166015625,
-0.0010976791381835938,
-0.026275634765625,
0.0216522216796875,
0.00881195068359375,
0.00905609130859375,
-0.02178955078125,
0.0188751220703125,
-0.0290374755859375,
-0.0280303955078125,
-0.03118896484375,
-0.0750732421875,
-0.031982421875,
0.0254974365234375,
0.051971435546875,
0.037200927734375,
-0.044097900390625,
0.00359344482421875,
-0.0135345458984375,
-0.0254669189453125,
-0.0218353271484375,
-0.04803466796875,
0.0028133392333984375,
-0.072265625,
-0.0232391357421875,
0.075439453125,
-0.056365966796875,
0.006092071533203125,
-0.02484130859375,
0.01629638671875,
-0.01073455810546875,
0.00862884521484375,
-0.01103973388671875,
-0.00876617431640625,
0.013946533203125,
-0.0193939208984375,
0.022064208984375,
-0.033447265625,
0.0126953125,
-0.033599853515625,
0.020965576171875,
-0.03857421875,
-0.003269195556640625,
-0.0064697265625,
-0.049774169921875,
-0.0156707763671875,
-0.0914306640625,
0.005840301513671875,
-0.0122528076171875,
-0.0004870891571044922,
-0.06304931640625,
0.003749847412109375,
-0.0004527568817138672,
-0.0097808837890625,
-0.05474853515625,
0.040008544921875,
-0.0335693359375,
-0.024627685546875,
0.00377655029296875,
0.005374908447265625,
0.046722412109375,
-0.0246734619140625,
-0.052886962890625,
0.0124969482421875,
0.022369384765625,
-0.002017974853515625,
-0.03741455078125,
0.010162353515625,
-0.0286712646484375,
-0.02325439453125,
0.00988006591796875,
0.00763702392578125,
-0.0277557373046875,
-0.0031909942626953125,
-0.0513916015625,
0.00925445556640625,
0.002101898193359375,
0.027801513671875,
-0.033721923828125,
0.0322265625,
-0.0004420280456542969,
-0.051177978515625,
-0.01013946533203125,
-0.006549835205078125,
0.031097412109375,
-0.0552978515625,
0.0069427490234375,
0.08917236328125,
0.0266571044921875,
0.0155487060546875,
-0.034637451171875,
0.03753662109375,
0.0056304931640625,
0.0009784698486328125,
0.01494598388671875,
0.0112457275390625,
-0.0416259765625,
-0.016143798828125,
0.021209716796875,
-0.003345489501953125,
0.058837890625,
0.00946807861328125,
-0.0103759765625,
-0.004306793212890625,
-0.039703369140625,
-0.002960205078125,
-0.0577392578125,
0.041595458984375,
-0.00743865966796875,
-0.023956298828125,
0.0321044921875,
0.052825927734375,
-0.01334381103515625,
-0.0765380859375,
-0.026947021484375,
0.0290985107421875,
-0.0103912353515625,
-0.003753662109375,
0.0023822784423828125,
-0.02362060546875,
0.007068634033203125,
-0.028839111328125,
-0.0022125244140625,
0.0091705322265625,
-0.0181121826171875,
0.02581787109375,
-0.0169677734375,
-0.038818359375,
-0.027191162109375,
-0.004596710205078125,
0.00038313865661621094,
0.02825927734375,
0.08984375,
0.00566864013671875,
-0.00305938720703125,
-0.00995635986328125,
-0.05401611328125,
0.1026611328125,
-0.052001953125,
-0.0494384765625,
0.0247344970703125,
0.0139923095703125,
0.050628662109375,
0.020111083984375,
0.01727294921875,
0.039215087890625,
-0.0023822784423828125,
-0.03436279296875,
0.01389312744140625,
-0.00347900390625,
-0.021575927734375,
-0.0205841064453125,
-0.01788330078125,
-0.0067901611328125,
0.023406982421875,
-0.05706787109375,
-0.0474853515625,
0.0197296142578125,
0.0170440673828125,
0.03875732421875,
-0.03729248046875,
-0.0021076202392578125,
0.002819061279296875,
-0.04083251953125,
-0.00409698486328125,
0.02557373046875,
-0.021728515625,
-0.0219573974609375,
0.017578125,
0.00974273681640625,
0.002750396728515625,
-0.01641845703125,
0.051788330078125,
0.004695892333984375,
0.02069091796875,
0.024627685546875,
-0.037261962890625,
0.0005879402160644531,
-0.002971649169921875,
0.0357666015625,
0.037872314453125,
-0.0306243896484375,
0.0181121826171875,
0.04107666015625,
0.035614013671875,
-0.0031948089599609375,
-0.0014104843139648438,
0.0268707275390625,
-0.031890869140625,
-0.06536865234375,
-0.003955841064453125,
-0.0183563232421875,
-0.059295654296875,
-0.019622802734375,
0.07952880859375,
0.0247955322265625,
0.01995849609375,
-0.0075531005859375,
0.0205230712890625,
0.01641845703125,
-0.05120849609375,
0.005096435546875,
0.006809234619140625,
-0.020263671875,
0.00206756591796875,
-0.004669189453125,
0.005825042724609375,
0.0218658447265625,
-0.0804443359375,
0.02008056640625,
0.034515380859375,
-0.01279449462890625,
-0.0251007080078125,
0.0274658203125,
-0.0089874267578125,
0.008636474609375,
0.01354217529296875,
-0.01053619384765625,
0.0127105712890625,
0.049285888671875,
-0.0155181884765625,
0.029296875,
0.0037021636962890625,
-0.01551055908203125,
0.00928497314453125,
0.020965576171875,
-0.0310821533203125,
-0.00772857666015625,
0.013916015625,
0.0576171875,
0.038604736328125,
-0.03900146484375,
-0.0139312744140625,
0.01490020751953125,
0.0289154052734375,
-0.009765625,
0.030792236328125,
-0.026092529296875,
-0.018707275390625,
0.007068634033203125,
-0.0122833251953125,
-0.00923919677734375,
-0.0176544189453125,
0.049957275390625,
0.0012426376342773438,
0.0308380126953125,
-0.0217437744140625,
-0.05126953125,
0.04901123046875,
0.0260009765625,
-0.06378173828125,
-0.07281494140625,
-0.0389404296875,
0.054351806640625,
-0.0570068359375,
-0.0033092498779296875,
0.06536865234375,
-0.0295867919921875,
0.045257568359375,
-0.005954742431640625,
0.00881195068359375,
-0.0213470458984375,
0.044036865234375,
-0.00791168212890625,
-0.05230712890625,
-0.055572509765625,
-0.06365966796875,
0.006092071533203125,
-0.01184844970703125,
0.008392333984375,
-0.022216796875,
0.0023250579833984375,
0.0148468017578125,
-0.030853271484375,
0.010650634765625,
-0.0088958740234375,
0.007659912109375,
-0.020660400390625,
-0.025146484375,
0.0084991455078125,
0.01508331298828125,
-0.037322998046875,
-0.001270294189453125,
-0.01534271240234375,
0.0153961181640625,
-0.0162506103515625,
-0.0290374755859375,
-0.0311737060546875,
-0.04364013671875,
0.0017938613891601562,
-0.0005588531494140625,
0.00024056434631347656,
0.1005859375,
0.00714874267578125,
-0.0740966796875,
-0.0189971923828125,
0.00727081298828125,
-0.00809478759765625,
0.01873779296875,
-0.0171356201171875,
-0.0149688720703125,
0.036285400390625,
-0.006008148193359375,
-0.04925537109375,
-0.017364501953125,
0.0297088623046875,
-0.02630615234375,
0.0004572868347167969,
-0.020294189453125,
0.0011920928955078125,
0.0406494140625,
-0.0009675025939941406,
-0.0181427001953125,
0.01308441162109375,
-0.048492431640625,
0.0474853515625,
0.010772705078125,
0.0261688232421875,
-0.0156707763671875,
-0.055206298828125,
-0.0227203369140625,
0.0108795166015625,
0.0214080810546875,
-0.00031757354736328125,
0.016937255859375,
0.017791748046875,
-0.0016937255859375,
-0.02978515625,
-0.0027332305908203125,
0.006206512451171875,
-0.0031299591064453125,
-0.0229034423828125,
-0.040313720703125,
0.055816650390625,
-0.0091705322265625,
-0.001613616943359375,
-0.01349639892578125,
0.02105712890625,
-0.018341064453125,
-0.0855712890625,
0.06964111328125,
0.0004978179931640625,
0.0066375732421875,
-0.026123046875,
-0.045867919921875,
0.007476806640625,
0.12091064453125,
-0.05078125,
-0.0291290283203125,
-0.00588226318359375,
0.032928466796875,
0.0029125213623046875,
-0.052642822265625,
0.0357666015625,
-0.040618896484375,
-0.07049560546875,
-0.0272064208984375,
-0.006565093994140625,
-0.03863525390625,
0.035614013671875,
-0.0016202926635742188,
-0.0015773773193359375,
-0.051177978515625,
0.0232391357421875,
-0.0513916015625,
-0.0027713775634765625,
0.0103759765625,
0.01446533203125,
-0.042755126953125,
-0.0006227493286132812,
-0.034698486328125,
-0.05902099609375,
-0.0244903564453125,
0.0019159317016601562,
0.038604736328125,
-0.0009732246398925781,
-0.014434814453125,
0.00638580322265625,
0.0380859375,
0.003513336181640625,
-0.037353515625,
-0.0034084320068359375,
-0.000047206878662109375,
-0.05059814453125,
0.02099609375,
0.00545501708984375,
-0.0077362060546875,
-0.006908416748046875,
0.007167816162109375,
-0.01107025146484375,
0.01253509521484375,
-0.0190887451171875,
-0.032012939453125,
0.028656005859375,
-0.038360595703125,
-0.033538818359375,
-0.023345947265625,
-0.005420684814453125,
0.0193939208984375,
-0.0251922607421875,
0.01519775390625,
-0.02728271484375,
-0.0335693359375,
-0.0284576416015625,
-0.005275726318359375,
-0.005680084228515625,
0.0308074951171875,
0.06341552734375,
0.035430908203125,
0.01461029052734375,
-0.055755615234375,
0.00406646728515625,
0.016204833984375,
-0.053436279296875,
0.05389404296875,
0.057342529296875,
0.0297393798828125,
-0.0135955810546875,
-0.032196044921875,
-0.00804901123046875,
0.007232666015625,
0.022216796875,
-0.0082244873046875,
-0.033203125,
0.0233612060546875,
-0.03009033203125,
0.0188446044921875,
0.006504058837890625,
-0.00768280029296875,
0.006641387939453125,
0.017181396484375,
0.0004911422729492188,
-0.012908935546875,
0.0006136894226074219,
-0.0023288726806640625,
-0.003021240234375,
-0.0034580230712890625,
-0.0248260498046875,
-0.0061187744140625,
0.055816650390625,
-0.0240936279296875,
-0.0171966552734375,
-0.0239410400390625,
-0.003170013427734375,
-0.021087646484375,
-0.03466796875,
0.0173492431640625,
-0.004913330078125,
0.03558349609375,
0.01326751708984375,
-0.01357269287109375,
0.01245880126953125,
0.035552978515625,
-0.0245819091796875,
-0.05609130859375,
-0.042877197265625,
0.0005249977111816406,
0.0119781494140625,
0.04119873046875,
0.0194854736328125,
0.03759765625,
-0.0303192138671875,
-0.0135955810546875,
0.002765655517578125,
-0.006999969482421875,
-0.03717041015625,
-0.048309326171875,
0.01375579833984375,
0.006443023681640625,
0.00539398193359375,
-0.0266265869140625,
0.079345703125,
-0.01434326171875,
0.039947509765625,
-0.01334381103515625,
0.0283203125,
0.0465087890625,
0.0258331298828125,
0.035797119140625,
-0.051849365234375,
-0.0275115966796875,
0.0178680419921875,
-0.03271484375,
-0.0223541259765625,
-0.0145721435546875,
0.02294921875,
0.034088134765625,
-0.0169677734375,
-0.003177642822265625,
0.0060882568359375,
-0.0036602020263671875,
-0.01418304443359375,
-0.01450347900390625,
0.0275421142578125,
-0.009765625,
0.0287933349609375,
-0.0002880096435546875,
-0.048583984375,
0.006786346435546875,
-0.009735107421875,
0.026885986328125,
-0.03521728515625,
0.0220947265625,
-0.0283050537109375,
0.0005030632019042969,
-0.0003266334533691406,
0.0107269287109375,
-0.03131103515625,
-0.001720428466796875,
-0.0132293701171875,
0.027862548828125,
-0.023529052734375,
-0.0003731250762939453,
-0.0254669189453125,
0.02777099609375,
-0.0068817138671875,
0.0257110595703125,
-0.0256805419921875,
-0.01023101806640625,
-0.0163116455078125,
0.024078369140625,
-0.0108184814453125,
-0.023956298828125,
0.02545166015625,
-0.031341552734375,
-0.033294677734375,
-0.0298919677734375,
0.0230865478515625,
-0.004856109619140625,
0.0229339599609375,
0.004756927490234375,
0.0012159347534179688,
0.045135498046875,
-0.02197265625,
-0.0210113525390625,
0.0249176025390625,
-0.01385498046875,
-0.0194549560546875,
0.08258056640625,
-0.0328369140625,
0.0267333984375,
-0.011383056640625,
0.02294921875,
-0.028778076171875,
-0.0212249755859375,
0.0136260986328125,
0.00901031494140625,
-0.0128936767578125,
-0.0210113525390625,
-0.01033782958984375,
0.0020160675048828125,
0.0175018310546875,
0.0278472900390625,
0.039764404296875,
-0.00586700439453125,
0.028350830078125,
-0.005916595458984375,
0.006229400634765625,
-0.006381988525390625,
0.003559112548828125,
-0.0175323486328125,
0.015960693359375,
0.040130615234375,
-0.02801513671875,
0.0018596649169921875,
-0.0028247833251953125,
-0.022979736328125,
0.04730224609375,
-0.0153045654296875,
0.0229644775390625,
0.031494140625,
-0.028045654296875,
0.03582763671875,
0.014373779296875,
-0.004665374755859375,
0.02130126953125,
-0.0008649826049804688,
0.0088958740234375,
0.002391815185546875,
-0.0296478271484375,
-0.0276947021484375,
0.0096893310546875,
0.05145263671875,
0.009368896484375,
-0.0149078369140625,
0.06036376953125,
-0.0019817352294921875,
0.0313720703125,
0.00946807861328125,
0.0784912109375,
-0.0521240234375,
0.03289794921875,
0.0284423828125,
-0.0185394287109375,
0.02777099609375,
-0.0007777214050292969,
-0.0001704692840576172,
-0.0089569091796875,
0.03594970703125,
-0.0168304443359375,
-0.01605224609375,
0.0209808349609375,
-0.019927978515625,
-0.020172119140625,
-0.03741455078125,
0.020904541015625,
0.004608154296875,
0.0195770263671875,
0.035552978515625,
-0.040435791015625,
0.01175689697265625,
0.011810302734375,
-0.005970001220703125,
-0.00839996337890625,
-0.051971435546875,
-0.0706787109375,
-0.055755615234375,
-0.0201263427734375,
-0.046417236328125,
0.02191162109375,
0.035919189453125,
0.06951904296875,
0.0634765625,
0.024444580078125,
-0.037872314453125,
0.0231170654296875,
0.0272064208984375,
-0.07086181640625,
-0.02972412109375,
-0.0007681846618652344,
0.04693603515625,
0.0032444000244140625,
0.044158935546875,
-0.0007510185241699219,
-0.030792236328125,
-0.01218414306640625,
-0.0154571533203125,
0.049896240234375,
0.0036983489990234375,
-0.028961181640625,
0.043609619140625,
-0.0222320556640625,
-0.045379638671875,
0.0230712890625,
0.0160369873046875,
-0.03753662109375,
-0.00844573974609375,
0.01444244384765625,
-0.0225372314453125,
-0.0035457611083984375,
0.0237274169921875,
-0.09521484375,
0.1357421875,
0.0416259765625,
0.0304412841796875,
-0.01358795166015625,
0.04437255859375,
-0.050323486328125,
0.01126861572265625,
-0.0166168212890625,
0.040283203125,
0.00702667236328125,
0.01030731201171875,
-0.068359375,
-0.036468505859375,
-0.0193023681640625,
0.05963134765625,
0.042572021484375,
0.022918701171875,
-0.0105743408203125,
-0.0163116455078125,
0.0133056640625,
0.0218963623046875,
-0.032135009765625,
0.0267791748046875,
0.001140594482421875,
0.0276031494140625,
0.0535888671875,
-0.01068115234375,
0.02545166015625,
0.029754638671875,
-0.0271759033203125,
0.036163330078125,
0.005153656005859375,
-0.00911712646484375,
-0.0010309219360351562,
0.025634765625,
-0.04315185546875,
-0.0019397735595703125,
0.0305328369140625,
-0.0262908935546875,
-0.007080078125,
0.011016845703125,
-0.0031986236572265625,
-0.00846099853515625,
0.04339599609375,
-0.035186767578125,
0.047088623046875,
-0.0099334716796875,
0.030303955078125,
0.0100860595703125,
0.00395965576171875,
0.0655517578125,
0.042022705078125,
0.0198211669921875,
0.044097900390625,
0.00042700767517089844,
0.034088134765625,
0.0014219284057617188,
0.016021728515625,
-0.03851318359375,
0.0509033203125,
0.0256500244140625,
0.037109375,
-0.057464599609375,
-0.038604736328125,
-0.0026798248291015625,
0.004364013671875,
0.022552490234375,
-0.0196380615234375,
0.0121002197265625,
0.01123809814453125,
0.0343017578125,
0.00649261474609375,
0.001186370849609375,
0.0181121826171875,
-0.00897979736328125,
0.0162506103515625,
0.048126220703125,
-0.0238494873046875,
0.02093505859375,
-0.049591064453125,
0.006122589111328125,
0.007904052734375,
0.033966064453125,
0.03143310546875,
0.0305023193359375,
0.0501708984375,
-0.0028743743896484375,
0.01319122314453125,
0.01451873779296875,
0.01032257080078125,
-0.0162811279296875,
-0.0146942138671875,
-0.0316162109375,
0.04010009765625,
0.015228271484375,
0.0330810546875,
0.06103515625,
0.0885009765625,
0.055755615234375,
-0.01241302490234375,
-0.006343841552734375,
-0.0009436607360839844,
-0.02447509765625,
0.00205230712890625,
-0.054290771484375,
0.02545166015625,
0.0211944580078125,
0.006664276123046875,
-0.00046896934509277344,
-0.028961181640625,
0.058502197265625,
0.019500732421875,
0.00616455078125,
0.01531982421875,
-0.03497314453125,
0.024810791015625,
0.0288543701171875,
0.063720703125,
0.052734375,
-0.027374267578125,
-0.01441192626953125,
-0.00872802734375,
-0.022064208984375,
0.011688232421875,
0.0302734375,
-0.0230560302734375,
0.023956298828125,
0.04193115234375,
-0.0171661376953125,
0.0111083984375,
0.016204833984375,
0.016815185546875,
0.042694091796875,
0.0213775634765625,
0.0225372314453125,
-0.040985107421875,
-0.0242767333984375,
-0.01016998291015625,
0.01507568359375,
-0.005619049072265625,
0.0034351348876953125,
0.02154541015625,
0.01520538330078125,
-0.03778076171875,
0.024169921875,
-0.034820556640625,
-0.01306915283203125,
-0.0022144317626953125,
0.02508544921875,
0.008087158203125,
-0.0111236572265625,
-0.03411865234375,
0.041717529296875,
0.01349639892578125,
-0.043548583984375,
0.0276031494140625,
0.0175018310546875,
0.003993988037109375,
-0.024810791015625,
-0.015167236328125,
-0.038818359375,
-0.04266357421875,
-0.0487060546875,
0.00881195068359375,
0.01861572265625,
0.00437164306640625,
-0.038909912109375,
0.0335693359375,
0.0155487060546875,
0.028839111328125,
0.005702972412109375,
-0.0175018310546875,
-0.021270751953125,
0.01345062255859375,
-0.009246826171875,
-0.0019702911376953125,
-0.0181732177734375,
-0.018157958984375,
0.0169830322265625,
-0.004199981689453125,
0.0184326171875,
0.006923675537109375,
-0.03179931640625,
-0.0098876953125,
0.033355712890625,
0.05682373046875,
0.03192138671875,
0.018035888671875,
-0.002819061279296875,
-0.0109710693359375,
-0.0273590087890625,
-0.01425933837890625,
0.0027256011962890625,
-0.042449951171875,
-0.0132598876953125,
0.0208282470703125,
-0.0166015625,
0.01033782958984375,
0.0048828125,
0.03094482421875,
0.025482177734375,
-0.00980377197265625,
-0.03680419921875,
0.00519561767578125,
-0.0264739990234375,
0.09344482421875,
-0.0167388916015625,
0.02813720703125,
-0.0037899017333984375,
0.04510498046875,
-0.01222991943359375,
-0.0245208740234375,
-0.0142364501953125,
0.04217529296875,
-0.01500701904296875,
0.01192474365234375,
0.0198974609375,
-0.032745361328125,
-0.00383758544921875,
-0.01375579833984375,
0.031890869140625,
0.0229034423828125,
0.0648193359375,
-0.0310211181640625,
-0.0139007568359375,
0.014923095703125,
0.002597808837890625,
-0.04705810546875,
0.01922607421875,
-0.062347412109375,
-0.00920867919921875,
-0.02093505859375,
0.02276611328125,
0.043365478515625,
-0.0169830322265625,
-0.07904052734375,
0.0660400390625,
-0.0249481201171875,
-0.0203857421875,
-0.05377197265625,
-0.0003368854522705078,
0.0226287841796875,
0.009124755859375,
-0.0082550048828125,
-0.03326416015625,
-0.0716552734375,
-0.00652313232421875,
0.042938232421875,
-0.06475830078125,
0.0806884765625,
0.042236328125,
-0.048919677734375,
0.006839752197265625,
-0.012359619140625,
-0.0237274169921875,
0.0152740478515625,
-0.01175689697265625,
0.0086517333984375,
0.0185699462890625,
-0.05462646484375,
-0.053436279296875,
-0.0165557861328125,
0.030120849609375,
-0.0183868408203125,
-0.0123443603515625,
-0.0008563995361328125,
0.0125732421875,
0.08404541015625,
0.0338134765625,
0.0185546875,
-0.039398193359375,
-0.0003311634063720703,
-0.05364990234375,
-0.031219482421875,
-0.0321044921875,
0.01165008544921875,
-0.0631103515625,
-0.0181732177734375,
0.00525665283203125,
-0.0287628173828125,
-0.023651123046875,
0.01128387451171875,
-0.03253173828125,
0.0220947265625,
0.060516357421875,
0.01068115234375,
-0.021026611328125,
0.01088714599609375,
0.045654296875,
-0.0280609130859375,
0.01116180419921875,
0.0092620849609375,
-0.00577545166015625,
0.046966552734375,
0.0149078369140625,
-0.005462646484375,
-0.0287017822265625,
-0.016204833984375,
0.035186767578125,
-0.0264129638671875,
0.06781005859375,
-0.049468994140625,
-0.0248870849609375,
-0.03179931640625,
0.02362060546875,
0.004360198974609375,
0.0303955078125,
-0.022491455078125,
0.0256805419921875,
0.024444580078125,
0.031829833984375,
-0.0196075439453125,
-0.01490020751953125,
-0.0235595703125,
0.0310211181640625,
0.0232696533203125,
-0.0038585662841796875,
0.0758056640625,
-0.024658203125,
0.031829833984375,
-0.00824737548828125,
0.01328277587890625,
0.02215576171875,
-0.01457977294921875,
0.0487060546875,
-0.019775390625,
-0.0019359588623046875
] |
c756551c5b9a49bbe91c93db7d65c4e6f10f59d5
|
Wordpress Stackexchange
Q: Hourly WP schedule, do I need at least 1 visitor hourly? I am planning to schedule an hourly task from my wp plugin, as I understand these tasks are triggered by visits to the website.
So for an hourly task I will need at least one visitor hourly.
Does it matter at what time of the hour the visitor comes? For example if there's a visitor at 1:05, and another at 2:55, the 1 and 2hs task wont be missed?
A: As you've noted, cron jobs are only fired when someone visits your website. WordPress checks if they are any events that have been scheduled before 'now' that have not yet occurred - and runs them.
Importantly with events that are recur according to a regularly pattern (say hourly) - their occurrence is relative not absolute. That is, once your event triggers it will be scheduled again in an hour's time (rather than being schedule for 1:05, 2:05, 3:05) - of course with no guarantee that it will actually run in an hours time.
In fact with recurring events WordPress only keeps one occurrence saved. Once that occurrence is trigged it is replaced with the next one.
|
Q: Hourly WP schedule, do I need at least 1 visitor hourly? I am planning to schedule an hourly task from my wp plugin, as I understand these tasks are triggered by visits to the website.
So for an hourly task I will need at least one visitor hourly.
Does it matter at what time of the hour the visitor comes? For example if there's a visitor at 1:05, and another at 2:55, the 1 and 2hs task wont be missed?
A: As you've noted, cron jobs are only fired when someone visits your website. WordPress checks if they are any events that have been scheduled before 'now' that have not yet occurred - and runs them.
Importantly with events that are recur according to a regularly pattern (say hourly) - their occurrence is relative not absolute. That is, once your event triggers it will be scheduled again in an hour's time (rather than being schedule for 1:05, 2:05, 3:05) - of course with no guarantee that it will actually run in an hours time.
In fact with recurring events WordPress only keeps one occurrence saved. Once that occurrence is trigged it is replaced with the next one.
|
wordpress
|
{
"language": "en",
"length": 198,
"provenance": "stackexchange_00019.jsonl.gz:419201",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49491"
}
|
[
0.07183837890625,
0.0138702392578125,
-0.0361328125,
-0.03460693359375,
0.04022216796875,
-0.04840087890625,
0.02679443359375,
-0.023712158203125,
0.00821685791015625,
0.001552581787109375,
-0.043914794921875,
0.002468109130859375,
-0.0194549560546875,
-0.0305633544921875,
0.01143646240234375,
-0.054412841796875,
0.033966064453125,
-0.0051116943359375,
-0.0178070068359375,
-0.0227203369140625,
0.01459503173828125,
0.0029277801513671875,
-0.046630859375,
0.1107177734375,
0.061279296875,
-0.016998291015625,
0.005970001220703125,
-0.0275115966796875,
0.04833984375,
-0.00666046142578125,
0.03363037109375,
-0.046417236328125,
0.018707275390625,
0.015655517578125,
-0.0100555419921875,
-0.006000518798828125,
-0.0406494140625,
0.037109375,
0.01128387451171875,
0.007396697998046875,
0.0178070068359375,
-0.008819580078125,
-0.040191650390625,
-0.00013887882232666016,
-0.04425048828125,
-0.0341796875,
0.0213775634765625,
-0.00876617431640625,
0.01424407958984375,
-0.0019292831420898438,
0.010009765625,
-0.0111083984375,
0.03094482421875,
0.01540374755859375,
-0.0311431884765625,
-0.0286407470703125,
-0.024139404296875,
0.03509521484375,
0.0290985107421875,
-0.0821533203125,
-0.036407470703125,
-0.026611328125,
0.04290771484375,
0.054412841796875,
-0.03131103515625,
-0.01033782958984375,
-0.0667724609375,
0.005962371826171875,
-0.07635498046875,
-0.04730224609375,
0.0517578125,
-0.0618896484375,
-0.030975341796875,
0.033905029296875,
-0.048828125,
-0.049041748046875,
0.05889892578125,
-0.040802001953125,
-0.019775390625,
0.055511474609375,
-0.0036449432373046875,
0.006168365478515625,
-0.019805908203125,
0.015625,
-0.00933837890625,
0.02325439453125,
-0.01534271240234375,
-0.01256561279296875,
-0.062744140625,
-0.0192108154296875,
-0.031585693359375,
0.03369140625,
-0.0782470703125,
-0.037109375,
-0.021636962890625,
-0.006404876708984375,
0.0282135009765625,
0.0209808349609375,
-0.040924072265625,
-0.04345703125,
-0.0145721435546875,
0.007633209228515625,
-0.05908203125,
0.0199737548828125,
0.01284027099609375,
0.0252227783203125,
0.01446533203125,
0.061309814453125,
0.07012939453125,
0.01317596435546875,
0.0015125274658203125,
0.056243896484375,
0.0479736328125,
0.0178070068359375,
-0.0060882568359375,
-0.051116943359375,
-0.0177001953125,
0.051605224609375,
-0.00344085693359375,
0.01172637939453125,
-0.0234527587890625,
0.009674072265625,
-0.0194091796875,
-0.047027587890625,
0.0031986236572265625,
-0.041595458984375,
-0.02020263671875,
0.0181732177734375,
0.0035648345947265625,
0.0155181884765625,
-0.029266357421875,
0.0225982666015625,
0.050872802734375,
-0.0106353759765625,
-0.0252227783203125,
-0.01275634765625,
0.0250701904296875,
-0.0056610107421875,
-0.0160369873046875,
0.0015249252319335938,
0.004364013671875,
-0.023284912109375,
-0.01448822021484375,
-0.026947021484375,
0.045745849609375,
0.00046944618225097656,
0.004764556884765625,
0.0335693359375,
0.0181427001953125,
0.0142364501953125,
0.0416259765625,
-0.0292816162109375,
0.012298583984375,
-0.007656097412109375,
0.026397705078125,
-0.062255859375,
0.00004297494888305664,
-0.02972412109375,
0.054229736328125,
-0.01351165771484375,
-0.004512786865234375,
0.000759124755859375,
0.026214599609375,
-0.0374755859375,
-0.0286102294921875,
0.00809478759765625,
-0.069580078125,
-0.009429931640625,
0.035919189453125,
0.01629638671875,
0.041046142578125,
-0.049041748046875,
0.06439208984375,
0.020843505859375,
-0.00689697265625,
0.0311279296875,
0.060943603515625,
0.00634002685546875,
0.005443572998046875,
0.051483154296875,
-0.01213836669921875,
-0.0236968994140625,
0.08642578125,
-0.0655517578125,
-0.0217742919921875,
-0.00847625732421875,
-0.01267242431640625,
0.02984619140625,
0.048248291015625,
0.024322509765625,
0.00225830078125,
-0.037750244140625,
-0.004749298095703125,
-0.0014009475708007812,
0.00243377685546875,
-0.006000518798828125,
-0.037841796875,
-0.002140045166015625,
-0.0161590576171875,
-0.0209197998046875,
0.040771484375,
-0.00490570068359375,
0.0278167724609375,
-0.034698486328125,
-0.0936279296875,
0.0343017578125,
-0.041656494140625,
0.044464111328125,
0.03118896484375,
0.01107025146484375,
-0.0098724365234375,
0.025115966796875,
0.0216522216796875,
-0.0787353515625,
-0.03582763671875,
0.03350830078125,
-0.0219573974609375,
0.061370849609375,
-0.02197265625,
0.053192138671875,
-0.032745361328125,
-0.0521240234375,
-0.0106353759765625,
-0.00011897087097167969,
0.017364501953125,
-0.00945281982421875,
-0.0236968994140625,
-0.0206756591796875,
-0.0305328369140625,
0.0197906494140625,
-0.055877685546875,
0.0166473388671875,
0.0155029296875,
0.0243988037109375,
-0.01143646240234375,
0.0172882080078125,
0.02886962890625,
0.0026416778564453125,
0.00028133392333984375,
0.00977325439453125,
0.0186920166015625,
0.0034046173095703125,
0.01325225830078125,
0.07843017578125,
0.0214691162109375,
-0.01568603515625,
0.03662109375,
0.0298919677734375,
-0.0272064208984375,
0.0226593017578125,
0.040069580078125,
-0.0201873779296875,
-0.00829315185546875,
-0.054840087890625,
-0.0294647216796875,
0.00782012939453125,
0.01629638671875,
0.0234375,
-0.033905029296875,
0.0216064453125,
0.01328277587890625,
-0.00323486328125,
-0.0270843505859375,
0.0012063980102539062,
-0.033935546875,
-0.01264190673828125,
-0.01593017578125,
-0.01546478271484375,
0.0059814453125,
-0.01538848876953125,
0.034027099609375,
-0.0191192626953125,
0.0159759521484375,
0.0408935546875,
-0.04156494140625,
0.0287628173828125,
0.002532958984375,
-0.0034618377685546875,
-0.01474761962890625,
0.009613037109375,
-0.0259552001953125,
0.00621795654296875,
-0.00627899169921875,
-0.0167999267578125,
-0.01078033447265625,
0.0200347900390625,
0.02435302734375,
-0.0097503662109375,
0.01531982421875,
0.0148468017578125,
0.0457763671875,
-0.00476837158203125,
-0.0310211181640625,
0.041290283203125,
-0.032318115234375,
-0.040802001953125,
-0.0009431838989257812,
-0.030609130859375,
0.035400390625,
-0.06982421875,
0.005306243896484375,
0.04052734375,
-0.0251922607421875,
0.007190704345703125,
-0.0076446533203125,
0.01505279541015625,
0.005889892578125,
-0.0018787384033203125,
-0.022430419921875,
0.01025390625,
-0.0780029296875,
-0.01074981689453125,
0.00969696044921875,
0.07879638671875,
-0.042266845703125,
-0.0653076171875,
-0.0004467964172363281,
0.01372528076171875,
-0.04925537109375,
-0.0606689453125,
-0.037384033203125,
-0.031829833984375,
-0.00015020370483398438,
-0.04345703125,
0.00428009033203125,
0.016937255859375,
-0.0596923828125,
0.00270843505859375,
-0.07928466796875,
0.006160736083984375,
-0.0008378028869628906,
-0.032257080078125,
-0.017486572265625,
0.0347900390625,
-0.0036945343017578125,
0.026153564453125,
0.00383758544921875,
0.0787353515625,
0.007381439208984375,
-0.07366943359375,
-0.03033447265625,
-0.0034618377685546875,
-0.037841796875,
0.01318359375,
-0.00672149658203125,
-0.0157470703125,
-0.01464080810546875,
0.008819580078125,
-0.0171661376953125,
-0.0113372802734375,
0.021209716796875,
-0.01326751708984375,
-0.002178192138671875,
-0.02569580078125,
0.005023956298828125,
0.03924560546875,
-0.0049896240234375,
0.00508880615234375,
0.035003662109375,
-0.03271484375,
0.026275634765625,
-0.022796630859375,
-0.008575439453125,
-0.0095977783203125,
0.0282135009765625,
-0.027496337890625,
-0.03125,
-0.00959014892578125,
-0.0221710205078125,
0.00818634033203125,
0.0197601318359375,
-0.01763916015625,
-0.012542724609375,
-0.01873779296875,
-0.04473876953125,
-0.00841522216796875,
0.057373046875,
0.0029773712158203125,
-0.01177978515625,
0.009429931640625,
-0.00986480712890625,
-0.0458984375,
0.0306243896484375,
-0.0897216796875,
-0.0173492431640625,
0.057373046875,
0.049560546875,
0.0160980224609375,
0.0038814544677734375,
-0.050140380859375,
0.0199737548828125,
0.08880615234375,
0.0266265869140625,
-0.041290283203125,
-0.0119171142578125,
0.011993408203125,
-0.057281494140625,
0.00635528564453125,
0.0035533905029296875,
-0.00797271728515625,
-0.049774169921875,
0.02056884765625,
-0.0025691986083984375,
-0.0260467529296875,
-0.030303955078125,
0.0016260147094726562,
-0.060577392578125,
-0.024658203125,
0.0215606689453125,
-0.0064544677734375,
0.042724609375,
-0.016754150390625,
0.035186767578125,
-0.017730712890625,
-0.02044677734375,
-0.0286865234375,
-0.0170745849609375,
-0.01690673828125,
-0.0268707275390625,
0.02880859375,
0.023773193359375,
-0.00537872314453125,
-0.0219268798828125,
0.002452850341796875,
-0.0007262229919433594,
0.04156494140625,
0.011383056640625,
-0.01389312744140625,
0.0296173095703125,
0.055877685546875,
0.037384033203125,
0.009307861328125,
0.00537872314453125,
-0.0285491943359375,
-0.060882568359375,
-0.01222991943359375,
-0.021514892578125,
0.0164337158203125,
-0.006000518798828125,
-0.03204345703125,
-0.0166015625,
-0.035308837890625,
-0.02520751953125,
0.0178070068359375,
0.0092315673828125,
-0.0244598388671875,
-0.058349609375,
-0.0221099853515625,
0.015106201171875,
0.0200347900390625,
-0.00591278076171875,
0.0005078315734863281,
0.0256805419921875,
0.0191802978515625,
-0.038818359375,
-0.0233306884765625,
0.01351165771484375,
0.04803466796875,
0.01300048828125,
0.01200103759765625,
0.018951416015625,
-0.023895263671875,
0.0007777214050292969,
0.042510986328125,
-0.0186004638671875,
0.005550384521484375,
0.08270263671875,
0.0011997222900390625,
-0.0391845703125,
0.043548583984375,
-0.0166473388671875,
-0.037139892578125,
0.01410675048828125,
0.013397216796875,
-0.02508544921875,
0.0430908203125,
0.0399169921875,
-0.036651611328125,
0.0060272216796875,
-0.01099395751953125,
0.02105712890625,
-0.01544952392578125,
0.0802001953125,
0.0302581787109375,
0.03668212890625,
0.004062652587890625,
-0.0024700164794921875,
0.038909912109375,
-0.032257080078125,
0.021575927734375,
0.0275115966796875,
0.0186309814453125,
0.00525665283203125,
0.054595947265625,
-0.023590087890625,
-0.0296478271484375,
-0.01561737060546875,
0.0721435546875,
0.016876220703125,
-0.040618896484375,
0.0179290771484375,
-0.00853729248046875,
-0.03179931640625,
0.005336761474609375,
0.01152801513671875,
0.0479736328125,
0.007198333740234375,
-0.00823974609375,
-0.0323486328125,
-0.0301513671875,
-0.00208282470703125,
-0.061187744140625,
-0.048797607421875,
0.0013103485107421875,
-0.0269927978515625,
0.006298065185546875,
0.0003693103790283203,
0.0014476776123046875,
-0.0164337158203125,
-0.0135040283203125,
0.048431396484375,
0.04412841796875,
0.00832366943359375,
0.0187530517578125,
0.005733489990234375,
-0.004604339599609375,
-0.0205078125,
-0.0222015380859375,
-0.0265655517578125,
-0.03839111328125,
0.0309600830078125,
0.03326416015625,
-0.00122833251953125,
0.007404327392578125,
-0.001194000244140625,
0.01345062255859375,
-0.019927978515625,
-0.0098724365234375,
0.023712158203125,
0.01088714599609375,
-0.01200103759765625,
0.0203704833984375,
0.0089569091796875,
0.043701171875,
-0.002590179443359375,
0.0297393798828125,
-0.00943756103515625,
0.04241943359375,
0.0290374755859375,
0.02886962890625,
-0.0275421142578125,
-0.03826904296875,
0.0100555419921875,
-0.011322021484375,
0.0136871337890625,
-0.032562255859375,
-0.0187530517578125,
-0.00980377197265625,
-0.00904083251953125,
0.05572509765625,
-0.006832122802734375,
0.021209716796875,
-0.035614013671875,
-0.022918701171875,
-0.044189453125,
0.006313323974609375,
0.0380859375,
-0.006656646728515625,
-0.050811767578125,
-0.00759124755859375,
-0.048797607421875,
-0.03546142578125,
-0.06475830078125,
-0.01849365234375,
-0.060546875,
0.0281524658203125,
0.0416259765625,
0.0159454345703125,
0.009552001953125,
-0.044464111328125,
-0.00714111328125,
0.016754150390625,
0.032440185546875,
0.0313720703125,
-0.03021240234375,
0.0179443359375,
0.024017333984375,
0.003459930419921875,
-0.0115203857421875,
0.006229400634765625,
0.04791259765625,
-0.0197296142578125,
0.041412353515625,
0.0050506591796875,
-0.01126861572265625,
-0.0504150390625,
0.01543426513671875,
-0.046417236328125,
-0.006683349609375,
-0.01508331298828125,
-0.0022411346435546875,
-0.03125,
0.001804351806640625,
-0.021514892578125,
0.0531005859375,
-0.0256805419921875,
-0.03082275390625,
0.00446319580078125,
-0.01407623291015625,
0.044708251953125,
-0.007389068603515625,
0.0222320556640625,
-0.02593994140625,
-0.0151519775390625,
-0.0032749176025390625,
0.0020771026611328125,
-0.029632568359375,
0.045196533203125,
0.0880126953125,
0.022247314453125,
0.058929443359375,
0.007232666015625,
0.019439697265625,
0.0117340087890625,
-0.00722503662109375,
-0.0107879638671875,
-0.0198211669921875,
0.00873565673828125,
-0.0257415771484375,
-0.01006317138671875,
-0.0102386474609375,
-0.00513458251953125,
-0.020721435546875,
0.024322509765625,
0.01340484619140625,
-0.0489501953125,
-0.001079559326171875,
0.0009741783142089844,
-0.005718231201171875,
-0.02447509765625,
0.013580322265625,
-0.01062774658203125,
-0.05828857421875,
0.04791259765625,
0.0009312629699707031,
0.0103302001953125,
0.016845703125,
-0.006885528564453125,
-0.0005965232849121094,
-0.0287933349609375,
0.027557373046875,
-0.0012426376342773438,
-0.0232391357421875,
-0.0196685791015625,
0.01513671875,
-0.0201416015625,
-0.034088134765625,
0.01471710205078125,
0.036865234375,
-0.01235198974609375,
-0.05126953125,
0.0655517578125,
0.0208587646484375,
0.0114898681640625,
0.0274505615234375,
-0.0005478858947753906,
0.020751953125,
0.030303955078125,
0.00145721435546875,
-0.00635528564453125,
0.00029206275939941406,
0.00403594970703125,
-0.011383056640625,
-0.0303802490234375,
0.04302978515625,
0.05548095703125,
-0.0792236328125,
0.024169921875,
-0.012939453125,
-0.016693115234375,
-0.0115509033203125,
-0.055511474609375,
0.0251007080078125,
-0.004756927490234375,
-0.00943756103515625,
-0.010833740234375,
-0.006114959716796875,
0.032440185546875,
0.015289306640625,
0.0192718505859375,
-0.034210205078125,
-0.058258056640625,
0.0105438232421875,
-0.08709716796875,
-0.004543304443359375,
0.0003275871276855469,
-0.042022705078125,
0.12109375,
0.030914306640625,
-0.0105133056640625,
-0.01224517822265625,
0.05718994140625,
-0.018341064453125,
0.04144287109375,
-0.006122589111328125,
0.004871368408203125,
0.01238250732421875,
0.002803802490234375,
-0.02117919921875,
-0.034271240234375,
-0.0188140869140625,
0.055877685546875,
0.032012939453125,
0.0084991455078125,
0.0025177001953125,
0.0014867782592773438,
0.0132598876953125,
-0.006866455078125,
-0.031890869140625,
0.04022216796875,
-0.01242828369140625,
0.0186920166015625,
0.04522705078125,
-0.02484130859375,
0.03302001953125,
-0.01263427734375,
-0.01337432861328125,
0.00043845176696777344,
-0.005035400390625,
-0.0200958251953125,
0.005741119384765625,
-0.006099700927734375,
0.0036220550537109375,
-0.004779815673828125,
-0.0247039794921875,
-0.004428863525390625,
0.032806396484375,
0.036529541015625,
0.06683349609375,
-0.0172576904296875,
0.0225677490234375,
-0.039886474609375,
0.06390380859375,
-0.00946807861328125,
-0.0310211181640625,
0.025634765625,
0.02569580078125,
0.004718780517578125,
-0.035369873046875,
-0.03070068359375,
-0.018707275390625,
-0.0004801750183105469,
0.0016660690307617188,
0.01177978515625,
0.01885986328125,
-0.0172271728515625,
0.005207061767578125,
0.05670166015625,
0.0128631591796875,
-0.021820068359375,
-0.020599365234375,
0.028594970703125,
0.025390625,
-0.00859832763671875,
-0.00007146596908569336,
0.0284271240234375,
-0.023773193359375,
0.00653839111328125,
0.0238800048828125,
0.000026047229766845703,
0.033782958984375,
-0.040985107421875,
0.0267181396484375,
0.04791259765625,
-0.0051727294921875,
0.036590576171875,
-0.03448486328125,
0.031646728515625,
0.021636962890625,
0.00815582275390625,
-0.03131103515625,
0.055389404296875,
0.032135009765625,
0.0120086669921875,
0.0195770263671875,
0.035675048828125,
0.0031585693359375,
-0.0294342041015625,
0.0016689300537109375,
-0.053009033203125,
-0.01045989990234375,
0.00836944580078125,
0.041351318359375,
-0.0307769775390625,
0.04156494140625,
0.043243408203125,
-0.01861572265625,
-0.01027679443359375,
0.0158843994140625,
-0.001537322998046875,
-0.06292724609375,
-0.0003762245178222656,
-0.032318115234375,
0.021942138671875,
-0.002338409423828125,
0.00926971435546875,
0.05389404296875,
-0.01788330078125,
-0.015960693359375,
0.0053558349609375,
-0.003635406494140625,
-0.04290771484375,
0.0248260498046875,
-0.00800323486328125,
0.05242919921875,
-0.01015472412109375,
-0.05987548828125,
-0.0062103271484375,
-0.01934814453125,
-0.06201171875,
0.0168304443359375,
0.034698486328125,
-0.0252227783203125,
0.0292510986328125,
0.028076171875,
-0.0203399658203125,
0.00846099853515625,
0.0004382133483886719,
0.00807952880859375,
-0.041473388671875,
0.00672149658203125,
-0.0254974365234375,
-0.06103515625,
-0.03411865234375,
-0.0224151611328125,
0.0230865478515625,
-0.0200347900390625,
0.1007080078125,
-0.011138916015625,
0.004241943359375,
0.0362548828125,
-0.006893157958984375,
0.018218994140625,
0.039825439453125,
-0.0014333724975585938,
-0.021484375,
-0.003173828125,
0.003574371337890625,
-0.08453369140625,
-0.006244659423828125,
0.02276611328125,
-0.00884246826171875,
-0.0237579345703125,
0.0125579833984375,
0.033843994140625,
0.0382080078125,
0.0200347900390625,
-0.034271240234375,
-0.03253173828125,
-0.046783447265625,
-0.0165252685546875,
0.01073455810546875,
-0.0040435791015625,
0.0024890899658203125,
0.00897979736328125,
-0.0236053466796875,
-0.0599365234375,
0.003753662109375,
-0.04864501953125,
-0.0241546630859375,
0.021514892578125,
0.042724609375,
0.004375457763671875,
0.0140838623046875,
-0.00848388671875,
0.00435638427734375,
0.0016574859619140625,
0.034698486328125,
-0.0042572021484375,
0.0272064208984375,
0.00335693359375,
0.00438690185546875,
-0.013031005859375,
-0.042144775390625,
-0.01047515869140625,
0.0298309326171875,
-0.017974853515625,
0.0042724609375,
-0.03436279296875,
-0.01068115234375,
-0.01387786865234375,
-0.0229644775390625,
0.0064697265625,
-0.01111602783203125,
-0.06024169921875,
-0.0287322998046875,
0.0208892822265625,
0.00835418701171875,
-0.0012302398681640625,
-0.04229736328125,
0.0458984375,
-0.0282135009765625,
0.0250701904296875,
-0.017822265625,
0.00585174560546875,
0.0051727294921875,
0.0279998779296875,
-0.04656982421875,
-0.0210418701171875,
-0.045928955078125,
0.0045166015625,
-0.058990478515625,
-0.022430419921875,
0.024078369140625,
-0.009368896484375,
-0.01531219482421875,
-0.08038330078125,
-0.031158447265625,
-0.02557373046875,
-0.027252197265625,
-0.0177459716796875,
-0.01495361328125,
0.0196533203125,
-0.0015382766723632812,
-0.0260467529296875,
0.00507354736328125,
-0.0246734619140625,
-0.0173187255859375,
-0.03228759765625,
0.00507354736328125,
0.019866943359375,
-0.0411376953125,
-0.0831298828125,
0.06634521484375,
-0.03350830078125,
-0.006511688232421875,
-0.07830810546875,
-0.002655029296875,
-0.0038433074951171875,
-0.01068878173828125,
-0.041656494140625,
0.02886962890625,
-0.0281219482421875,
0.030853271484375,
0.018798828125,
-0.07232666015625,
0.041717529296875,
0.00848388671875,
-0.0499267578125,
0.0416259765625,
0.043121337890625,
-0.01406097412109375,
0.00634765625,
0.0036296844482421875,
0.0248260498046875,
0.0169677734375,
-0.028350830078125,
-0.0027828216552734375,
0.0024662017822265625,
0.0003535747528076172,
-0.030914306640625,
-0.0225677490234375,
-0.0234375,
0.01010894775390625,
0.09307861328125,
0.07635498046875,
0.0279541015625,
-0.060028076171875,
-0.0160369873046875,
-0.052947998046875,
-0.0240478515625,
-0.0182647705078125,
0.004180908203125,
-0.032684326171875,
0.015655517578125,
-0.0117034912109375,
-0.0169830322265625,
0.03466796875,
-0.0214996337890625,
-0.037353515625,
-0.00024819374084472656,
-0.034942626953125,
-0.024810791015625,
-0.021087646484375,
0.0122833251953125,
-0.0288848876953125,
0.0016565322875976562,
0.01316070556640625,
-0.0038890838623046875,
-0.00795745849609375,
-0.0130157470703125,
0.0556640625,
-0.0035381317138671875,
0.0169830322265625,
-0.033172607421875,
-0.011260986328125,
-0.004436492919921875,
0.0210723876953125,
-0.033294677734375,
-0.01739501953125,
0.0160980224609375,
0.0021915435791015625,
-0.006114959716796875,
0.0212554931640625,
0.032318115234375,
-0.0625,
-0.024200439453125,
-0.061553955078125,
0.00604248046875,
0.004962921142578125,
-0.0229034423828125,
0.04443359375,
-0.003643035888671875,
-0.0169219970703125,
0.0073394775390625,
-0.0287628173828125,
0.0133819580078125,
0.020660400390625,
0.0545654296875,
-0.002788543701171875,
-0.003391265869140625,
-0.019866943359375,
0.00704193115234375,
-0.00653839111328125
] |
af85fdaa21118fcda5de0bee883c7c252d8556b7
|
Wordpress Stackexchange
Q: When is admin_init Action ran? I have this function below that is called with the admin_init Action
function my_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
Like this
add_action('admin_init', 'my_flush_rewrites');
I am curious, when is this called? Is this called on every page load? Hopefully not
A: All the hooks are executed after the core WordPress application completes its loading process.
So initialization hooks are mainly used to initialize the process in plugins and themes.
Available init hooks in WordPress, in the order of their execution are -
1)init -> runs after WordPress has finished loading but before any headers are sent. Generally, this used by plugins to initialize their process.
2)widgets_init -> is used to register sidebar widgets of the application. The register_widgetfunction is executed within this hook.
3)admin_init -> is executed as the first action, when user access the admin section of WordPress. Generally, it’s used to initialize settings specific to the admin area.
admin_init hook runs every time admin page is rendered.
You can also look into Wordpress Codex for more information about activation process.
|
Q: When is admin_init Action ran? I have this function below that is called with the admin_init Action
function my_flush_rewrites() {
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
Like this
add_action('admin_init', 'my_flush_rewrites');
I am curious, when is this called? Is this called on every page load? Hopefully not
A: All the hooks are executed after the core WordPress application completes its loading process.
So initialization hooks are mainly used to initialize the process in plugins and themes.
Available init hooks in WordPress, in the order of their execution are -
1)init -> runs after WordPress has finished loading but before any headers are sent. Generally, this used by plugins to initialize their process.
2)widgets_init -> is used to register sidebar widgets of the application. The register_widgetfunction is executed within this hook.
3)admin_init -> is executed as the first action, when user access the admin section of WordPress. Generally, it’s used to initialize settings specific to the admin area.
admin_init hook runs every time admin page is rendered.
You can also look into Wordpress Codex for more information about activation process.
A: From the Codex:
admin_init is triggered before any other hook when a user access the
admin area. This hook doesn't provide any parameters, so it can only
be used to callback a specified function.
So yes, it's run on every admin page load.
A: admin_init is triggered when a user accesses the admin area. It is the first hook to be triggered. It can be used in cases like:
*
*We want to block access to the admin panel for users that do not have the Administrator Role.
*We want automatic redirection of users lacking the specified capability, to the homepage.
*We want to register a new setting for use by a plugin.
|
wordpress
|
{
"language": "en",
"length": 291,
"provenance": "stackexchange_00019.jsonl.gz:419205",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49514"
}
|
[
0.0245819091796875,
-0.018157958984375,
-0.004589080810546875,
-0.046722412109375,
-0.0177001953125,
-0.002410888671875,
-0.010772705078125,
-0.01462554931640625,
-0.02520751953125,
0.0401611328125,
0.0066986083984375,
0.027099609375,
0.0212554931640625,
-0.0131988525390625,
0.017059326171875,
0.001239776611328125,
0.0205078125,
0.0082244873046875,
0.025970458984375,
-0.0100555419921875,
0.0231475830078125,
0.00868988037109375,
-0.004711151123046875,
0.0210418701171875,
0.01187896728515625,
-0.07183837890625,
0.028076171875,
-0.0201568603515625,
-0.00505828857421875,
-0.035888671875,
0.00896453857421875,
0.045989990234375,
0.01849365234375,
0.001316070556640625,
0.0421142578125,
0.0455322265625,
-0.0239105224609375,
0.0204315185546875,
0.038543701171875,
-0.0094757080078125,
0.03607177734375,
-0.026824951171875,
0.047332763671875,
0.00484466552734375,
0.0004475116729736328,
-0.00408935546875,
0.0257568359375,
-0.03826904296875,
0.0231170654296875,
-0.0400390625,
0.0124053955078125,
-0.002292633056640625,
0.0215911865234375,
-0.0029926300048828125,
-0.01421356201171875,
0.0181121826171875,
-0.0181884765625,
-0.031982421875,
0.034637451171875,
0.06976318359375,
-0.016021728515625,
-0.02606201171875,
0.0006070137023925781,
-0.07891845703125,
-0.0020389556884765625,
0.0026340484619140625,
-0.0045928955078125,
0.005924224853515625,
-0.0179443359375,
0.006500244140625,
0.034637451171875,
-0.0206146240234375,
-0.0517578125,
0.0008020401000976562,
-0.009490966796875,
-0.0038776397705078125,
0.01061248779296875,
-0.003505706787109375,
-0.0196685791015625,
0.0628662109375,
0.063720703125,
-0.005008697509765625,
0.006488800048828125,
0.029327392578125,
0.007389068603515625,
0.04193115234375,
-0.0037593841552734375,
-0.037811279296875,
-0.03875732421875,
-0.0278167724609375,
-0.0272369384765625,
0.01497650146484375,
0.0186920166015625,
-0.07501220703125,
-0.039825439453125,
-0.03857421875,
0.01505279541015625,
0.0182647705078125,
0.007656097412109375,
0.00565338134765625,
-0.00881195068359375,
-0.04010009765625,
0.02593994140625,
-0.0228118896484375,
0.02630615234375,
0.05291748046875,
-0.03240966796875,
-0.0193939208984375,
0.0401611328125,
0.00502777099609375,
0.00440216064453125,
0.016693115234375,
0.007343292236328125,
0.0129852294921875,
-0.0345458984375,
-0.036346435546875,
-0.0439453125,
0.007160186767578125,
0.004375457763671875,
-0.0130767822265625,
-0.00554656982421875,
-0.0044403076171875,
0.02685546875,
0.0166015625,
0.0016145706176757812,
-0.00933074951171875,
-0.0177154541015625,
-0.024749755859375,
0.006671905517578125,
-0.0002987384796142578,
-0.0177459716796875,
0.042724609375,
-0.000423431396484375,
-0.0291748046875,
-0.024566650390625,
0.005428314208984375,
0.050933837890625,
0.028564453125,
0.0018396377563476562,
0.0121307373046875,
0.0178985595703125,
-0.07183837890625,
-0.0650634765625,
0.046630859375,
0.0137786865234375,
0.031463623046875,
0.0012569427490234375,
-0.0279083251953125,
0.007450103759765625,
-0.00995635986328125,
-0.042816162109375,
-0.0257568359375,
0.03192138671875,
0.016021728515625,
-0.005481719970703125,
0.0228424072265625,
0.039459228515625,
0.001316070556640625,
-0.048004150390625,
-0.0223388671875,
0.0302734375,
-0.02008056640625,
-0.043487548828125,
-0.0043182373046875,
-0.04864501953125,
0.0057220458984375,
0.010498046875,
-0.0008635520935058594,
0.02691650390625,
0.01959228515625,
0.045196533203125,
0.0009899139404296875,
0.0018415451049804688,
0.00794219970703125,
0.0020694732666015625,
-0.005428314208984375,
-0.0248260498046875,
0.00514984130859375,
0.0241546630859375,
0.00539398193359375,
-0.02587890625,
-0.02362060546875,
0.0299072265625,
-0.0036182403564453125,
-0.04241943359375,
0.0156402587890625,
0.01947021484375,
0.04156494140625,
0.0108642578125,
0.00345611572265625,
0.01277923583984375,
0.01209259033203125,
-0.01129150390625,
0.058685302734375,
-0.005615234375,
-0.03411865234375,
-0.0011529922485351562,
0.011627197265625,
-0.020416259765625,
-0.0372314453125,
0.0053253173828125,
-0.00811767578125,
-0.0007548332214355469,
0.00318145751953125,
-0.092529296875,
0.0394287109375,
-0.044952392578125,
0.045806884765625,
0.04327392578125,
0.0227203369140625,
-0.01141357421875,
0.002239227294921875,
0.007007598876953125,
-0.02484130859375,
-0.031341552734375,
0.03717041015625,
-0.006557464599609375,
0.05615234375,
0.022125244140625,
0.042144775390625,
0.03009033203125,
-0.025909423828125,
0.020294189453125,
-0.01934814453125,
0.0228118896484375,
-0.0209808349609375,
0.0005731582641601562,
-0.0259552001953125,
0.0277252197265625,
-0.003116607666015625,
0.0070343017578125,
0.0280914306640625,
0.0063018798828125,
0.03802490234375,
-0.058990478515625,
-0.034912109375,
-0.0650634765625,
-0.036468505859375,
-0.0007772445678710938,
0.06793212890625,
0.0308837890625,
0.0274200439453125,
-0.0162811279296875,
0.0016803741455078125,
0.02935791015625,
-0.045928955078125,
0.00872039794921875,
-0.00785064697265625,
0.001178741455078125,
0.05120849609375,
-0.0289306640625,
0.0218353271484375,
0.00182342529296875,
0.00814056396484375,
-0.0013036727905273438,
0.0313720703125,
-0.038604736328125,
-0.07952880859375,
0.005840301513671875,
0.00580596923828125,
0.033233642578125,
-0.059722900390625,
-0.05706787109375,
-0.01800537109375,
0.00400543212890625,
-0.0176544189453125,
-0.0063018798828125,
-0.0153045654296875,
-0.0279388427734375,
-0.0038166046142578125,
0.05267333984375,
0.00823211669921875,
-0.027374267578125,
0.033447265625,
0.050537109375,
-0.08447265625,
-0.035186767578125,
0.01238250732421875,
-0.035736083984375,
-0.01181793212890625,
-0.0178680419921875,
-0.00553131103515625,
-0.0274810791015625,
-0.01084136962890625,
-0.00992584228515625,
-0.050140380859375,
0.0260009765625,
0.024505615234375,
0.048919677734375,
-0.00247955322265625,
0.0171356201171875,
-0.005596160888671875,
-0.0364990234375,
0.07177734375,
-0.01035308837890625,
-0.050872802734375,
-0.015899658203125,
-0.002788543701171875,
0.01213836669921875,
-0.006015777587890625,
0.03857421875,
0.060394287109375,
-0.0010328292846679688,
-0.01198577880859375,
0.00215911865234375,
-0.00731658935546875,
0.01153564453125,
0.01158905029296875,
0.0139312744140625,
-0.00974273681640625,
-0.035614013671875,
0.032623291015625,
0.02606201171875,
0.0836181640625,
-0.0198974609375,
-0.048858642578125,
-0.004608154296875,
0.0310211181640625,
-0.0273590087890625,
-0.042724609375,
-0.10308837890625,
-0.0631103515625,
0.0152130126953125,
-0.0006074905395507812,
-0.00571441650390625,
0.0182342529296875,
0.0095062255859375,
0.041046142578125,
-0.03277587890625,
-0.0037975311279296875,
0.0024967193603515625,
-0.037841796875,
-0.020904541015625,
-0.01042938232421875,
-0.0030536651611328125,
0.0029697418212890625,
0.006374359130859375,
0.04400634765625,
-0.00635528564453125,
-0.0703125,
0.015350341796875,
-0.044525146484375,
-0.024017333984375,
0.0418701171875,
-0.02459716796875,
-0.01099395751953125,
0.0141143798828125,
-0.002147674560546875,
0.017364501953125,
-0.0010318756103515625,
0.002971649169921875,
-0.009796142578125,
0.0127716064453125,
-0.0455322265625,
0.00490570068359375,
0.034149169921875,
-0.00629425048828125,
-0.06640625,
0.01363372802734375,
-0.0694580078125,
0.005283355712890625,
-0.0017547607421875,
-0.0242156982421875,
-0.038848876953125,
0.04632568359375,
-0.034912109375,
0.01824951171875,
-0.05169677734375,
-0.021209716796875,
-0.0171051025390625,
0.0303497314453125,
-0.038787841796875,
0.016815185546875,
-0.0248260498046875,
-0.0258331298828125,
-0.019561767578125,
0.02593994140625,
-0.00020420551300048828,
-0.018096923828125,
0.007251739501953125,
-0.005168914794921875,
-0.019073486328125,
-0.0010890960693359375,
-0.040283203125,
0.0184478759765625,
0.00408935546875,
-0.00982666015625,
0.024627685546875,
0.01543426513671875,
-0.003772735595703125,
-0.007251739501953125,
0.0283966064453125,
-0.008544921875,
0.002323150634765625,
-0.0002319812774658203,
-0.0044403076171875,
-0.054656982421875,
-0.0285186767578125,
-0.0650634765625,
0.004974365234375,
-0.10272216796875,
0.0187835693359375,
0.007152557373046875,
-0.0297698974609375,
-0.01062774658203125,
-0.0026111602783203125,
-0.048980712890625,
-0.05938720703125,
0.0127410888671875,
-0.040374755859375,
0.0159759521484375,
0.01812744140625,
0.0117950439453125,
-0.0111846923828125,
0.00009047985076904297,
-0.03558349609375,
-0.076171875,
0.00038552284240722656,
-0.0653076171875,
0.0606689453125,
0.07403564453125,
-0.06646728515625,
-0.010284423828125,
0.0171966552734375,
-0.0103912353515625,
-0.001232147216796875,
0.0023021697998046875,
0.04278564453125,
-0.0145263671875,
-0.0211334228515625,
-0.022735595703125,
-0.01629638671875,
0.015777587890625,
0.015228271484375,
-0.046478271484375,
0.004657745361328125,
-0.03167724609375,
-0.00418853759765625,
0.0083770751953125,
-0.04473876953125,
-0.0239105224609375,
-0.0231170654296875,
-0.049041748046875,
0.01611328125,
-0.022979736328125,
0.005191802978515625,
-0.0321044921875,
-0.042724609375,
0.0034465789794921875,
-0.072509765625,
0.0018215179443359375,
0.00832366943359375,
0.040435791015625,
0.0271453857421875,
0.0184478759765625,
0.0765380859375,
-0.0303497314453125,
0.01186370849609375,
0.0013322830200195312,
0.031585693359375,
0.033660888671875,
0.01192474365234375,
-0.01519012451171875,
0.0099334716796875,
0.010162353515625,
-0.015899658203125,
0.05108642578125,
0.01739501953125,
0.0211181640625,
-0.0254058837890625,
0.0129241943359375,
0.01218414306640625,
0.0245513916015625,
-0.024017333984375,
0.01519775390625,
0.0310516357421875,
0.006130218505859375,
-0.030242919921875,
-0.00946807861328125,
-0.017059326171875,
0.005695343017578125,
-0.006511688232421875,
-0.0000050067901611328125,
0.036041259765625,
0.01507568359375,
0.00527191162109375,
-0.006076812744140625,
0.016143798828125,
-0.0035190582275390625,
0.047698974609375,
0.0251617431640625,
-0.0198516845703125,
-0.00524139404296875,
0.053314208984375,
-0.0257720947265625,
0.00742340087890625,
0.0008721351623535156,
0.0203399658203125,
-0.0039825439453125,
-0.037139892578125,
-0.0301513671875,
0.007358551025390625,
0.031524658203125,
0.020965576171875,
-0.00943756103515625,
0.017974853515625,
0.0236663818359375,
-0.006855010986328125,
-0.0044403076171875,
0.0026302337646484375,
0.017608642578125,
-0.027862548828125,
-0.0248260498046875,
-0.0017156600952148438,
-0.0168304443359375,
0.0177764892578125,
0.031494140625,
0.0231781005859375,
0.0028209686279296875,
-0.021881103515625,
0.050445556640625,
0.016571044921875,
0.031524658203125,
0.0274505615234375,
-0.0035037994384765625,
0.004169464111328125,
-0.0166168212890625,
-0.02392578125,
-0.041595458984375,
0.006320953369140625,
0.025787353515625,
0.0408935546875,
0.019500732421875,
-0.00615692138671875,
-0.00787353515625,
-0.01171112060546875,
-0.0386962890625,
0.096435546875,
0.02520751953125,
-0.079345703125,
-0.0362548828125,
-0.0016393661499023438,
0.036285400390625,
-0.0321044921875,
-0.018951416015625,
0.0577392578125,
-0.013702392578125,
0.03717041015625,
-0.0589599609375,
-0.01021575927734375,
0.01186370849609375,
0.024749755859375,
0.0169219970703125,
-0.022552490234375,
-0.019317626953125,
-0.004962921142578125,
-0.0014247894287109375,
-0.0178375244140625,
0.004596710205078125,
0.048675537109375,
-0.0119781494140625,
0.0198516845703125,
-0.0161590576171875,
-0.00986480712890625,
-0.034637451171875,
0.016448974609375,
0.028656005859375,
0.00457000732421875,
-0.0802001953125,
0.00984954833984375,
-0.041015625,
0.0235137939453125,
-0.024566650390625,
-0.051483154296875,
-0.0232086181640625,
0.0059814453125,
-0.011871337890625,
0.0182342529296875,
-0.0109405517578125,
0.0193634033203125,
0.004238128662109375,
0.022979736328125,
-0.00231170654296875,
0.039337158203125,
-0.0192413330078125,
0.0726318359375,
-0.007503509521484375,
0.0313720703125,
0.0007123947143554688,
0.01507568359375,
-0.0250244140625,
0.0199127197265625,
0.0025348663330078125,
0.01331329345703125,
-0.00247955322265625,
0.01068115234375,
-0.00276947021484375,
-0.016845703125,
0.05438232421875,
-0.0112457275390625,
0.007396697998046875,
0.01554107666015625,
0.0057830810546875,
-0.012115478515625,
-0.0016622543334960938,
0.03460693359375,
0.03338623046875,
-0.00011450052261352539,
-0.0183868408203125,
-0.0037631988525390625,
-0.030120849609375,
-0.010345458984375,
0.050323486328125,
-0.021820068359375,
0.012969970703125,
0.0249481201171875,
-0.056976318359375,
0.06573486328125,
0.06317138671875,
0.01708984375,
0.0645751953125,
0.0104217529296875,
0.0305938720703125,
0.02239990234375,
0.0125732421875,
0.0008382797241210938,
-0.01300048828125,
0.0245819091796875,
-0.0008711814880371094,
0.01378631591796875,
0.0275421142578125,
-0.0048675537109375,
0.0016908645629882812,
0.06463623046875,
0.0440673828125,
-0.1102294921875,
0.021026611328125,
-0.0112152099609375,
0.0121612548828125,
0.0272979736328125,
-0.00696563720703125,
-0.0159149169921875,
-0.0301513671875,
0.061737060546875,
0.002288818359375,
-0.00936126708984375,
0.03179931640625,
0.001338958740234375,
-0.016510009765625,
-0.00977325439453125,
0.040496826171875,
0.0219573974609375,
0.004062652587890625,
0.01873779296875,
-0.006542205810546875,
0.01904296875,
0.003803253173828125,
-0.005832672119140625,
0.00015366077423095703,
-0.021759033203125,
-0.005275726318359375,
0.022003173828125,
-0.03765869140625,
0.00542449951171875,
0.0087432861328125,
-0.01024627685546875,
0.036407470703125,
0.0357666015625,
-0.016326904296875,
0.01467132568359375,
-0.01103973388671875,
-0.003696441650390625,
-0.10089111328125,
-0.036529541015625,
0.006443023681640625,
0.055816650390625,
-0.0229949951171875,
0.046539306640625,
-0.0176544189453125,
-0.0380859375,
-0.006175994873046875,
-0.034820556640625,
0.0263214111328125,
-0.037567138671875,
-0.0029735565185546875,
0.004238128662109375,
-0.01451873779296875,
0.0160980224609375,
-0.0175323486328125,
0.0311126708984375,
-0.039093017578125,
-0.0009303092956542969,
-0.01995849609375,
-0.03509521484375,
-0.026123046875,
-0.040924072265625,
-0.0655517578125,
0.09576416015625,
0.0258941650390625,
0.0079193115234375,
-0.01666259765625,
0.0309906005859375,
-0.0189361572265625,
0.00501251220703125,
-0.027587890625,
0.031768798828125,
0.0081939697265625,
-0.004425048828125,
-0.024871826171875,
0.0178375244140625,
-0.0074462890625,
-0.01279449462890625,
0.011932373046875,
0.00803375244140625,
-0.013946533203125,
0.00235748291015625,
0.016082763671875,
-0.004550933837890625,
-0.0129241943359375,
0.052398681640625,
0.025787353515625,
0.00807952880859375,
0.01303863525390625,
0.0157470703125,
0.04998779296875,
-0.0709228515625,
-0.0185089111328125,
0.031890869140625,
-0.00818634033203125,
-0.01497650146484375,
-0.026092529296875,
0.0694580078125,
-0.0491943359375,
-0.01346588134765625,
0.03216552734375,
0.00855255126953125,
-0.041839599609375,
0.0244293212890625,
-0.033599853515625,
-0.0027179718017578125,
0.00304412841796875,
-0.03363037109375,
0.0240478515625,
-0.0023345947265625,
0.005573272705078125,
-0.004116058349609375,
0.02606201171875,
-0.00839996337890625,
-0.0166168212890625,
-0.0036144256591796875,
0.05499267578125,
-0.08282470703125,
0.041656494140625,
0.030975341796875,
0.0537109375,
0.01470184326171875,
-0.00934600830078125,
-0.01009368896484375,
0.038665771484375,
-0.01094818115234375,
-0.03125,
0.00392913818359375,
0.0295562744140625,
-0.0035419464111328125,
0.022918701171875,
0.0225067138671875,
-0.02276611328125,
0.035064697265625,
0.038421630859375,
-0.037872314453125,
-0.0100860595703125,
0.0211639404296875,
0.005889892578125,
0.0260772705078125,
0.0023136138916015625,
-0.02838134765625,
-0.01213836669921875,
0.00215911865234375,
-0.008026123046875,
0.0328369140625,
-0.0025787353515625,
0.0347900390625,
-0.02410888671875,
-0.0069580078125,
-0.0290374755859375,
0.0197601318359375,
-0.01263427734375,
0.04608154296875,
-0.054351806640625,
-0.0177764892578125,
0.002384185791015625,
0.058013916015625,
0.0423583984375,
0.037933349609375,
0.05364990234375,
0.03607177734375,
0.0013189315795898438,
0.0145263671875,
0.03814697265625,
-0.005771636962890625,
-0.0042877197265625,
-0.01461029052734375,
0.0015964508056640625,
-0.036224365234375,
-0.004337310791015625,
-0.015594482421875,
0.08087158203125,
-0.062042236328125,
-0.03851318359375,
0.0007143020629882812,
-0.0079498291015625,
-0.055328369140625,
0.0675048828125,
-0.0117645263671875,
0.08978271484375,
-0.01092529296875,
-0.038848876953125,
-0.00806427001953125,
-0.01290130615234375,
-0.07818603515625,
0.050048828125,
0.05950927734375,
-0.03179931640625,
0.020416259765625,
0.042022705078125,
0.029083251953125,
-0.047943115234375,
0.00738525390625,
0.0009412765502929688,
-0.05377197265625,
0.052490234375,
0.021697998046875,
-0.0033206939697265625,
0.0180206298828125,
0.0095672607421875,
0.0031890869140625,
0.0168304443359375,
0.07940673828125,
-0.0121917724609375,
0.017822265625,
0.040740966796875,
-0.010406494140625,
0.0022106170654296875,
0.0233917236328125,
-0.01324462890625,
-0.048004150390625,
0.00412750244140625,
0.0052337646484375,
-0.0254058837890625,
-0.002689361572265625,
0.028900146484375,
-0.040863037109375,
-0.004329681396484375,
-0.0182952880859375,
0.024658203125,
-0.0048675537109375,
0.06732177734375,
-0.0143890380859375,
-0.03607177734375,
-0.01470947265625,
0.025115966796875,
0.00811767578125,
0.006435394287109375,
-0.016510009765625,
0.0142364501953125,
-0.0310516357421875,
-0.0311126708984375,
-0.01617431640625,
-0.0196685791015625,
-0.06756591796875,
0.0189971923828125,
-0.00472259521484375,
-0.006893157958984375,
0.0144805908203125,
-0.03033447265625,
0.01995849609375,
0.0075836181640625,
0.015960693359375,
-0.00237274169921875,
-0.033447265625,
-0.0141143798828125,
0.01000213623046875,
0.0199127197265625,
-0.043975830078125,
0.0223846435546875,
0.02154541015625,
-0.003894805908203125,
0.01131439208984375,
-0.037017822265625,
-0.0289154052734375,
-0.061065673828125,
-0.0194854736328125,
0.0246734619140625,
-0.03790283203125,
-0.038543701171875,
-0.035430908203125,
0.0570068359375,
0.015533447265625,
0.004909515380859375,
-0.0843505859375,
0.059295654296875,
-0.0338134765625,
0.08758544921875,
-0.0260467529296875,
0.019378662109375,
-0.0097503662109375,
0.0004360675811767578,
-0.056732177734375,
-0.0465087890625,
-0.047515869140625,
0.032928466796875,
-0.058624267578125,
-0.0127716064453125,
0.0287628173828125,
-0.0159454345703125,
-0.0282745361328125,
-0.0284271240234375,
-0.01490020751953125,
0.034149169921875,
-0.0360107421875,
-0.003116607666015625,
0.052520751953125,
0.0144500732421875,
-0.0281219482421875,
-0.058563232421875,
-0.025115966796875,
0.00103759765625,
0.044952392578125,
-0.0194854736328125,
0.0105438232421875,
0.0178375244140625,
-0.0286407470703125,
-0.07183837890625,
0.0124359130859375,
-0.01073455810546875,
-0.0214385986328125,
-0.09210205078125,
0.01529693603515625,
0.01276397705078125,
0.0075225830078125,
-0.02288818359375,
-0.0213165283203125,
-0.045318603515625,
0.017333984375,
0.0158538818359375,
0.01226043701171875,
0.044708251953125,
0.00830078125,
-0.02508544921875,
0.02825927734375,
0.008941650390625,
0.0218658447265625,
0.031402587890625,
-0.0091552734375,
0.060546875,
0.09930419921875,
0.0027599334716796875,
0.04931640625,
-0.03143310546875,
-0.08648681640625,
-0.01690673828125,
-0.0582275390625,
0.006038665771484375,
-0.005954742431640625,
0.068359375,
0.0114898681640625,
0.0027828216552734375,
-0.0350341796875,
-0.025054931640625,
-0.0196533203125,
-0.01258087158203125,
-0.032623291015625,
0.035003662109375,
-0.0904541015625,
-0.0275421142578125,
0.0275421142578125,
0.0183258056640625,
-0.011505126953125,
-0.0245208740234375,
-0.002376556396484375,
-0.0124053955078125,
0.01474761962890625,
0.02459716796875,
-0.005229949951171875,
-0.04443359375,
0.059326171875,
-0.034637451171875,
-0.022430419921875,
0.03070068359375,
0.026123046875,
0.013092041015625,
0.04473876953125,
0.0123443603515625,
0.060760498046875,
-0.060272216796875,
-0.01016998291015625,
-0.0038852691650390625,
-0.004253387451171875,
-0.034271240234375,
0.0182037353515625,
0.01435089111328125,
0.0260467529296875,
-0.0230865478515625,
0.024749755859375,
0.0214080810546875,
0.0280609130859375,
-0.02587890625,
0.06781005859375,
-0.00896453857421875,
0.076904296875,
-0.0052642822265625,
0.046630859375,
-0.0113525390625,
-0.0050811767578125,
0.0032749176025390625,
-0.0157623291015625,
0.00201416015625,
0.00861358642578125,
0.0027484893798828125,
-0.03271484375,
0.01558685302734375,
-0.0207672119140625,
0.01338958740234375,
0.01226806640625
] |
46bc4aeaf7c6b80f104155536e1ad31c934c7896
|
Wordpress Stackexchange
Q: how can i embed wordpress backend in iframe I have 2 websites http://www.aaa.com and http://www.bbb.com and need them to show the same.
Now I put an iframe in index.html and upload to aaa.com. It's ok for frontend but it's doesn't work for backend, where it shows a blank page.
Can anyone suggest me how I can solve this problem ?
A: By default WordPress sends an HTTP header to prevent iframe embedding on /wp_admin/ and /wp-login.php:
X-Frame-Options: SAMEORIGIN
That's a security feature. If you want to remove this header remove the filters:
remove_action( 'login_init', 'send_frame_options_header' );
remove_action( 'admin_init', 'send_frame_options_header' );
But you should really use the multisite feature as Tom J Nowell suggested.
|
Q: how can i embed wordpress backend in iframe I have 2 websites http://www.aaa.com and http://www.bbb.com and need them to show the same.
Now I put an iframe in index.html and upload to aaa.com. It's ok for frontend but it's doesn't work for backend, where it shows a blank page.
Can anyone suggest me how I can solve this problem ?
A: By default WordPress sends an HTTP header to prevent iframe embedding on /wp_admin/ and /wp-login.php:
X-Frame-Options: SAMEORIGIN
That's a security feature. If you want to remove this header remove the filters:
remove_action( 'login_init', 'send_frame_options_header' );
remove_action( 'admin_init', 'send_frame_options_header' );
But you should really use the multisite feature as Tom J Nowell suggested.
A: Tried to extend the version of @toscho
//remove the restriction
remove_action( 'login_init', 'send_frame_options_header' );
remove_action( 'admin_init', 'send_frame_options_header' );
//for added security
add_action( 'login_init', 'Access_Control_Allow_Origin' );
add_action( 'admin_init', 'Access_Control_Allow_Origin' );
function Access_Control_Allow_Origin(){
$origin=get_http_origin();
$allowed_origins=array(//add your domains or keeps empty
"aaa.com",
"bbb.com",
);
$allowed=false;
if(count($allowed_origins)>0){
foreach($allowed_origins as $allowed_origin){
if (strstr($origin,$allowed_origin)){
$allowed=true;
break;
}
}
}else{
$allowed=true;
}
if($allowed){
return true;
}else{
send_origin_headers();
}
}
|
wordpress
|
{
"language": "en",
"length": 177,
"provenance": "stackexchange_00019.jsonl.gz:419212",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49540"
}
|
[
0.06658935546875,
0.0268707275390625,
-0.0045166015625,
-0.0042572021484375,
0.0369873046875,
-0.048126220703125,
0.03802490234375,
-0.0643310546875,
-0.032379150390625,
-0.0076751708984375,
-0.0258331298828125,
0.0009708404541015625,
-0.0302886962890625,
-0.0283355712890625,
0.030548095703125,
-0.04742431640625,
0.0225372314453125,
0.048797607421875,
0.04656982421875,
-0.0030307769775390625,
-0.00385284423828125,
0.00200653076171875,
0.00704193115234375,
0.0004596710205078125,
0.023162841796875,
-0.034912109375,
0.07415771484375,
-0.0379638671875,
0.0157623291015625,
-0.01175689697265625,
0.0289306640625,
-0.0191497802734375,
0.00616455078125,
0.04559326171875,
-0.045196533203125,
-0.038238525390625,
-0.0169677734375,
0.034088134765625,
0.0168609619140625,
0.01003265380859375,
0.00379180908203125,
0.005435943603515625,
0.10772705078125,
0.00933074951171875,
0.0345458984375,
-0.0297698974609375,
0.0207977294921875,
-0.06463623046875,
-0.00580596923828125,
-0.040557861328125,
0.0092315673828125,
-0.01366424560546875,
0.0209808349609375,
-0.02520751953125,
-0.007236480712890625,
0.0190887451171875,
-0.00942230224609375,
0.0287322998046875,
0.036651611328125,
0.00676727294921875,
-0.036102294921875,
0.00164794921875,
-0.005306243896484375,
-0.03216552734375,
0.045501708984375,
-0.035003662109375,
-0.0256805419921875,
0.043731689453125,
-0.033203125,
0.033935546875,
0.04266357421875,
-0.034515380859375,
0.01509857177734375,
-0.01329803466796875,
-0.03997802734375,
0.00112152099609375,
0.0301513671875,
0.0253753662109375,
0.0094757080078125,
-0.037689208984375,
-0.03759765625,
-0.0064239501953125,
-0.066162109375,
-0.039703369140625,
0.02398681640625,
0.00754547119140625,
-0.0189361572265625,
-0.012969970703125,
-0.0179290771484375,
0.025238037109375,
-0.021881103515625,
-0.0029354095458984375,
-0.0269927978515625,
0.037841796875,
-0.007671356201171875,
0.01390838623046875,
0.01514434814453125,
0.0110015869140625,
0.005374908447265625,
0.0121002197265625,
0.0016803741455078125,
-0.047698974609375,
0.0325927734375,
-0.042266845703125,
0.0255279541015625,
0.06427001953125,
-0.002197265625,
-0.00395965576171875,
0.041717529296875,
0.0025157928466796875,
0.0247344970703125,
0.028045654296875,
-0.00624847412109375,
-0.0271453857421875,
-0.03460693359375,
0.0232086181640625,
-0.00527191162109375,
-0.01776123046875,
0.01160430908203125,
-0.00928497314453125,
-0.012481689453125,
0.007709503173828125,
-0.0172882080078125,
0.04949951171875,
0.016143798828125,
0.0266265869140625,
0.0208740234375,
-0.024993896484375,
0.01201629638671875,
-0.01522064208984375,
-0.0284423828125,
0.00238037109375,
0.0484619140625,
0.0438232421875,
0.0206451416015625,
-0.0030269622802734375,
0.024658203125,
0.004138946533203125,
-0.0106964111328125,
0.0345458984375,
-0.015716552734375,
-0.07891845703125,
-0.035003662109375,
-0.00571441650390625,
-0.0161895751953125,
0.005706787109375,
0.007049560546875,
0.01617431640625,
0.015869140625,
-0.03814697265625,
0.0089111328125,
-0.052276611328125,
0.01496124267578125,
0.01073455810546875,
0.041717529296875,
-0.000005543231964111328,
0.07244873046875,
-0.031646728515625,
-0.0178375244140625,
-0.008636474609375,
-0.007015228271484375,
0.00450897216796875,
0.0517578125,
-0.015869140625,
-0.007598876953125,
-0.019805908203125,
-0.04949951171875,
-0.0018358230590820312,
0.0345458984375,
0.056427001953125,
0.007221221923828125,
-0.052642822265625,
0.001728057861328125,
0.0139617919921875,
-0.018890380859375,
0.03564453125,
0.0033168792724609375,
0.06805419921875,
0.02001953125,
0.015289306640625,
0.027069091796875,
-0.022247314453125,
0.1063232421875,
-0.021453857421875,
-0.039581298828125,
0.036102294921875,
0.01107025146484375,
0.08441162109375,
-0.005283355712890625,
0.035308837890625,
0.012298583984375,
0.00470733642578125,
0.0225830078125,
0.03192138671875,
-0.023773193359375,
-0.054351806640625,
-0.0091552734375,
0.0020618438720703125,
-0.035980224609375,
0.006046295166015625,
-0.02099609375,
0.003002166748046875,
0.02880859375,
-0.0092315673828125,
0.0231170654296875,
0.00745391845703125,
-0.00855255126953125,
0.034423828125,
0.0258636474609375,
0.007598876953125,
-0.00437164306640625,
-0.0038299560546875,
0.0014400482177734375,
-0.0462646484375,
-0.041229248046875,
0.025848388671875,
-0.0283050537109375,
0.019134521484375,
-0.0086822509765625,
0.044830322265625,
-0.033966064453125,
-0.008941650390625,
-0.0290985107421875,
-0.019927978515625,
0.0280914306640625,
-0.037872314453125,
0.00447845458984375,
-0.0230560302734375,
0.0274200439453125,
0.0131683349609375,
-0.034454345703125,
0.018463134765625,
-0.00138092041015625,
-0.0027561187744140625,
-0.05035400390625,
0.0003688335418701172,
-0.0264739990234375,
-0.0226593017578125,
-0.01378631591796875,
0.05194091796875,
0.041748046875,
0.007415771484375,
0.021728515625,
0.0284576416015625,
-0.0260772705078125,
-0.057281494140625,
0.01959228515625,
-0.0087738037109375,
-0.004650115966796875,
0.00885772705078125,
-0.0088043212890625,
-0.031890869140625,
0.0189666748046875,
-0.1234130859375,
-0.00310516357421875,
0.041351318359375,
-0.005401611328125,
-0.01274871826171875,
-0.0097198486328125,
0.0113372802734375,
-0.0004987716674804688,
-0.0313720703125,
-0.0303955078125,
-0.01413726806640625,
0.005977630615234375,
-0.00960540771484375,
0.01490020751953125,
0.0193023681640625,
0.00521087646484375,
-0.0164031982421875,
0.015625,
-0.01025390625,
0.006931304931640625,
0.042266845703125,
0.07659912109375,
-0.0310821533203125,
-0.049835205078125,
-0.0214080810546875,
0.04803466796875,
0.02996826171875,
0.01172637939453125,
0.02490234375,
-0.01515960693359375,
-0.01153564453125,
-0.01142120361328125,
-0.0180206298828125,
0.01276397705078125,
0.03790283203125,
0.0265350341796875,
-0.0289306640625,
0.004398345947265625,
0.02520751953125,
-0.01727294921875,
0.049774169921875,
-0.01092529296875,
-0.038787841796875,
-0.00989532470703125,
-0.040435791015625,
0.05426025390625,
-0.03448486328125,
0.0233154296875,
0.061370849609375,
0.003170013427734375,
0.000522613525390625,
-0.01055145263671875,
0.0158538818359375,
0.0030345916748046875,
0.017333984375,
-0.0013799667358398438,
-0.0458984375,
0.001857757568359375,
0.01061248779296875,
0.00909423828125,
-0.01473236083984375,
0.0013933181762695312,
-0.0276641845703125,
-0.0163421630859375,
0.01428985595703125,
-0.054168701171875,
-0.006072998046875,
0.01357269287109375,
-0.1014404296875,
-0.0160064697265625,
-0.0218048095703125,
-0.07061767578125,
0.000804901123046875,
0.0251922607421875,
0.006374359130859375,
0.0013418197631835938,
-0.031341552734375,
-0.03460693359375,
-0.04302978515625,
-0.05157470703125,
-0.02252197265625,
-0.0045623779296875,
-0.0176239013671875,
0.01442718505859375,
0.038330078125,
0.034881591796875,
0.006175994873046875,
0.0653076171875,
0.0204925537109375,
-0.0281829833984375,
-0.005218505859375,
0.0200958251953125,
-0.024627685546875,
0.0001666545867919922,
0.003559112548828125,
-0.0276336669921875,
0.00743865966796875,
0.005687713623046875,
-0.019561767578125,
-0.0301361083984375,
-0.0626220703125,
-0.038970947265625,
0.01366424560546875,
0.03167724609375,
-0.0650634765625,
-0.009796142578125,
-0.07598876953125,
0.0141448974609375,
0.0128021240234375,
-0.01654052734375,
-0.07440185546875,
-0.017578125,
-0.0221710205078125,
0.001956939697265625,
-0.0394287109375,
-0.0020847320556640625,
0.0008931159973144531,
0.0297088623046875,
-0.00838470458984375,
0.01190185546875,
-0.0251007080078125,
-0.0286865234375,
-0.030975341796875,
0.041839599609375,
-0.0025787353515625,
-0.020782470703125,
0.01000213623046875,
0.009857177734375,
-0.0023784637451171875,
0.006999969482421875,
-0.040557861328125,
-0.037384033203125,
0.04376220703125,
-0.032684326171875,
0.0004305839538574219,
-0.03265380859375,
-0.01300811767578125,
-0.009307861328125,
0.08935546875,
-0.0160675048828125,
0.007354736328125,
0.00809478759765625,
-0.00231170654296875,
0.01181793212890625,
-0.036376953125,
-0.05914306640625,
-0.022857666015625,
0.003726959228515625,
-0.00693511962890625,
-0.0187225341796875,
-0.003841400146484375,
0.0100555419921875,
-0.0322265625,
0.033447265625,
-0.0240936279296875,
0.028106689453125,
-0.03765869140625,
-0.01812744140625,
0.002498626708984375,
-0.01079559326171875,
-0.055816650390625,
0.0050201416015625,
-0.0187530517578125,
-0.0272064208984375,
-0.0002467632293701172,
0.011138916015625,
0.002368927001953125,
-0.006511688232421875,
0.01535797119140625,
0.01425933837890625,
0.040008544921875,
-0.02740478515625,
0.0270538330078125,
-0.02001953125,
0.0297088623046875,
-0.0019512176513671875,
-0.01556396484375,
0.0011196136474609375,
-0.017425537109375,
-0.02642822265625,
-0.00489044189453125,
0.00621795654296875,
0.019805908203125,
-0.0032958984375,
-0.05584716796875,
0.031585693359375,
-0.019622802734375,
-0.06396484375,
-0.0478515625,
-0.00789642333984375,
-0.044708251953125,
-0.00714874267578125,
-0.0142669677734375,
-0.0238800048828125,
-0.0206451416015625,
0.060699462890625,
0.025665283203125,
-0.0188751220703125,
-0.0008702278137207031,
0.054107666015625,
0.00505828857421875,
-0.047454833984375,
-0.030517578125,
0.004718780517578125,
0.0323486328125,
-0.036651611328125,
0.04791259765625,
0.0065155029296875,
-0.00812530517578125,
0.08355712890625,
-0.028289794921875,
0.0650634765625,
-0.03094482421875,
0.0338134765625,
-0.00844573974609375,
-0.01409912109375,
0.041717529296875,
0.0296630859375,
-0.06768798828125,
-0.0299224853515625,
-0.00897216796875,
0.02740478515625,
-0.0241241455078125,
-0.0221710205078125,
0.0254058837890625,
-0.006412506103515625,
0.00037407875061035156,
0.0204010009765625,
-0.00722503662109375,
0.016082763671875,
0.039825439453125,
0.05023193359375,
-0.0080718994140625,
-0.00493621826171875,
0.02081298828125,
-0.03411865234375,
0.0182037353515625,
0.0109405517578125,
-0.0025463104248046875,
0.0033283233642578125,
0.01324462890625,
-0.0496826171875,
0.00798797607421875,
-0.00035262107849121094,
0.06414794921875,
0.0218505859375,
-0.021636962890625,
-0.057891845703125,
-0.004863739013671875,
0.0026340484619140625,
-0.0011281967163085938,
0.0205841064453125,
0.0260009765625,
-0.0010633468627929688,
-0.0215911865234375,
-0.00977325439453125,
0.0268707275390625,
-0.022979736328125,
-0.05401611328125,
-0.01483154296875,
-0.032562255859375,
0.006420135498046875,
0.004840850830078125,
0.0595703125,
0.0029315948486328125,
0.0272674560546875,
-0.035125732421875,
0.0197601318359375,
0.003925323486328125,
0.051605224609375,
0.003997802734375,
-0.005306243896484375,
-0.0087890625,
0.033966064453125,
-0.0006361007690429688,
-0.012664794921875,
0.01056671142578125,
-0.005146026611328125,
0.029571533203125,
0.01386260986328125,
-0.011932373046875,
0.0302276611328125,
-0.033660888671875,
-0.011566162109375,
0.0445556640625,
-0.0177154541015625,
-0.05535888671875,
-0.03961181640625,
-0.00348663330078125,
0.0247650146484375,
-0.01459503173828125,
-0.03936767578125,
0.04852294921875,
-0.031982421875,
0.01218414306640625,
0.035308837890625,
-0.0439453125,
0.01218414306640625,
0.0216064453125,
0.0175323486328125,
-0.0452880859375,
-0.0169525146484375,
-0.0282440185546875,
0.043975830078125,
-0.050201416015625,
-0.01148223876953125,
0.03448486328125,
-0.05279541015625,
0.012939453125,
-0.0176239013671875,
0.004547119140625,
0.006145477294921875,
0.0223388671875,
0.033111572265625,
0.0255279541015625,
-0.0687255859375,
-0.01140594482421875,
-0.038818359375,
-0.01094818115234375,
-0.0210113525390625,
-0.029022216796875,
-0.03302001953125,
-0.01708984375,
0.0001748800277709961,
0.0272674560546875,
-0.0312042236328125,
-0.006450653076171875,
-0.0014505386352539062,
0.0272979736328125,
0.005214691162109375,
0.0721435546875,
-0.0296630859375,
0.07244873046875,
-0.01146697998046875,
0.050994873046875,
-0.0007343292236328125,
0.03424072265625,
-0.00887298583984375,
-0.0161285400390625,
0.011688232421875,
-0.0721435546875,
-0.0131683349609375,
-0.0087738037109375,
-0.0213775634765625,
0.02545166015625,
0.01096343994140625,
0.005039215087890625,
0.005279541015625,
-0.02362060546875,
-0.011077880859375,
-0.0309906005859375,
0.07159423828125,
-0.0025997161865234375,
0.019134521484375,
0.005950927734375,
0.006519317626953125,
0.0223846435546875,
-0.017303466796875,
-0.0211029052734375,
0.0167388916015625,
0.00725555419921875,
0.026458740234375,
-0.0268402099609375,
-0.058349609375,
0.04913330078125,
0.115234375,
0.047149658203125,
0.080322265625,
0.02178955078125,
0.038177490234375,
0.0255889892578125,
0.03704833984375,
-0.031402587890625,
-0.052581787109375,
0.036376953125,
0.01132965087890625,
-0.041046142578125,
0.033111572265625,
-0.035858154296875,
0.0300750732421875,
0.043975830078125,
0.0709228515625,
-0.054534912109375,
0.01139068603515625,
0.008209228515625,
-0.03289794921875,
0.029022216796875,
-0.01337432861328125,
0.00490570068359375,
-0.02850341796875,
0.06121826171875,
0.00006973743438720703,
-0.0080108642578125,
0.020599365234375,
-0.01399993896484375,
0.01044464111328125,
-0.0018100738525390625,
0.039276123046875,
-0.006381988525390625,
-0.08538818359375,
-0.006122589111328125,
0.031982421875,
-0.01245880126953125,
-0.016357421875,
-0.020965576171875,
0.02264404296875,
-0.05120849609375,
-0.06512451171875,
-0.01442718505859375,
-0.0116119384765625,
-0.01172637939453125,
0.0180511474609375,
0.0262603759765625,
0.033447265625,
0.041534423828125,
0.00936126708984375,
-0.00121307373046875,
-0.0023326873779296875,
0.03802490234375,
0.0292205810546875,
0.00653076171875,
0.031829833984375,
0.00809478759765625,
-0.0755615234375,
0.00262451171875,
-0.06005859375,
0.02362060546875,
-0.015106201171875,
-0.022216796875,
0.034820556640625,
0.05279541015625,
-0.044097900390625,
0.04034423828125,
0.0182647705078125,
-0.032135009765625,
-0.0007791519165039062,
0.02764892578125,
-0.0948486328125,
-0.0374755859375,
0.01436614990234375,
-0.006885528564453125,
0.01506805419921875,
0.0205230712890625,
-0.0762939453125,
0.08465576171875,
0.0002722740173339844,
0.03369140625,
-0.002147674560546875,
0.030914306640625,
-0.0364990234375,
-0.00818634033203125,
-0.028228759765625,
0.024993896484375,
0.0275421142578125,
0.0270843505859375,
-0.048828125,
-0.0218048095703125,
-0.005222320556640625,
0.040679931640625,
-0.0154571533203125,
0.00275421142578125,
-0.018524169921875,
-0.0118865966796875,
0.043426513671875,
0.03887939453125,
0.02947998046875,
0.01303863525390625,
0.005126953125,
0.0229339599609375,
-0.002079010009765625,
-0.04705810546875,
0.014007568359375,
-0.032440185546875,
-0.0267333984375,
0.016815185546875,
0.0175933837890625,
0.0167083740234375,
-0.007785797119140625,
-0.041107177734375,
-0.036865234375,
0.01605224609375,
0.019256591796875,
0.0029392242431640625,
-0.035400390625,
0.0271148681640625,
-0.00511932373046875,
-0.038787841796875,
0.04205322265625,
-0.05328369140625,
0.0428466796875,
0.0089874267578125,
-0.0215911865234375,
0.005889892578125,
0.02093505859375,
-0.0328369140625,
-0.039794921875,
-0.01568603515625,
0.0015897750854492188,
-0.027923583984375,
-0.006103515625,
-0.0003540515899658203,
0.050079345703125,
-0.0447998046875,
-0.07122802734375,
0.030242919921875,
0.02996826171875,
0.01163482666015625,
-0.045806884765625,
-0.005626678466796875,
0.0193328857421875,
0.034149169921875,
-0.0012941360473632812,
0.04205322265625,
-0.002197265625,
0.039581298828125,
0.012969970703125,
-0.00685882568359375,
0.01087188720703125,
0.030517578125,
0.024169921875,
0.04290771484375,
-0.037841796875,
-0.014801025390625,
-0.048248291015625,
-0.006343841552734375,
0.0255279541015625,
0.05596923828125,
0.038482666015625,
0.0577392578125,
0.0284423828125,
-0.031585693359375,
-0.032623291015625,
0.0855712890625,
-0.022186279296875,
0.040191650390625,
-0.056396484375,
-0.07916259765625,
0.032562255859375,
0.037322998046875,
0.018035888671875,
0.0271148681640625,
0.00832366943359375,
-0.011932373046875,
-0.00504302978515625,
0.001293182373046875,
0.037567138671875,
-0.025909423828125,
0.01336669921875,
-0.042938232421875,
0.00740814208984375,
-0.0163116455078125,
-0.01419830322265625,
-0.0157470703125,
0.006603240966796875,
0.01198577880859375,
0.0013408660888671875,
0.0167083740234375,
-0.005359649658203125,
0.00382232666015625,
0.004547119140625,
-0.043121337890625,
0.00034928321838378906,
0.00287628173828125,
-0.03326416015625,
0.00696563720703125,
-0.039703369140625,
-0.046539306640625,
0.0168304443359375,
0.041351318359375,
-0.018798828125,
0.0245513916015625,
0.06396484375,
-0.003429412841796875,
-0.038848876953125,
-0.0012683868408203125,
0.053375244140625,
-0.01311492919921875,
0.00106048583984375,
0.043701171875,
-0.05035400390625,
-0.037506103515625,
0.0007476806640625,
0.030853271484375,
-0.01513671875,
0.02545166015625,
0.01287078857421875,
0.01171112060546875,
-0.0113983154296875,
0.020904541015625,
-0.0086212158203125,
0.0167083740234375,
0.0109405517578125,
0.033660888671875,
-0.0082855224609375,
-0.041473388671875,
-0.045989990234375,
0.02569580078125,
0.0020694732666015625,
-0.03472900390625,
0.0233306884765625,
-0.0026874542236328125,
0.00812530517578125,
-0.0018987655639648438,
0.0290374755859375,
-0.02471923828125,
-0.044525146484375,
-0.0283966064453125,
0.01406097412109375,
0.01111602783203125,
0.0125274658203125,
-0.02935791015625,
0.052825927734375,
0.0023059844970703125,
-0.0263671875,
-0.002452850341796875,
-0.07061767578125,
0.0011739730834960938,
0.0294647216796875,
0.0289764404296875,
-0.0227813720703125,
0.023193359375,
-0.00124359130859375,
0.00469970703125,
0.0167083740234375,
0.0328369140625,
0.035797119140625,
0.0018033981323242188,
-0.0009741783142089844,
0.08636474609375,
0.05584716796875,
0.00494384765625,
0.036041259765625,
0.02276611328125,
-0.04681396484375,
0.0478515625,
-0.019805908203125,
-0.0166473388671875,
-0.031951904296875,
-0.012481689453125,
0.0229339599609375,
-0.026947021484375,
-0.026275634765625,
-0.051971435546875,
0.0173187255859375,
0.0770263671875,
0.01375579833984375,
-0.061981201171875,
0.013763427734375,
-0.049560546875,
0.07684326171875,
0.034332275390625,
-0.00902557373046875,
-0.0134735107421875,
0.01465606689453125,
-0.02984619140625,
-0.02496337890625,
-0.036590576171875,
0.0209503173828125,
-0.055206298828125,
0.0057220458984375,
0.03839111328125,
-0.00299835205078125,
0.0074310302734375,
-0.0301513671875,
-0.0271148681640625,
0.0262451171875,
-0.04583740234375,
-0.00582122802734375,
-0.02728271484375,
0.0194244384765625,
-0.0212860107421875,
-0.0029621124267578125,
0.0307769775390625,
-0.004180908203125,
-0.0272369384765625,
-0.0297088623046875,
-0.0080718994140625,
-0.0108489990234375,
-0.054901123046875,
-0.061279296875,
0.01180267333984375,
0.01500701904296875,
-0.029327392578125,
0.002349853515625,
0.0214080810546875,
0.0008687973022460938,
-0.00940704345703125,
0.00007635354995727539,
-0.0127716064453125,
-0.0005822181701660156,
0.00861358642578125,
-0.012939453125,
0.017913818359375,
-0.031158447265625,
-0.0003361701965332031,
-0.052886962890625,
0.0244140625,
0.022705078125,
-0.03460693359375,
0.0009579658508300781,
-0.0139617919921875,
0.03289794921875,
0.02630615234375,
-0.0194549560546875,
0.02490234375,
0.03021240234375,
0.004611968994140625,
-0.00591278076171875,
-0.01715087890625,
-0.00954437255859375,
-0.0267333984375,
0.0285491943359375,
0.022186279296875,
0.01055908203125,
-0.0026397705078125,
-0.038177490234375,
-0.01042938232421875,
0.0096588134765625,
-0.0308074951171875,
0.0029621124267578125,
-0.08184814453125,
-0.0293731689453125,
-0.00547027587890625,
-0.00290679931640625,
-0.0035190582275390625,
-0.0163116455078125,
-0.0260009765625,
0.0020160675048828125,
0.02655029296875,
0.0203094482421875,
-0.018768310546875,
-0.01561737060546875,
0.09619140625,
-0.07659912109375,
-0.041748046875,
0.0204315185546875,
0.0198211669921875,
0.020660400390625,
-0.048553466796875,
0.00963592529296875,
-0.0159454345703125,
-0.01413726806640625,
0.0215606689453125,
0.0035381317138671875,
0.031585693359375,
-0.035064697265625,
-0.0419921875,
-0.02337646484375,
0.0181884765625,
-0.007595062255859375,
0.0225982666015625,
0.017913818359375,
0.0029010772705078125,
0.00496673583984375,
0.031890869140625,
-0.04742431640625,
0.02056884765625,
-0.0201263427734375,
-0.00838470458984375,
-0.00799560546875,
0.039947509765625,
0.0408935546875,
0.0009083747863769531,
0.00893402099609375,
0.01788330078125,
0.027587890625,
-0.022430419921875,
-0.0027141571044921875,
-0.05426025390625,
0.0168914794921875,
0.00409698486328125
] |
75364fd03933419065fc064d12ea03143bac7b5a
|
Wordpress Stackexchange
Q: Where are wordpress custom types stored? Where are custom types stored? Because when a custom type is created, in wp_posts, the post type is set to the <new_custom_post_type>. But where are the details of the new custom post type stored??
A: You can use the function get_post_types to get information on any and all post types that are active at that time. To get info on a specific post type, use get_post_type_object.
|
Q: Where are wordpress custom types stored? Where are custom types stored? Because when a custom type is created, in wp_posts, the post type is set to the <new_custom_post_type>. But where are the details of the new custom post type stored??
A: You can use the function get_post_types to get information on any and all post types that are active at that time. To get info on a specific post type, use get_post_type_object.
A: I finally found the custom post type data. It is stored in the wp_post table where post_type = custom post type (e.g. "products"). The field (column) data is stored in wp_postmeta where the meta_key is the column name and meta_value is the column value.
This query will bring back all data associated with the custom post type "products":
SELECT P.ID, P.post_title, M.meta_key, M.meta_value
FROM wp_posts AS P
INNER JOIN wp_postmeta AS M ON M.post_id = P.ID
WHERE P.post_type = 'products' and P.post_status = 'publish'
ORDER BY post_title, meta_key
A: The details of custom post types aren't stored anywhere, they're loaded at runtime with each request via register_post_type calls.
A: As mentioned by @milo in this answer
Post Types aren't actually stored separately in the database however that being said...
via SQL
you can view all saved PUBLIC post types using the following sql query
SELECT DISTINCT( post_type ) FROM wp_posts;
Which will output something similar to:
+----------------------+
| post_type |
+----------------------+
| attachment |
| competition |
| custom_css |
| customize_changeset |
| deprecated_log |
| experts |
| magazine |
| nav_menu_item |
| page |
| post |
| revision |
+----------------------+
via WP CLI
Additionally if you have access to wp cli, you can run:
wp post-type list
Which will output something like:
+---------------------+-----------------------+--------------+--------------+--------+---------------------+
| name | label | description | hierarchical | public | capability_type |
+---------------------+-----------------------+--------------+--------------+--------+---------------------+
| post | Posts | | | 1 | post |
| page | Pages | | 1 | 1 | page |
| attachment | Media | | | 1 | post |
| revision | Revisions | | | | post |
| nav_menu_item | Navigation Menu Items | | | | post |
| custom_css | Custom CSS | | | | post |
| customize_changeset | Changesets | | | | customize_changeset |
| deprecated_log | Deprecated Calls | | | | post |
+---------------------+-----------------------+--------------+--------------+--------+---------------------+
A: WordPress default comes with some sample post types like pages, posts etc. Wordpress has given option to create our own custom post types also. Both default & custom posts are stored in single table "wp_posts" by differentiating all posts types based on "post_type" column in "wp_posts" table.
Eg:
pages--> post_type="page",
testiminials--> post_type="testimonials" etc
To grab more information about this post_types, which would be available at "wp_postmeta " table.
|
wordpress
|
{
"language": "en",
"length": 464,
"provenance": "stackexchange_00019.jsonl.gz:419225",
"question_score": "25",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49581"
}
|
[
0.02557373046875,
-0.014404296875,
0.0038051605224609375,
-0.02801513671875,
-0.005214691162109375,
-0.00548553466796875,
0.0369873046875,
0.014801025390625,
-0.0185089111328125,
-0.005687713623046875,
0.0015163421630859375,
0.003116607666015625,
-0.0243072509765625,
-0.0379638671875,
0.0279541015625,
-0.03680419921875,
0.05450439453125,
-0.046295166015625,
0.0267791748046875,
-0.00829315185546875,
0.019317626953125,
0.017120361328125,
0.054656982421875,
0.08251953125,
0.02880859375,
-0.0218048095703125,
0.0313720703125,
-0.0166778564453125,
0.02386474609375,
0.004215240478515625,
0.0255126953125,
-0.020172119140625,
0.00396728515625,
0.01441192626953125,
0.01279449462890625,
0.018280029296875,
0.00714874267578125,
0.005886077880859375,
0.020111083984375,
0.009521484375,
0.01309967041015625,
-0.009429931640625,
0.04052734375,
-0.0186920166015625,
0.01033782958984375,
-0.0321044921875,
0.007061004638671875,
-0.045501708984375,
0.0098724365234375,
-0.0210113525390625,
0.0272674560546875,
-0.020782470703125,
0.0531005859375,
-0.03643798828125,
-0.033843994140625,
-0.039703369140625,
0.021240234375,
-0.0254669189453125,
0.03350830078125,
-0.025909423828125,
-0.031494140625,
-0.033905029296875,
0.03729248046875,
-0.00003349781036376953,
0.00238800048828125,
0.010406494140625,
0.0689697265625,
0.0240020751953125,
-0.0579833984375,
-0.017669677734375,
0.041107177734375,
-0.0207672119140625,
0.01345062255859375,
-0.01727294921875,
0.0095672607421875,
-0.0216064453125,
0.020294189453125,
-0.0154266357421875,
-0.003681182861328125,
0.037750244140625,
0.00983428955078125,
-0.01171112060546875,
-0.02020263671875,
-0.025299072265625,
0.002849578857421875,
-0.0204315185546875,
-0.0174560546875,
-0.007579803466796875,
0.01436614990234375,
0.00530242919921875,
-0.00618743896484375,
-0.033538818359375,
0.032501220703125,
0.03399658203125,
-0.0200347900390625,
-0.0245819091796875,
-0.0089569091796875,
0.00995635986328125,
-0.0164947509765625,
0.02886962890625,
-0.0201873779296875,
-0.01166534423828125,
0.047943115234375,
-0.03216552734375,
0.034515380859375,
0.004993438720703125,
-0.041595458984375,
-0.0654296875,
0.0379638671875,
0.0256805419921875,
-0.01253509521484375,
0.025665283203125,
-0.0029087066650390625,
-0.032958984375,
-0.0147552490234375,
0.035064697265625,
-0.01108551025390625,
0.0211334228515625,
0.01401519775390625,
0.02716064453125,
0.0304107666015625,
0.05084228515625,
0.030029296875,
-0.0521240234375,
-0.0060882568359375,
-0.01009368896484375,
-0.035430908203125,
-0.05242919921875,
-0.02227783203125,
0.06610107421875,
-0.0225982666015625,
-0.027618408203125,
0.003696441650390625,
0.041778564453125,
-0.0024127960205078125,
-0.032440185546875,
0.006252288818359375,
-0.032745361328125,
-0.024810791015625,
0.04150390625,
-0.00783538818359375,
-0.05548095703125,
-0.0140380859375,
-0.0014925003051757812,
0.0113677978515625,
0.0306243896484375,
0.007778167724609375,
0.00601959228515625,
-0.0189361572265625,
-0.0273895263671875,
-0.0087738037109375,
-0.00795745849609375,
0.0223388671875,
0.0076141357421875,
0.003902435302734375,
-0.0205230712890625,
0.03411865234375,
-0.0316162109375,
-0.0285797119140625,
-0.054901123046875,
0.0216827392578125,
-0.001934051513671875,
-0.0261993408203125,
0.0137786865234375,
-0.013702392578125,
0.0221099853515625,
-0.0023326873779296875,
0.00751495361328125,
0.00888824462890625,
0.0034942626953125,
-0.00627899169921875,
-0.0091400146484375,
-0.01509857177734375,
-0.01983642578125,
-0.01171875,
-0.009735107421875,
-0.01374053955078125,
-0.037384033203125,
0.035614013671875,
0.0211639404296875,
-0.0121002197265625,
-0.017059326171875,
-0.0189361572265625,
0.0236663818359375,
-0.03997802734375,
0.041900634765625,
0.00763702392578125,
0.044036865234375,
0.005992889404296875,
0.0177154541015625,
-0.0017728805541992188,
0.033843994140625,
-0.087890625,
0.0001614093780517578,
0.0128021240234375,
0.043304443359375,
-0.0340576171875,
0.006305694580078125,
-0.00390625,
-0.0031032562255859375,
-0.051971435546875,
0.0210418701171875,
-0.015869140625,
0.0230560302734375,
-0.049530029296875,
0.0238189697265625,
-0.0238800048828125,
0.046173095703125,
0.0012569427490234375,
0.01270294189453125,
0.010833740234375,
-0.0178985595703125,
0.0103607177734375,
-0.0579833984375,
-0.032562255859375,
0.0077667236328125,
-0.02001953125,
0.0276336669921875,
-0.01349639892578125,
0.0124053955078125,
-0.0263519287109375,
-0.0225830078125,
-0.03076171875,
0.008026123046875,
0.034454345703125,
0.041473388671875,
-0.0261383056640625,
0.0046539306640625,
0.028900146484375,
0.047943115234375,
-0.05621337890625,
-0.01134490966796875,
-0.00406646728515625,
-0.00012743473052978516,
-0.0213623046875,
-0.0196685791015625,
-0.01189422607421875,
-0.07061767578125,
0.0122833251953125,
0.057586669921875,
0.0171966552734375,
0.030364990234375,
0.00685882568359375,
0.050323486328125,
0.06109619140625,
0.006473541259765625,
0.02056884765625,
0.0171966552734375,
0.035858154296875,
0.0723876953125,
0.006633758544921875,
0.003246307373046875,
0.00772857666015625,
0.004413604736328125,
0.01273345947265625,
0.01312255859375,
-0.01837158203125,
-0.0103302001953125,
0.035858154296875,
-0.0000641942024230957,
-0.006366729736328125,
-0.0021343231201171875,
0.0113525390625,
-0.006183624267578125,
0.07623291015625,
0.03619384765625,
0.07672119140625,
0.052947998046875,
-0.051239013671875,
0.02630615234375,
-0.00261688232421875,
0.005680084228515625,
0.00270843505859375,
-0.0227813720703125,
0.0108489990234375,
0.006561279296875,
-0.03399658203125,
0.00925445556640625,
0.034637451171875,
-0.00632476806640625,
-0.014434814453125,
0.01396942138671875,
-0.0592041015625,
-0.0056304931640625,
-0.0175323486328125,
-0.085693359375,
-0.007732391357421875,
0.04473876953125,
0.00400543212890625,
-0.025909423828125,
-0.0172576904296875,
0.053192138671875,
-0.00698089599609375,
0.05059814453125,
0.01555633544921875,
-0.015045166015625,
0.020843505859375,
-0.04974365234375,
0.02923583984375,
-0.023101806640625,
0.035430908203125,
0.07513427734375,
0.01309967041015625,
0.0038433074951171875,
0.01396942138671875,
0.003055572509765625,
0.01114654541015625,
0.02911376953125,
-0.006572723388671875,
-0.0274658203125,
-0.03814697265625,
-0.0008358955383300781,
0.0192108154296875,
0.01995849609375,
-0.0148468017578125,
-0.0276031494140625,
0.0014982223510742188,
0.0293426513671875,
-0.041046142578125,
-0.0251922607421875,
-0.006549835205078125,
-0.037841796875,
-0.0087890625,
-0.061187744140625,
-0.0104522705078125,
0.0124053955078125,
-0.07281494140625,
-0.006145477294921875,
0.0162811279296875,
-0.0089263916015625,
-0.01641845703125,
-0.0264739990234375,
-0.052276611328125,
-0.03997802734375,
0.0019283294677734375,
0.00354766845703125,
0.0012655258178710938,
0.09893798828125,
0.0154876708984375,
-0.05047607421875,
-0.01418304443359375,
-0.0116119384765625,
-0.033294677734375,
0.01465606689453125,
0.0012273788452148438,
-0.02215576171875,
0.07855224609375,
-0.003574371337890625,
-0.007083892822265625,
0.0545654296875,
-0.01190948486328125,
-0.0196380615234375,
-0.0018453598022460938,
-0.0012416839599609375,
0.021148681640625,
0.02923583984375,
-0.016021728515625,
-0.011505126953125,
0.027130126953125,
-0.046539306640625,
-0.0321044921875,
0.0185089111328125,
-0.029876708984375,
0.0267486572265625,
-0.016571044921875,
-0.01140594482421875,
-0.004364013671875,
0.0577392578125,
0.0258636474609375,
0.0221710205078125,
0.0089874267578125,
-0.01287078857421875,
0.043182373046875,
0.005710601806640625,
0.01065826416015625,
-0.033355712890625,
0.0009608268737792969,
-0.02398681640625,
0.04718017578125,
0.015869140625,
0.0177459716796875,
-0.0025348663330078125,
0.00937652587890625,
-0.0484619140625,
-0.10064697265625,
0.05377197265625,
-0.036865234375,
-0.00234222412109375,
-0.037841796875,
-0.0265045166015625,
0.0075836181640625,
0.12237548828125,
-0.061981201171875,
0.02386474609375,
0.00211334228515625,
0.00359344482421875,
-0.03314208984375,
-0.055419921875,
-0.08624267578125,
-0.01035308837890625,
-0.047454833984375,
0.00984954833984375,
-0.006229400634765625,
-0.004169464111328125,
-0.04620361328125,
0.046875,
-0.056304931640625,
-0.0232086181640625,
0.040374755859375,
-0.061248779296875,
0.0418701171875,
-0.0005831718444824219,
0.05364990234375,
-0.0457763671875,
-0.018951416015625,
-0.035797119140625,
-0.06866455078125,
-0.00608062744140625,
-0.011810302734375,
0.03057861328125,
0.01340484619140625,
-0.03143310546875,
-0.0100860595703125,
0.02099609375,
0.00998687744140625,
0.034423828125,
0.018798828125,
0.0178680419921875,
-0.00011420249938964844,
-0.038970947265625,
0.00858306884765625,
-0.042816162109375,
-0.0258941650390625,
-0.0249481201171875,
-0.01236724853515625,
0.0195159912109375,
-0.00252532958984375,
0.0137481689453125,
0.01119232177734375,
-0.00412750244140625,
0.0092315673828125,
0.0145416259765625,
-0.0099029541015625,
0.023651123046875,
-0.0099945068359375,
0.006011962890625,
-0.019195556640625,
-0.005191802978515625,
0.053680419921875,
-0.007015228271484375,
0.005146026611328125,
0.0024166107177734375,
0.098388671875,
0.01197052001953125,
-0.01934814453125,
-0.0469970703125,
0.00939178466796875,
0.0443115234375,
0.020111083984375,
0.016357421875,
0.0360107421875,
-0.007678985595703125,
-0.0276031494140625,
0.0257415771484375,
-0.0257415771484375,
-0.01556396484375,
0.08197021484375,
0.0222625732421875,
0.01030731201171875,
0.0012359619140625,
-0.031494140625,
0.01995849609375,
0.049774169921875,
-0.006580352783203125,
-0.05450439453125,
0.014007568359375,
0.0863037109375,
-0.0662841796875,
0.05877685546875,
-0.0382080078125,
-0.061309814453125,
0.036285400390625,
-0.007511138916015625,
0.01537322998046875,
0.00276947021484375,
-0.007770538330078125,
0.0172576904296875,
-0.0292510986328125,
0.02294921875,
0.00022661685943603516,
-0.00911712646484375,
0.01873779296875,
0.0369873046875,
0.01448822021484375,
0.03790283203125,
-0.006561279296875,
0.01715087890625,
-0.0239410400390625,
-0.03875732421875,
-0.060791015625,
0.0113372802734375,
-0.00682830810546875,
0.017486572265625,
0.064453125,
-0.0200653076171875,
0.02838134765625,
0.038604736328125,
0.0130767822265625,
0.0267181396484375,
-0.02301025390625,
0.0288543701171875,
-0.015777587890625,
-0.0011310577392578125,
-0.00666046142578125,
-0.0065155029296875,
-0.00785064697265625,
0.05419921875,
-0.01544189453125,
0.032135009765625,
-0.0066070556640625,
0.053558349609375,
0.047760009765625,
0.028106689453125,
0.0151824951171875,
0.004657745361328125,
-0.0127410888671875,
0.00823974609375,
-0.0285491943359375,
-0.0262908935546875,
-0.016387939453125,
0.0086822509765625,
0.034210205078125,
-0.0212554931640625,
0.0060577392578125,
0.03411865234375,
-0.001323699951171875,
0.01666259765625,
-0.0069427490234375,
-0.005828857421875,
-0.0430908203125,
0.020294189453125,
0.03863525390625,
0.0197296142578125,
-0.04150390625,
-0.0237274169921875,
0.00042176246643066406,
-0.060394287109375,
-0.00493621826171875,
-0.019195556640625,
-0.034393310546875,
-0.00014448165893554688,
0.00879669189453125,
-0.06689453125,
-0.0157012939453125,
0.0303497314453125,
-0.043243408203125,
-0.0238189697265625,
-0.000438690185546875,
-0.0279541015625,
-0.0082550048828125,
-0.0191802978515625,
0.01007080078125,
0.00872802734375,
-0.0225830078125,
-0.00439453125,
0.01509857177734375,
0.047760009765625,
-0.00417327880859375,
-0.0132904052734375,
-0.0195465087890625,
-0.0249176025390625,
-0.03173828125,
-0.01849365234375,
-0.032501220703125,
-0.03570556640625,
-0.0108489990234375,
0.0017061233520507812,
0.015869140625,
-0.0225067138671875,
-0.0265350341796875,
-0.0082550048828125,
0.0168609619140625,
0.0233001708984375,
0.0138092041015625,
0.02227783203125,
0.08349609375,
-0.028076171875,
0.0941162109375,
0.0290985107421875,
0.036651611328125,
-0.056610107421875,
-0.0181732177734375,
0.0311126708984375,
-0.0132904052734375,
-0.04754638671875,
-0.07037353515625,
-0.0008578300476074219,
0.03021240234375,
0.0687255859375,
-0.0164794921875,
0.02557373046875,
-0.00018644332885742188,
-0.0005207061767578125,
-0.0101776123046875,
-0.0021209716796875,
0.004734039306640625,
0.010406494140625,
0.02899169921875,
-0.0032901763916015625,
0.0135650634765625,
0.02130126953125,
-0.0018463134765625,
-0.00376129150390625,
-0.000579833984375,
0.0211944580078125,
0.0021381378173828125,
-0.0487060546875,
0.024200439453125,
0.039459228515625,
0.02728271484375,
0.05389404296875,
-0.02001953125,
0.032501220703125,
0.03472900390625,
0.0067596435546875,
-0.0263824462890625,
-0.0266265869140625,
0.05926513671875,
0.0225982666015625,
-0.0291595458984375,
0.04833984375,
-0.0251922607421875,
0.00046515464782714844,
0.050506591796875,
0.06298828125,
-0.07562255859375,
0.01331329345703125,
0.0340576171875,
0.0137176513671875,
0.0142974853515625,
0.0029582977294921875,
-0.0290985107421875,
-0.042694091796875,
-0.0068206787109375,
-0.01428985595703125,
-0.035308837890625,
-0.0306243896484375,
0.0106964111328125,
0.00006949901580810547,
-0.00862884521484375,
0.049224853515625,
0.00815582275390625,
0.01369476318359375,
-0.02252197265625,
0.00250244140625,
-0.0032863616943359375,
-0.018829345703125,
0.030914306640625,
-0.0033721923828125,
0.00868988037109375,
-0.033966064453125,
0.04473876953125,
-0.01727294921875,
0.00027179718017578125,
0.001422882080078125,
-0.0166778564453125,
0.054931640625,
0.0501708984375,
-0.006473541259765625,
-0.00008338689804077148,
0.0081329345703125,
0.00725555419921875,
-0.0732421875,
-0.054962158203125,
0.0237274169921875,
0.055511474609375,
-0.0675048828125,
0.05010986328125,
-0.0134735107421875,
-0.038848876953125,
-0.0093231201171875,
0.006389617919921875,
0.0537109375,
-0.0457763671875,
0.00232696533203125,
0.043609619140625,
0.040679931640625,
0.006832122802734375,
-0.01317596435546875,
0.00264739990234375,
0.010162353515625,
0.06585693359375,
-0.0308380126953125,
0.0212554931640625,
0.0257568359375,
-0.007396697998046875,
-0.0445556640625,
0.04864501953125,
0.018585205078125,
-0.0002543926239013672,
0.023406982421875,
0.01410675048828125,
-0.0312347412109375,
-0.009765625,
-0.04254150390625,
0.03973388671875,
-0.031524658203125,
0.06976318359375,
-0.06964111328125,
-0.0207061767578125,
0.0037136077880859375,
0.035369873046875,
0.08905029296875,
0.0032711029052734375,
0.0132598876953125,
0.0173187255859375,
0.0941162109375,
0.021514892578125,
-0.029815673828125,
0.004947662353515625,
0.0012035369873046875,
0.040130615234375,
0.0784912109375,
-0.0171356201171875,
0.04437255859375,
0.00962066650390625,
-0.01403045654296875,
0.009063720703125,
-0.002216339111328125,
-0.0172576904296875,
-0.01461029052734375,
-0.04345703125,
-0.01009368896484375,
-0.0101165771484375,
-0.01229095458984375,
0.018463134765625,
0.0306549072265625,
0.02783203125,
0.068603515625,
-0.02294921875,
-0.0083770751953125,
-0.0185089111328125,
0.0584716796875,
0.0119476318359375,
0.02642822265625,
0.013031005859375,
0.00676727294921875,
0.0116729736328125,
-0.0194091796875,
0.0012187957763671875,
0.015594482421875,
-0.0158538818359375,
0.06195068359375,
0.040771484375,
0.034088134765625,
-0.033660888671875,
0.011932373046875,
0.0260162353515625,
0.076416015625,
-0.055938720703125,
-0.0504150390625,
0.01190948486328125,
0.0169830322265625,
-0.0038776397705078125,
0.019378662109375,
0.0144805908203125,
0.0247344970703125,
0.0609130859375,
-0.04718017578125,
-0.0160369873046875,
0.0296630859375,
0.049530029296875,
-0.0185394287109375,
-0.0225372314453125,
-0.047454833984375,
-0.050567626953125,
-0.0214691162109375,
-0.028167724609375,
0.006191253662109375,
0.035675048828125,
0.04937744140625,
0.021209716796875,
0.02685546875,
-0.006793975830078125,
-0.01483917236328125,
-0.0002536773681640625,
-0.005397796630859375,
0.0295867919921875,
-0.03607177734375,
-0.022216796875,
-0.0012865066528320312,
0.04571533203125,
0.0174560546875,
0.033477783203125,
0.0252838134765625,
-0.008697509765625,
-0.0125274658203125,
0.00904083251953125,
0.030914306640625,
-0.026885986328125,
0.022552490234375,
-0.032318115234375,
0.005619049072265625,
0.027374267578125,
-0.0117950439453125,
-0.0035648345947265625,
-0.0335693359375,
0.0762939453125,
-0.00525665283203125,
0.032257080078125,
0.00716400146484375,
-0.0194244384765625,
0.02508544921875,
0.0028209686279296875,
0.05145263671875,
0.0289459228515625,
-0.04132080078125,
-0.016021728515625,
-0.044189453125,
-0.01177215576171875,
0.0235137939453125,
0.037139892578125,
0.032135009765625,
-0.0282135009765625,
0.0259552001953125,
-0.02532958984375,
-0.023223876953125,
0.0260009765625,
0.044952392578125,
0.0144805908203125,
0.010284423828125,
0.0311279296875,
-0.09613037109375,
-0.03778076171875,
-0.01702880859375,
-0.0126190185546875,
0.01361846923828125,
-0.0109100341796875,
0.05987548828125,
0.0240325927734375,
-0.00995635986328125,
0.037078857421875,
-0.032257080078125,
-0.0164642333984375,
0.0279388427734375,
0.0146484375,
0.0189056396484375,
-0.01122283935546875,
-0.0023212432861328125,
0.01519012451171875,
0.0408935546875,
-0.0269317626953125,
-0.001129150390625,
-0.0203704833984375,
0.0294647216796875,
-0.0208282470703125,
-0.001567840576171875,
-0.0277099609375,
-0.0156707763671875,
-0.01290130615234375,
-0.0145263671875,
0.015167236328125,
-0.0196990966796875,
-0.009765625,
0.0186767578125,
0.01090240478515625,
-0.055816650390625,
0.052825927734375,
-0.064453125,
0.0931396484375,
0.037353515625,
0.01042938232421875,
-0.035858154296875,
-0.0199737548828125,
-0.0275421142578125,
-0.023529052734375,
0.0101776123046875,
0.0104217529296875,
-0.0015153884887695312,
-0.039764404296875,
-0.017578125,
-0.016876220703125,
0.0184326171875,
-0.037384033203125,
-0.010040283203125,
-0.02618408203125,
-0.00899505615234375,
0.008331298828125,
-0.0045013427734375,
-0.0252838134765625,
-0.048614501953125,
0.005382537841796875,
0.02435302734375,
-0.01258087158203125,
0.011810302734375,
-0.01244354248046875,
-0.005069732666015625,
0.066650390625,
0.0115509033203125,
-0.04473876953125,
0.0026092529296875,
-0.039825439453125,
0.0286102294921875,
0.044830322265625,
-0.04498291015625,
0.03631591796875,
0.07745361328125,
0.01476287841796875,
0.0031585693359375,
-0.007518768310546875,
-0.0270538330078125,
0.0115203857421875,
0.0247955322265625,
0.031707763671875,
-0.0297088623046875,
-0.007236480712890625,
0.04931640625,
0.0121917724609375,
0.09136962890625,
0.002201080322265625,
-0.0167388916015625,
0.022491455078125,
-0.00780487060546875,
-0.0240478515625,
-0.037017822265625,
-0.00007832050323486328,
-0.038848876953125,
-0.02081298828125,
-0.05352783203125,
0.049407958984375,
0.045440673828125,
-0.01100921630859375,
-0.044647216796875,
0.04132080078125,
-0.03045654296875,
-0.01300811767578125,
-0.08062744140625,
0.027191162109375,
0.0013914108276367188,
-0.00011992454528808594,
-0.018096923828125,
-0.0277557373046875,
-0.022186279296875,
0.0272064208984375,
-0.012664794921875,
0.0352783203125,
0.0207366943359375,
-0.040069580078125,
-0.050933837890625,
-0.0306396484375,
-0.01513671875,
0.018768310546875,
0.0209503173828125,
-0.0300750732421875,
0.032470703125,
0.03985595703125,
-0.035125732421875,
-0.003757476806640625,
-0.00434112548828125,
0.010650634765625,
-0.007289886474609375,
-0.02825927734375,
0.003124237060546875,
-0.007358551025390625,
0.0259246826171875,
0.0177154541015625,
0.00449371337890625,
-0.02801513671875,
0.005893707275390625,
-0.0095672607421875,
-0.05133056640625,
-0.004917144775390625,
0.0267486572265625,
-0.045501708984375,
0.0059051513671875,
0.002765655517578125,
0.005199432373046875,
-0.0239410400390625,
0.017181396484375,
-0.0099334716796875,
-0.0200042724609375,
0.0047760009765625,
-0.024932861328125,
-0.043609619140625,
0.026275634765625,
-0.024139404296875,
0.004154205322265625,
0.0254364013671875,
-0.021514892578125,
0.004215240478515625,
0.011016845703125,
0.01800537109375,
0.002529144287109375,
0.0030994415283203125,
-0.0217742919921875,
0.0233306884765625,
-0.006099700927734375,
0.031036376953125,
-0.040863037109375,
0.0008215904235839844,
-0.0013132095336914062,
0.032135009765625,
-0.00433349609375,
0.0196685791015625,
-0.026763916015625,
0.07891845703125,
0.02203369140625,
0.043701171875,
0.017547607421875,
-0.0085296630859375,
-0.01110076904296875,
0.058868408203125,
-0.03778076171875,
-0.0265350341796875,
-0.031646728515625,
-0.0238189697265625,
0.0127716064453125,
-0.0162811279296875,
0.007350921630859375,
-0.0310516357421875,
-0.008636474609375,
0.01534271240234375,
-0.00934600830078125,
0.0182037353515625
] |
41215cd9c5f93057c6a8ce8abc2085533bbe913e
|
Wordpress Stackexchange
Q: Multisite htaccess on localhost with WP as an SVN external? I've mimicked Otto's setup here: http://ottopress.com/2011/creating-a-wordpress-site-using-svn/ and my brief example is below.
That tutorial is specific to a single site install, and specifies a single domain. How can I customize the htaccess below to be suitable for multisite? Note that the multisite htaccess WordPress provides doesn't work because the wp directory is custom.
Directory Setup
*
*C:\wamp\www\my_site - Site root
*C:\wamp\www\my_site\wp-config.php - Config
*C:\wamp\www\my_site\wp - WordPress as an SVN external
*C:\wamp\www\my_site\custom-content - Custom content dir
Apache Setup
<VirtualHost 127.0.0.1>
ServerName example.com
DocumentRoot "C:/wamp/www/my_site"
ServerAdmin [email protected]
<Directory C:/wamp/www/my_site>
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ wp/index.php [L]
A: For now, this is unsolvable according to Mark Jaquith, as noted here.
Q: Does this support WordPress in multisite mode?
|
Q: Multisite htaccess on localhost with WP as an SVN external? I've mimicked Otto's setup here: http://ottopress.com/2011/creating-a-wordpress-site-using-svn/ and my brief example is below.
That tutorial is specific to a single site install, and specifies a single domain. How can I customize the htaccess below to be suitable for multisite? Note that the multisite htaccess WordPress provides doesn't work because the wp directory is custom.
Directory Setup
*
*C:\wamp\www\my_site - Site root
*C:\wamp\www\my_site\wp-config.php - Config
*C:\wamp\www\my_site\wp - WordPress as an SVN external
*C:\wamp\www\my_site\custom-content - Custom content dir
Apache Setup
<VirtualHost 127.0.0.1>
ServerName example.com
DocumentRoot "C:/wamp/www/my_site"
ServerAdmin [email protected]
<Directory C:/wamp/www/my_site>
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ wp/index.php [L]
A: For now, this is unsolvable according to Mark Jaquith, as noted here.
Q: Does this support WordPress in multisite mode?
A: No. Not until
WordPress supports WordPress-in-a-subdirectory installation for
multisite. If you're a WordPress hacker who wants to help with that
feature, drop me a line
A: Not sure if this is exactly relevant, but Before You Create A Network: WordPress_Settings_Requirements says
Giving WordPress its own directory will not work in WordPress 3.0 with multisite enabled. If you wish to install WordPress in a folder AND have that folder name it will work. Domain mapping, however, will not work.
I'm not sure what AND have that folder name means there.
|
wordpress
|
{
"language": "en",
"length": 243,
"provenance": "stackexchange_00019.jsonl.gz:419227",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49585"
}
|
[
0.058441162109375,
-0.00872802734375,
0.005374908447265625,
-0.051727294921875,
0.01384735107421875,
-0.0143280029296875,
0.047332763671875,
-0.0164642333984375,
-0.0203399658203125,
0.0049285888671875,
-0.025177001953125,
0.0261383056640625,
-0.008148193359375,
-0.027435302734375,
0.039520263671875,
-0.0175933837890625,
0.0087890625,
0.0203704833984375,
0.041534423828125,
-0.00815582275390625,
-0.008819580078125,
0.007030487060546875,
0.00911712646484375,
-0.0091552734375,
0.01557159423828125,
-0.0584716796875,
0.0986328125,
-0.0264434814453125,
0.0347900390625,
-0.018798828125,
0.02227783203125,
-0.0034008026123046875,
0.03302001953125,
0.0139312744140625,
-0.045013427734375,
-0.039642333984375,
-0.0247650146484375,
0.0082550048828125,
-0.0276031494140625,
0.0289459228515625,
0.018035888671875,
-0.0175323486328125,
0.0535888671875,
0.0141448974609375,
0.0318603515625,
-0.057342529296875,
0.0648193359375,
-0.059326171875,
-0.0009598731994628906,
-0.0169830322265625,
-0.044464111328125,
0.03228759765625,
-0.026763916015625,
-0.029022216796875,
0.00824737548828125,
-0.0004582405090332031,
0.034698486328125,
-0.01494598388671875,
0.018157958984375,
-0.0301666259765625,
-0.045379638671875,
0.013427734375,
0.028045654296875,
0.0282135009765625,
-0.03887939453125,
-0.003612518310546875,
0.0173797607421875,
0.00650787353515625,
-0.041656494140625,
-0.041107177734375,
0.029205322265625,
-0.004146575927734375,
0.02197265625,
-0.016143798828125,
-0.0025348663330078125,
-0.049713134765625,
-0.01155853271484375,
-0.042877197265625,
0.035919189453125,
-0.01016998291015625,
-0.0068817138671875,
-0.040008544921875,
-0.045318603515625,
-0.0592041015625,
0.0428466796875,
0.00432586669921875,
-0.00795745849609375,
-0.0007734298706054688,
-0.0478515625,
0.006694793701171875,
-0.034912109375,
-0.0226287841796875,
-0.0256500244140625,
0.0012226104736328125,
-0.001567840576171875,
0.00821685791015625,
0.003444671630859375,
-0.00047516822814941406,
0.00431060791015625,
-0.0080718994140625,
0.050628662109375,
-0.06390380859375,
0.0330810546875,
-0.0222015380859375,
-0.001312255859375,
0.047210693359375,
0.0221710205078125,
0.056488037109375,
0.0214996337890625,
0.0008544921875,
-0.0031585693359375,
-0.0182952880859375,
-0.027587890625,
-0.0199127197265625,
-0.032196044921875,
0.010833740234375,
-0.056243896484375,
-0.01291656494140625,
-0.0009036064147949219,
-0.038482666015625,
0.00423431396484375,
0.034820556640625,
-0.036346435546875,
-0.0272674560546875,
0.00482940673828125,
-0.0001882314682006836,
-0.01116180419921875,
-0.0159912109375,
-0.0122528076171875,
0.04302978515625,
-0.0206756591796875,
-0.0003383159637451172,
0.02569580078125,
0.033050537109375,
-0.00888824462890625,
-0.01776123046875,
0.0423583984375,
0.0212554931640625,
0.005115509033203125,
0.01491546630859375,
-0.020172119140625,
-0.0185546875,
0.005523681640625,
-0.020172119140625,
-0.01629638671875,
0.01300048828125,
0.040069580078125,
0.0255126953125,
-0.03204345703125,
-0.0421142578125,
0.01248931884765625,
-0.02203369140625,
0.0302886962890625,
-0.012420654296875,
0.05059814453125,
-0.07073974609375,
0.0157318115234375,
-0.03997802734375,
0.0281524658203125,
-0.005855560302734375,
-0.01438140869140625,
0.00162506103515625,
0.037628173828125,
-0.0399169921875,
-0.055328369140625,
-0.0016069412231445312,
-0.0237884521484375,
-0.0203704833984375,
0.0177154541015625,
-0.0266265869140625,
-0.0240325927734375,
-0.003894805908203125,
0.033782958984375,
0.0027179718017578125,
-0.00400543212890625,
0.027557373046875,
0.0005311965942382812,
0.004299163818359375,
0.01036834716796875,
0.072021484375,
0.05096435546875,
0.004451751708984375,
0.034271240234375,
0.02972412109375,
-0.05645751953125,
0.05548095703125,
-0.0164947509765625,
0.066650390625,
0.0159759521484375,
-0.001117706298828125,
0.0158843994140625,
0.004390716552734375,
-0.021270751953125,
0.0158538818359375,
-0.016876220703125,
-0.03131103515625,
-0.021453857421875,
0.006557464599609375,
-0.026031494140625,
-0.01461029052734375,
-0.016845703125,
-0.019927978515625,
0.05902099609375,
-0.006855010986328125,
0.022369384765625,
0.016082763671875,
-0.007720947265625,
0.0249176025390625,
0.0379638671875,
0.01532745361328125,
-0.005840301513671875,
0.028045654296875,
-0.00415802001953125,
-0.06719970703125,
-0.048431396484375,
0.00131988525390625,
-0.0203399658203125,
0.0261688232421875,
-0.0037021636962890625,
0.0367431640625,
0.004802703857421875,
-0.040924072265625,
0.00093841552734375,
-0.01399993896484375,
0.0291290283203125,
-0.0139007568359375,
-0.028656005859375,
-0.0210723876953125,
0.00765228271484375,
0.004634857177734375,
-0.045379638671875,
0.055816650390625,
-0.006999969482421875,
0.02337646484375,
-0.045196533203125,
-0.01271820068359375,
-0.046966552734375,
-0.03314208984375,
-0.004962921142578125,
0.046112060546875,
0.0255126953125,
0.0015363693237304688,
-0.0278167724609375,
-0.005092620849609375,
0.044342041015625,
-0.00846099853515625,
0.005657196044921875,
0.0030460357666015625,
0.00159454345703125,
0.00501251220703125,
0.0226593017578125,
-0.02838134765625,
0.04052734375,
-0.06243896484375,
-0.018280029296875,
0.045013427734375,
-0.0212860107421875,
-0.0172576904296875,
-0.007389068603515625,
0.011077880859375,
0.0249481201171875,
0.026702880859375,
-0.030914306640625,
0.0229339599609375,
0.0090789794921875,
0.00897216796875,
0.033721923828125,
0.031768798828125,
-0.0028553009033203125,
0.0021991729736328125,
-0.0009613037109375,
-0.031524658203125,
0.01279449462890625,
0.045257568359375,
0.063720703125,
-0.0173492431640625,
-0.00574493408203125,
-0.0340576171875,
0.01080322265625,
0.0148468017578125,
-0.025054931640625,
-0.00002276897430419922,
0.0211181640625,
-0.0006771087646484375,
-0.006481170654296875,
-0.0499267578125,
0.040802001953125,
-0.0008645057678222656,
-0.00191497802734375,
-0.0128021240234375,
0.0007882118225097656,
0.023895263671875,
-0.046844482421875,
0.03851318359375,
0.03076171875,
-0.0307769775390625,
0.03387451171875,
-0.034423828125,
0.044769287109375,
-0.039825439453125,
0.00732421875,
0.047332763671875,
-0.0129547119140625,
-0.01467132568359375,
0.01251983642578125,
-0.010406494140625,
0.012939453125,
0.01476287841796875,
-0.00228118896484375,
-0.0107269287109375,
-0.056884765625,
-0.01522064208984375,
0.0033626556396484375,
0.0161590576171875,
0.00662994384765625,
-0.032989501953125,
0.0084991455078125,
0.0068206787109375,
-0.055389404296875,
-0.050994873046875,
-0.016571044921875,
-0.0252227783203125,
0.0323486328125,
-0.0079193115234375,
-0.006572723388671875,
-0.0285797119140625,
0.007617950439453125,
0.005550384521484375,
0.0126495361328125,
-0.01439666748046875,
-0.061676025390625,
-0.07916259765625,
-0.09405517578125,
-0.052703857421875,
-0.0187530517578125,
0.0135498046875,
0.01727294921875,
-0.00643157958984375,
0.005245208740234375,
-0.002696990966796875,
0.04595947265625,
0.032379150390625,
-0.0089263916015625,
-0.0316162109375,
-0.03515625,
0.0042572021484375,
-0.0006322860717773438,
-0.004085540771484375,
0.0640869140625,
0.0256195068359375,
-0.0226287841796875,
0.0097198486328125,
0.019073486328125,
-0.0313720703125,
0.004878997802734375,
-0.042572021484375,
-0.0150604248046875,
-0.05621337890625,
-0.027130126953125,
-0.08587646484375,
-0.0013380050659179688,
0.0012388229370117188,
-0.0220184326171875,
-0.003040313720703125,
0.0269012451171875,
-0.031585693359375,
-0.007450103759765625,
-0.01177215576171875,
0.0205535888671875,
-0.00722503662109375,
0.0283966064453125,
-0.027008056640625,
0.0899658203125,
-0.0045928955078125,
0.01227569580078125,
-0.06689453125,
0.017242431640625,
-0.040771484375,
0.017333984375,
-0.0042877197265625,
-0.038482666015625,
-0.0195770263671875,
-0.010589599609375,
-0.0285797119140625,
-0.0271148681640625,
0.01654052734375,
-0.033843994140625,
0.043212890625,
-0.045257568359375,
-0.01702880859375,
-0.04345703125,
0.06695556640625,
-0.018218994140625,
-0.040802001953125,
-0.008941650390625,
0.0277557373046875,
-0.0034236907958984375,
-0.023468017578125,
0.0240020751953125,
-0.0243377685546875,
-0.08087158203125,
-0.033233642578125,
-0.017059326171875,
-0.0623779296875,
0.040130615234375,
-0.09637451171875,
-0.031402587890625,
-0.060272216796875,
0.0259246826171875,
0.006511688232421875,
0.007904052734375,
0.008087158203125,
-0.00914764404296875,
-0.003108978271484375,
-0.00615692138671875,
-0.02001953125,
-0.09466552734375,
-0.028167724609375,
-0.030975341796875,
0.0987548828125,
0.000035703182220458984,
0.0302886962890625,
-0.024505615234375,
0.0576171875,
-0.01277923583984375,
0.0298309326171875,
-0.01361083984375,
-0.0079498291015625,
-0.001987457275390625,
0.024688720703125,
0.009033203125,
-0.005550384521484375,
-0.0284271240234375,
-0.0367431640625,
-0.0330810546875,
0.01267242431640625,
0.0005550384521484375,
0.03631591796875,
0.0211029052734375,
-0.01033782958984375,
-0.0321044921875,
-0.006072998046875,
-0.047882080078125,
0.0021610260009765625,
-0.0310516357421875,
-0.0161590576171875,
-0.0102386474609375,
-0.0377197265625,
0.0484619140625,
0.0228424072265625,
-0.0137786865234375,
0.0006837844848632812,
0.03985595703125,
-0.0012454986572265625,
-0.056304931640625,
-0.054351806640625,
-0.003261566162109375,
0.0128631591796875,
0.0176849365234375,
0.00891876220703125,
-0.02349853515625,
-0.01279449462890625,
0.0295562744140625,
-0.02423095703125,
-0.01000213623046875,
0.0284271240234375,
0.01538848876953125,
-0.0011625289916992188,
-0.023773193359375,
-0.0005106925964355469,
-0.017425537109375,
-0.016998291015625,
0.01824951171875,
0.00885009765625,
-0.0131378173828125,
0.0203094482421875,
0.023895263671875,
-0.0143280029296875,
0.0003445148468017578,
-0.0219573974609375,
-0.055419921875,
0.0228118896484375,
-0.030181884765625,
0.059295654296875,
0.01203155517578125,
-0.00630950927734375,
0.0638427734375,
0.03924560546875,
-0.0166168212890625,
0.00513458251953125,
0.00785064697265625,
-0.0034198760986328125,
0.0019130706787109375,
0.00586700439453125,
-0.01739501953125,
-0.006549835205078125,
0.0012712478637695312,
0.06890869140625,
-0.0009832382202148438,
-0.031707763671875,
-0.025115966796875,
-0.022552490234375,
-0.0313720703125,
0.01421356201171875,
0.0004870891571044922,
0.0159759521484375,
-0.010101318359375,
-0.0273895263671875,
0.01309967041015625,
0.003509521484375,
-0.04779052734375,
-0.04534912109375,
-0.003955841064453125,
-0.0036144256591796875,
-0.0141754150390625,
0.004364013671875,
0.05303955078125,
0.024505615234375,
0.0210113525390625,
-0.01369476318359375,
0.033416748046875,
0.057464599609375,
0.0018110275268554688,
0.006931304931640625,
0.019500732421875,
-0.00771331787109375,
-0.0081024169921875,
0.01204681396484375,
-0.024139404296875,
-0.01556396484375,
0.054931640625,
0.061004638671875,
0.01473236083984375,
-0.0151214599609375,
-0.034027099609375,
-0.02471923828125,
-0.02410888671875,
-0.0191802978515625,
-0.034332275390625,
-0.0270233154296875,
0.00974273681640625,
-0.00411224365234375,
0.0123291015625,
-0.01094818115234375,
-0.016754150390625,
-0.0030364990234375,
-0.040496826171875,
-0.0022735595703125,
-0.00658416748046875,
-0.0196075439453125,
-0.0007719993591308594,
-0.0094451904296875,
0.036590576171875,
-0.00885009765625,
0.005077362060546875,
-0.0880126953125,
-0.01078033447265625,
-0.02880859375,
0.0130615234375,
0.0295867919921875,
-0.0201263427734375,
0.010833740234375,
-0.0298309326171875,
0.007171630859375,
-0.0036678314208984375,
-0.00794219970703125,
0.06756591796875,
0.030181884765625,
-0.05560302734375,
0.005970001220703125,
-0.041778564453125,
0.003131866455078125,
0.037750244140625,
-0.017578125,
-0.01316070556640625,
-0.030181884765625,
0.01544189453125,
0.004070281982421875,
0.003269195556640625,
-0.0156402587890625,
-0.03460693359375,
0.0181884765625,
0.0106201171875,
-0.0251312255859375,
-0.0244598388671875,
0.05767822265625,
-0.00029921531677246094,
0.01190185546875,
-0.00475311279296875,
0.051971435546875,
0.0237884521484375,
-0.0157623291015625,
0.033447265625,
-0.0745849609375,
-0.045013427734375,
-0.026214599609375,
-0.043426513671875,
0.0246734619140625,
0.033447265625,
-0.007762908935546875,
0.007366180419921875,
-0.015350341796875,
-0.01181793212890625,
-0.032562255859375,
0.01337432861328125,
-0.0284271240234375,
0.04107666015625,
-0.05523681640625,
0.00489044189453125,
0.05810546875,
-0.0338134765625,
-0.01287078857421875,
-0.01560211181640625,
-0.00887298583984375,
0.0009098052978515625,
0.02081298828125,
-0.040283203125,
0.0293731689453125,
0.09893798828125,
0.04107666015625,
0.08306884765625,
0.033905029296875,
0.0289154052734375,
0.05230712890625,
0.0097503662109375,
-0.007167816162109375,
-0.0159454345703125,
0.00525665283203125,
-0.0005974769592285156,
0.006504058837890625,
0.010833740234375,
0.0025691986083984375,
0.0164947509765625,
0.0477294921875,
0.053253173828125,
-0.059173583984375,
-0.01064300537109375,
-0.0190277099609375,
-0.03668212890625,
0.0109405517578125,
0.0062103271484375,
-0.004474639892578125,
0.0164642333984375,
0.004520416259765625,
0.005092620849609375,
-0.02325439453125,
0.002765655517578125,
0.02337646484375,
-0.0129241943359375,
0.01267242431640625,
0.04095458984375,
0.014892578125,
0.0022335052490234375,
-0.0098419189453125,
-0.0191192626953125,
0.02532958984375,
0.02215576171875,
0.00530242919921875,
-0.0224761962890625,
-0.028839111328125,
-0.0124053955078125,
-0.002834320068359375,
-0.0316162109375,
-0.0264129638671875,
0.04364013671875,
-0.01361083984375,
-0.02978515625,
0.0309906005859375,
-0.024688720703125,
0.0161895751953125,
0.01092529296875,
-0.050933837890625,
0.043487548828125,
0.0060882568359375,
-0.0037841796875,
0.003582000732421875,
-0.04156494140625,
-0.00984954833984375,
-0.02398681640625,
0.01605224609375,
0.003604888916015625,
0.03131103515625,
0.038116455078125,
-0.0145263671875,
-0.0261383056640625,
0.04107666015625,
0.0171966552734375,
-0.00971221923828125,
0.00586700439453125,
-0.002437591552734375,
-0.07281494140625,
-0.0775146484375,
-0.0022106170654296875,
-0.105224609375,
0.00594329833984375,
-0.033599853515625,
-0.051239013671875,
0.0872802734375,
0.014678955078125,
0.0272064208984375,
0.0297088623046875,
0.040618896484375,
-0.058624267578125,
-0.006824493408203125,
-0.031494140625,
0.03082275390625,
0.0156097412109375,
-0.0017251968383789062,
-0.0236053466796875,
0.003307342529296875,
0.00020241737365722656,
0.02508544921875,
0.05084228515625,
0.02276611328125,
-0.0909423828125,
0.0111083984375,
0.052703857421875,
0.02972412109375,
0.01715087890625,
0.060760498046875,
-0.0209808349609375,
-0.0020389556884765625,
-0.021759033203125,
-0.0276336669921875,
0.002651214599609375,
-0.023834228515625,
-0.044647216796875,
0.0112152099609375,
0.00926971435546875,
-0.0179443359375,
0.036712646484375,
-0.00760650634765625,
-0.0290985107421875,
0.035400390625,
0.0181884765625,
0.029052734375,
-0.00585174560546875,
0.0232696533203125,
-0.0140228271484375,
0.00978851318359375,
0.001628875732421875,
-0.0243682861328125,
0.032257080078125,
-0.0151519775390625,
-0.0035266876220703125,
0.051513671875,
0.022705078125,
-0.024993896484375,
0.057708740234375,
0.01018524169921875,
0.0280914306640625,
0.00528717041015625,
-0.004367828369140625,
0.043853759765625,
0.0194244384765625,
0.0156402587890625,
0.0308685302734375,
0.0239715576171875,
0.00946807861328125,
-0.01702880859375,
-0.01508331298828125,
0.01132965087890625,
-0.0318603515625,
-0.01271820068359375,
-0.012054443359375,
-0.01424407958984375,
0.0160369873046875,
-0.01541900634765625,
-0.057708740234375,
0.0292816162109375,
0.01873779296875,
0.011627197265625,
-0.0224456787109375,
0.0009341239929199219,
-0.035186767578125,
0.0273590087890625,
-0.0298309326171875,
-0.0008053779602050781,
0.028564453125,
0.059661865234375,
0.0169525146484375,
0.057342529296875,
-0.0174560546875,
-0.02801513671875,
0.01361846923828125,
0.048858642578125,
0.025360107421875,
-0.038238525390625,
-0.04443359375,
-0.0841064453125,
0.033599853515625,
0.0518798828125,
0.049102783203125,
0.0361328125,
0.015899658203125,
0.006946563720703125,
0.01360321044921875,
0.0177154541015625,
0.03955078125,
-0.01284027099609375,
0.0239715576171875,
-0.0302581787109375,
0.0078582763671875,
-0.0164794921875,
-0.0250701904296875,
-0.0088348388671875,
-0.0007987022399902344,
0.0147247314453125,
-0.003528594970703125,
0.04730224609375,
0.0039005279541015625,
-0.0035247802734375,
0.0077667236328125,
-0.03448486328125,
0.0177154541015625,
-0.00959014892578125,
-0.0322265625,
-0.00968170166015625,
0.00038886070251464844,
-0.0276336669921875,
0.0009312629699707031,
0.0362548828125,
0.0162353515625,
-0.0149078369140625,
-0.0003116130828857422,
-0.0098724365234375,
0.01390838623046875,
-0.00959014892578125,
0.009307861328125,
-0.006664276123046875,
0.0136260986328125,
-0.0108795166015625,
-0.0865478515625,
-0.03314208984375,
-0.03936767578125,
0.042510986328125,
-0.0185699462890625,
0.14306640625,
-0.05584716796875,
0.0191497802734375,
0.0242919921875,
-0.0273284912109375,
0.0355224609375,
0.0009598731994628906,
0.00821685791015625,
-0.0053253173828125,
0.005859375,
-0.0108184814453125,
-0.025909423828125,
0.038909912109375,
-0.00333404541015625,
-0.037689208984375,
0.0005450248718261719,
0.002483367919921875,
0.00566864013671875,
0.007175445556640625,
0.043548583984375,
-0.04901123046875,
-0.0931396484375,
-0.0941162109375,
0.02410888671875,
-0.004528045654296875,
-0.0208740234375,
-0.050445556640625,
0.032196044921875,
-0.0014019012451171875,
-0.042449951171875,
0.0009508132934570312,
-0.0501708984375,
0.0137481689453125,
0.039093017578125,
-0.002826690673828125,
-0.06640625,
0.01316070556640625,
-0.0038890838623046875,
-0.02099609375,
0.009735107421875,
0.05584716796875,
-0.0032978057861328125,
-0.04815673828125,
-0.014007568359375,
0.028167724609375,
0.00974273681640625,
-0.0079345703125,
0.006656646728515625,
0.01021575927734375,
-0.0341796875,
-0.003078460693359375,
-0.00974273681640625,
-0.038055419921875,
-0.0127410888671875,
0.0014810562133789062,
0.01220703125,
-0.0168914794921875,
-0.048187255859375,
-0.08441162109375,
0.0114898681640625,
0.046875,
-0.0250701904296875,
-0.0225677490234375,
0.0230560302734375,
-0.05157470703125,
0.050750732421875,
-0.0084686279296875,
-0.0116424560546875,
-0.0149688720703125,
-0.042236328125,
-0.040679931640625,
-0.0182037353515625,
-0.045684814453125,
0.013214111328125,
-0.021087646484375,
0.0111846923828125,
0.0379638671875,
-0.0077056884765625,
-0.0011882781982421875,
-0.0005097389221191406,
-0.01678466796875,
0.05859375,
-0.0223846435546875,
-0.0074615478515625,
0.0153045654296875,
-0.0209503173828125,
-0.053619384765625,
-0.0167083740234375,
0.0382080078125,
-0.06353759765625,
-0.062469482421875,
-0.01104736328125,
-0.021453857421875,
-0.006195068359375,
-0.050994873046875,
-0.059906005859375,
0.0347900390625,
0.006084442138671875,
-0.0301513671875,
-0.057891845703125,
-0.01270294189453125,
-0.00782012939453125,
0.023773193359375,
-0.0128326416015625,
-0.017425537109375,
-0.0217742919921875,
0.04620361328125,
0.018951416015625,
0.055145263671875,
-0.05145263671875,
0.06884765625,
0.003582000732421875,
0.058135986328125,
0.02374267578125,
-0.00940704345703125,
0.0474853515625,
-0.027618408203125,
0.051177978515625,
0.07537841796875,
-0.00531005859375,
0.00858306884765625,
-0.01419830322265625,
-0.0770263671875,
-0.00888824462890625,
-0.0019683837890625,
-0.0511474609375,
-0.056182861328125,
0.0701904296875,
0.027679443359375,
0.01788330078125,
0.00505828857421875,
0.0215301513671875,
-0.014617919921875,
-0.00420379638671875,
0.006732940673828125,
0.00450897216796875,
-0.00960540771484375,
-0.0045318603515625,
-0.007659912109375,
-0.0038814544677734375,
0.008270263671875,
0.0174713134765625,
-0.0263671875,
0.0162506103515625,
0.0197296142578125,
-0.0248260498046875,
-0.031158447265625,
0.042266845703125,
0.05548095703125,
-0.050323486328125,
-0.016693115234375,
-0.0010557174682617188,
-0.005001068115234375,
0.006885528564453125,
-0.030120849609375,
0.016937255859375,
0.02508544921875,
-0.0400390625,
0.0106658935546875,
0.0197906494140625,
-0.006107330322265625,
-0.0167999267578125,
-0.0152587890625,
-0.004791259765625,
0.010955810546875,
-0.004673004150390625,
0.0258026123046875,
0.0201416015625,
0.009033203125,
-0.003955841064453125,
0.023590087890625,
-0.002559661865234375,
-0.032135009765625,
-0.047943115234375,
0.056884765625,
-0.04290771484375,
-0.0023403167724609375,
-0.0400390625,
-0.010955810546875,
0.01153564453125,
0.04345703125,
-0.005405426025390625,
-0.0169525146484375,
0.0230255126953125,
0.011566162109375,
0.00641632080078125,
0.0036945343017578125
] |
e3ba8bb4289098d7a0e3c5f3f618135ccbc1e6b3
|
Wordpress Stackexchange
Q: Showing as logged in after logout (W3 Total Cache issue) I've got a login/logout link using wp_loginout(). After a user logs out their user info is still being shown by get_currentuserinfo(), only after they visit a second page does it revert to not showing any user info. They are, however actually, logged out after the initial logout (as they can't access any protected pages).
If I disable the plugin I don't experience this issue. How can I ensure that when a user logs out the change is reflected without having to visit a second page?
http://wordpress.org/extend/plugins/w3-total-cache/
A: As the commenters have alluded to, this is a "feature" of using cookies. Changes to cookies are only enacted on the next page refresh.
You could try adding an extra page refresh (which will make the users browser page flash) or you could add some JavaScript to destroy the cookie dynamically.
|
Q: Showing as logged in after logout (W3 Total Cache issue) I've got a login/logout link using wp_loginout(). After a user logs out their user info is still being shown by get_currentuserinfo(), only after they visit a second page does it revert to not showing any user info. They are, however actually, logged out after the initial logout (as they can't access any protected pages).
If I disable the plugin I don't experience this issue. How can I ensure that when a user logs out the change is reflected without having to visit a second page?
http://wordpress.org/extend/plugins/w3-total-cache/
A: As the commenters have alluded to, this is a "feature" of using cookies. Changes to cookies are only enacted on the next page refresh.
You could try adding an extra page refresh (which will make the users browser page flash) or you could add some JavaScript to destroy the cookie dynamically.
A: Try to not cache the home page and also click on the checkbox to disabled caching for login/logout pages. I encountered the same issue with my site http://www.techflict.com, It got resolved after disabling caching for home page. Hope this helps...:)
|
wordpress
|
{
"language": "en",
"length": 190,
"provenance": "stackexchange_00019.jsonl.gz:419237",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49625"
}
|
[
0.0673828125,
0.01155853271484375,
-0.0009593963623046875,
-0.0107574462890625,
0.02069091796875,
-0.044769287109375,
0.041351318359375,
-0.023040771484375,
-0.039154052734375,
0.0305023193359375,
0.001674652099609375,
0.020538330078125,
-0.0333251953125,
-0.028472900390625,
0.0005598068237304688,
-0.0274505615234375,
0.0364990234375,
0.0004353523254394531,
0.06390380859375,
0.006320953369140625,
0.005828857421875,
0.0282440185546875,
0.034423828125,
0.0197601318359375,
0.004535675048828125,
-0.0237884521484375,
0.0802001953125,
-0.02520751953125,
0.019744873046875,
0.0009617805480957031,
0.01824951171875,
-0.034942626953125,
0.01092529296875,
0.054779052734375,
-0.053497314453125,
-0.0269927978515625,
0.0008893013000488281,
0.0240478515625,
0.00182342529296875,
0.030975341796875,
-0.0005693435668945312,
0.01031494140625,
0.0237579345703125,
-0.018951416015625,
-0.016845703125,
-0.004093170166015625,
-0.01041412353515625,
-0.0142669677734375,
0.051971435546875,
0.0408935546875,
0.016143798828125,
0.052032470703125,
0.00952911376953125,
0.0035343170166015625,
-0.0252532958984375,
-0.0032806396484375,
-0.016571044921875,
-0.005950927734375,
0.032623291015625,
-0.018157958984375,
-0.0165252685546875,
-0.0181121826171875,
0.0294647216796875,
-0.00047779083251953125,
-0.0198516845703125,
-0.006198883056640625,
0.017181396484375,
0.0200958251953125,
-0.057525634765625,
-0.0467529296875,
0.026580810546875,
-0.0022830963134765625,
0.0078887939453125,
0.0172271728515625,
-0.0170440673828125,
-0.0360107421875,
0.012725830078125,
0.0014476776123046875,
0.0216522216796875,
0.030303955078125,
-0.0256500244140625,
0.00025153160095214844,
-0.05499267578125,
-0.0009016990661621094,
-0.004791259765625,
0.025054931640625,
-0.0253753662109375,
-0.014495849609375,
0.0036792755126953125,
-0.0156097412109375,
-0.0238037109375,
0.0103302001953125,
0.003570556640625,
0.002685546875,
-0.036224365234375,
-0.020416259765625,
0.025238037109375,
0.06854248046875,
-0.0180816650390625,
-0.019744873046875,
-0.046905517578125,
0.01169586181640625,
-0.051025390625,
-0.0245513916015625,
-0.00586700439453125,
0.03118896484375,
0.0082244873046875,
0.0257110595703125,
0.024688720703125,
0.0182037353515625,
0.003559112548828125,
-0.002048492431640625,
-0.02752685546875,
-0.0665283203125,
0.011016845703125,
0.050872802734375,
-0.02337646484375,
0.0174713134765625,
0.020599365234375,
0.00962066650390625,
-0.036590576171875,
-0.0264892578125,
-0.019683837890625,
0.01520538330078125,
-0.0015392303466796875,
-0.0247802734375,
-0.0007967948913574219,
0.03253173828125,
-0.0029010772705078125,
0.041778564453125,
-0.04095458984375,
0.01027679443359375,
0.048431396484375,
0.00153350830078125,
-0.00412750244140625,
-0.0267486572265625,
0.019195556640625,
-0.05670166015625,
-0.0006394386291503906,
0.0400390625,
-0.053802490234375,
-0.036376953125,
0.049896240234375,
-0.0294647216796875,
0.01837158203125,
0.032989501953125,
0.0223388671875,
0.008758544921875,
-0.0013837814331054688,
-0.05474853515625,
-0.0005741119384765625,
0.0221405029296875,
-0.01027679443359375,
0.0010557174682617188,
0.0178985595703125,
-0.0200347900390625,
-0.00797271728515625,
-0.0110015869140625,
0.0472412109375,
0.00856781005859375,
0.037811279296875,
-0.01410675048828125,
-0.01264190673828125,
-0.01522064208984375,
-0.05810546875,
0.0039520263671875,
-0.0218505859375,
-0.00333404541015625,
0.0340576171875,
0.0013265609741210938,
0.0457763671875,
-0.0226287841796875,
0.028778076171875,
0.01512908935546875,
-0.00531005859375,
-0.00203704833984375,
0.01242828369140625,
0.056793212890625,
0.018798828125,
0.0032367706298828125,
-0.0038852691650390625,
-0.03076171875,
0.08514404296875,
-0.0279083251953125,
-0.00951385498046875,
0.017822265625,
-0.005474090576171875,
0.0015192031860351562,
0.005847930908203125,
-0.004482269287109375,
0.0128173828125,
0.053558349609375,
-0.042816162109375,
0.02301025390625,
0.0128936767578125,
0.0024547576904296875,
0.002532958984375,
0.01242828369140625,
0.005611419677734375,
-0.052947998046875,
0.0296478271484375,
0.032012939453125,
-0.02587890625,
-0.0158843994140625,
-0.10614013671875,
0.035675048828125,
-0.033599853515625,
0.054168701171875,
0.015228271484375,
0.033447265625,
0.01503753662109375,
0.0229339599609375,
-0.03277587890625,
-0.0081939697265625,
-0.025970458984375,
-0.0223846435546875,
-0.0187835693359375,
0.0513916015625,
0.00543975830078125,
0.033172607421875,
-0.0031223297119140625,
-0.0170745849609375,
0.014007568359375,
-0.0218505859375,
0.02947998046875,
-0.0204010009765625,
-0.0007576942443847656,
-0.01776123046875,
0.037841796875,
-0.0240325927734375,
0.045989990234375,
0.040008544921875,
-0.006397247314453125,
0.02130126953125,
-0.033233642578125,
-0.0273590087890625,
-0.02764892578125,
-0.044281005859375,
0.0168304443359375,
0.0513916015625,
0.0311126708984375,
0.015655517578125,
0.010528564453125,
0.048736572265625,
0.024871826171875,
-0.0155181884765625,
0.0174102783203125,
0.020050048828125,
0.0419921875,
0.033203125,
0.00362396240234375,
-0.0231781005859375,
0.043731689453125,
-0.03240966796875,
0.033050537109375,
0.03094482421875,
0.00807952880859375,
0.0019464492797851562,
-0.020965576171875,
0.005428314208984375,
-0.005725860595703125,
-0.014739990234375,
-0.0121002197265625,
-0.0034885406494140625,
-0.0087738037109375,
-0.045745849609375,
-0.022857666015625,
-0.033477783203125,
-0.00466156005859375,
-0.0305328369140625,
0.03814697265625,
-0.016082763671875,
0.0188751220703125,
0.04278564453125,
0.008331298828125,
-0.02850341796875,
-0.01560211181640625,
-0.01238250732421875,
0.0224151611328125,
0.00441741943359375,
-0.00032019615173339844,
-0.014678955078125,
-0.052520751953125,
-0.01006317138671875,
0.038787841796875,
0.010101318359375,
-0.014129638671875,
0.00543212890625,
0.031219482421875,
0.0186309814453125,
0.046630859375,
0.01116943359375,
-0.0042266845703125,
0.042755126953125,
-0.035675048828125,
-0.01543426513671875,
0.0052032470703125,
-0.050262451171875,
0.04022216796875,
-0.047088623046875,
0.0189361572265625,
0.06463623046875,
0.0180511474609375,
-0.004192352294921875,
-0.0187835693359375,
0.0259857177734375,
-0.035736083984375,
-0.0021800994873046875,
-0.00991058349609375,
-0.0333251953125,
0.0016298294067382812,
0.053375244140625,
0.0386962890625,
0.049102783203125,
-0.01568603515625,
-0.04766845703125,
-0.030853271484375,
0.0133819580078125,
-0.0660400390625,
-0.061370849609375,
-0.07513427734375,
-0.0484619140625,
-0.017669677734375,
0.0000776052474975586,
-0.0073089599609375,
0.03973388671875,
0.0153350830078125,
0.018280029296875,
-0.014312744140625,
-0.04669189453125,
-0.019805908203125,
-0.0736083984375,
-0.035888671875,
-0.0195159912109375,
0.0028438568115234375,
-0.025390625,
-0.002422332763671875,
0.0325927734375,
-0.004840850830078125,
-0.042816162109375,
-0.032012939453125,
0.055999755859375,
-0.01885986328125,
-0.042938232421875,
-0.040740966796875,
0.00717926025390625,
0.0254669189453125,
-0.0016727447509765625,
-0.0268096923828125,
-0.004184722900390625,
0.029449462890625,
-0.01256561279296875,
-0.004642486572265625,
-0.073486328125,
0.0185394287109375,
-0.0465087890625,
-0.0374755859375,
0.00928497314453125,
0.036376953125,
-0.0293121337890625,
0.01166534423828125,
-0.01103973388671875,
-0.0279388427734375,
-0.024322509765625,
0.0283050537109375,
-0.02874755859375,
-0.0190277099609375,
-0.034454345703125,
-0.001674652099609375,
-0.0218505859375,
-0.0019817352294921875,
-0.002147674560546875,
-0.00794219970703125,
-0.01186370849609375,
-0.00702667236328125,
0.01378631591796875,
0.06414794921875,
0.010345458984375,
0.001659393310546875,
0.011688232421875,
0.02044677734375,
-0.027679443359375,
-0.0142974853515625,
-0.0928955078125,
-0.05169677734375,
0.0206146240234375,
-0.0204925537109375,
0.027557373046875,
-0.0178680419921875,
-0.005649566650390625,
-0.01006317138671875,
0.08001708984375,
-0.033447265625,
-0.0099639892578125,
0.005702972412109375,
0.01629638671875,
-0.0229339599609375,
-0.0095062255859375,
-0.04998779296875,
-0.0218658447265625,
-0.067138671875,
0.0274658203125,
0.02685546875,
-0.0206146240234375,
0.0003523826599121094,
0.0047760009765625,
-0.032379150390625,
-0.035614013671875,
0.0159759521484375,
-0.003498077392578125,
0.023956298828125,
-0.01544189453125,
-0.001049041748046875,
-0.0167236328125,
0.0126953125,
-0.043182373046875,
-0.0009975433349609375,
0.0011138916015625,
-0.040191650390625,
0.01788330078125,
0.0384521484375,
-0.02752685546875,
-0.00724029541015625,
-0.00665283203125,
0.01142120361328125,
0.044586181640625,
-0.0007772445678710938,
-0.0198211669921875,
0.0229644775390625,
0.019927978515625,
0.0263824462890625,
-0.01342010498046875,
0.0010175704956054688,
-0.0308074951171875,
-0.04071044921875,
-0.0411376953125,
-0.04425048828125,
-0.026397705078125,
-0.01422119140625,
-0.0316162109375,
0.0006494522094726562,
-0.042327880859375,
-0.0119171142578125,
0.01097869873046875,
-0.00759124755859375,
0.02093505859375,
-0.02655029296875,
-0.0106201171875,
0.01529693603515625,
0.01052093505859375,
-0.0195465087890625,
0.0130615234375,
0.04705810546875,
0.0229034423828125,
-0.01357269287109375,
-0.01343536376953125,
0.01294708251953125,
0.0149383544921875,
0.0016002655029296875,
0.0350341796875,
-0.0086669921875,
-0.019805908203125,
0.07275390625,
-0.012237548828125,
0.036895751953125,
-0.0377197265625,
0.06060791015625,
-0.0261688232421875,
-0.0277557373046875,
0.045989990234375,
-0.0233001708984375,
-0.037139892578125,
-0.0016937255859375,
0.01424407958984375,
-0.00672149658203125,
0.0201568603515625,
0.0296173095703125,
-0.008056640625,
-0.0040740966796875,
-0.010284423828125,
-0.0574951171875,
0.00803375244140625,
0.00902557373046875,
0.03497314453125,
0.0611572265625,
-0.0260009765625,
0.071533203125,
0.032806396484375,
0.00022304058074951172,
-0.0306854248046875,
-0.0257110595703125,
-0.0257720947265625,
0.0340576171875,
-0.04803466796875,
-0.004589080810546875,
0.005352020263671875,
-0.0193634033203125,
0.10406494140625,
0.0239105224609375,
-0.04876708984375,
0.04071044921875,
-0.039093017578125,
0.0175323486328125,
0.0140838623046875,
0.0199432373046875,
0.04449462890625,
-0.034423828125,
-0.0006413459777832031,
-0.01080322265625,
-0.0015497207641601562,
-0.0299072265625,
-0.03466796875,
0.0166778564453125,
-0.0181121826171875,
0.00016832351684570312,
0.00931549072265625,
0.067138671875,
-0.000934600830078125,
0.04638671875,
-0.017486572265625,
0.0005140304565429688,
-0.0261688232421875,
0.04443359375,
0.0225830078125,
0.0144805908203125,
0.0087738037109375,
0.022796630859375,
0.01436614990234375,
-0.0256805419921875,
-0.033660888671875,
0.022369384765625,
0.03424072265625,
-0.007122039794921875,
0.0033054351806640625,
0.0210723876953125,
-0.0007529258728027344,
0.0128021240234375,
0.056060791015625,
-0.005939483642578125,
-0.086181640625,
-0.00569915771484375,
0.056671142578125,
0.031341552734375,
-0.06109619140625,
0.0036907196044921875,
-0.05499267578125,
-0.04241943359375,
-0.04815673828125,
0.022674560546875,
-0.04229736328125,
-0.014862060546875,
-0.034881591796875,
-0.06793212890625,
-0.03497314453125,
-0.01299285888671875,
-0.019317626953125,
-0.02386474609375,
-0.00006729364395141602,
-0.031494140625,
0.01364898681640625,
-0.043212890625,
-0.003849029541015625,
-0.0153656005859375,
0.01221466064453125,
-0.0115966796875,
0.0132904052734375,
0.06512451171875,
0.031768798828125,
-0.05377197265625,
0.02392578125,
-0.03497314453125,
-0.0097503662109375,
0.03082275390625,
-0.033966064453125,
-0.0254974365234375,
-0.038726806640625,
0.0643310546875,
0.03704833984375,
0.00438690185546875,
-0.07794189453125,
-0.044677734375,
0.015899658203125,
0.08447265625,
0.0888671875,
0.0005998611450195312,
0.054901123046875,
-0.01837158203125,
0.036346435546875,
0.0115966796875,
0.0292510986328125,
-0.0236358642578125,
-0.01424407958984375,
0.04327392578125,
0.01215362548828125,
-0.05926513671875,
-0.0548095703125,
-0.029296875,
-0.0218505859375,
0.069091796875,
-0.03558349609375,
-0.040374755859375,
0.0035266876220703125,
-0.004543304443359375,
-0.0039520263671875,
0.03094482421875,
0.07318115234375,
-0.0175018310546875,
0.0294342041015625,
0.0219573974609375,
0.0030841827392578125,
-0.0051727294921875,
-0.0034275054931640625,
-0.0133056640625,
0.006259918212890625,
0.0009388923645019531,
-0.03778076171875,
-0.00624847412109375,
0.00036144256591796875,
0.061431884765625,
0.0187530517578125,
0.050262451171875,
0.01922607421875,
0.046112060546875,
0.0537109375,
-0.01776123046875,
-0.010711669921875,
0.01104736328125,
0.03570556640625,
-0.013641357421875,
-0.0282745361328125,
0.00351715087890625,
-0.02685546875,
0.032440185546875,
0.039947509765625,
0.057037353515625,
-0.087158203125,
0.04058837890625,
0.0084228515625,
0.006145477294921875,
0.0654296875,
0.0103302001953125,
0.01189422607421875,
0.01068878173828125,
-0.01708984375,
-0.0213775634765625,
-0.03070068359375,
-0.00168609619140625,
-0.0098419189453125,
-0.01277923583984375,
-0.0213165283203125,
0.0168609619140625,
0.01507568359375,
-0.0618896484375,
0.027099609375,
0.0303192138671875,
-0.0190887451171875,
-0.0185394287109375,
-0.0201263427734375,
0.0191497802734375,
-0.020660400390625,
-0.056549072265625,
0.0247802734375,
-0.036163330078125,
0.007122039794921875,
0.043060302734375,
-0.00228118896484375,
0.035919189453125,
0.0212249755859375,
0.0083770751953125,
0.013763427734375,
-0.0276031494140625,
0.0318603515625,
0.0269012451171875,
-0.0128631591796875,
0.0014190673828125,
0.01666259765625,
-0.041748046875,
0.00020015239715576172,
-0.01276397705078125,
0.00370025634765625,
-0.0221405029296875,
-0.027801513671875,
0.0675048828125,
-0.0400390625,
0.0129852294921875,
0.037933349609375,
0.0263671875,
-0.035400390625,
-0.0105133056640625,
0.0288848876953125,
-0.04937744140625,
-0.01317596435546875,
0.003566741943359375,
0.0010852813720703125,
0.0157623291015625,
0.0194091796875,
-0.06707763671875,
0.05120849609375,
-0.02001953125,
0.06207275390625,
0.0202484130859375,
0.0041961669921875,
-0.00968170166015625,
0.0003833770751953125,
-0.045867919921875,
0.06329345703125,
-0.0255889892578125,
0.0811767578125,
-0.0596923828125,
-0.008514404296875,
0.045074462890625,
0.0279541015625,
-0.018768310546875,
0.0126800537109375,
-0.006114959716796875,
-0.02215576171875,
-0.05438232421875,
-0.005580902099609375,
-0.022216796875,
0.03387451171875,
0.0007619857788085938,
0.0310516357421875,
0.01270294189453125,
-0.049102783203125,
0.011138916015625,
-0.0060882568359375,
-0.037506103515625,
0.024658203125,
-0.0016698837280273438,
-0.035491943359375,
-0.0145721435546875,
0.0716552734375,
-0.08294677734375,
0.0130462646484375,
0.034637451171875,
0.051666259765625,
-0.004047393798828125,
0.04693603515625,
0.0216064453125,
-0.035400390625,
-0.00489044189453125,
-0.040374755859375,
0.041015625,
-0.016326904296875,
-0.00007486343383789062,
0.0552978515625,
0.03411865234375,
-0.0237579345703125,
-0.0419921875,
0.00475311279296875,
-0.01126861572265625,
-0.05035400390625,
0.0350341796875,
0.018310546875,
0.039031982421875,
-0.03466796875,
0.0013227462768554688,
0.035552978515625,
0.058990478515625,
-0.0218505859375,
-0.058258056640625,
0.0096588134765625,
0.0020580291748046875,
0.031341552734375,
0.01800537109375,
0.050750732421875,
-0.03973388671875,
-0.01029205322265625,
0.03289794921875,
-0.0008974075317382812,
0.01422119140625,
-0.010589599609375,
0.031524658203125,
0.0531005859375,
-0.04608154296875,
0.029632568359375,
-0.005359649658203125,
0.0015821456909179688,
0.0079193115234375,
-0.00394439697265625,
0.01117706298828125,
0.0014162063598632812,
0.039794921875,
0.004085540771484375,
-0.0258941650390625,
0.01282501220703125,
0.007965087890625,
0.0270843505859375,
-0.0318603515625,
-0.0340576171875,
0.02703857421875,
0.0511474609375,
-0.0016813278198242188,
-0.05352783203125,
0.0018186569213867188,
0.0001766681671142578,
-0.052978515625,
-0.0350341796875,
0.016693115234375,
-0.024139404296875,
0.0550537109375,
-0.005706787109375,
0.0243988037109375,
0.0185546875,
-0.019805908203125,
-0.05059814453125,
0.0137481689453125,
0.04730224609375,
-0.031280517578125,
0.04547119140625,
0.002315521240234375,
-0.033660888671875,
0.0076446533203125,
0.0248870849609375,
0.057586669921875,
0.01739501953125,
-0.02459716796875,
0.01149749755859375,
-0.047698974609375,
-0.0020599365234375,
0.005573272705078125,
0.026275634765625,
0.00848388671875,
0.0155487060546875,
0.04144287109375,
0.0016107559204101562,
-0.01000213623046875,
-0.020904541015625,
0.044158935546875,
-0.0357666015625,
-0.01561737060546875,
0.00951385498046875,
-0.07086181640625,
-0.03485107421875,
-0.0171966552734375,
0.0110321044921875,
0.010894775390625,
0.006122589111328125,
0.0292816162109375,
0.0181884765625,
-0.018402099609375,
-0.01015472412109375,
-0.01361083984375,
-0.0181884765625,
0.023956298828125,
-0.0188140869140625,
-0.04083251953125,
0.00742340087890625,
-0.08184814453125,
0.06793212890625,
-0.006763458251953125,
0.052093505859375,
0.0718994140625,
-0.00937652587890625,
-0.0022907257080078125,
-0.00934600830078125,
-0.0323486328125,
-0.03668212890625,
-0.0318603515625,
0.00472259521484375,
0.01129913330078125,
-0.00801849365234375,
-0.027862548828125,
-0.038421630859375,
0.034454345703125,
0.01401519775390625,
-0.0182647705078125,
-0.0052947998046875,
-0.0230865478515625,
0.005992889404296875,
0.023895263671875,
0.01904296875,
0.02923583984375,
-0.0273284912109375,
-0.035247802734375,
0.007343292236328125,
0.0021305084228515625,
-0.01377105712890625,
-0.021728515625,
0.01282501220703125,
0.05010986328125,
0.022552490234375,
0.053955078125,
0.000751495361328125,
0.005840301513671875,
0.0029659271240234375,
0.0166778564453125,
0.0162811279296875,
-0.056732177734375,
-0.05133056640625,
-0.0703125,
0.011688232421875,
0.0268402099609375,
-0.031402587890625,
-0.0263671875,
-0.0611572265625,
0.0222930908203125,
0.0279998779296875,
0.0098114013671875,
-0.056854248046875,
0.04461669921875,
-0.032501220703125,
0.0323486328125,
-0.00887298583984375,
-0.056488037109375,
0.016571044921875,
0.0250701904296875,
-0.01326751708984375,
0.0219879150390625,
-0.034088134765625,
-0.03631591796875,
-0.00695037841796875,
-0.04742431640625,
0.01324462890625,
0.041656494140625,
-0.038177490234375,
-0.04168701171875,
-0.05535888671875,
0.002613067626953125,
-0.079345703125,
-0.01392364501953125,
-0.017547607421875,
0.01531219482421875,
0.0119476318359375,
0.0178985595703125,
0.006298065185546875,
0.053192138671875,
-0.031951904296875,
0.0233001708984375,
-0.046142578125,
-0.036468505859375,
-0.03973388671875,
-0.01018524169921875,
0.044342041015625,
0.04058837890625,
-0.02734375,
-0.0362548828125,
0.00841522216796875,
-0.00445556640625,
-0.016204833984375,
-0.01300811767578125,
-0.034332275390625,
-0.01132965087890625,
0.027374267578125,
0.018310546875,
-0.0038013458251953125,
0.048553466796875,
0.038970947265625,
-0.058258056640625,
0.0117950439453125,
-0.0124969482421875,
0.0189208984375,
-0.006229400634765625,
0.0192718505859375,
0.0077667236328125,
0.027557373046875,
-0.033905029296875,
0.054901123046875,
0.00013017654418945312,
0.02703857421875,
0.007358551025390625,
-0.0005192756652832031,
0.033111572265625,
0.019683837890625,
0.00021588802337646484,
-0.0145721435546875,
-0.022064208984375,
-0.005840301513671875,
-0.043792724609375,
-0.0408935546875,
-0.05859375,
-0.006275177001953125,
0.0352783203125,
-0.08013916015625,
0.00890350341796875,
0.00795745849609375,
-0.0267791748046875,
-0.0161590576171875,
0.0245513916015625,
-0.042633056640625,
0.003936767578125,
0.0240478515625,
-0.0005421638488769531,
-0.033935546875,
-0.0007929801940917969,
0.00847625732421875,
-0.0183563232421875,
-0.027191162109375,
-0.004688262939453125,
0.0169830322265625,
-0.03076171875,
-0.0198974609375,
0.0078125,
0.03350830078125,
-0.025146484375,
-0.00543975830078125,
0.0262603759765625,
0.0245819091796875,
-0.0026645660400390625,
-0.0183868408203125,
-0.02142333984375,
-0.01593017578125,
0.00846099853515625,
-0.010162353515625,
-0.0032253265380859375,
-0.01358795166015625,
0.01348876953125,
-0.0090179443359375,
-0.0237579345703125,
0.010101318359375,
-0.047607421875,
0.0587158203125,
0.004276275634765625,
-0.005680084228515625,
0.04180908203125,
0.007137298583984375,
-0.004329681396484375,
-0.041778564453125,
-0.0005397796630859375,
-0.06903076171875,
0.0469970703125,
-0.042572021484375,
-0.00836944580078125,
0.029541015625
] |
44ef63cf29942b220147bce676c661bd6b72d7b3
|
Wordpress Stackexchange
Q: Remove Personal Options section from Profile I want to hide/remove the Personal Options in the Your Profile (wp-admin/profile.php) admin page.
I am aware that solutions for this exist, but I they use jQuery to do hide this section. This works, but when a user has JavaScript disabled in their browser, it will show up again. Therefore it is not a proper way to remove Personal Options.
Is there a way to remove the Personal Options section from the HTML source of the page? This means no jQuery or CSS hacks, or core file modification.
A: Accepted answer is not working with 4.8
Here comes an up to date and simplified code that should work with any version:
// removes admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
//Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
add_action( 'admin_head', function () {
ob_start( function( $subject ) {
$subject = preg_replace( '#<h[0-9]>'.__("Personal Options").'</h[0-9]>.+?/table>#s', '', $subject, 1 );
return $subject;
});
});
add_action( 'admin_footer', function(){
ob_end_flush();
});
|
Q: Remove Personal Options section from Profile I want to hide/remove the Personal Options in the Your Profile (wp-admin/profile.php) admin page.
I am aware that solutions for this exist, but I they use jQuery to do hide this section. This works, but when a user has JavaScript disabled in their browser, it will show up again. Therefore it is not a proper way to remove Personal Options.
Is there a way to remove the Personal Options section from the HTML source of the page? This means no jQuery or CSS hacks, or core file modification.
A: Accepted answer is not working with 4.8
Here comes an up to date and simplified code that should work with any version:
// removes admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
//Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
add_action( 'admin_head', function () {
ob_start( function( $subject ) {
$subject = preg_replace( '#<h[0-9]>'.__("Personal Options").'</h[0-9]>.+?/table>#s', '', $subject, 1 );
return $subject;
});
});
add_action( 'admin_footer', function(){
ob_end_flush();
});
A: Was just trying to figure this out and came across this answer. The above code by Cor van doesn't work anymore, but with a slight change of the add_action, it can.
All you need to do is change the last two lines from:
add_action( 'admin_head-profile.php', 'cor_profile_subject_start' );
add_action( 'admin_footer-profile.php', 'cor_profile_subject_end' );
to
add_action( 'admin_head-user-edit.php', 'cor_profile_subject_start' );
add_action( 'admin_footer-user-edit.php', 'cor_profile_subject_end' );
So, the final code would look something like:
if ( ! function_exists( 'cor_remove_personal_options' ) ) {
/**
* Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
*/
function cor_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );
return $subject;
}
function cor_profile_subject_start() {
ob_start( 'cor_remove_personal_options' );
}
function cor_profile_subject_end() {
ob_end_flush();
}
}
add_action( 'admin_head-user-edit.php', 'cor_profile_subject_start' );
add_action( 'admin_footer-user-edit.php', 'cor_profile_subject_end' );
A: Thanks to the comment from @Per I got it working for 4.5.2
// removes admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
if ( ! function_exists( 'cor_remove_personal_options' ) ) {
/**
* Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
*/
function cor_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h2>Personal Options</h2>.+?/table>#s', '', $subject, 1 );
return $subject;
}
function cor_profile_subject_start() {
ob_start( 'cor_remove_personal_options' );
}
function cor_profile_subject_end() {
ob_end_flush();
}
}
add_action( 'admin_head', 'cor_profile_subject_start' );
add_action( 'admin_footer', 'cor_profile_subject_end' );`
A: This should do the trick
// removes the `profile.php` admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
if ( ! function_exists( 'cor_remove_personal_options' ) ) {
/**
* Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
*/
function cor_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );
return $subject;
}
function cor_profile_subject_start() {
ob_start( 'cor_remove_personal_options' );
}
function cor_profile_subject_end() {
ob_end_flush();
}
}
add_action( 'admin_head-profile.php', 'cor_profile_subject_start' );
add_action( 'admin_footer-profile.php', 'cor_profile_subject_end' );
Also, don't forget to mark your previous questions as solved :)
A: Update for 3.9, the following works:
add_action( 'admin_head', 'cor_profile_subject_start' );
add_action( 'admin_footer', 'cor_profile_subject_end' );
A: Here's my CSS solution, tested in Wordpress 4.9.8
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
add_action( 'admin_head', function(){
ob_start(); ?>
<style>
#your-profile > h2,
.user-rich-editing-wrap,
.user-syntax-highlighting-wrap,
.user-comment-shortcuts-wrap,
.user-admin-bar-front-wrap {
display: none;
}
</style>
<?php ob_end_flush();
});
A: I just wanted to clarify that the code will not work for localized versions of WordPress, because of the hardcoded Personal Options string. I cannot think of any easy solution here, but suggestions are welcome.
I would have added this as a comment, but I haven't got enough reputation to add a comment.
I also take this opportunity to re-paste the whole code updated for WordPress version 3.9.
Here it is:
// removes the `profile.php` admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
if ( ! function_exists( 'cor_remove_personal_options' ) ) {
/**
* Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
*/
function cor_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );
return $subject;
}
function cor_profile_subject_start() {
ob_start( 'cor_remove_personal_options' );
}
function cor_profile_subject_end() {
ob_end_flush();
}
}
add_action( 'admin_head', 'cor_profile_subject_start' );
add_action( 'admin_footer', 'cor_profile_subject_end' );
Again, if you know in advance what the language of your WP installation will be, change the Personal Options string to the localized version of your language, for example in Italian you will replace it with Impostazioni personali.
A: By using
$subject = preg_replace( '#<h3>'.__("Personal Options").'</h3>.+?/table>#s', '', $subject, 1 );
in the cor_remove_personal_options function, it is localized as well.
A: I´ve found this solution on: https://premium.wpmudev.org/blog/how-to-simplify-wordpress-profiles-by-removing-personal-options/?ptm=c&utm_expid=3606929-108.O6f5ypXuTg-XPCV9sY1yrw.2
function hide_personal_options(){
echo "\n" . '<script type="text/javascript">jQuery(document).ready(function($) {
$(\'form#your-profile > h3:first\').hide(); $(\'form#your-profile >
table:first\').hide(); $(\'form#your-profile\').show(); });</script>' . "\n";
}
add_action('admin_head','hide_personal_options');
If you want to be more specific or remove more you should have a look over here: https://isabelcastillo.com/hide-personal-options-wordpress-admin-profile
You can just add those lines into the function.
A: I remove only title and use CSS to hide first table...
For me, in 2023, this work:
// removes admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
if ( ! function_exists( 'cor_remove_personal_options' ) ) {
/**
* Removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
*/
function cor_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h[0-9]>'.__("Personal Options").'</h[0-9]>#s', '<style>#your-profile>.form-table {display:none} #your-profile>.form-table ~ .form-table {display:block}</style>', $subject, 1 );
return $subject;
}
function cor_profile_subject_start() {
ob_start( 'cor_remove_personal_options' );
}
function cor_profile_subject_end() {
ob_end_flush();
}
}
add_action( 'admin_head', 'cor_profile_subject_start' );
add_action( 'admin_footer', 'cor_profile_subject_end' );
|
wordpress
|
{
"language": "en",
"length": 861,
"provenance": "stackexchange_00019.jsonl.gz:419242",
"question_score": "13",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49643"
}
|
[
0.05792236328125,
0.02215576171875,
-0.004673004150390625,
-0.018890380859375,
0.034759521484375,
-0.0556640625,
0.046966552734375,
-0.047027587890625,
-0.0341796875,
0.034149169921875,
0.041534423828125,
-0.008087158203125,
-0.038360595703125,
-0.050384521484375,
-0.006305694580078125,
-0.0285797119140625,
0.044586181640625,
-0.00443267822265625,
0.03717041015625,
0.01348114013671875,
0.00850677490234375,
0.0316162109375,
-0.01043701171875,
0.01462554931640625,
0.004207611083984375,
-0.038665771484375,
0.03692626953125,
0.005229949951171875,
-0.0045166015625,
-0.0137939453125,
0.006633758544921875,
0.014984130859375,
-0.020538330078125,
0.0367431640625,
0.00634765625,
-0.041259765625,
-0.023101806640625,
0.0362548828125,
0.03802490234375,
-0.0208892822265625,
0.036590576171875,
-0.0260772705078125,
-0.043792724609375,
0.04071044921875,
-0.039459228515625,
-0.0299224853515625,
0.041351318359375,
-0.0030460357666015625,
0.017852783203125,
-0.0176239013671875,
-0.004100799560546875,
-0.033447265625,
0.009307861328125,
-0.04327392578125,
-0.0273895263671875,
-0.03814697265625,
-0.0107574462890625,
0.024658203125,
0.02001953125,
0.029022216796875,
-0.0157623291015625,
0.016204833984375,
-0.0146026611328125,
-0.0528564453125,
-0.040313720703125,
-0.00769805908203125,
-0.0258941650390625,
-0.0006175041198730469,
-0.08349609375,
-0.03546142578125,
0.04779052734375,
-0.038238525390625,
0.01206207275390625,
-0.039794921875,
-0.0139617919921875,
0.0121307373046875,
-0.049835205078125,
-0.0163726806640625,
0.04901123046875,
-0.030975341796875,
0.020904541015625,
0.0447998046875,
-0.042205810546875,
-0.011749267578125,
0.0227508544921875,
0.022064208984375,
-0.0038318634033203125,
-0.035919189453125,
-0.0111083984375,
-0.013519287109375,
-0.0200653076171875,
-0.0673828125,
0.0253143310546875,
0.0249176025390625,
-0.0139617919921875,
-0.013580322265625,
0.0156707763671875,
0.0142822265625,
0.0026531219482421875,
-0.02447509765625,
0.0360107421875,
-0.032012939453125,
-0.01509857177734375,
-0.01038360595703125,
0.0013628005981445312,
0.03277587890625,
-0.00945281982421875,
0.0233917236328125,
0.03656005859375,
0.0250244140625,
0.00925445556640625,
-0.010589599609375,
-0.00681304931640625,
-0.0011720657348632812,
-0.0026340484619140625,
0.00893402099609375,
-0.0216827392578125,
0.02752685546875,
-0.00577545166015625,
0.03680419921875,
-0.008270263671875,
0.00951385498046875,
-0.0121002197265625,
-0.03509521484375,
0.0107269287109375,
-0.015045166015625,
-0.0215606689453125,
-0.01126861572265625,
0.019317626953125,
0.029388427734375,
-0.0653076171875,
-0.00013709068298339844,
0.10748291015625,
0.03082275390625,
0.036712646484375,
-0.040008544921875,
0.034027099609375,
-0.032379150390625,
0.0010929107666015625,
0.0028533935546875,
0.0345458984375,
-0.0258331298828125,
-0.0184478759765625,
0.0139312744140625,
-0.01328277587890625,
0.01824951171875,
0.02606201171875,
-0.01291656494140625,
0.0021495819091796875,
-0.0080108642578125,
-0.05743408203125,
-0.0132598876953125,
0.042449951171875,
0.00864410400390625,
-0.01910400390625,
0.01160430908203125,
0.0518798828125,
-0.00439453125,
-0.0496826171875,
-0.038818359375,
0.03204345703125,
0.002666473388671875,
-0.004199981689453125,
-0.027435302734375,
-0.03759765625,
-0.01149749755859375,
-0.0107421875,
-0.0018987655639648438,
0.02398681640625,
0.016448974609375,
0.040679931640625,
-0.03857421875,
0.03985595703125,
0.00414276123046875,
-0.0196075439453125,
0.01136016845703125,
-0.0004456043243408203,
0.00749969482421875,
0.0133819580078125,
-0.00626373291015625,
-0.038360595703125,
-0.05438232421875,
0.0347900390625,
-0.03289794921875,
-0.0791015625,
0.041961669921875,
0.0178375244140625,
0.0716552734375,
0.01078033447265625,
0.00989532470703125,
0.08648681640625,
0.024871826171875,
0.03533935546875,
-0.022064208984375,
0.01073455810546875,
-0.0262451171875,
-0.0287933349609375,
-0.0020294189453125,
-0.0162353515625,
0.0178985595703125,
-0.006732940673828125,
0.0248260498046875,
-0.013092041015625,
-0.026123046875,
-0.0626220703125,
-0.01212310791015625,
-0.0271453857421875,
0.05181884765625,
-0.01019287109375,
-0.00872802734375,
0.017730712890625,
-0.0130767822265625,
-0.0304412841796875,
0.034454345703125,
-0.021942138671875,
-0.0187530517578125,
-0.026763916015625,
0.047149658203125,
0.00962066650390625,
0.034088134765625,
0.020782470703125,
-0.0318603515625,
0.022064208984375,
-0.020294189453125,
0.071533203125,
0.0142822265625,
-0.00772857666015625,
-0.013580322265625,
0.0667724609375,
-0.0131378173828125,
0.0038852691650390625,
0.046966552734375,
0.01493072509765625,
0.02001953125,
-0.0283355712890625,
-0.02142333984375,
0.01290130615234375,
-0.0546875,
0.00940704345703125,
0.05157470703125,
0.049774169921875,
0.03277587890625,
0.0113372802734375,
-0.038238525390625,
0.064697265625,
-0.0021419525146484375,
0.044464111328125,
-0.06201171875,
-0.01666259765625,
-0.03436279296875,
0.0110931396484375,
-0.018646240234375,
0.0611572265625,
-0.01214599609375,
0.0035686492919921875,
0.04327392578125,
-0.0142822265625,
-0.01526641845703125,
0.0211029052734375,
-0.003940582275390625,
0.015869140625,
-0.01480865478515625,
-0.02130126953125,
0.0035686492919921875,
0.04864501953125,
-0.0292510986328125,
0.0211029052734375,
0.01036834716796875,
-0.01554107666015625,
-0.0156097412109375,
0.0225677490234375,
-0.00884246826171875,
-0.01617431640625,
0.01373291015625,
0.023834228515625,
-0.035064697265625,
-0.0251007080078125,
-0.00673675537109375,
-0.020782470703125,
-0.008209228515625,
0.0191192626953125,
0.033050537109375,
-0.046630859375,
-0.00467681884765625,
0.01200103759765625,
-0.031402587890625,
-0.025421142578125,
0.030853271484375,
-0.0161285400390625,
0.00167083740234375,
0.0234222412109375,
0.0006823539733886719,
-0.0282135009765625,
0.0301666259765625,
-0.01218414306640625,
-0.01451873779296875,
0.0628662109375,
-0.040130615234375,
0.0274658203125,
-0.027587890625,
0.063232421875,
0.0556640625,
0.002544403076171875,
0.002468109130859375,
0.0088653564453125,
-0.038726806640625,
0.0011749267578125,
0.0193328857421875,
0.022857666015625,
0.004024505615234375,
-0.00316619873046875,
0.09814453125,
0.01363372802734375,
-0.039886474609375,
0.0240325927734375,
-0.0184173583984375,
-0.010833740234375,
-0.00215911865234375,
-0.042327880859375,
0.0129547119140625,
-0.01367950439453125,
-0.0714111328125,
-0.040130615234375,
0.054107666015625,
-0.05322265625,
0.021240234375,
0.09832763671875,
0.015289306640625,
-0.03668212890625,
-0.02587890625,
-0.03228759765625,
-0.047637939453125,
-0.048858642578125,
-0.011627197265625,
0.006870269775390625,
0.01244354248046875,
0.01332855224609375,
0.050750732421875,
0.0062103271484375,
-0.05609130859375,
0.01183319091796875,
-0.056976318359375,
-0.0001392364501953125,
0.055389404296875,
0.00838470458984375,
-0.0205230712890625,
0.01062774658203125,
-0.0012407302856445312,
0.0154876708984375,
-0.002849578857421875,
-0.005245208740234375,
-0.0201568603515625,
-0.0092315673828125,
0.0049591064453125,
0.004070281982421875,
0.00384521484375,
0.0175933837890625,
-0.019439697265625,
-0.0080413818359375,
-0.042022705078125,
-0.00647735595703125,
-0.004550933837890625,
-0.0180206298828125,
0.041107177734375,
0.00672149658203125,
-0.03369140625,
0.02459716796875,
0.007221221923828125,
0.043609619140625,
0.0284881591796875,
-0.0020809173583984375,
0.01267242431640625,
-0.01038360595703125,
0.00153350830078125,
0.0202178955078125,
-0.0220947265625,
0.028594970703125,
-0.0230865478515625,
0.0257415771484375,
0.01087188720703125,
0.00024628639221191406,
0.01139068603515625,
-0.0253753662109375,
0.00817108154296875,
-0.0965576171875,
0.053680419921875,
-0.03363037109375,
-0.0260772705078125,
-0.042694091796875,
-0.00783538818359375,
0.018402099609375,
0.0792236328125,
-0.02069091796875,
0.00791168212890625,
-0.0165557861328125,
-0.0034389495849609375,
-0.053131103515625,
-0.0281524658203125,
-0.043182373046875,
0.0204620361328125,
-0.1346435546875,
0.0124359130859375,
0.004627227783203125,
-0.04107666015625,
-0.045196533203125,
0.0091094970703125,
-0.08392333984375,
-0.046356201171875,
0.00957489013671875,
0.0164642333984375,
-0.028106689453125,
0.0101776123046875,
-0.032745361328125,
-0.0033016204833984375,
0.01157379150390625,
0.0008997917175292969,
-0.04425048828125,
-0.018035888671875,
0.021881103515625,
0.0313720703125,
-0.00519561767578125,
0.00966644287109375,
-0.00911712646484375,
0.048095703125,
0.01526641845703125,
0.01190185546875,
-0.01207733154296875,
0.0005884170532226562,
-0.0205841064453125,
-0.018585205078125,
-0.016937255859375,
-0.025146484375,
0.00440216064453125,
0.005825042724609375,
-0.0210418701171875,
0.0020160675048828125,
-0.0239410400390625,
-0.005290985107421875,
0.016082763671875,
-0.0450439453125,
-0.0321044921875,
-0.00919342041015625,
-0.03631591796875,
-0.0263214111328125,
-0.0207977294921875,
-0.0205841064453125,
0.006160736083984375,
-0.041168212890625,
-0.0004603862762451172,
-0.002712249755859375,
-0.0071258544921875,
-0.0116424560546875,
0.005283355712890625,
0.0264892578125,
-0.01080322265625,
0.055755615234375,
0.034881591796875,
0.030792236328125,
-0.04962158203125,
0.06500244140625,
0.0219879150390625,
-0.0247955322265625,
0.10369873046875,
-0.032928466796875,
0.02044677734375,
-0.07525634765625,
0.0655517578125,
-0.0142974853515625,
-0.00699615478515625,
0.01428985595703125,
-0.00701141357421875,
0.0184326171875,
0.01398468017578125,
0.0018939971923828125,
0.0125579833984375,
-0.025970458984375,
-0.01473236083984375,
0.049591064453125,
-0.067138671875,
-0.01050567626953125,
-0.0280303955078125,
-0.0009403228759765625,
-0.07806396484375,
0.0419921875,
0.025360107421875,
-0.01445770263671875,
0.0182037353515625,
0.01873779296875,
-0.016448974609375,
-0.034637451171875,
-0.01666259765625,
-0.028778076171875,
0.018524169921875,
-0.0286865234375,
-0.02667236328125,
-0.0006890296936035156,
-0.007396697998046875,
0.04498291015625,
-0.003810882568359375,
-0.036712646484375,
-0.031829833984375,
0.002719879150390625,
0.0400390625,
0.00591278076171875,
-0.0000019073486328125,
0.0296173095703125,
0.0285186767578125,
0.03643798828125,
-0.01464080810546875,
-0.0293731689453125,
0.0240020751953125,
-0.021453857421875,
0.04022216796875,
0.0291595458984375,
0.00009870529174804688,
0.036865234375,
0.03955078125,
-0.009918212890625,
0.0421142578125,
-0.011383056640625,
0.04913330078125,
0.0428466796875,
-0.0007696151733398438,
-0.013458251953125,
0.0179443359375,
0.03839111328125,
-0.04296875,
0.03228759765625,
-0.0307159423828125,
-0.0177154541015625,
-0.01143646240234375,
0.03277587890625,
0.011932373046875,
0.01067352294921875,
0.01230621337890625,
0.004848480224609375,
-0.022857666015625,
0.0299835205078125,
0.01329803466796875,
-0.04534912109375,
0.00010418891906738281,
0.0254974365234375,
-0.0044708251953125,
-0.008514404296875,
-0.016937255859375,
0.0038909912109375,
-0.040496826171875,
-0.053436279296875,
0.063720703125,
-0.09765625,
-0.0005598068237304688,
0.0227813720703125,
-0.0360107421875,
-0.0233306884765625,
-0.01335906982421875,
-0.089599609375,
-0.05352783203125,
0.0093231201171875,
0.0019893646240234375,
0.029296875,
0.0096282958984375,
0.0164642333984375,
-0.0108642578125,
-0.0266876220703125,
0.0030345916748046875,
-0.0052032470703125,
0.042510986328125,
0.0091705322265625,
-0.051788330078125,
-0.000904083251953125,
-0.0465087890625,
0.0047760009765625,
-0.035125732421875,
-0.0419921875,
-0.026123046875,
-0.0013456344604492188,
-0.0093841552734375,
0.002349853515625,
-0.0038700103759765625,
0.0016145706176757812,
-0.0147552490234375,
0.049407958984375,
0.035186767578125,
0.0673828125,
0.00048351287841796875,
0.035614013671875,
-0.0283355712890625,
0.03656005859375,
0.0019969940185546875,
0.0297698974609375,
0.015960693359375,
-0.0304107666015625,
0.033447265625,
-0.02587890625,
-0.048980712890625,
-0.04180908203125,
-0.021331787109375,
0.016082763671875,
0.031524658203125,
-0.018096923828125,
0.01258087158203125,
0.0017576217651367188,
0.0165252685546875,
-0.0386962890625,
0.021942138671875,
-0.0252227783203125,
0.004848480224609375,
-0.0019779205322265625,
-0.0019216537475585938,
0.021759033203125,
-0.001071929931640625,
-0.0005917549133300781,
0.006984710693359375,
-0.01454925537109375,
0.031219482421875,
-0.0013103485107421875,
-0.0018796920776367188,
0.03411865234375,
0.057708740234375,
-0.003818511962890625,
0.021240234375,
-0.0107269287109375,
0.01007843017578125,
0.0239105224609375,
0.020111083984375,
0.0018491744995117188,
-0.02642822265625,
0.046112060546875,
0.008453369140625,
0.010894775390625,
0.03448486328125,
-0.0206298828125,
0.0257110595703125,
0.09918212890625,
0.0484619140625,
-0.151611328125,
0.020843505859375,
-0.0261688232421875,
0.0206146240234375,
0.09619140625,
-0.0166778564453125,
-0.00803375244140625,
-0.03131103515625,
0.0031032562255859375,
0.043304443359375,
-0.02001953125,
0.0012254714965820312,
0.01277923583984375,
-0.01219940185546875,
0.0182037353515625,
-0.01146697998046875,
-0.0034084320068359375,
-0.01261138916015625,
-0.032928466796875,
0.010284423828125,
-0.0086822509765625,
-0.0246734619140625,
-0.026611328125,
0.0115203857421875,
-0.047332763671875,
-0.10235595703125,
-0.0289154052734375,
-0.03094482421875,
-0.01129913330078125,
0.048370361328125,
-0.01605224609375,
-0.0018024444580078125,
0.03460693359375,
-0.025543212890625,
0.03094482421875,
-0.0125274658203125,
-0.0133819580078125,
0.006931304931640625,
-0.033416748046875,
0.00644683837890625,
-0.009521484375,
-0.042877197265625,
0.013092041015625,
-0.0077362060546875,
-0.032958984375,
-0.00628662109375,
-0.0239715576171875,
0.03790283203125,
-0.0123138427734375,
-0.03131103515625,
0.0133056640625,
0.0077362060546875,
-0.0057830810546875,
-0.0035572052001953125,
-0.0034809112548828125,
-0.05804443359375,
-0.037445068359375,
-0.00847625732421875,
-0.05792236328125,
0.029571533203125,
-0.0087890625,
-0.05670166015625,
0.11724853515625,
-0.0011816024780273438,
0.009002685546875,
-0.0157470703125,
0.06707763671875,
-0.0198974609375,
0.056610107421875,
-0.01390838623046875,
0.0143890380859375,
0.04315185546875,
0.00795745849609375,
0.0004620552062988281,
-0.0171661376953125,
-0.004852294921875,
0.035552978515625,
0.008758544921875,
0.004756927490234375,
-0.0067901611328125,
-0.01190185546875,
0.04931640625,
0.033966064453125,
0.016357421875,
0.01345062255859375,
0.00473785400390625,
-0.00583648681640625,
-0.007732391357421875,
-0.050872802734375,
0.00670623779296875,
-0.04327392578125,
-0.01018524169921875,
0.03778076171875,
0.0237884521484375,
0.03326416015625,
0.01342010498046875,
0.0071563720703125,
0.004344940185546875,
0.00018393993377685547,
0.0169677734375,
-0.04791259765625,
-0.01739501953125,
0.03997802734375,
-0.01064300537109375,
-0.0132293701171875,
-0.023193359375,
-0.0267181396484375,
0.0236663818359375,
0.006206512451171875,
0.007610321044921875,
0.0041961669921875,
0.0232391357421875,
0.005035400390625,
-0.040557861328125,
-0.005550384521484375,
0.00373077392578125,
-0.031982421875,
0.004756927490234375,
0.01357269287109375,
0.036590576171875,
0.01458740234375,
0.03985595703125,
-0.0205535888671875,
0.0007205009460449219,
-0.020477294921875,
-0.0697021484375,
0.0020580291748046875,
-0.018341064453125,
-0.0005884170532226562,
0.000873565673828125,
-0.0250244140625,
-0.0206451416015625,
0.040802001953125,
-0.06597900390625,
0.00821685791015625,
0.0396728515625,
0.024627685546875,
-0.018707275390625,
-0.0007653236389160156,
-0.0169219970703125,
0.00264739990234375,
-0.0129241943359375,
-0.0213165283203125,
-0.000024318695068359375,
0.00469970703125,
0.033111572265625,
-0.01739501953125,
0.042724609375,
0.01174163818359375,
-0.0235137939453125,
-0.005767822265625,
0.0007829666137695312,
0.0261077880859375,
-0.057586669921875,
0.0013742446899414062,
0.00397491455078125,
0.0467529296875,
0.0162200927734375,
0.06890869140625,
0.041259765625,
0.024505615234375,
0.019866943359375,
-0.004302978515625,
-0.004077911376953125,
-0.0164947509765625,
-0.01105499267578125,
-0.01073455810546875,
0.0239105224609375,
0.0140228271484375,
0.0178680419921875,
-0.01678466796875,
0.03875732421875,
0.04461669921875,
-0.01457977294921875,
0.0115203857421875,
0.0115966796875,
0.0013980865478515625,
0.037994384765625,
0.035858154296875,
0.0034656524658203125,
0.0361328125,
-0.050872802734375,
0.003055572509765625,
0.005451202392578125,
-0.0478515625,
-0.0011949539184570312,
0.02288818359375,
-0.047271728515625,
0.040679931640625,
-0.005023956298828125,
-0.0014677047729492188,
0.006259918212890625,
-0.016357421875,
0.01401519775390625,
0.0224609375,
0.01192474365234375,
0.01329803466796875,
-0.034637451171875,
-0.0085296630859375,
-0.01319122314453125,
0.021728515625,
0.025390625,
0.07012939453125,
-0.018890380859375,
0.023284912109375,
-0.0242767333984375,
0.023590087890625,
-0.022491455078125,
-0.0250244140625,
0.02557373046875,
-0.01324462890625,
-0.0022640228271484375,
0.0109710693359375,
-0.058197021484375,
0.0215606689453125,
0.0240478515625,
-0.0121612548828125,
0.0242156982421875,
0.03631591796875,
0.00445556640625,
-0.01531982421875,
0.018524169921875,
-0.015899658203125,
-0.00807952880859375,
0.0096893310546875,
-0.030303955078125,
0.01515960693359375,
0.040924072265625,
0.044952392578125,
0.0007524490356445312,
-0.001605987548828125,
-0.0198822021484375,
0.0174713134765625,
0.006473541259765625,
0.022857666015625,
0.035888671875,
-0.04620361328125,
-0.00542449951171875,
0.0167083740234375,
-0.004383087158203125,
0.03753662109375,
0.01265716552734375,
0.01268768310546875,
0.0081024169921875,
0.0159454345703125,
0.00498199462890625,
0.02734375,
0.03271484375,
-0.00685882568359375,
0.0145111083984375,
0.01149749755859375,
-0.016265869140625,
-0.0221710205078125,
0.043365478515625,
-0.0277862548828125,
-0.031829833984375,
0.007022857666015625,
0.0256500244140625,
0.0004749298095703125,
-0.0188140869140625,
-0.0806884765625,
0.024932861328125,
0.0008955001831054688,
0.009429931640625,
-0.0653076171875,
0.02288818359375,
-0.005031585693359375,
0.06353759765625,
-0.0296630859375,
0.04864501953125,
-0.0189056396484375,
0.00823974609375,
-0.016204833984375,
0.03460693359375,
-0.0275726318359375,
-0.010162353515625,
0.0189056396484375,
-0.016937255859375,
0.036651611328125,
0.0235137939453125,
-0.0160675048828125,
-0.016754150390625,
-0.0195465087890625,
0.03564453125,
-0.09429931640625,
-0.004791259765625,
-0.004364013671875,
0.019561767578125,
-0.0127716064453125,
-0.062164306640625,
-0.026123046875,
0.0145416259765625,
0.003917694091796875,
0.0183258056640625,
-0.0239410400390625,
-0.0080108642578125,
-0.03350830078125,
-0.045684814453125,
0.060516357421875,
0.0207061767578125,
-0.01071929931640625,
0.00466156005859375,
-0.00782012939453125,
-0.00028395652770996094,
-0.005977630615234375,
0.00394439697265625,
-0.047576904296875,
-0.031524658203125,
0.00001043081283569336,
-0.00004500150680541992,
0.0618896484375,
-0.02532958984375,
0.0145263671875,
-0.039306640625,
0.0259857177734375,
-0.01226043701171875,
-0.00634002685546875,
-0.0107269287109375,
0.011199951171875,
0.035797119140625,
0.05657958984375,
-0.004863739013671875,
0.01470947265625,
0.0138397216796875,
-0.0478515625,
0.0017910003662109375,
-0.05645751953125,
-0.055938720703125,
-0.0295257568359375,
0.070556640625,
0.06390380859375,
0.0263519287109375,
-0.016571044921875,
-0.025970458984375,
-0.00954437255859375,
0.011871337890625,
-0.017333984375,
0.014434814453125,
-0.06610107421875,
-0.0259857177734375,
0.01407623291015625,
0.0109405517578125,
-0.01078033447265625,
0.0121917724609375,
0.005893707275390625,
-0.026763916015625,
0.05914306640625,
-0.0075836181640625,
-0.00835418701171875,
0.004589080810546875,
-0.027008056640625,
-0.0191192626953125,
-0.036468505859375,
-0.01172637939453125,
0.00262451171875,
-0.037200927734375,
0.0204315185546875,
-0.015472412109375,
-0.0655517578125,
0.00556182861328125,
0.0633544921875,
-0.0264129638671875,
0.04229736328125,
-0.055084228515625,
-0.0188751220703125,
-0.0165557861328125,
0.00933074951171875,
0.00286865234375,
-0.0099029541015625,
-0.040679931640625,
0.0513916015625,
0.01415252685546875,
0.033294677734375,
-0.03302001953125,
0.07012939453125,
-0.007266998291015625,
0.03515625,
0.01678466796875,
-0.010894775390625,
0.08306884765625,
-0.025238037109375,
-0.007404327392578125,
-0.0072174072265625,
-0.0227203369140625,
-0.056427001953125,
0.005992889404296875,
0.0288238525390625,
0.01239776611328125,
0.02655029296875
] |
ad03e897a2378b51bbfcd5f0efa693f99044fb72
|
Wordpress Stackexchange
Q: Include PHP file in Content using [shortcode] Here is what I have
I am not having any lucking finding how to simply include a file in the content editor using a shortcode.
For Example if I wanted to include form.php inside my Contact Page how would I make this happen using a shortcode?
Below is was attempting to work with to no avail.
Any help would be appreciated!
// Shortcode implementation
function magic_stuff($atts) {
// turn on output buffering to capture script output
ob_start();
// include file (contents will get saved in output buffer)
include(TEMPLATEPATH.'/wp-content/themes/grainandmortar/inc_static/test.php');
// save and return the content that has been output
$content = ob_get_clean();
return $content;
}
//register the Shortcode handler
add_shortcode('magic', 'magic_stuff');
A: Here's another way to do it, utilizing get_template_part of wordpress
function include_file($atts) {
$a = shortcode_atts( array(
'slug' => 'NULL',
), $atts );
if($a['slug'] != 'NULL'){
ob_start();
get_template_part($a['slug']);
return ob_get_clean();
}
}
add_shortcode('include', 'include_file');
examples:
[include slug="form"]
[include slug="sub-folder/filename_without_extension"]
|
Q: Include PHP file in Content using [shortcode] Here is what I have
I am not having any lucking finding how to simply include a file in the content editor using a shortcode.
For Example if I wanted to include form.php inside my Contact Page how would I make this happen using a shortcode?
Below is was attempting to work with to no avail.
Any help would be appreciated!
// Shortcode implementation
function magic_stuff($atts) {
// turn on output buffering to capture script output
ob_start();
// include file (contents will get saved in output buffer)
include(TEMPLATEPATH.'/wp-content/themes/grainandmortar/inc_static/test.php');
// save and return the content that has been output
$content = ob_get_clean();
return $content;
}
//register the Shortcode handler
add_shortcode('magic', 'magic_stuff');
A: Here's another way to do it, utilizing get_template_part of wordpress
function include_file($atts) {
$a = shortcode_atts( array(
'slug' => 'NULL',
), $atts );
if($a['slug'] != 'NULL'){
ob_start();
get_template_part($a['slug']);
return ob_get_clean();
}
}
add_shortcode('include', 'include_file');
examples:
[include slug="form"]
[include slug="sub-folder/filename_without_extension"]
A: I modified some code from an old blog post to do this, and allow for query-strings to be attached to the file as well.
Original credit goes to amberpanther.com, and it turns out they made a plug-in out of this, too.
//create the shortcode [include] that accepts a filepath and query string
//this function was modified from a post on www.amberpanther.com you can find it at the link below:
//http://www.amberpanther.com/knowledge-base/using-the-wordpress-shortcode-api-to-include-an-external-file-in-the-post-content/
//BEGIN amberpanther.com code
function include_file($atts) {
//if filepath was specified
extract(
shortcode_atts(
array(
'filepath' => 'NULL'
), $atts
)
);
//BEGIN modified portion of code to accept query strings
//check for query string of variables after file path
if(strpos($filepath,"?")) {
$query_string_pos = strpos($filepath,"?");
//create global variable for query string so we can access it in our included files if we need it
//also parse it out from the clean file name which we will store in a new variable for including
global $query_string;
$query_string = substr($filepath,$query_string_pos + 1);
$clean_file_path = substr($filepath,0,$query_string_pos);
//if there isn't a query string
} else {
$clean_file_path = $filepath;
}
//END modified portion of code
//check if the filepath was specified and if the file exists
if ($filepath != 'NULL' && file_exists(get_stylesheet_directory_uri() . "/" . $clean_file_path)){
//turn on output buffering to capture script output
ob_start();
//include the specified file
include(TEMPLATEPATH.$clean_file_path);
//assign the file output to $content variable and clean buffer
$content = ob_get_clean();
//return the $content
//return is important for the output to appear at the correct position
//in the content
return $content;
}
}
//register the Shortcode handler
add_shortcode('include', 'include_file');
//END amberpanther.com code
//shortcode with sample query string:
//[include filepath="/get-posts.php?format=grid&taxonomy=testing&term=stuff&posttype=work"]
I set mine to pull from the stylesheet uri (so it will work with child themes and such), but you could adjust that code easily to pull from anywhere (including plug-in directories), or remove it altogether and just use the full path when including the file. You could even add a conditional with a trigger character at the beginning that tells it to use a specific path based on what the first character of the file name is, like using a "#" for the template directory, etc.
I use it to pull in a file called get-posts.php that lives in my template directory and formats the output of various posts based on a series of parameters provided in the query string. It saves me from needing special templates because I can include the file, send it a format and it will output the posts with the markup I've specified in the get-posts.php file.
It also allows clients to pull custom post types into actual blog-posts in specific formats and is quite handy.
Let me know if you need clarification on anything.
A: There is an error in the solution provided by @adedoy, since $slug is never defined. This worked for me:
function include_file($atts) {
$atts = shortcode_atts(
array(
'path' => 'NULL',
), $atts, 'include' );
ob_start();
get_template_part($atts['path']);
return ob_get_clean();
}
add_shortcode('include', 'include_file');
Usage: [include path="path/from/root"]
A: Ok, first I'd ditch the output buffering.
Second change:
include(TEMPLATEPATH.'/wp-content/themes/grainandmortar/inc_static/test.php');
To
include( get_stylesheet_directory() . '/inc_static/test.php');
Finally,
Reading the documentation here: https://codex.wordpress.org/Shortcode_API
You need to return something, if your test.php doesn't output something in a returnable fashion, you're going to have a bad time.
So make sure that test.php does something along the lines of:
$output = "STUFF"; // a variable you could return after include.
// or
function test() {
// do stuff
return $stuff; // a function that returns a value that you can call after include.
}
Then after you include your test.php file -- you just return $output or do something like return test();.
A: I found that the include code originally written by the AmberPanther folks didn't work so well for me, so I found another wordpress plugin that does pretty much the same thing. It's called Include Me, by Stefano Lissa. The usage is pretty much that you write your path to the file, starting from the root directory of your site.
So for example, within your WordPress page you'd write:
[includeme file="wp-content/themes/your-theme/code/example-code.php"]
and within your functions.php file you'd include:
<?php
if (is_admin()) {
include dirname(__FILE__) . '/admin.php';
} else {
function includeme_call($attrs, $content = null) {
if (isset($attrs['file'])) {
$file = strip_tags($attrs['file']);
if ($file[0] != '/')
$file = ABSPATH . $file;
ob_start();
include($file);
$buffer = ob_get_clean();
$options = get_option('includeme', array());
if (isset($options['shortcode'])) {
$buffer = do_shortcode($buffer);
}
} else {
$tmp = '';
foreach ($attrs as $key => $value) {
if ($key == 'src') {
$value = strip_tags($value);
}
$value = str_replace('&', '&', $value);
if ($key == 'src') {
$value = strip_tags($value);
}
$tmp .= ' ' . $key . '="' . $value . '"';
}
$buffer = '<iframe' . $tmp . '></iframe>';
}
return $buffer;
}
// Here because the funciton MUST be define before the "add_shortcode" since
// "add_shortcode" check the function name with "is_callable".
add_shortcode('includeme', 'includeme_call');
}
of course, I'd also recommend just installing the plugin so you can take advantage of updates. https://wordpress.org/plugins/include-me/
|
wordpress
|
{
"language": "en",
"length": 983,
"provenance": "stackexchange_00019.jsonl.gz:419252",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49675"
}
|
[
0.048004150390625,
0.005218505859375,
-0.0010080337524414062,
-0.054351806640625,
0.00922393798828125,
-0.00701141357421875,
0.005550384521484375,
-0.0233306884765625,
-0.02032470703125,
0.03271484375,
-0.0228118896484375,
0.010498046875,
-0.0055999755859375,
-0.0064697265625,
0.006866455078125,
-0.0202789306640625,
0.030792236328125,
-0.0004546642303466797,
0.026123046875,
-0.013702392578125,
-0.006511688232421875,
0.01534271240234375,
-0.007732391357421875,
0.017425537109375,
0.0007562637329101562,
-0.016998291015625,
0.059906005859375,
-0.027618408203125,
-0.03936767578125,
-0.046783447265625,
0.004955291748046875,
0.050994873046875,
0.036376953125,
0.03887939453125,
-0.0699462890625,
0.04339599609375,
0.01001739501953125,
0.016693115234375,
-0.005126953125,
0.026885986328125,
0.0189971923828125,
0.0012903213500976562,
0.0390625,
0.00803375244140625,
0.0024852752685546875,
-0.04144287109375,
0.00585174560546875,
-0.05322265625,
0.0150146484375,
0.01393890380859375,
0.015228271484375,
0.01471710205078125,
0.0203704833984375,
-0.03582763671875,
0.01227569580078125,
0.035736083984375,
-0.0185699462890625,
-0.01132965087890625,
0.03887939453125,
0.0011425018310546875,
-0.013702392578125,
-0.0229339599609375,
0.024932861328125,
-0.0218353271484375,
-0.004970550537109375,
0.00836181640625,
-0.025238037109375,
-0.0021915435791015625,
-0.0411376953125,
0.0187530517578125,
0.04736328125,
-0.06298828125,
0.0242767333984375,
-0.0164031982421875,
0.004421234130859375,
0.0218353271484375,
-0.032012939453125,
0.0175323486328125,
0.042144775390625,
-0.00799560546875,
-0.0233612060546875,
0.003070831298828125,
-0.048309326171875,
-0.045257568359375,
0.021728515625,
-0.0007004737854003906,
-0.018890380859375,
-0.00440216064453125,
0.005802154541015625,
0.011627197265625,
-0.00893402099609375,
0.05194091796875,
0.0084381103515625,
-0.007762908935546875,
-0.0158233642578125,
-0.021820068359375,
0.0090789794921875,
0.038604736328125,
0.0206756591796875,
0.051177978515625,
0.021575927734375,
-0.054229736328125,
0.0693359375,
-0.057403564453125,
0.0105133056640625,
0.0694580078125,
-0.0174407958984375,
-0.01294708251953125,
0.03497314453125,
0.02093505859375,
0.0282440185546875,
0.004608154296875,
-0.0252838134765625,
-0.036865234375,
-0.039825439453125,
0.04058837890625,
-0.05078125,
0.0009632110595703125,
0.0165252685546875,
0.015960693359375,
0.02117919921875,
0.041015625,
0.0212860107421875,
-0.051361083984375,
-0.005756378173828125,
-0.0209808349609375,
-0.0271148681640625,
-0.04791259765625,
0.0195465087890625,
0.03314208984375,
-0.0189666748046875,
-0.0061492919921875,
0.04571533203125,
0.028411865234375,
0.01383209228515625,
-0.0205841064453125,
0.008453369140625,
-0.0012912750244140625,
0.0029468536376953125,
-0.02093505859375,
0.0222015380859375,
0.0169677734375,
0.0184326171875,
-0.01355743408203125,
-0.00789642333984375,
0.0174407958984375,
0.00930023193359375,
0.01471710205078125,
0.019775390625,
-0.05828857421875,
0.00838470458984375,
-0.02587890625,
0.03302001953125,
0.009124755859375,
-0.036712646484375,
-0.007198333740234375,
-0.001956939697265625,
-0.018157958984375,
-0.01397705078125,
-0.0287628173828125,
0.0030269622802734375,
-0.0173492431640625,
-0.0158233642578125,
-0.0732421875,
-0.054534912109375,
-0.01068115234375,
-0.02862548828125,
-0.0014543533325195312,
0.0156402587890625,
0.0113372802734375,
0.037872314453125,
0.01103973388671875,
-0.0587158203125,
0.0169830322265625,
0.0188140869140625,
0.0036106109619140625,
-0.009979248046875,
0.0379638671875,
0.0243988037109375,
0.043060302734375,
0.010101318359375,
-0.024566650390625,
0.08770751953125,
-0.0164337158203125,
-0.048431396484375,
0.038177490234375,
0.0010089874267578125,
0.044647216796875,
-0.0014362335205078125,
0.0008091926574707031,
0.038604736328125,
0.0352783203125,
-0.0038204193115234375,
-0.006313323974609375,
-0.02264404296875,
-0.01837158203125,
-0.003360748291015625,
0.010711669921875,
-0.0106658935546875,
0.01262664794921875,
-0.038238525390625,
-0.039306640625,
0.038330078125,
0.00420379638671875,
-0.0226593017578125,
0.006748199462890625,
-0.04425048828125,
0.0251007080078125,
-0.0004410743713378906,
-0.01313018798828125,
0.002002716064453125,
-0.029998779296875,
-0.0095062255859375,
0.003662109375,
-0.01279449462890625,
0.03753662109375,
-0.01934814453125,
0.028839111328125,
0.008636474609375,
0.07904052734375,
0.0246429443359375,
-0.0183563232421875,
0.005279541015625,
-0.032501220703125,
0.034820556640625,
0.00017333030700683594,
-0.02850341796875,
-0.0264434814453125,
-0.0270233154296875,
0.00957489013671875,
-0.066162109375,
0.0548095703125,
-0.013671875,
-0.03375244140625,
-0.06622314453125,
-0.004276275634765625,
-0.026763916015625,
0.008880615234375,
-0.01525115966796875,
0.04168701171875,
0.045684814453125,
0.040771484375,
-0.0155792236328125,
-0.015716552734375,
0.0711669921875,
-0.02655029296875,
0.0130767822265625,
-0.0251007080078125,
0.01302337646484375,
0.056732177734375,
-0.02630615234375,
0.011138916015625,
0.0071563720703125,
-0.048095703125,
-0.0011014938354492188,
0.034027099609375,
-0.02886962890625,
-0.033416748046875,
0.0225067138671875,
0.007152557373046875,
0.0166473388671875,
-0.0474853515625,
-0.01611328125,
-0.0360107421875,
0.007198333740234375,
0.04608154296875,
0.0455322265625,
0.05694580078125,
-0.0292205810546875,
0.0206756591796875,
-0.00867462158203125,
0.037322998046875,
-0.01023101806640625,
0.06719970703125,
0.0213775634765625,
0.021209716796875,
-0.0217132568359375,
-0.02117919921875,
0.01187896728515625,
0.041259765625,
-0.031982421875,
0.00457000732421875,
0.03387451171875,
-0.00704193115234375,
-0.002307891845703125,
-0.04962158203125,
0.02178955078125,
-0.033966064453125,
0.0328369140625,
-0.003948211669921875,
0.01485443115234375,
0.042938232421875,
-0.00888824462890625,
0.05810546875,
0.027191162109375,
-0.004291534423828125,
0.09051513671875,
-0.014068603515625,
0.0176239013671875,
0.005512237548828125,
0.06280517578125,
0.052276611328125,
-0.01461029052734375,
0.004238128662109375,
0.01163482666015625,
-0.03387451171875,
-0.046844482421875,
0.0181427001953125,
0.00121307373046875,
-0.01776123046875,
-0.04425048828125,
0.048858642578125,
0.0298004150390625,
0.01136016845703125,
-0.003551483154296875,
-0.0164794921875,
-0.003734588623046875,
0.0270233154296875,
-0.052825927734375,
-0.05303955078125,
0.0140533447265625,
-0.040924072265625,
0.00548553466796875,
0.01042938232421875,
-0.0399169921875,
-0.02557373046875,
0.04632568359375,
-0.0016031265258789062,
-0.025360107421875,
0.0011205673217773438,
-0.0278472900390625,
-0.0194091796875,
-0.058502197265625,
0.0229034423828125,
0.00492095947265625,
0.0176544189453125,
0.00017309188842773438,
0.04681396484375,
0.00444793701171875,
-0.0286102294921875,
0.01076507568359375,
0.03167724609375,
-0.0227508544921875,
-0.010528564453125,
0.019317626953125,
-0.056243896484375,
-0.0188140869140625,
-0.0010519027709960938,
-0.004688262939453125,
-0.00322723388671875,
0.01800537109375,
-0.00484466552734375,
-0.021331787109375,
-0.0237884521484375,
0.0174407958984375,
0.036895751953125,
-0.0026111602783203125,
-0.031951904296875,
0.06805419921875,
-0.03759765625,
0.01335906982421875,
-0.016876220703125,
-0.0233917236328125,
-0.0198211669921875,
0.005924224853515625,
0.0002472400665283203,
-0.019683837890625,
0.000995635986328125,
0.0249786376953125,
0.0312347412109375,
0.016845703125,
0.010650634765625,
-0.0024433135986328125,
-0.017669677734375,
-0.019256591796875,
-0.026275634765625,
0.048583984375,
0.0111083984375,
0.0011453628540039062,
0.00997161865234375,
0.0302734375,
-0.00011450052261352539,
0.0207977294921875,
-0.0270843505859375,
-0.038909912109375,
0.06353759765625,
-0.012176513671875,
0.023834228515625,
-0.077880859375,
-0.026275634765625,
-0.0633544921875,
0.05438232421875,
-0.031402587890625,
-0.0285491943359375,
-0.02960205078125,
-0.018768310546875,
0.008209228515625,
0.0205230712890625,
-0.0215911865234375,
-0.00975799560546875,
-0.0258636474609375,
0.0269775390625,
-0.0016965866088867188,
0.0081939697265625,
-0.0228729248046875,
-0.01007843017578125,
-0.0065765380859375,
-0.029205322265625,
0.03948974609375,
-0.02032470703125,
0.048614501953125,
0.01971435546875,
0.0019168853759765625,
0.0254364013671875,
-0.045745849609375,
-0.039093017578125,
-0.0526123046875,
-0.00719451904296875,
-0.037841796875,
0.05535888671875,
0.0271759033203125,
-0.01326751708984375,
-0.041351318359375,
0.02679443359375,
-0.0220184326171875,
-0.0083770751953125,
0.01038360595703125,
0.0323486328125,
-0.0184326171875,
0.040374755859375,
0.0250244140625,
0.00494384765625,
0.0074310302734375,
0.033416748046875,
-0.0217437744140625,
0.054779052734375,
-0.03082275390625,
-0.0181121826171875,
0.017974853515625,
-0.04278564453125,
-0.00933074951171875,
-0.0232696533203125,
0.0018301010131835938,
0.018463134765625,
0.0027599334716796875,
-0.01418304443359375,
-0.021514892578125,
0.0018854141235351562,
0.036773681640625,
0.01274871826171875,
-0.035247802734375,
0.010894775390625,
0.02716064453125,
0.015869140625,
-0.03350830078125,
-0.09039306640625,
0.0179443359375,
0.04595947265625,
-0.016815185546875,
0.07635498046875,
0.0384521484375,
-0.027862548828125,
0.09716796875,
0.02203369140625,
0.0206756591796875,
-0.062347412109375,
0.06982421875,
-0.0052947998046875,
0.00555419921875,
0.0130615234375,
-0.00705718994140625,
0.0167083740234375,
-0.00496673583984375,
-0.009979248046875,
0.02191162109375,
0.01216888427734375,
0.002593994140625,
-0.00811767578125,
0.01084136962890625,
-0.0008397102355957031,
-0.032684326171875,
-0.0136871337890625,
0.022613525390625,
0.0499267578125,
0.0223541259765625,
0.0183563232421875,
0.031158447265625,
0.07086181640625,
0.0008640289306640625,
0.054351806640625,
0.0025539398193359375,
0.0170135498046875,
0.032958984375,
0.0330810546875,
0.00885772705078125,
0.0255279541015625,
0.0007309913635253906,
-0.0166473388671875,
0.0173187255859375,
-0.0180511474609375,
-0.0056915283203125,
0.0155487060546875,
-0.03131103515625,
-0.0205230712890625,
0.00185394287109375,
0.0254364013671875,
0.0262451171875,
-0.0080108642578125,
0.0196075439453125,
0.00948333740234375,
0.0295562744140625,
-0.0178680419921875,
-0.0217132568359375,
-0.00516510009765625,
-0.028533935546875,
-0.0147247314453125,
0.01111602783203125,
-0.05450439453125,
0.0028324127197265625,
0.0221405029296875,
0.01097869873046875,
0.0273590087890625,
0.017059326171875,
0.0201873779296875,
-0.003246307373046875,
-0.0159912109375,
0.00402069091796875,
0.007534027099609375,
-0.03985595703125,
-0.034637451171875,
0.007564544677734375,
0.062225341796875,
-0.0615234375,
-0.0261077880859375,
0.0222320556640625,
-0.0396728515625,
0.0073089599609375,
-0.033355712890625,
-0.01788330078125,
0.0186004638671875,
-0.002025604248046875,
-0.01311492919921875,
0.01149749755859375,
0.011077880859375,
-0.0286865234375,
0.0482177734375,
-0.0262603759765625,
0.0179595947265625,
0.023162841796875,
-0.04461669921875,
0.004482269287109375,
0.0086212158203125,
0.025848388671875,
-0.006412506103515625,
-0.0021686553955078125,
-0.042236328125,
-0.0276641845703125,
-0.032684326171875,
-0.0038814544677734375,
0.0751953125,
-0.0089111328125,
-0.00865936279296875,
-0.0204010009765625,
0.0195465087890625,
0.02252197265625,
-0.0086212158203125,
0.050506591796875,
-0.00354766845703125,
-0.035369873046875,
0.0302581787109375,
-0.0247344970703125,
0.0102386474609375,
0.01303863525390625,
-0.0537109375,
-0.01776123046875,
-0.0455322265625,
-0.0133819580078125,
0.018035888671875,
-0.029937744140625,
-0.0055389404296875,
-0.0044708251953125,
0.0168304443359375,
-0.0055694580078125,
0.06915283203125,
-0.001983642578125,
0.050811767578125,
-0.0220947265625,
0.03363037109375,
0.0177459716796875,
0.0239105224609375,
0.0005044937133789062,
-0.0287322998046875,
-0.01470184326171875,
-0.0228424072265625,
-0.0230560302734375,
-0.006183624267578125,
-0.0024700164794921875,
0.0491943359375,
0.08294677734375,
0.0018663406372070312,
-0.0016775131225585938,
-0.01438140869140625,
-0.0006756782531738281,
-0.016082763671875,
0.051513671875,
0.0006814002990722656,
-0.0088653564453125,
0.01081085205078125,
-0.02325439453125,
-0.003147125244140625,
-0.0205078125,
-0.005222320556640625,
0.017333984375,
-0.0204315185546875,
0.0249176025390625,
0.00720977783203125,
-0.0181884765625,
0.07763671875,
0.09222412109375,
-0.003993988037109375,
0.028411865234375,
0.059906005859375,
-0.010345458984375,
-0.0369873046875,
0.0165863037109375,
0.0121612548828125,
-0.01178741455078125,
0.049346923828125,
0.004604339599609375,
-0.0205230712890625,
0.019012451171875,
-0.0197601318359375,
0.036895751953125,
0.06219482421875,
0.06390380859375,
-0.0618896484375,
-0.0178375244140625,
-0.0089874267578125,
-0.0482177734375,
0.03277587890625,
-0.0201568603515625,
0.0033168792724609375,
0.0204010009765625,
0.057464599609375,
0.0221405029296875,
-0.01617431640625,
0.035552978515625,
0.0306396484375,
-0.022857666015625,
0.004119873046875,
0.0308380126953125,
0.00714874267578125,
0.0029277801513671875,
-0.01800537109375,
-0.0198822021484375,
0.0232696533203125,
0.0008168220520019531,
0.034515380859375,
-0.034759521484375,
0.0172119140625,
0.010894775390625,
0.0282440185546875,
-0.0176544189453125,
0.0062103271484375,
0.011199951171875,
0.0016984939575195312,
0.0055084228515625,
0.04656982421875,
-0.02325439453125,
0.016448974609375,
0.0118255615234375,
0.007251739501953125,
0.0167388916015625,
-0.00563812255859375,
0.01213836669921875,
0.028167724609375,
-0.0396728515625,
0.0080718994140625,
-0.00897979736328125,
0.0209808349609375,
-0.00952911376953125,
-0.00659942626953125,
0.10638427734375,
-0.0399169921875,
-0.0285797119140625,
0.016845703125,
0.01026153564453125,
-0.01233673095703125,
-0.00789642333984375,
0.044677734375,
-0.058807373046875,
-0.0216217041015625,
0.0289306640625,
-0.0219879150390625,
-0.052703857421875,
-0.0268707275390625,
-0.0960693359375,
0.1619873046875,
0.0016508102416992188,
0.071044921875,
0.01276397705078125,
0.06414794921875,
-0.06829833984375,
0.01239013671875,
-0.041015625,
0.078369140625,
0.0282135009765625,
0.03472900390625,
-0.08599853515625,
-0.029998779296875,
0.00714111328125,
0.05255126953125,
0.047454833984375,
0.004291534423828125,
-0.0020771026611328125,
0.01702880859375,
0.0794677734375,
-0.0089111328125,
-0.03875732421875,
0.04254150390625,
0.00424957275390625,
-0.00856781005859375,
0.028472900390625,
-0.0230712890625,
0.0240325927734375,
-0.0277099609375,
0.0069427490234375,
0.023162841796875,
-0.00655364990234375,
-0.019012451171875,
0.01435089111328125,
-0.012359619140625,
-0.00788116455078125,
-0.0007920265197753906,
-0.0074462890625,
-0.01392364501953125,
-0.0165863037109375,
0.01297760009765625,
-0.006816864013671875,
-0.0684814453125,
-0.0312347412109375,
-0.0211334228515625,
0.0323486328125,
0.00490570068359375,
0.028076171875,
-0.01195526123046875,
0.0113983154296875,
0.09356689453125,
-0.02655029296875,
-0.00611114501953125,
0.0238800048828125,
-0.00560760498046875,
0.0164031982421875,
0.006725311279296875,
0.0174713134765625,
-0.035400390625,
0.0222320556640625,
0.036529541015625,
0.0290985107421875,
-0.031341552734375,
-0.0212249755859375,
-0.0022430419921875,
0.0035076141357421875,
-0.005138397216796875,
-0.0274658203125,
-0.002353668212890625,
-0.00833892822265625,
0.01125335693359375,
-0.037872314453125,
-0.01519012451171875,
0.03851318359375,
0.0008902549743652344,
-0.007205963134765625,
-0.0241851806640625,
0.030029296875,
0.0079193115234375,
-0.04296875,
0.039215087890625,
0.0283660888671875,
0.053619384765625,
-0.028778076171875,
0.09747314453125,
-0.048583984375,
-0.0173187255859375,
-0.019561767578125,
0.01454925537109375,
-0.0185394287109375,
0.006313323974609375,
-0.028961181640625,
-0.007801055908203125,
-0.00923919677734375,
0.0302886962890625,
0.0276947021484375,
0.0313720703125,
0.036712646484375,
0.0027751922607421875,
-0.0221405029296875,
0.0018072128295898438,
0.03515625,
-0.017578125,
0.018280029296875,
-0.018341064453125,
0.00604248046875,
0.0333251953125,
0.0022716522216796875,
-0.018707275390625,
-0.0174102783203125,
0.0830078125,
-0.0289154052734375,
0.0211944580078125,
-0.01459503173828125,
0.00334930419921875,
0.048828125,
-0.02130126953125,
0.007274627685546875,
0.003810882568359375,
-0.051116943359375,
-0.0006303787231445312,
-0.018218994140625,
-0.052276611328125,
0.02545166015625,
0.055145263671875,
0.0023136138916015625,
-0.00882720947265625,
0.01004791259765625,
0.0225982666015625,
0.0073394775390625,
-0.006427764892578125,
-0.020904541015625,
0.00014317035675048828,
0.06976318359375,
-0.0022792816162109375,
-0.034454345703125,
-0.013427734375,
-0.0017766952514648438,
0.0421142578125,
0.0261688232421875,
0.0615234375,
-0.019927978515625,
0.03790283203125,
-0.01428985595703125,
-0.0142974853515625,
0.017669677734375,
-0.01003265380859375,
0.060882568359375,
0.0232696533203125,
-0.0194854736328125,
-0.0384521484375,
0.0167083740234375,
0.00240325927734375,
0.05419921875,
-0.027801513671875,
-0.01309967041015625,
0.006496429443359375,
0.0212249755859375,
-0.0211181640625,
0.0223236083984375,
-0.0196380615234375,
-0.0147552490234375,
-0.013671875,
0.0116424560546875,
0.0158233642578125,
0.000988006591796875,
-0.015472412109375,
-0.00655364990234375,
0.031707763671875,
-0.026153564453125,
0.03045654296875,
-0.01033782958984375,
0.039337158203125,
0.035736083984375,
0.00445556640625,
-0.03143310546875,
0.0177459716796875,
-0.01861572265625,
0.007488250732421875,
0.00701141357421875,
0.0439453125,
0.005916595458984375,
-0.03656005859375,
0.027984619140625,
0.02850341796875,
0.03466796875,
-0.0305328369140625,
0.0160369873046875,
0.019134521484375,
-0.00402069091796875,
0.0248565673828125,
-0.0281829833984375,
-0.0242919921875,
-0.041015625,
0.0116729736328125,
0.0266876220703125,
-0.022735595703125,
-0.01047515869140625,
-0.050872802734375,
0.00888824462890625,
0.050201416015625,
0.0131683349609375,
-0.053314208984375,
0.00853729248046875,
-0.01242828369140625,
0.07574462890625,
0.0113372802734375,
0.0175628662109375,
-0.01406097412109375,
-0.0262451171875,
-0.061309814453125,
-0.0249481201171875,
-0.0408935546875,
0.0278472900390625,
-0.01280975341796875,
0.0372314453125,
0.07977294921875,
-0.0230712890625,
-0.03985595703125,
0.036041259765625,
-0.0027103424072265625,
0.0928955078125,
-0.06964111328125,
-0.039276123046875,
0.0175018310546875,
-0.016082763671875,
0.0153656005859375,
-0.0126495361328125,
-0.02362060546875,
-0.025665283203125,
0.034881591796875,
-0.016937255859375,
-0.01568603515625,
-0.0185394287109375,
-0.05950927734375,
-0.0855712890625,
-0.0112762451171875,
0.007007598876953125,
-0.0531005859375,
-0.035736083984375,
-0.003574371337890625,
0.00948333740234375,
-0.0106353759765625,
-0.0308380126953125,
-0.0018377304077148438,
-0.035797119140625,
0.032684326171875,
-0.00438690185546875,
0.037353515625,
0.033782958984375,
-0.0010881423950195312,
-0.0022373199462890625,
-0.0182952880859375,
-0.0296783447265625,
-0.048919677734375,
0.0592041015625,
-0.02777099609375,
0.051727294921875,
0.052825927734375,
-0.044677734375,
-0.035003662109375,
-0.01861572265625,
-0.06304931640625,
-0.0041351318359375,
-0.08038330078125,
-0.044464111328125,
-0.034576416015625,
0.09552001953125,
0.04681396484375,
0.02410888671875,
-0.0296783447265625,
0.0029621124267578125,
0.033111572265625,
-0.01154327392578125,
0.0009322166442871094,
0.0119476318359375,
-0.0240020751953125,
-0.00670623779296875,
-0.043182373046875,
-0.00925445556640625,
-0.0020961761474609375,
-0.034393310546875,
-0.029541015625,
0.00688934326171875,
-0.023712158203125,
-0.00843048095703125,
0.011993408203125,
-0.043914794921875,
0.044281005859375,
-0.0035228729248046875,
0.03289794921875,
-0.0161895751953125,
0.036224365234375,
0.0262908935546875,
0.016632080078125,
-0.01537322998046875,
-0.01398468017578125,
-0.005260467529296875,
0.020599365234375,
0.00904083251953125,
0.035552978515625,
-0.0030689239501953125,
-0.006855010986328125,
0.0011911392211914062,
-0.00015223026275634766,
0.0039520263671875,
-0.0205230712890625,
-0.0118865966796875,
0.03448486328125,
-0.0016002655029296875,
0.064453125,
-0.0380859375,
-0.004741668701171875,
-0.0220947265625,
0.0233001708984375,
-0.0136566162109375,
-0.0004210472106933594,
0.047698974609375,
-0.045166015625,
0.0007586479187011719,
0.022064208984375,
-0.0189361572265625,
-0.021484375,
0.00004857778549194336,
-0.02105712890625,
0.0151824951171875,
-0.0007009506225585938
] |
b15eada870ef4650c7e808756cb6117752f51866
|
Wordpress Stackexchange
Q: How do I display logged-in username IF logged-in? I'm working on creating some text that says 'Login' to users that are not logged in, and the user's username or display name when logged in.
It seems like it should be an easy problem to solve, and I've found the following two bits of code on the wordpress codex that each do half of what I am looking for, but I haven't figured out how to combine them (without breaking the site).
Is this the correct direction, or way off base?
To check if the user is logged in and display something different depending:
<?php if ( is_user_logged_in() ) {
echo '{username code here}';
} else {
echo 'Login';
}
?>
To get and display the current user's information:
<?php global $current_user;
wp_get_current_user();
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
?>
A: This seems to do what you need.
<?php global $current_user; wp_get_current_user(); ?>
<?php
if ( is_user_logged_in() ) {
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
} else {
wp_loginout();
} ?>
|
Q: How do I display logged-in username IF logged-in? I'm working on creating some text that says 'Login' to users that are not logged in, and the user's username or display name when logged in.
It seems like it should be an easy problem to solve, and I've found the following two bits of code on the wordpress codex that each do half of what I am looking for, but I haven't figured out how to combine them (without breaking the site).
Is this the correct direction, or way off base?
To check if the user is logged in and display something different depending:
<?php if ( is_user_logged_in() ) {
echo '{username code here}';
} else {
echo 'Login';
}
?>
To get and display the current user's information:
<?php global $current_user;
wp_get_current_user();
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
?>
A: This seems to do what you need.
<?php global $current_user; wp_get_current_user(); ?>
<?php
if ( is_user_logged_in() ) {
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
} else {
wp_loginout();
} ?>
|
wordpress
|
{
"language": "en",
"length": 191,
"provenance": "stackexchange_00019.jsonl.gz:419254",
"question_score": "21",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49686"
}
|
[
0.054412841796875,
0.01357269287109375,
-0.0196075439453125,
-0.022979736328125,
0.0197601318359375,
-0.039306640625,
0.042510986328125,
-0.0028285980224609375,
-0.01434326171875,
0.044769287109375,
-0.0178985595703125,
0.017059326171875,
-0.0231475830078125,
-0.0010204315185546875,
-0.030792236328125,
-0.0325927734375,
0.0117950439453125,
-0.0163421630859375,
0.017303466796875,
-0.0160980224609375,
0.00572967529296875,
0.0036296844482421875,
0.0272979736328125,
0.02618408203125,
0.0151214599609375,
-0.06781005859375,
0.148193359375,
-0.044586181640625,
0.057647705078125,
-0.0050048828125,
0.0289306640625,
-0.043853759765625,
-0.01568603515625,
0.047119140625,
-0.0089569091796875,
0.0127716064453125,
-0.0164337158203125,
0.0308685302734375,
0.04620361328125,
0.0027141571044921875,
0.034576416015625,
-0.01432037353515625,
-0.0115509033203125,
-0.018707275390625,
-0.0173492431640625,
-0.029388427734375,
0.032928466796875,
-0.0023975372314453125,
0.0250244140625,
0.0294036865234375,
0.02911376953125,
0.042999267578125,
0.0255889892578125,
0.017181396484375,
-0.00902557373046875,
0.029449462890625,
-0.022216796875,
0.03472900390625,
0.0528564453125,
-0.0209808349609375,
-0.044097900390625,
-0.050201416015625,
0.040679931640625,
-0.0248260498046875,
-0.005382537841796875,
0.0097808837890625,
0.0008444786071777344,
0.0240478515625,
-0.0171356201171875,
-0.020751953125,
-0.0017242431640625,
-0.0098724365234375,
0.009796142578125,
-0.004398345947265625,
-0.045623779296875,
-0.0034351348876953125,
0.00997161865234375,
-0.017608642578125,
0.0198211669921875,
-0.01506805419921875,
-0.0228424072265625,
0.028564453125,
-0.06719970703125,
-0.01242828369140625,
0.01438140869140625,
0.01259613037109375,
-0.0260467529296875,
-0.017852783203125,
0.0121612548828125,
-0.0187530517578125,
0.0002028942108154297,
0.0233917236328125,
-0.01210784912109375,
-0.007114410400390625,
-0.0203704833984375,
-0.041534423828125,
0.01459503173828125,
0.058135986328125,
-0.0338134765625,
-0.03546142578125,
-0.028839111328125,
-0.0013332366943359375,
-0.0210723876953125,
-0.0220794677734375,
-0.00022470951080322266,
0.061248779296875,
0.009765625,
0.033966064453125,
0.0128021240234375,
0.0033111572265625,
0.0163421630859375,
-0.01418304443359375,
-0.05328369140625,
-0.06500244140625,
0.01346588134765625,
0.0654296875,
-0.046630859375,
0.0201568603515625,
0.0089263916015625,
0.039581298828125,
-0.0052947998046875,
0.0173797607421875,
0.01544952392578125,
-0.0198516845703125,
0.014617919921875,
0.01190948486328125,
-0.007598876953125,
-0.0380859375,
-0.017791748046875,
0.0168304443359375,
-0.0239410400390625,
0.0244140625,
0.04150390625,
0.0158843994140625,
-0.0083770751953125,
-0.018585205078125,
0.024658203125,
-0.0302734375,
0.00484466552734375,
0.04888916015625,
-0.037261962890625,
-0.054290771484375,
0.011810302734375,
-0.028961181640625,
0.0130157470703125,
0.03802490234375,
0.02825927734375,
0.00539398193359375,
-0.034423828125,
-0.0753173828125,
0.0312347412109375,
-0.0123138427734375,
-0.04364013671875,
0.0272216796875,
0.06890869140625,
0.050140380859375,
0.0185699462890625,
0.0162506103515625,
0.01384735107421875,
0.044708251953125,
0.0179595947265625,
-0.00537872314453125,
0.0015192031860351562,
-0.01087188720703125,
-0.03839111328125,
-0.006572723388671875,
-0.032867431640625,
0.00455474853515625,
0.028228759765625,
-0.04388427734375,
0.024444580078125,
0.0162811279296875,
0.058837890625,
0.01186370849609375,
0.0006480216979980469,
-0.00638580322265625,
-0.0289306640625,
0.030670166015625,
0.033233642578125,
-0.00858306884765625,
0.00310516357421875,
-0.0233001708984375,
0.0294036865234375,
0.0031147003173828125,
-0.0389404296875,
0.0282440185546875,
-0.00603485107421875,
-0.00429534912109375,
0.027679443359375,
0.00027823448181152344,
0.03350830078125,
0.042449951171875,
-0.034942626953125,
0.0029506683349609375,
-0.01105499267578125,
-0.017425537109375,
0.0204925537109375,
0.0002944469451904297,
-0.019073486328125,
0.0160980224609375,
0.04217529296875,
-0.00811767578125,
-0.006317138671875,
-0.0292205810546875,
-0.07379150390625,
-0.009490966796875,
-0.01203155517578125,
0.0345458984375,
-0.00832366943359375,
-0.009918212890625,
0.0112762451171875,
-0.0144805908203125,
0.004543304443359375,
-0.058074951171875,
-0.04119873046875,
0.01262664794921875,
-0.0304107666015625,
0.031768798828125,
0.01326751708984375,
0.04364013671875,
0.0178070068359375,
-0.0014820098876953125,
0.0199737548828125,
-0.0287933349609375,
0.024444580078125,
-0.02294921875,
-0.0157928466796875,
-0.027435302734375,
-0.0005598068237304688,
-0.00685882568359375,
-0.004974365234375,
0.02874755859375,
0.0284881591796875,
0.03125,
-0.0279998779296875,
-0.017608642578125,
0.0062713623046875,
-0.0167236328125,
0.0176544189453125,
0.03741455078125,
0.0296783447265625,
0.0288238525390625,
-0.005069732666015625,
0.01059722900390625,
0.054229736328125,
-0.00786590576171875,
0.0236663818359375,
-0.0085296630859375,
0.035247802734375,
0.0474853515625,
0.004451751708984375,
-0.00403594970703125,
0.027191162109375,
-0.029449462890625,
0.011260986328125,
0.04632568359375,
-0.03515625,
0.00394439697265625,
-0.044921875,
-0.0022068023681640625,
-0.01136016845703125,
-0.032318115234375,
0.031890869140625,
-0.033966064453125,
0.0010204315185546875,
-0.048492431640625,
-0.0241546630859375,
-0.05010986328125,
-0.01447296142578125,
-0.0254058837890625,
0.0301971435546875,
-0.0357666015625,
0.0081024169921875,
-0.003726959228515625,
-0.00212860107421875,
-0.0208740234375,
-0.039642333984375,
0.005634307861328125,
0.01995849609375,
-0.0119781494140625,
-0.019622802734375,
-0.0166473388671875,
-0.00988006591796875,
-0.0042572021484375,
0.039276123046875,
-0.01247406005859375,
0.01036834716796875,
0.005084991455078125,
0.0226898193359375,
0.00921630859375,
0.03411865234375,
0.0233001708984375,
-0.0174102783203125,
0.058746337890625,
-0.026275634765625,
0.0010328292846679688,
-0.0026645660400390625,
-0.033599853515625,
0.02679443359375,
-0.042877197265625,
0.0112762451171875,
0.04241943359375,
-0.0005807876586914062,
-0.004512786865234375,
0.00789642333984375,
-0.0212249755859375,
-0.012451171875,
-0.004650115966796875,
0.0015077590942382812,
-0.018463134765625,
0.01123046875,
0.0867919921875,
0.02734375,
0.0587158203125,
-0.0010766983032226562,
-0.05377197265625,
-0.014068603515625,
0.01190185546875,
-0.0660400390625,
-0.06927490234375,
-0.07757568359375,
-0.090576171875,
0.0196075439453125,
-0.00724029541015625,
-0.016754150390625,
0.027130126953125,
0.0189666748046875,
0.0226593017578125,
0.02764892578125,
-0.044342041015625,
-0.0560302734375,
-0.054473876953125,
-0.07275390625,
0.00719451904296875,
-0.01715087890625,
0.0006666183471679688,
-0.005702972412109375,
0.017364501953125,
-0.0062713623046875,
-0.0264739990234375,
-0.0241241455078125,
0.02685546875,
-0.0038700103759765625,
-0.0309295654296875,
-0.0239715576171875,
-0.0026760101318359375,
0.0227508544921875,
0.01465606689453125,
-0.017852783203125,
-0.023651123046875,
0.02874755859375,
-0.0262908935546875,
0.0118560791015625,
-0.056915283203125,
0.0313720703125,
-0.0043487548828125,
-0.036163330078125,
0.01483917236328125,
0.041717529296875,
-0.0284271240234375,
0.0041961669921875,
-0.0002570152282714844,
-0.032257080078125,
0.05224609375,
0.0076141357421875,
-0.036407470703125,
0.02374267578125,
-0.0251312255859375,
-0.03216552734375,
-0.00888824462890625,
-0.020904541015625,
-0.019195556640625,
0.008758544921875,
-0.0011653900146484375,
-0.00299072265625,
0.046966552734375,
-0.0276031494140625,
-0.04498291015625,
0.0093841552734375,
-0.03765869140625,
0.004985809326171875,
-0.01041412353515625,
0.0087890625,
0.0014009475708007812,
-0.06658935546875,
0.053558349609375,
-0.006153106689453125,
-0.0179290771484375,
-0.0203399658203125,
-0.022369384765625,
0.00911712646484375,
0.0838623046875,
-0.01261138916015625,
-0.0029754638671875,
0.0180511474609375,
0.01214599609375,
-0.0740966796875,
-0.005558013916015625,
-0.0894775390625,
0.007354736328125,
-0.076171875,
0.01751708984375,
-0.004367828369140625,
-0.02496337890625,
0.005252838134765625,
-0.020263671875,
-0.026702880859375,
-0.038330078125,
0.00489044189453125,
0.01666259765625,
0.037506103515625,
0.002689361572265625,
-0.005889892578125,
0.024566650390625,
0.017791748046875,
-0.0535888671875,
-0.03985595703125,
-0.01503753662109375,
-0.035675048828125,
0.06890869140625,
0.056793212890625,
-0.04168701171875,
-0.017181396484375,
0.0189666748046875,
0.0097198486328125,
-0.01248931884765625,
0.022308349609375,
-0.005992889404296875,
0.040679931640625,
0.0110931396484375,
-0.00939178466796875,
-0.00740814208984375,
-0.019683837890625,
-0.017608642578125,
0.0013866424560546875,
0.0143890380859375,
-0.035430908203125,
-0.03131103515625,
-0.0146026611328125,
-0.0129547119140625,
-0.02960205078125,
-0.0009226799011230469,
0.0296630859375,
0.01446533203125,
0.00585174560546875,
0.005634307861328125,
0.014312744140625,
-0.0435791015625,
0.02801513671875,
0.0097808837890625,
-0.02227783203125,
0.017425537109375,
0.04412841796875,
0.01763916015625,
-0.0213775634765625,
-0.036529541015625,
0.0285797119140625,
0.0290069580078125,
-0.00669097900390625,
0.050079345703125,
0.0221710205078125,
-0.023834228515625,
0.054046630859375,
0.0092010498046875,
0.01033782958984375,
-0.00496673583984375,
0.0291900634765625,
-0.026092529296875,
-0.0299224853515625,
0.0276031494140625,
-0.0291900634765625,
-0.004100799560546875,
-0.0204620361328125,
0.002735137939453125,
-0.0189361572265625,
0.0179595947265625,
0.031951904296875,
-0.00659942626953125,
0.0259857177734375,
-0.008270263671875,
-0.04833984375,
-0.0027217864990234375,
-0.01383209228515625,
0.012847900390625,
0.031707763671875,
-0.0143890380859375,
0.0270843505859375,
0.0226593017578125,
-0.03973388671875,
-0.02850341796875,
-0.040985107421875,
0.0218048095703125,
-0.0003407001495361328,
-0.034210205078125,
-0.0167083740234375,
-0.008056640625,
-0.01532745361328125,
0.12359619140625,
0.003856658935546875,
-0.06170654296875,
0.015869140625,
-0.05352783203125,
0.020294189453125,
0.0396728515625,
0.027923583984375,
0.0472412109375,
0.01285552978515625,
-0.02923583984375,
-0.007602691650390625,
0.0032100677490234375,
0.00446319580078125,
-0.035919189453125,
-0.0251617431640625,
-0.031097412109375,
0.0025787353515625,
0.0001468658447265625,
0.08197021484375,
-0.0013494491577148438,
0.06512451171875,
-0.0323486328125,
0.02777099609375,
0.035675048828125,
0.01190948486328125,
0.030059814453125,
0.00801849365234375,
-0.0149688720703125,
-0.0159454345703125,
0.00545501708984375,
-0.00502777099609375,
-0.01800537109375,
0.0072021484375,
0.020172119140625,
-0.006084442138671875,
0.0190277099609375,
0.01343536376953125,
-0.01349639892578125,
-0.006015777587890625,
0.04669189453125,
-0.018890380859375,
-0.08709716796875,
-0.032989501953125,
0.02215576171875,
0.03125,
-0.051116943359375,
-0.00982666015625,
-0.006153106689453125,
-0.035064697265625,
-0.0019435882568359375,
-0.00994110107421875,
-0.0198974609375,
-0.0035724639892578125,
-0.0035266876220703125,
-0.0577392578125,
-0.0215911865234375,
-0.00025463104248046875,
-0.041748046875,
-0.01151275634765625,
-0.01023101806640625,
-0.036590576171875,
0.01291656494140625,
-0.01508331298828125,
0.0007042884826660156,
-0.0261383056640625,
-0.0073394775390625,
-0.0181884765625,
-0.0205841064453125,
0.076904296875,
0.023834228515625,
-0.0810546875,
0.035125732421875,
-0.047149658203125,
0.010284423828125,
0.0072174072265625,
-0.0234375,
-0.04583740234375,
-0.046722412109375,
0.0347900390625,
0.01151275634765625,
0.0168304443359375,
-0.0017480850219726562,
-0.034820556640625,
0.032318115234375,
0.03521728515625,
0.058990478515625,
-0.0158233642578125,
0.06982421875,
0.03314208984375,
0.025726318359375,
0.0230712890625,
0.038543701171875,
-0.017181396484375,
-0.016754150390625,
0.0298309326171875,
0.023651123046875,
-0.0293426513671875,
-0.047119140625,
0.0298614501953125,
-0.0478515625,
0.02532958984375,
-0.0212554931640625,
-0.033050537109375,
0.0191192626953125,
0.0036373138427734375,
-0.003452301025390625,
-0.005611419677734375,
0.07080078125,
-0.0343017578125,
0.01297760009765625,
-0.00710296630859375,
-0.015869140625,
-0.02398681640625,
-0.03460693359375,
0.0121002197265625,
0.01480865478515625,
-0.0121307373046875,
0.0231475830078125,
-0.0670166015625,
0.054107666015625,
0.08197021484375,
0.0176544189453125,
0.0469970703125,
0.00827789306640625,
0.031829833984375,
0.0312347412109375,
-0.026397705078125,
-0.01100921630859375,
0.006290435791015625,
0.055145263671875,
0.0003705024719238281,
-0.0206756591796875,
0.039154052734375,
-0.036590576171875,
0.0247650146484375,
0.07696533203125,
0.08148193359375,
-0.11248779296875,
0.01885986328125,
-0.0030384063720703125,
0.00397491455078125,
0.0706787109375,
-0.004398345947265625,
0.007472991943359375,
0.006198883056640625,
0.037628173828125,
-0.0257568359375,
-0.01267242431640625,
0.01470184326171875,
-0.01515960693359375,
-0.01255035400390625,
-0.0230560302734375,
0.03289794921875,
0.01258087158203125,
-0.0228729248046875,
0.0033721923828125,
0.004638671875,
0.00025963783264160156,
-0.01497650146484375,
0.0161590576171875,
0.0037364959716796875,
-0.011383056640625,
-0.055023193359375,
0.01136016845703125,
-0.0276947021484375,
-0.0123138427734375,
0.03070068359375,
-0.00507354736328125,
0.014617919921875,
0.0537109375,
-0.0226593017578125,
0.025543212890625,
0.0195465087890625,
-0.004474639892578125,
0.0159912109375,
-0.0010509490966796875,
-0.0127716064453125,
0.0401611328125,
-0.044281005859375,
0.01314544677734375,
-0.036895751953125,
0.03240966796875,
-0.0257720947265625,
-0.06903076171875,
0.076171875,
-0.014190673828125,
-0.019378662109375,
0.00337982177734375,
0.018096923828125,
-0.0185546875,
-0.03692626953125,
0.035064697265625,
-0.06488037109375,
-0.031585693359375,
-0.00567626953125,
-0.032958984375,
0.005779266357421875,
-0.034149169921875,
-0.09051513671875,
0.039398193359375,
-0.005462646484375,
0.056243896484375,
-0.0039043426513671875,
-0.00274658203125,
0.01558685302734375,
-0.01953125,
-0.0275115966796875,
0.0802001953125,
0.00737762451171875,
0.0799560546875,
-0.03009033203125,
-0.00225067138671875,
0.0621337890625,
0.02490234375,
0.0026397705078125,
0.024749755859375,
-0.0157470703125,
-0.021759033203125,
-0.03631591796875,
0.0278778076171875,
-0.015350341796875,
0.019195556640625,
-0.0036144256591796875,
0.039520263671875,
0.021331787109375,
-0.043243408203125,
0.032196044921875,
-0.01190185546875,
-0.04559326171875,
0.01678466796875,
0.007106781005859375,
-0.0212554931640625,
-0.0235595703125,
0.0213470458984375,
-0.065673828125,
0.0011577606201171875,
0.0267333984375,
0.034881591796875,
0.00928497314453125,
0.04541015625,
0.0153961181640625,
0.0010700225830078125,
0.002166748046875,
-0.03302001953125,
0.03826904296875,
-0.020477294921875,
-0.003643035888671875,
0.057220458984375,
0.02398681640625,
-0.0261993408203125,
0.0079345703125,
0.0176849365234375,
0.003421783447265625,
-0.003704071044921875,
0.040008544921875,
0.05364990234375,
0.018463134765625,
-0.0296630859375,
0.000782012939453125,
0.0684814453125,
0.07293701171875,
-0.037750244140625,
-0.00919342041015625,
0.0146331787109375,
0.0041961669921875,
0.02227783203125,
0.01493072509765625,
0.06427001953125,
-0.0015439987182617188,
0.003063201904296875,
-0.01593017578125,
0.00585174560546875,
0.0232696533203125,
0.01129150390625,
0.00635528564453125,
-0.001827239990234375,
-0.053619384765625,
0.020660400390625,
-0.039398193359375,
0.004596710205078125,
0.026336669921875,
0.017608642578125,
-0.0034694671630859375,
0.0269622802734375,
0.01971435546875,
-0.001270294189453125,
0.0080108642578125,
-0.0111846923828125,
-0.0103607177734375,
-0.004230499267578125,
0.0035610198974609375,
-0.016265869140625,
-0.0155029296875,
0.0257568359375,
-0.010009765625,
-0.0236968994140625,
-0.0096435546875,
0.00447845458984375,
-0.023956298828125,
-0.0255279541015625,
0.0341796875,
-0.0204620361328125,
0.00897216796875,
-0.0005922317504882812,
0.01081085205078125,
0.019622802734375,
-0.0061798095703125,
-0.030670166015625,
0.036102294921875,
0.044921875,
-0.057891845703125,
0.042816162109375,
-0.014892578125,
-0.0306854248046875,
0.0119171142578125,
-0.0282745361328125,
0.0556640625,
-0.019287109375,
-0.0648193359375,
-0.019805908203125,
-0.0296630859375,
-0.0222625732421875,
0.035308837890625,
0.038055419921875,
0.01519775390625,
-0.0106964111328125,
0.048736572265625,
-0.0108795166015625,
0.021209716796875,
-0.019073486328125,
0.0254974365234375,
-0.043304443359375,
0.011505126953125,
0.00170135498046875,
-0.06439208984375,
-0.0305938720703125,
-0.049041748046875,
0.0220947265625,
0.05206298828125,
-0.00598907470703125,
0.0253753662109375,
0.046966552734375,
-0.043487548828125,
0.0181121826171875,
-0.0673828125,
-0.045196533203125,
0.046142578125,
-0.05108642578125,
-0.053558349609375,
0.0179595947265625,
-0.0765380859375,
0.07080078125,
-0.01439666748046875,
0.0280914306640625,
0.06488037109375,
-0.0270538330078125,
-0.00922393798828125,
-0.0148773193359375,
-0.0255126953125,
-0.0162200927734375,
-0.05621337890625,
-0.01227569580078125,
0.048614501953125,
-0.0092010498046875,
0.020233154296875,
-0.02972412109375,
0.0158843994140625,
0.0168304443359375,
-0.05267333984375,
-0.0016260147094726562,
-0.0151214599609375,
0.005859375,
0.02789306640625,
0.032989501953125,
0.02783203125,
-0.039520263671875,
-0.034942626953125,
0.006923675537109375,
-0.00669097900390625,
-0.0229034423828125,
-0.042388916015625,
-0.00858306884765625,
0.037384033203125,
0.030029296875,
0.047119140625,
-0.016937255859375,
0.005977630615234375,
0.022857666015625,
-0.01267242431640625,
0.0243682861328125,
-0.07354736328125,
-0.038177490234375,
-0.06781005859375,
-0.01497650146484375,
0.0143585205078125,
-0.03973388671875,
-0.041748046875,
-0.01568603515625,
-0.007167816162109375,
-0.0002448558807373047,
-0.0230865478515625,
0.01428985595703125,
-0.02325439453125,
-0.012603759765625,
0.01354217529296875,
-0.0298004150390625,
-0.0538330078125,
0.01007843017578125,
0.04144287109375,
0.004413604736328125,
0.0233917236328125,
-0.0291748046875,
-0.033538818359375,
-0.00008279085159301758,
-0.0013227462768554688,
0.027099609375,
0.0041351318359375,
-0.0682373046875,
0.01104736328125,
-0.033538818359375,
0.044708251953125,
-0.005352020263671875,
-0.00858306884765625,
0.006626129150390625,
0.0022907257080078125,
-0.00330352783203125,
-0.0229339599609375,
0.006805419921875,
0.0008940696716308594,
-0.029296875,
0.006000518798828125,
-0.0006914138793945312,
0.01334381103515625,
-0.033721923828125,
-0.04669189453125,
0.051605224609375,
-0.00930023193359375,
-0.039886474609375,
-0.0007886886596679688,
0.0126190185546875,
-0.01422119140625,
0.004642486572265625,
0.00734710693359375,
-0.05035400390625,
-0.00864410400390625,
0.0208740234375,
0.009613037109375,
-0.01641845703125,
0.0458984375,
0.0286407470703125,
-0.035980224609375,
-0.004184722900390625,
-0.0156097412109375,
-0.023193359375,
-0.0051422119140625,
0.017059326171875,
-0.0017147064208984375,
0.024871826171875,
-0.01641845703125,
0.006805419921875,
-0.02325439453125,
0.004932403564453125,
-0.00397491455078125,
-0.049591064453125,
0.0093841552734375,
-0.01497650146484375,
0.03375244140625,
-0.005222320556640625,
-0.01073455810546875,
-0.00640869140625,
-0.06866455078125,
-0.04364013671875,
-0.036956787109375,
-0.005367279052734375,
0.0255126953125,
-0.08038330078125,
0.0122222900390625,
0.0012226104736328125,
-0.036163330078125,
-0.015960693359375,
0.03302001953125,
-0.06658935546875,
0.0153045654296875,
0.00746917724609375,
0.0032863616943359375,
-0.03875732421875,
-0.03594970703125,
0.072509765625,
-0.034942626953125,
-0.0246124267578125,
0.016265869140625,
0.020721435546875,
0.01030731201171875,
-0.017059326171875,
0.0210723876953125,
0.0020427703857421875,
-0.0291290283203125,
-0.007045745849609375,
0.01433563232421875,
0.031890869140625,
0.007587432861328125,
-0.046051025390625,
-0.01248931884765625,
0.0158538818359375,
-0.008819580078125,
0.0230865478515625,
-0.016265869140625,
0.0325927734375,
0.0222625732421875,
0.04339599609375,
-0.0268402099609375,
-0.0026264190673828125,
-0.031768798828125,
0.035003662109375,
0.0033588409423828125,
-0.0024166107177734375,
0.034210205078125,
0.007633209228515625,
-0.00018262863159179688,
-0.019561767578125,
0.0173797607421875,
-0.055816650390625,
0.0516357421875,
0.0033168792724609375,
0.01181793212890625,
0.044921875
] |
48a94939b2f7d7088ed62f242ca13380bdcd643d
|
Wordpress Stackexchange
Q: get query's query string By the time index.php runs, it seems as though there is already a query populated.
How can I find out what that query's query string is?
eg. new WP_Query([query string is here])
A: Take a look at global $query_string;.
Or var_dump( $GLOBALS['wp_query'] );.
|
Q: get query's query string By the time index.php runs, it seems as though there is already a query populated.
How can I find out what that query's query string is?
eg. new WP_Query([query string is here])
A: Take a look at global $query_string;.
Or var_dump( $GLOBALS['wp_query'] );.
A: <?php var_dump( $GLOBALS['wp_query'] ); ?>
and if you have custom loop in your template, dont forget to use (query_post()) <?php wp_reset_query(); ?> or (new WP_Query) <?php wp_reset_postdata(); ?>
:)
Function should be called after The Loop to ensure conditional tags work as expected.
|
wordpress
|
{
"language": "en",
"length": 92,
"provenance": "stackexchange_00019.jsonl.gz:419258",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49698"
}
|
[
0.0213775634765625,
-0.0162811279296875,
-0.0296173095703125,
-0.0233612060546875,
0.017974853515625,
-0.043670654296875,
0.03857421875,
0.0311431884765625,
-0.01442718505859375,
0.0228271484375,
-0.047821044921875,
0.01342010498046875,
-0.0340576171875,
0.00431060791015625,
-0.01238250732421875,
-0.041290283203125,
0.0557861328125,
-0.059295654296875,
-0.01169586181640625,
-0.0126800537109375,
-0.00533294677734375,
0.02374267578125,
0.0367431640625,
0.07769775390625,
0.01806640625,
-0.0054473876953125,
0.05120849609375,
0.016448974609375,
-0.0015087127685546875,
-0.0042572021484375,
0.021392822265625,
-0.024444580078125,
0.01410675048828125,
0.0116729736328125,
0.027374267578125,
0.02117919921875,
0.0062103271484375,
0.0216064453125,
0.03851318359375,
-0.0059967041015625,
0.037353515625,
-0.0284881591796875,
0.020538330078125,
-0.0041656494140625,
0.01030731201171875,
-0.022857666015625,
0.038909912109375,
-0.048065185546875,
0.0200347900390625,
0.00968170166015625,
0.0065765380859375,
0.0400390625,
0.007648468017578125,
-0.01103973388671875,
-0.005825042724609375,
0.01238250732421875,
0.032257080078125,
0.0013570785522460938,
0.031524658203125,
-0.051361083984375,
-0.0499267578125,
-0.00836944580078125,
0.03265380859375,
0.005062103271484375,
-0.0234222412109375,
-0.004604339599609375,
0.00543975830078125,
0.01398468017578125,
0.00010597705841064453,
-0.037384033203125,
-0.003955841064453125,
0.009246826171875,
-0.0076446533203125,
0.01458740234375,
-0.0164337158203125,
-0.055084228515625,
0.0261688232421875,
-0.047698974609375,
0.006099700927734375,
0.0338134765625,
-0.002620697021484375,
-0.0173797607421875,
-0.0985107421875,
0.0027179718017578125,
0.0157318115234375,
0.016754150390625,
-0.002777099609375,
-0.01146697998046875,
-0.00937652587890625,
-0.04583740234375,
-0.01055908203125,
-0.01392364501953125,
0.002460479736328125,
-0.034637451171875,
-0.04315185546875,
-0.055389404296875,
-0.0081939697265625,
0.018310546875,
-0.00849151611328125,
0.00518798828125,
-0.0347900390625,
0.000034928321838378906,
-0.024261474609375,
-0.00852203369140625,
-0.0026397705078125,
0.00958251953125,
0.0176849365234375,
0.03656005859375,
0.0190582275390625,
0.016082763671875,
-0.0167999267578125,
0.0335693359375,
-0.01308441162109375,
-0.003803253173828125,
-0.052520751953125,
0.02178955078125,
-0.0204620361328125,
-0.042327880859375,
0.00215911865234375,
-0.0153045654296875,
0.007038116455078125,
0.018524169921875,
0.014312744140625,
-0.0090179443359375,
0.0186309814453125,
0.0209808349609375,
-0.018829345703125,
-0.0218963623046875,
-0.044525146484375,
0.0300140380859375,
0.0099334716796875,
0.01525115966796875,
-0.026702880859375,
-0.0023136138916015625,
-0.038482666015625,
0.0016050338745117188,
0.01513671875,
-0.01236724853515625,
-0.0011987686157226562,
0.0191650390625,
0.00743865966796875,
-0.039825439453125,
-0.0031032562255859375,
0.0038928985595703125,
-0.027099609375,
-0.0051422119140625,
0.038177490234375,
0.033203125,
-0.0435791015625,
-0.022918701171875,
-0.038299560546875,
0.07177734375,
0.00417327880859375,
0.01165008544921875,
-0.0286712646484375,
0.0028285980224609375,
0.0139007568359375,
-0.0030155181884765625,
-0.02593994140625,
-0.00977325439453125,
0.0018310546875,
0.00962066650390625,
0.0014276504516601562,
-0.01453399658203125,
-0.005588531494140625,
-0.049407958984375,
0.0023670196533203125,
0.005859375,
0.0084991455078125,
0.0233306884765625,
0.0260162353515625,
0.004241943359375,
0.034820556640625,
-0.02203369140625,
-0.0341796875,
-0.03582763671875,
-0.00849151611328125,
-0.0411376953125,
0.0179595947265625,
0.034881591796875,
-0.03253173828125,
-0.036285400390625,
-0.017913818359375,
-0.0127716064453125,
-0.031829833984375,
0.039886474609375,
0.0032501220703125,
0.05029296875,
0.0033893585205078125,
0.006855010986328125,
0.03350830078125,
0.0159454345703125,
-0.0257415771484375,
0.03521728515625,
0.016082763671875,
0.021484375,
-0.05419921875,
0.030670166015625,
-0.01306915283203125,
-0.0765380859375,
0.0263214111328125,
0.0270233154296875,
0.004547119140625,
0.00827789306640625,
-0.07122802734375,
0.041046142578125,
-0.027984619140625,
0.0295867919921875,
0.03753662109375,
0.0228118896484375,
0.0009374618530273438,
-0.002071380615234375,
-0.0056610107421875,
-0.02783203125,
-0.05523681640625,
0.02032470703125,
-0.0338134765625,
-0.0022525787353515625,
-0.0287017822265625,
-0.00383758544921875,
-0.022735595703125,
-0.004306793212890625,
-0.028289794921875,
0.00458526611328125,
0.037567138671875,
0.0204010009765625,
-0.036865234375,
-0.00916290283203125,
0.051239013671875,
-0.005275726318359375,
0.0220947265625,
0.032745361328125,
0.0357666015625,
0.07794189453125,
0.020172119140625,
0.001117706298828125,
0.01727294921875,
-0.056365966796875,
0.0092620849609375,
0.0297698974609375,
0.048065185546875,
0.052978515625,
-0.004337310791015625,
-0.0261077880859375,
0.06341552734375,
-0.07733154296875,
-0.0035953521728515625,
-0.025177001953125,
0.02838134765625,
0.07586669921875,
-0.0157012939453125,
-0.01203155517578125,
0.00794219970703125,
-0.01471710205078125,
-0.0123138427734375,
0.021881103515625,
0.0272979736328125,
0.036956787109375,
-0.039031982421875,
0.07183837890625,
-0.035003662109375,
0.0306396484375,
0.007488250732421875,
-0.01049041748046875,
0.01056671142578125,
0.0167694091796875,
0.0164642333984375,
0.0175323486328125,
-0.0023326873779296875,
0.007511138916015625,
-0.0006785392761230469,
-0.035430908203125,
-0.0177764892578125,
-0.01108551025390625,
0.0294342041015625,
-0.0029506683349609375,
-0.03448486328125,
0.01267242431640625,
-0.006267547607421875,
-0.0015811920166015625,
-0.0246429443359375,
-0.013916015625,
-0.055267333984375,
-0.01340484619140625,
0.00543212890625,
-0.03594970703125,
0.0002779960632324219,
0.002155303955078125,
-0.01358795166015625,
0.00016236305236816406,
0.0258331298828125,
0.0006527900695800781,
-0.056976318359375,
0.04736328125,
-0.045440673828125,
-0.02587890625,
-0.023773193359375,
-0.0293426513671875,
0.0009255409240722656,
-0.00296783447265625,
0.01262664794921875,
0.0740966796875,
0.052734375,
-0.028106689453125,
0.0155792236328125,
-0.044158935546875,
0.0335693359375,
-0.01092529296875,
-0.01727294921875,
0.056854248046875,
-0.1173095703125,
0.0249481201171875,
0.00988006591796875,
0.0126953125,
-0.001659393310546875,
-0.038665771484375,
-0.005565643310546875,
-0.0023860931396484375,
-0.10302734375,
-0.10699462890625,
-0.0638427734375,
-0.041412353515625,
-0.036773681640625,
-0.013580322265625,
-0.019927978515625,
0.0496826171875,
-0.00872039794921875,
0.00927734375,
0.002750396728515625,
-0.041015625,
-0.07635498046875,
-0.074462890625,
-0.090576171875,
0.01922607421875,
-0.005401611328125,
0.0312347412109375,
0.000148773193359375,
0.06060791015625,
-0.0021343231201171875,
-0.03326416015625,
-0.003536224365234375,
-0.0041656494140625,
-0.0209808349609375,
-0.033721923828125,
-0.01050567626953125,
0.01207733154296875,
0.029449462890625,
-0.0037555694580078125,
0.050537109375,
0.0504150390625,
-0.043975830078125,
0.006343841552734375,
0.038726806640625,
-0.02215576171875,
0.033538818359375,
0.02850341796875,
-0.05438232421875,
-0.0192108154296875,
0.027587890625,
-0.0526123046875,
-0.03582763671875,
0.0005393028259277344,
-0.040802001953125,
-0.0017900466918945312,
0.032867431640625,
-0.0111846923828125,
-0.0022525787353515625,
-0.0033245086669921875,
0.002490997314453125,
-0.03546142578125,
-0.013031005859375,
-0.06304931640625,
0.07574462890625,
0.015228271484375,
0.048736572265625,
0.0127410888671875,
0.003192901611328125,
-0.051513671875,
0.018890380859375,
0.00702667236328125,
0.00510406494140625,
0.023712158203125,
-0.0282745361328125,
0.0209808349609375,
-0.00278472900390625,
0.024078369140625,
-0.0163421630859375,
0.0268402099609375,
-0.0301666259765625,
-0.0235595703125,
-0.0333251953125,
0.0562744140625,
-0.00623321533203125,
-0.0157318115234375,
0.0042572021484375,
0.002410888671875,
-0.05322265625,
-0.038330078125,
-0.0295562744140625,
-0.0030384063720703125,
-0.055084228515625,
0.01374053955078125,
-0.0219573974609375,
-0.0225067138671875,
-0.01433563232421875,
-0.0302276611328125,
-0.040985107421875,
-0.037445068359375,
0.03131103515625,
-0.048095703125,
0.01415252685546875,
-0.0143280029296875,
0.005420684814453125,
-0.0308074951171875,
-0.01137542724609375,
-0.036865234375,
-0.0877685546875,
-0.014129638671875,
-0.004642486572265625,
0.06304931640625,
0.023040771484375,
-0.0323486328125,
-0.01318359375,
0.047332763671875,
0.0159759521484375,
0.03680419921875,
0.005794525146484375,
-0.004589080810546875,
0.01383209228515625,
-0.01393890380859375,
0.01390838623046875,
-0.03253173828125,
-0.00975799560546875,
-0.0287628173828125,
-0.0023288726806640625,
0.01507568359375,
-0.0330810546875,
-0.002483367919921875,
-0.037933349609375,
0.007534027099609375,
-0.0313720703125,
0.023529052734375,
0.022186279296875,
0.0178985595703125,
-0.0092926025390625,
0.004150390625,
0.03082275390625,
-0.047088623046875,
0.06964111328125,
0.0362548828125,
-0.012908935546875,
-0.00832366943359375,
0.064697265625,
0.01153564453125,
-0.0418701171875,
-0.034423828125,
0.0313720703125,
0.038818359375,
0.031890869140625,
0.0214996337890625,
0.001552581787109375,
-0.00988006591796875,
0.02484130859375,
0.0228424072265625,
-0.00647735595703125,
-0.02294921875,
0.043792724609375,
-0.004741668701171875,
-0.01087188720703125,
0.00970458984375,
-0.032012939453125,
0.025421142578125,
0.01139068603515625,
-0.0184478759765625,
-0.0121002197265625,
0.033111572265625,
0.037811279296875,
-0.061126708984375,
0.07080078125,
-0.010986328125,
-0.046661376953125,
0.016357421875,
-0.00028824806213378906,
0.0200042724609375,
0.02838134765625,
-0.01204681396484375,
0.0163421630859375,
0.001537322998046875,
-0.02130126953125,
0.011199951171875,
0.044677734375,
0.012664794921875,
0.049652099609375,
-0.026947021484375,
-0.0013484954833984375,
-0.036468505859375,
-0.012176513671875,
0.036865234375,
-0.020843505859375,
-0.051971435546875,
0.03436279296875,
-0.022247314453125,
0.018157958984375,
0.04833984375,
-0.0194244384765625,
0.0193634033203125,
0.0518798828125,
-0.01479339599609375,
-0.0008206367492675781,
0.031585693359375,
-0.0196685791015625,
-0.031585693359375,
0.0144195556640625,
0.00649261474609375,
-0.0106048583984375,
0.036865234375,
0.055206298828125,
-0.09130859375,
0.07794189453125,
0.00981903076171875,
-0.02154541015625,
-0.0138397216796875,
0.01800537109375,
0.0290069580078125,
-0.011962890625,
0.0237884521484375,
-0.01352691650390625,
0.01983642578125,
-0.03460693359375,
-0.01409912109375,
0.0289764404296875,
0.038726806640625,
-0.0167694091796875,
-0.0245208740234375,
0.01477813720703125,
-0.006504058837890625,
-0.0165252685546875,
0.016754150390625,
0.027496337890625,
0.005268096923828125,
-0.040374755859375,
-0.06494140625,
0.01715087890625,
0.0198211669921875,
-0.0157623291015625,
0.0283203125,
-0.0137176513671875,
0.0380859375,
0.01031494140625,
0.00411224365234375,
0.00740814208984375,
-0.0011997222900390625,
-0.0053558349609375,
-0.005451202392578125,
-0.0258026123046875,
-0.0308380126953125,
-0.0185546875,
-0.0150604248046875,
-0.021270751953125,
0.060089111328125,
0.006771087646484375,
0.0265350341796875,
-0.04052734375,
0.0018835067749023438,
0.001979827880859375,
-0.0154571533203125,
0.0755615234375,
0.02325439453125,
-0.037322998046875,
-0.0262451171875,
-0.048492431640625,
-0.01306915283203125,
0.0276031494140625,
-0.0159912109375,
-0.0150146484375,
-0.0098419189453125,
-0.01226043701171875,
0.004047393798828125,
-0.00537109375,
0.0189056396484375,
-0.024322509765625,
0.03961181640625,
0.010772705078125,
0.038482666015625,
-0.01085662841796875,
0.0369873046875,
0.005584716796875,
0.01322174072265625,
0.002574920654296875,
0.00746917724609375,
0.0030364990234375,
-0.015533447265625,
0.00585174560546875,
0.003345489501953125,
-0.0081329345703125,
-0.0238037109375,
0.0291748046875,
-0.037261962890625,
-0.0014247894287109375,
-0.0026416778564453125,
-0.006565093994140625,
-0.010223388671875,
-0.0009388923645019531,
-0.01186370849609375,
0.052947998046875,
-0.007549285888671875,
-0.01548004150390625,
0.037750244140625,
-0.0178985595703125,
0.0031604766845703125,
-0.019287109375,
0.048553466796875,
-0.0291748046875,
-0.04058837890625,
-0.0254669189453125,
0.035125732421875,
-0.053131103515625,
0.041778564453125,
0.057525634765625,
0.0027942657470703125,
0.049041748046875,
0.003940582275390625,
0.012969970703125,
0.041900634765625,
0.020904541015625,
-0.01374053955078125,
-0.0051422119140625,
0.04498291015625,
0.011138916015625,
0.0031452178955078125,
0.036834716796875,
-0.00951385498046875,
-0.0006189346313476562,
0.031890869140625,
0.06597900390625,
-0.03143310546875,
0.004932403564453125,
0.03057861328125,
-0.0086669921875,
-0.00862884521484375,
0.0189056396484375,
-0.019744873046875,
-0.0306549072265625,
-0.006351470947265625,
0.0015764236450195312,
-0.016448974609375,
-0.017578125,
0.0087890625,
0.00563812255859375,
-0.02606201171875,
0.04461669921875,
0.01293182373046875,
-0.024078369140625,
0.033355712890625,
0.031951904296875,
0.0247955322265625,
-0.024139404296875,
0.0015621185302734375,
0.0239105224609375,
0.01983642578125,
-0.017852783203125,
0.0645751953125,
-0.0243377685546875,
0.02734375,
-0.028594970703125,
0.010345458984375,
0.030364990234375,
0.04046630859375,
-0.004856109619140625,
-0.00035452842712402344,
0.017181396484375,
-0.02496337890625,
-0.016510009765625,
-0.003665924072265625,
0.02947998046875,
0.0228729248046875,
-0.00814056396484375,
0.0219879150390625,
-0.02313232421875,
-0.0157623291015625,
-0.004215240478515625,
-0.0004668235778808594,
0.04937744140625,
-0.0501708984375,
0.0024814605712890625,
0.0450439453125,
0.0146942138671875,
0.006496429443359375,
-0.01611328125,
-0.0428466796875,
-0.0256805419921875,
0.0302581787109375,
-0.02618408203125,
-0.0017957687377929688,
0.0239715576171875,
-0.0248260498046875,
-0.04620361328125,
0.045623779296875,
-0.0100860595703125,
0.0159912109375,
0.0443115234375,
0.0003643035888671875,
-0.040618896484375,
-0.0193328857421875,
-0.06732177734375,
0.077392578125,
0.0128326416015625,
0.10235595703125,
-0.08831787109375,
-0.03509521484375,
0.04931640625,
0.054840087890625,
0.054443359375,
0.01088714599609375,
0.01403045654296875,
-0.024871826171875,
0.00308990478515625,
0.03924560546875,
-0.0335693359375,
0.0011377334594726562,
0.056060791015625,
0.050079345703125,
0.0987548828125,
-0.028106689453125,
0.02752685546875,
-0.004703521728515625,
0.050079345703125,
0.08587646484375,
-0.002521514892578125,
-0.015716552734375,
0.02117919921875,
-0.045989990234375,
-0.00872802734375,
0.0162506103515625,
-0.003643035888671875,
-0.005931854248046875,
0.00832366943359375,
0.051544189453125,
0.023590087890625,
-0.04541015625,
-0.05035400390625,
-0.018341064453125,
0.03057861328125,
0.004390716552734375,
0.005191802978515625,
0.03948974609375,
0.006824493408203125,
0.043426513671875,
0.007228851318359375,
0.006206512451171875,
0.02001953125,
0.004364013671875,
0.076416015625,
0.03582763671875,
0.050994873046875,
-0.02587890625,
-0.01983642578125,
0.00997161865234375,
0.08892822265625,
-0.04205322265625,
-0.046630859375,
0.014373779296875,
-0.0006785392761230469,
-0.01708984375,
0.00017440319061279297,
-0.018310546875,
0.042327880859375,
0.0711669921875,
-0.0029964447021484375,
-0.0246124267578125,
0.019622802734375,
-0.01206207275390625,
0.0107421875,
0.008209228515625,
0.02301025390625,
-0.0194549560546875,
-0.0312042236328125,
-0.01345062255859375,
0.009857177734375,
0.050750732421875,
0.0138092041015625,
0.0484619140625,
-0.00707244873046875,
-0.0195465087890625,
-0.00858306884765625,
0.014617919921875,
0.006572723388671875,
0.0204315185546875,
-0.0257568359375,
-0.0168304443359375,
0.007343292236328125,
0.0296173095703125,
0.0391845703125,
0.003749847412109375,
0.049774169921875,
0.0236053466796875,
-0.03680419921875,
0.0055389404296875,
0.0087432861328125,
-0.02362060546875,
0.020172119140625,
-0.03350830078125,
0.055450439453125,
0.0174560546875,
0.016204833984375,
-0.02899169921875,
0.035125732421875,
0.0352783203125,
0.0157470703125,
0.01309967041015625,
0.01020050048828125,
-0.00856781005859375,
0.00811767578125,
-0.02081298828125,
0.017974853515625,
0.019622802734375,
-0.00536346435546875,
0.00373077392578125,
-0.01403045654296875,
-0.042999267578125,
0.01526641845703125,
0.0372314453125,
-0.008575439453125,
-0.0007562637329101562,
0.032440185546875,
-0.0113067626953125,
-0.0072174072265625,
-0.00007545948028564453,
0.03314208984375,
-0.00316619873046875,
0.002445220947265625,
0.021881103515625,
-0.07513427734375,
-0.040435791015625,
-0.01061248779296875,
-0.01015472412109375,
0.016815185546875,
-0.0059814453125,
0.04669189453125,
0.0183258056640625,
0.039825439453125,
-0.0273895263671875,
0.02978515625,
0.01486968994140625,
0.0221405029296875,
-0.021820068359375,
-0.008026123046875,
-0.0162506103515625,
-0.049652099609375,
0.025909423828125,
0.041839599609375,
0.005886077880859375,
0.04644775390625,
-0.0296478271484375,
0.02423095703125,
-0.042816162109375,
-0.0002722740173339844,
-0.0239105224609375,
0.029541015625,
0.045745849609375,
-0.0224456787109375,
0.01995849609375,
-0.0191192626953125,
0.022064208984375,
0.01116180419921875,
0.017486572265625,
-0.0165557861328125,
0.031494140625,
-0.01531219482421875,
0.046356201171875,
0.0273895263671875,
-0.005558013916015625,
0.0286102294921875,
-0.035614013671875,
-0.04193115234375,
0.017303466796875,
-0.0082244873046875,
-0.0169525146484375,
-0.0230865478515625,
0.0513916015625,
-0.0330810546875,
-0.029388427734375,
0.044158935546875,
0.0178985595703125,
0.0257415771484375,
-0.0628662109375,
0.01385498046875,
-0.002490997314453125,
-0.0197601318359375,
-0.0301055908203125,
-0.024017333984375,
-0.0014925003051757812,
0.001659393310546875,
-0.0062255859375,
-0.055267333984375,
-0.0157470703125,
-0.0254974365234375,
0.01161956787109375,
0.004756927490234375,
-0.0310211181640625,
0.00019168853759765625,
-0.0169830322265625,
0.01032257080078125,
-0.0244293212890625,
-0.00579071044921875,
0.020477294921875,
0.029388427734375,
-0.0465087890625,
0.00774383544921875,
-0.02239990234375,
-0.0283050537109375,
0.00722503662109375,
0.0220794677734375,
0.039031982421875,
-0.037567138671875,
-0.003631591796875,
0.0667724609375,
0.035369873046875,
0.10260009765625,
-0.0080108642578125,
-0.00923919677734375,
0.0170440673828125,
0.0213470458984375,
-0.041351318359375,
-0.06683349609375,
0.0037326812744140625,
-0.029541015625,
0.018402099609375,
0.0045623779296875,
-0.00904083251953125,
0.0173797607421875,
-0.0335693359375,
-0.1051025390625,
0.054229736328125,
-0.0304718017578125,
-0.0390625,
-0.0290985107421875,
0.022186279296875,
0.03277587890625,
-0.06439208984375,
-0.0195159912109375,
0.0015954971313476562,
-0.0328369140625,
-0.02166748046875,
0.017974853515625,
0.0203857421875,
0.026123046875,
-0.0054473876953125,
-0.06573486328125,
-0.0008153915405273438,
-0.030517578125,
0.044097900390625,
0.0034122467041015625,
-0.01274871826171875,
0.00322723388671875,
0.041046142578125,
-0.03741455078125,
-0.03277587890625,
-0.025787353515625,
0.007785797119140625,
-0.0184783935546875,
0.0174102783203125,
0.0006794929504394531,
0.0216827392578125,
0.030914306640625,
0.048797607421875,
0.005695343017578125,
-0.03228759765625,
-0.01552581787109375,
-0.00844573974609375,
-0.04205322265625,
-0.0250091552734375,
0.045166015625,
-0.0828857421875,
-0.00989532470703125,
-0.002216339111328125,
-0.0120391845703125,
-0.00437164306640625,
0.0221405029296875,
-0.040008544921875,
-0.0016946792602539062,
-0.019012451171875,
-0.015411376953125,
-0.0648193359375,
-0.050811767578125,
0.06396484375,
-0.0408935546875,
0.0012369155883789062,
-0.0141143798828125,
0.040130615234375,
0.023406982421875,
-0.03399658203125,
0.0295257568359375,
-0.01226043701171875,
0.0261383056640625,
0.00939178466796875,
0.042633056640625,
-0.044219970703125,
0.0306243896484375,
-0.0367431640625,
-0.01312255859375,
0.035675048828125,
0.00553131103515625,
0.0325927734375,
-0.02740478515625,
0.063232421875,
0.01192474365234375,
0.0555419921875,
-0.004638671875,
0.059478759765625,
0.0099334716796875,
0.0305328369140625,
-0.007465362548828125,
-0.002033233642578125,
0.022430419921875,
-0.04266357421875,
0.011962890625,
-0.01087188720703125,
-0.035247802734375,
-0.0142364501953125,
-0.01739501953125,
-0.0157928466796875,
-0.0194854736328125,
0.00791168212890625
] |
4264966dc22c5a79b5b3d24be758ea8c4af4767c
|
Wordpress Stackexchange
Q: Is it possible to disable certain user roles from creating tags? As a site admin, I'd like to have control over things.
I'd like to prevent my contributors and authors ( who generate content for me ) from creating new tags. I don't want that tag taxonomy to turn into a zoo! Especially when you know that wordpress creates separate terms for apple and Apple! I give them a while list ( of 1000 tags that I want them to cover ) and that's it. They cannot come up with the 1001st.
How do I achieve that so that my authors just pick from what I give them?
A: This is the most solid answer to this, if anyone ever comes to this post again.
This this in your functions.php file.
add_action( 'pre_insert_term', function ( $term, $taxonomy )
{
return ( 'yourtax' === $taxonomy )
? new WP_Error( 'term_addition_blocked', __( 'You are unauthorized to add new terms.' ) )
: $term;
}, 0, 2 );
I hope this helps anyone in the future.
|
Q: Is it possible to disable certain user roles from creating tags? As a site admin, I'd like to have control over things.
I'd like to prevent my contributors and authors ( who generate content for me ) from creating new tags. I don't want that tag taxonomy to turn into a zoo! Especially when you know that wordpress creates separate terms for apple and Apple! I give them a while list ( of 1000 tags that I want them to cover ) and that's it. They cannot come up with the 1001st.
How do I achieve that so that my authors just pick from what I give them?
A: This is the most solid answer to this, if anyone ever comes to this post again.
This this in your functions.php file.
add_action( 'pre_insert_term', function ( $term, $taxonomy )
{
return ( 'yourtax' === $taxonomy )
? new WP_Error( 'term_addition_blocked', __( 'You are unauthorized to add new terms.' ) )
: $term;
}, 0, 2 );
I hope this helps anyone in the future.
A: This Wordpress Answers thread has exactly the information you are looking for - Plugin to restrict non-admin user to existing tags
Simply change "administrator" to whatever you need.
A: Check this answer to your solution. I used remove_meta_box() WordPress internal function to solve similiar problem.
|
wordpress
|
{
"language": "en",
"length": 220,
"provenance": "stackexchange_00019.jsonl.gz:419265",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49741"
}
|
[
0.095458984375,
0.0197296142578125,
-0.0199127197265625,
-0.045379638671875,
0.04376220703125,
-0.050048828125,
0.051025390625,
-0.019805908203125,
-0.031585693359375,
0.020263671875,
0.01300048828125,
-0.0175018310546875,
0.00007814168930053711,
-0.0439453125,
-0.002410888671875,
-0.04217529296875,
-0.0082244873046875,
0.0012044906616210938,
-0.00585174560546875,
-0.0189208984375,
0.00811004638671875,
-0.0352783203125,
0.00576019287109375,
-0.0013551712036132812,
-0.00283050537109375,
0.005855560302734375,
0.0086212158203125,
-0.0254974365234375,
-0.00490570068359375,
-0.00557708740234375,
0.0163421630859375,
-0.0105133056640625,
-0.004261016845703125,
0.027862548828125,
-0.0145416259765625,
-0.01727294921875,
0.0023193359375,
0.0201416015625,
0.0113525390625,
0.01238250732421875,
0.054443359375,
-0.0301055908203125,
-0.006534576416015625,
0.0313720703125,
0.0007371902465820312,
-0.056854248046875,
0.078125,
-0.020904541015625,
0.01273345947265625,
-0.0204315185546875,
0.034423828125,
0.00965118408203125,
0.049163818359375,
-0.0231781005859375,
-0.020477294921875,
0.01314544677734375,
-0.01255035400390625,
0.006740570068359375,
0.031646728515625,
-0.01495361328125,
-0.0279083251953125,
-0.0283203125,
0.0240631103515625,
-0.01419830322265625,
0.02056884765625,
-0.0142669677734375,
0.018951416015625,
0.05291748046875,
-0.05047607421875,
0.0122528076171875,
0.0228729248046875,
-0.038848876953125,
0.0104827880859375,
0.021026611328125,
-0.0196075439453125,
-0.00745391845703125,
0.0112762451171875,
-0.0053558349609375,
0.0297088623046875,
0.01221466064453125,
0.04937744140625,
0.0065765380859375,
0.01126861572265625,
0.0029239654541015625,
0.00777435302734375,
0.00031757354736328125,
0.0028896331787109375,
-0.01255035400390625,
-0.0143280029296875,
0.00667572021484375,
-0.0180206298828125,
-0.03338623046875,
-0.0291748046875,
0.051666259765625,
0.016021728515625,
-0.005603790283203125,
0.04278564453125,
0.050872802734375,
-0.0173492431640625,
-0.01169586181640625,
-0.007282257080078125,
-0.040374755859375,
0.0050506591796875,
-0.03277587890625,
0.0175323486328125,
0.062103271484375,
-0.0321044921875,
-0.01079559326171875,
0.04150390625,
0.0148468017578125,
0.0261077880859375,
-0.025787353515625,
-0.0226898193359375,
-0.02099609375,
-0.0282745361328125,
0.00606536865234375,
-0.03973388671875,
-0.0011987686157226562,
-0.0029125213623046875,
0.0034046173095703125,
-0.0117950439453125,
0.0178375244140625,
0.00415802001953125,
0.020416259765625,
0.0266876220703125,
0.0251007080078125,
-0.0101318359375,
-0.0231475830078125,
-0.0202789306640625,
-0.005550384521484375,
-0.021148681640625,
0.01137542724609375,
0.0751953125,
0.0736083984375,
0.033721923828125,
-0.006992340087890625,
0.042724609375,
-0.024261474609375,
-0.035186767578125,
0.033782958984375,
-0.012451171875,
-0.01995849609375,
-0.00466156005859375,
-0.039764404296875,
0.02313232421875,
-0.00047278404235839844,
0.01366424560546875,
0.039581298828125,
0.0284881591796875,
0.00624847412109375,
0.0005254745483398438,
-0.013275146484375,
0.04803466796875,
-0.0104217529296875,
-0.0135040283203125,
-0.028411865234375,
0.0200653076171875,
-0.0146484375,
-0.02978515625,
-0.041839599609375,
0.02252197265625,
0.00494384765625,
0.034942626953125,
-0.01407623291015625,
-0.0286712646484375,
-0.0190887451171875,
-0.054229736328125,
-0.01016998291015625,
0.024505615234375,
0.004688262939453125,
0.0025577545166015625,
-0.0235595703125,
0.0300445556640625,
0.007015228271484375,
-0.00469970703125,
0.032989501953125,
0.01476287841796875,
0.025421142578125,
0.002880096435546875,
0.0038700103759765625,
0.00006467103958129883,
-0.0258941650390625,
0.050994873046875,
-0.01800537109375,
-0.06646728515625,
0.0296783447265625,
-0.01971435546875,
0.0408935546875,
0.0584716796875,
-0.0025577545166015625,
0.045318603515625,
-0.0014886856079101562,
-0.0294189453125,
0.02032470703125,
0.03448486328125,
-0.04290771484375,
-0.011962890625,
-0.034942626953125,
0.01160430908203125,
-0.0046844482421875,
0.050537109375,
0.007564544677734375,
-0.0272216796875,
-0.05084228515625,
-0.079345703125,
-0.03338623046875,
-0.01544952392578125,
0.040435791015625,
0.0003504753112792969,
0.01163482666015625,
0.006443023681640625,
-0.0170440673828125,
-0.017120361328125,
-0.0019207000732421875,
0.00740814208984375,
0.0168914794921875,
-0.0211029052734375,
0.0455322265625,
0.020904541015625,
0.01229095458984375,
0.040252685546875,
-0.0257720947265625,
0.032073974609375,
-0.0233306884765625,
0.00299072265625,
-0.004390716552734375,
-0.007076263427734375,
-0.00421142578125,
0.01490020751953125,
0.031494140625,
-0.006404876708984375,
-0.016021728515625,
0.06634521484375,
0.00592041015625,
-0.00002658367156982422,
0.0257415771484375,
0.03375244140625,
-0.09844970703125,
-0.0147552490234375,
0.055267333984375,
0.038360595703125,
0.0277099609375,
-0.021087646484375,
-0.0187530517578125,
0.03759765625,
-0.034637451171875,
0.00780487060546875,
-0.006404876708984375,
0.0159149169921875,
0.023162841796875,
-0.0036449432373046875,
0.0220947265625,
0.033843994140625,
-0.0034618377685546875,
0.036407470703125,
0.043487548828125,
-0.056396484375,
-0.05487060546875,
0.0560302734375,
-0.051666259765625,
0.02410888671875,
-0.053558349609375,
-0.0118865966796875,
-0.029388427734375,
0.00344085693359375,
0.008392333984375,
0.00711822509765625,
0.011260986328125,
-0.0174102783203125,
0.0118255615234375,
0.0152587890625,
-0.03863525390625,
0.006580352783203125,
-0.0124664306640625,
0.0294342041015625,
-0.004505157470703125,
-0.0506591796875,
0.028106689453125,
0.0076904296875,
0.0015249252319335938,
-0.0163116455078125,
0.054779052734375,
-0.016021728515625,
-0.0265960693359375,
-0.039520263671875,
-0.06219482421875,
-0.00821685791015625,
-0.0212249755859375,
-0.045135498046875,
-0.024383544921875,
-0.005908966064453125,
0.03826904296875,
0.0019664764404296875,
0.011077880859375,
-0.00034809112548828125,
0.010772705078125,
-0.03216552734375,
-0.069580078125,
0.03900146484375,
-0.028228759765625,
0.051116943359375,
0.08038330078125,
0.0234832763671875,
-0.0066986083984375,
0.02264404296875,
-0.0294036865234375,
0.006084442138671875,
0.0222930908203125,
0.0023479461669921875,
0.02764892578125,
-0.06903076171875,
0.01149749755859375,
0.01227569580078125,
0.022552490234375,
-0.0037631988525390625,
-0.0325927734375,
-0.0123138427734375,
0.015777587890625,
0.0258026123046875,
0.052032470703125,
0.050628662109375,
-0.0177764892578125,
0.01995849609375,
-0.0007677078247070312,
-0.01032257080078125,
-0.044219970703125,
0.036407470703125,
-0.0031280517578125,
-0.020599365234375,
-0.03778076171875,
-0.0216217041015625,
-0.053131103515625,
-0.00830078125,
0.026580810546875,
-0.00457000732421875,
-0.0238189697265625,
0.005809783935546875,
0.10400390625,
0.005218505859375,
-0.0631103515625,
-0.01319122314453125,
-0.034820556640625,
-0.02044677734375,
0.029022216796875,
-0.0018367767333984375,
-0.004108428955078125,
0.01497650146484375,
0.0006833076477050781,
-0.0169525146484375,
0.007724761962890625,
-0.0005922317504882812,
-0.0288543701171875,
0.031982421875,
0.012725830078125,
0.043182373046875,
0.0355224609375,
-0.034515380859375,
-0.004230499267578125,
0.027740478515625,
-0.04327392578125,
0.01126861572265625,
-0.00756072998046875,
-0.01538848876953125,
0.0237579345703125,
-0.029449462890625,
-0.01250457763671875,
0.02294921875,
0.00428009033203125,
0.0283355712890625,
0.022491455078125,
-0.01080322265625,
0.0012865066528320312,
0.0192718505859375,
0.0158538818359375,
0.0201568603515625,
-0.01480865478515625,
0.01885986328125,
-0.019073486328125,
0.017608642578125,
0.0006785392761230469,
0.00014328956604003906,
-0.0233917236328125,
0.0016384124755859375,
-0.06219482421875,
-0.025146484375,
-0.004489898681640625,
-0.097900390625,
0.00745391845703125,
-0.039520263671875,
0.0260467529296875,
-0.00766754150390625,
0.045135498046875,
-0.0309906005859375,
0.01081085205078125,
-0.01287078857421875,
0.0129852294921875,
-0.04925537109375,
-0.04937744140625,
-0.055755615234375,
0.000453948974609375,
-0.0017452239990234375,
-0.0112152099609375,
-0.0131988525390625,
0.0130462646484375,
-0.047119140625,
-0.0175628662109375,
-0.0128631591796875,
-0.00830841064453125,
0.043914794921875,
-0.052337646484375,
0.01519012451171875,
-0.005695343017578125,
0.0110626220703125,
-0.048919677734375,
-0.0291595458984375,
-0.0152587890625,
-0.09075927734375,
-0.00429534912109375,
-0.00608062744140625,
0.01763916015625,
-0.042144775390625,
0.056182861328125,
-0.029205322265625,
0.024993896484375,
-0.01275634765625,
-0.03204345703125,
-0.001445770263671875,
0.035675048828125,
-0.0031566619873046875,
-0.0117950439453125,
-0.037078857421875,
-0.022613525390625,
-0.01020050048828125,
-0.00958251953125,
0.0016002655029296875,
0.0440673828125,
-0.026641845703125,
-0.023040771484375,
-0.003833770751953125,
-0.02447509765625,
-0.07763671875,
-0.0472412109375,
-0.04022216796875,
-0.0005602836608886719,
-0.0038547515869140625,
-0.01117706298828125,
-0.050201416015625,
-0.0855712890625,
0.05889892578125,
-0.0306243896484375,
0.00994110107421875,
0.0091552734375,
0.1014404296875,
-0.002330780029296875,
-0.00505828857421875,
-0.014801025390625,
0.027069091796875,
0.033538818359375,
-0.005397796630859375,
0.0309295654296875,
0.025665283203125,
-0.017852783203125,
0.019744873046875,
0.0008463859558105469,
-0.00838470458984375,
-0.0180206298828125,
0.034454345703125,
-0.007171630859375,
-0.0439453125,
0.017425537109375,
-0.0197601318359375,
0.0241546630859375,
-0.004726409912109375,
-0.0009899139404296875,
-0.0029754638671875,
0.02484130859375,
0.0443115234375,
0.0018224716186523438,
-0.006198883056640625,
-0.024871826171875,
-0.02203369140625,
0.01715087890625,
0.005329132080078125,
-0.054931640625,
0.000949859619140625,
0.0146942138671875,
-0.072265625,
-0.0635986328125,
-0.00777435302734375,
-0.0298004150390625,
-0.025604248046875,
-0.02215576171875,
0.030853271484375,
-0.05767822265625,
-0.0232391357421875,
-0.006191253662109375,
-0.0141143798828125,
0.051361083984375,
0.005481719970703125,
-0.06365966796875,
0.031829833984375,
-0.00589752197265625,
0.004489898681640625,
0.0210113525390625,
-0.0477294921875,
0.0243682861328125,
0.03253173828125,
0.006160736083984375,
0.0223388671875,
-0.037078857421875,
-0.004802703857421875,
-0.022125244140625,
-0.04327392578125,
-0.006092071533203125,
-0.031646728515625,
0.0183258056640625,
-0.0007357597351074219,
0.0032196044921875,
0.00579833984375,
-0.020416259765625,
0.03955078125,
0.038330078125,
-0.0009832382202148438,
0.01438140869140625,
0.0228118896484375,
-0.01654052734375,
-0.0135040283203125,
0.0140380859375,
-0.058258056640625,
0.008636474609375,
0.01470184326171875,
0.0648193359375,
-0.004123687744140625,
-0.048614501953125,
0.0289459228515625,
-0.043670654296875,
-0.00757598876953125,
0.017852783203125,
-0.044921875,
-0.050811767578125,
-0.037384033203125,
-0.0117034912109375,
0.02203369140625,
-0.03924560546875,
0.0019063949584960938,
-0.01123809814453125,
-0.007030487060546875,
0.0114898681640625,
-0.0022907257080078125,
-0.0194854736328125,
-0.0034084320068359375,
0.00316619873046875,
-0.0751953125,
-0.00502777099609375,
0.01393890380859375,
-0.03289794921875,
-0.02410888671875,
0.0005097389221191406,
-0.036956787109375,
-0.0084228515625,
-0.0191497802734375,
0.019500732421875,
-0.021636962890625,
-0.0136566162109375,
-0.0158233642578125,
0.00952911376953125,
0.0645751953125,
0.0367431640625,
-0.0740966796875,
0.00785064697265625,
-0.07977294921875,
0.00687408447265625,
-0.07171630859375,
-0.046478271484375,
-0.0207366943359375,
0.0157623291015625,
0.0233154296875,
0.00809478759765625,
0.0030117034912109375,
-0.046875,
-0.0002453327178955078,
0.01497650146484375,
0.03216552734375,
0.0032253265380859375,
-0.0400390625,
-0.007808685302734375,
0.041778564453125,
0.0216217041015625,
-0.002567291259765625,
-0.031890869140625,
0.00760650634765625,
-0.033111572265625,
-0.023590087890625,
-0.101806640625,
-0.01146697998046875,
0.0269775390625,
-0.0243072509765625,
0.0712890625,
0.03924560546875,
0.0161285400390625,
0.03131103515625,
-0.0112457275390625,
0.036346435546875,
-0.01067352294921875,
-0.0185546875,
-0.06304931640625,
-0.0246734619140625,
0.03875732421875,
-0.0146026611328125,
0.051300048828125,
-0.006877899169921875,
-0.0085601806640625,
0.03973388671875,
-0.031951904296875,
0.0301361083984375,
0.02960205078125,
-0.00902557373046875,
0.004589080810546875,
0.00732421875,
-0.018829345703125,
0.028778076171875,
-0.0081787109375,
0.017578125,
0.00800323486328125,
-0.00794219970703125,
-0.0634765625,
-0.0254974365234375,
0.00905609130859375,
0.008270263671875,
0.004734039306640625,
0.03875732421875,
-0.0036334991455078125,
-0.015594482421875,
0.06866455078125,
0.039642333984375,
-0.0579833984375,
-0.02056884765625,
-0.01953125,
-0.006343841552734375,
0.01393890380859375,
-0.01326751708984375,
0.004558563232421875,
-0.0458984375,
0.034393310546875,
-0.01377105712890625,
-0.0156707763671875,
0.0029296875,
-0.0408935546875,
-0.022613525390625,
0.00814056396484375,
0.0116729736328125,
0.034576416015625,
0.029571533203125,
0.0137939453125,
-0.01497650146484375,
0.03973388671875,
-0.0196990966796875,
0.0212249755859375,
-0.00516510009765625,
0.0016050338745117188,
-0.0273590087890625,
0.03240966796875,
0.002086639404296875,
-0.00487518310546875,
-0.001605987548828125,
-0.025299072265625,
0.03106689453125,
0.036651611328125,
-0.021881103515625,
0.0055084228515625,
0.0286407470703125,
-0.04901123046875,
-0.055755615234375,
-0.0345458984375,
-0.003673553466796875,
-0.013031005859375,
0.012176513671875,
0.025665283203125,
-0.0169525146484375,
-0.0592041015625,
-0.010772705078125,
-0.0290985107421875,
0.035614013671875,
0.0234832763671875,
-0.03302001953125,
0.02447509765625,
-0.00726318359375,
-0.008087158203125,
-0.0046234130859375,
-0.00887298583984375,
-0.048828125,
-0.034210205078125,
-0.0005011558532714844,
-0.04522705078125,
0.00689697265625,
0.003925323486328125,
-0.07891845703125,
0.095947265625,
-0.01216888427734375,
0.03668212890625,
0.01497650146484375,
0.0263519287109375,
-0.022979736328125,
-0.00992584228515625,
-0.05072021484375,
0.05340576171875,
0.02691650390625,
0.061004638671875,
-0.026275634765625,
-0.01129913330078125,
0.043853759765625,
0.0284881591796875,
0.06890869140625,
0.0273284912109375,
-0.022369384765625,
-0.021209716796875,
0.01139068603515625,
-0.007183074951171875,
-0.04779052734375,
0.0487060546875,
-0.005886077880859375,
0.00787353515625,
-0.0026531219482421875,
-0.007442474365234375,
0.042236328125,
-0.03363037109375,
-0.0618896484375,
0.0150604248046875,
0.01407623291015625,
-0.00516510009765625,
-0.01326751708984375,
0.028411865234375,
-0.059295654296875,
0.0084228515625,
0.0416259765625,
0.0023937225341796875,
0.0196380615234375,
0.0264892578125,
0.059478759765625,
-0.0276641845703125,
0.03167724609375,
-0.024658203125,
0.06341552734375,
0.0220794677734375,
0.02423095703125,
0.036712646484375,
0.030731201171875,
0.001338958740234375,
-0.007686614990234375,
0.0222320556640625,
0.0248565673828125,
-0.039703369140625,
-0.0179443359375,
-0.03485107421875,
0.00855255126953125,
-0.064697265625,
0.00695037841796875,
0.046630859375,
0.007965087890625,
-0.0148773193359375,
-0.00406646728515625,
0.01776123046875,
0.0345458984375,
0.0169677734375,
-0.00437164306640625,
0.05450439453125,
0.03985595703125,
0.0775146484375,
-0.051849365234375,
0.016693115234375,
0.02130126953125,
0.0240478515625,
-0.0201416015625,
0.017791748046875,
-0.03729248046875,
0.00896453857421875,
-0.033203125,
-0.019256591796875,
-0.0033130645751953125,
0.02081298828125,
0.0292510986328125,
0.01184844970703125,
0.040191650390625,
-0.0006127357482910156,
-0.006206512451171875,
0.017822265625,
0.0014562606811523438,
-0.0165863037109375,
-0.00988006591796875,
-0.0297088623046875,
0.01296234130859375,
0.0135955810546875,
-0.036865234375,
0.0231170654296875,
0.007793426513671875,
0.0419921875,
0.005100250244140625,
-0.01593017578125,
0.0753173828125,
-0.00994873046875,
-0.022216796875,
-0.028533935546875,
0.0037975311279296875,
0.037628173828125,
0.0050201416015625,
0.0070037841796875,
0.002590179443359375,
0.05780029296875,
-0.04095458984375,
0.0158233642578125,
-0.012420654296875,
-0.0243682861328125,
0.0189361572265625,
-0.042755126953125,
0.0008268356323242188,
-0.02294921875,
-0.0894775390625,
0.0257720947265625,
-0.0999755859375,
-0.0718994140625,
0.04266357421875,
0.029937744140625,
-0.04718017578125,
0.03948974609375,
0.0159454345703125,
-0.01519775390625,
-0.01171112060546875,
0.025421142578125,
0.006435394287109375,
0.016387939453125,
0.0146026611328125,
0.000949859619140625,
-0.045989990234375,
0.0032253265380859375,
0.013397216796875,
-0.0017986297607421875,
-0.002346038818359375,
0.069091796875,
0.0014162063598632812,
-0.005764007568359375,
-0.047149658203125,
0.034942626953125,
-0.05157470703125,
-0.0703125,
0.08740234375,
-0.009246826171875,
-0.016845703125,
0.0010929107666015625,
-0.036651611328125,
0.0294342041015625,
0.0025691986083984375,
-0.0198822021484375,
0.002056121826171875,
-0.0182647705078125,
0.00957489013671875,
0.01922607421875,
0.045440673828125,
-0.0248870849609375,
-0.0330810546875,
-0.07562255859375,
-0.014373779296875,
0.0308837890625,
0.030853271484375,
-0.014068603515625,
0.03021240234375,
-0.0205230712890625,
-0.0299224853515625,
-0.01560211181640625,
-0.021270751953125,
-0.06390380859375,
0.00992584228515625,
0.0230255126953125,
-0.0203704833984375,
0.0295257568359375,
-0.00949859619140625,
-0.020599365234375,
0.03692626953125,
-0.005947113037109375,
0.0283050537109375,
-0.072998046875,
0.027740478515625,
0.0167999267578125,
0.05523681640625,
-0.00771331787109375,
0.0192718505859375,
0.0033435821533203125,
0.01364898681640625,
-0.0037097930908203125,
-0.0037841796875,
-0.02020263671875,
-0.004924774169921875,
0.006244659423828125,
0.03857421875,
0.01210784912109375,
-0.0252838134765625,
-0.058624267578125,
0.005001068115234375,
0.03851318359375,
0.012298583984375,
-0.07452392578125,
0.055999755859375,
-0.0189361572265625,
0.041290283203125,
-0.01336669921875,
-0.0241546630859375,
0.0095062255859375,
0.01324462890625,
-0.03204345703125,
-0.0236358642578125,
-0.0270233154296875,
0.0110015869140625,
-0.039031982421875,
0.0294342041015625,
0.048370361328125,
-0.01666259765625,
-0.0189971923828125,
0.032928466796875,
0.005924224853515625,
0.0677490234375,
-0.031494140625,
0.0036067962646484375,
0.005329132080078125,
-0.0013408660888671875,
-0.037109375,
-0.05523681640625,
0.03155517578125,
-0.0533447265625,
-0.0704345703125,
-0.019775390625,
0.003002166748046875,
0.02032470703125,
-0.0304412841796875,
-0.0550537109375,
-0.012725830078125,
0.0010519027709960938,
-0.044403076171875,
-0.00782012939453125,
-0.0227203369140625,
-0.03228759765625,
0.01296234130859375,
0.0174407958984375,
-0.017822265625,
0.00737762451171875,
0.034271240234375,
0.01073455810546875,
-0.0139312744140625,
0.041229248046875,
-0.023956298828125,
-0.0007305145263671875,
0.0257568359375,
0.048004150390625,
-0.0093231201171875,
-0.01407623291015625,
0.01055908203125,
0.0011444091796875,
0.035888671875,
-0.02655029296875,
-0.0027332305908203125,
-0.00925445556640625,
0.00876617431640625,
-0.02752685546875,
-0.06719970703125,
-0.01129150390625,
-0.044586181640625,
0.0809326171875,
0.034881591796875,
0.00833892822265625,
-0.00846099853515625,
-0.01132965087890625,
-0.03900146484375,
0.000036776065826416016,
-0.011474609375,
0.01055145263671875,
-0.058502197265625,
-0.002086639404296875,
0.022735595703125,
-0.006298065185546875,
0.01212310791015625,
0.00955963134765625,
-0.01473236083984375,
-0.00041675567626953125,
0.01153564453125,
-0.0099029541015625,
-0.055328369140625,
0.043487548828125,
-0.02496337890625,
-0.0298919677734375,
-0.040130615234375,
-0.031829833984375,
-0.0019931793212890625,
-0.061859130859375,
-0.07666015625,
-0.0382080078125,
-0.0240936279296875,
0.0099029541015625,
0.040618896484375,
-0.0032176971435546875,
0.01290130615234375,
-0.0250701904296875,
0.01806640625,
0.01320648193359375,
0.037994384765625,
0.0033473968505859375,
0.037506103515625,
-0.025390625,
0.06787109375,
-0.0023937225341796875,
0.06182861328125,
-0.0015687942504882812,
-0.01184844970703125,
-0.0181884765625,
0.02935791015625,
-0.0252227783203125,
-0.00786590576171875,
0.00017952919006347656,
0.0008211135864257812,
0.037200927734375,
0.00688934326171875,
0.046356201171875,
0.020965576171875,
-0.01378631591796875,
-0.0033397674560546875,
0.01261138916015625,
-0.00527191162109375
] |
e6d954f869b4c0e21d091493ae570b8ef048d2a4
|
Wordpress Stackexchange
Q: How to add a class to meta box When adding a metabox, i.e.:
add_meta_box(
'metabox_id',
'Metabox Title',
'my_metabox_callback',
'page',
'normal',
'low',
array( 'foo' => $var1, 'bar' => $var2)
);
how do I add a class to it for css styling? I'd like to avoid having to call each id in the style rule for metaboxes that contain elements having the same style.
A: Let's say you want a class for the excerpt box. Then you can do:
add_filter('postbox_classes_post_postexcerpt','add_metabox_classes');
function add_metabox_classes($classes) {
array_push($classes,'another_class');
return $classes;
}
With this method you need to add a filter for every box u need to add a class for. The filter is applied in the function postbox_classes in wp-admin/includes/post.php
In general the hook is postbox_classes_{$page}_{$id} where $page is the page identifier (e.g. 'post' for posts and (presumably) 'custom-post-type' for posts of type 'custom-post-type'). $id refers to the ID of the metabox, automatically assigned for 'default' metaboxes or specified in add_meta_box.
DOCS: https://developer.wordpress.org/reference/hooks/postbox_classes_page_id/
|
Q: How to add a class to meta box When adding a metabox, i.e.:
add_meta_box(
'metabox_id',
'Metabox Title',
'my_metabox_callback',
'page',
'normal',
'low',
array( 'foo' => $var1, 'bar' => $var2)
);
how do I add a class to it for css styling? I'd like to avoid having to call each id in the style rule for metaboxes that contain elements having the same style.
A: Let's say you want a class for the excerpt box. Then you can do:
add_filter('postbox_classes_post_postexcerpt','add_metabox_classes');
function add_metabox_classes($classes) {
array_push($classes,'another_class');
return $classes;
}
With this method you need to add a filter for every box u need to add a class for. The filter is applied in the function postbox_classes in wp-admin/includes/post.php
In general the hook is postbox_classes_{$page}_{$id} where $page is the page identifier (e.g. 'post' for posts and (presumably) 'custom-post-type' for posts of type 'custom-post-type'). $id refers to the ID of the metabox, automatically assigned for 'default' metaboxes or specified in add_meta_box.
DOCS: https://developer.wordpress.org/reference/hooks/postbox_classes_page_id/
A: Just add the class to the markup you are generating in the callback.
|
wordpress
|
{
"language": "en",
"length": 172,
"provenance": "stackexchange_00019.jsonl.gz:419276",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49773"
}
|
[
0.0380859375,
-0.012298583984375,
0.01885986328125,
-0.028961181640625,
0.00403594970703125,
-0.00820159912109375,
0.0140838623046875,
-0.02508544921875,
-0.036163330078125,
0.0208892822265625,
-0.01226806640625,
0.027679443359375,
-0.0151214599609375,
-0.0166778564453125,
0.01136016845703125,
-0.020111083984375,
0.0184326171875,
0.0087127685546875,
0.019012451171875,
-0.0223236083984375,
0.01514434814453125,
-0.0242767333984375,
0.02593994140625,
0.035003662109375,
0.00846099853515625,
-0.05352783203125,
0.07025146484375,
-0.00986480712890625,
0.011627197265625,
-0.001354217529296875,
0.013031005859375,
-0.015167236328125,
0.01352691650390625,
0.03057861328125,
-0.019012451171875,
0.0650634765625,
0.0260467529296875,
0.017181396484375,
0.0209808349609375,
0.0220794677734375,
0.0157318115234375,
-0.0011320114135742188,
0.0087738037109375,
0.01995849609375,
-0.03302001953125,
-0.017852783203125,
-0.0019054412841796875,
-0.0194244384765625,
0.048095703125,
-0.028167724609375,
0.0016851425170898438,
0.014312744140625,
0.01209259033203125,
-0.045196533203125,
-0.02227783203125,
-0.0181427001953125,
-0.0118560791015625,
-0.00884246826171875,
0.034942626953125,
0.0010986328125,
-0.0270233154296875,
-0.0096435546875,
0.0184173583984375,
-0.0340576171875,
-0.00283050537109375,
-0.01541900634765625,
0.0102081298828125,
0.02264404296875,
-0.042205810546875,
-0.00614166259765625,
0.0330810546875,
-0.01242828369140625,
-0.00356292724609375,
-0.0628662109375,
-0.01068878173828125,
0.042877197265625,
-0.0009350776672363281,
-0.01325225830078125,
-0.0099334716796875,
0.0002846717834472656,
0.035614013671875,
0.01209259033203125,
-0.023284912109375,
0.0089111328125,
0.006744384765625,
0.033660888671875,
-0.02447509765625,
-0.03704833984375,
-0.02655029296875,
-0.05328369140625,
-0.0218353271484375,
-0.10626220703125,
-0.0018911361694335938,
-0.01593017578125,
-0.0011587142944335938,
-0.06158447265625,
-0.01435089111328125,
0.048675537109375,
-0.0154571533203125,
0.0222320556640625,
-0.004283905029296875,
-0.029541015625,
0.03662109375,
-0.0548095703125,
0.0083160400390625,
0.029327392578125,
-0.01216888427734375,
0.01087188720703125,
0.030853271484375,
0.037261962890625,
-0.0024318695068359375,
-0.024322509765625,
0.01328277587890625,
0.0234375,
-0.058349609375,
-0.043212890625,
-0.032501220703125,
-0.0204315185546875,
-0.0249786376953125,
-0.0418701171875,
0.032440185546875,
0.040863037109375,
0.04058837890625,
-0.049652099609375,
0.002353668212890625,
-0.004528045654296875,
-0.045440673828125,
-0.05950927734375,
0.015838623046875,
-0.024688720703125,
-0.03485107421875,
0.0199737548828125,
0.08294677734375,
0.046600341796875,
0.0195465087890625,
-0.0013399124145507812,
0.059844970703125,
-0.036468505859375,
-0.006435394287109375,
0.01690673828125,
-0.0087432861328125,
-0.03314208984375,
-0.01580810546875,
-0.0083770751953125,
-0.029022216796875,
0.037994384765625,
0.0032806396484375,
-0.0166473388671875,
-0.002422332763671875,
-0.07861328125,
0.00983428955078125,
-0.0870361328125,
0.03790283203125,
0.036834716796875,
-0.02044677734375,
0.0215911865234375,
0.058837890625,
-0.035064697265625,
-0.06134033203125,
-0.0517578125,
0.0172882080078125,
-0.0013914108276367188,
0.013671875,
0.0267486572265625,
0.00926971435546875,
0.0035572052001953125,
-0.01515960693359375,
-0.002193450927734375,
0.0241546630859375,
0.029052734375,
0.033935546875,
0.0244903564453125,
0.00867462158203125,
-0.0032405853271484375,
-0.02215576171875,
-0.0249176025390625,
0.02716064453125,
0.036865234375,
0.0183868408203125,
-0.007232666015625,
-0.0290679931640625,
-0.05169677734375,
0.067626953125,
-0.044921875,
-0.027679443359375,
0.019287109375,
0.01485443115234375,
0.03192138671875,
-0.007648468017578125,
0.01309967041015625,
0.0257415771484375,
0.0281829833984375,
-0.0848388671875,
-0.01059722900390625,
-0.00083160400390625,
0.01702880859375,
0.0004949569702148438,
0.0005435943603515625,
0.007038116455078125,
0.034027099609375,
-0.02410888671875,
-0.0246429443359375,
0.0202484130859375,
0.01136016845703125,
-0.049285888671875,
0.0249786376953125,
-0.03558349609375,
0.0428466796875,
-0.01189422607421875,
-0.0151214599609375,
0.0017642974853515625,
-0.047943115234375,
0.0274505615234375,
-0.0474853515625,
-0.033111572265625,
0.0187835693359375,
-0.0008988380432128906,
0.0125274658203125,
-0.01837158203125,
-0.015289306640625,
-0.0272369384765625,
-0.021270751953125,
-0.0308685302734375,
0.01236724853515625,
0.05419921875,
0.033935546875,
-0.03009033203125,
-0.00690460205078125,
0.040130615234375,
0.03466796875,
-0.037353515625,
0.01354217529296875,
0.00830078125,
0.025146484375,
-0.028076171875,
-0.00959014892578125,
-0.0105133056640625,
-0.058837890625,
0.01152801513671875,
0.034637451171875,
0.03662109375,
0.019195556640625,
0.018646240234375,
0.0288848876953125,
0.034698486328125,
-0.009765625,
0.0284423828125,
-0.01206207275390625,
-0.03460693359375,
0.01055908203125,
-0.0265045166015625,
0.0196685791015625,
0.0435791015625,
0.0177764892578125,
-0.00760650634765625,
0.0421142578125,
-0.034698486328125,
-0.01517486572265625,
0.008514404296875,
-0.0119171142578125,
0.00078582763671875,
-0.0269622802734375,
-0.010162353515625,
-0.018798828125,
0.03802490234375,
0.00188446044921875,
0.06597900390625,
0.0474853515625,
0.0103759765625,
-0.01515960693359375,
-0.01898193359375,
-0.01259613037109375,
0.00562286376953125,
0.00571441650390625,
0.007476806640625,
0.06317138671875,
-0.033843994140625,
-0.0099945068359375,
0.0310516357421875,
0.016998291015625,
-0.00536346435546875,
0.04248046875,
-0.0157623291015625,
-0.01302337646484375,
-0.005542755126953125,
-0.054901123046875,
-0.005298614501953125,
0.0020351409912109375,
-0.0038394927978515625,
-0.034210205078125,
-0.004638671875,
0.0237884521484375,
-0.02716064453125,
0.03778076171875,
0.02740478515625,
-0.0364990234375,
0.06640625,
-0.008453369140625,
0.03912353515625,
-0.046875,
0.0205535888671875,
0.0191497802734375,
-0.0765380859375,
0.023223876953125,
-0.00719451904296875,
0.0207977294921875,
-0.024322509765625,
0.01788330078125,
0.0022029876708984375,
-0.060394287109375,
0.023101806640625,
0.03277587890625,
0.028045654296875,
0.058197021484375,
-0.01446533203125,
-0.0322265625,
0.004650115966796875,
0.026397705078125,
-0.028656005859375,
-0.046173095703125,
0.0618896484375,
-0.043182373046875,
-0.045745849609375,
-0.03118896484375,
-0.05499267578125,
0.00789642333984375,
-0.01561737060546875,
-0.0220947265625,
-0.014495849609375,
-0.0244598388671875,
-0.0213165283203125,
-0.058074951171875,
-0.04638671875,
-0.04217529296875,
0.0108489990234375,
-0.00595855712890625,
0.003963470458984375,
0.0537109375,
0.0121917724609375,
-0.0267486572265625,
0.0180206298828125,
0.0482177734375,
-0.00939178466796875,
0.0026912689208984375,
0.0287628173828125,
-0.045379638671875,
0.00316619873046875,
-0.01047515869140625,
0.0007066726684570312,
0.025115966796875,
-0.021087646484375,
0.0011739730834960938,
-0.042236328125,
0.0257415771484375,
-0.0068817138671875,
0.039947509765625,
0.06451416015625,
0.049346923828125,
0.037506103515625,
-0.007289886474609375,
-0.00519561767578125,
0.006191253662109375,
-0.0028247833251953125,
-0.04827880859375,
-0.015380859375,
-0.007350921630859375,
-0.03472900390625,
0.0399169921875,
0.01861572265625,
0.00849151611328125,
0.040069580078125,
-0.00876617431640625,
0.021148681640625,
-0.0022735595703125,
0.0081939697265625,
-0.03192138671875,
0.0173797607421875,
0.007373809814453125,
0.033447265625,
0.00930023193359375,
0.043304443359375,
-0.01042938232421875,
0.0372314453125,
-0.0618896484375,
-0.0733642578125,
0.06561279296875,
-0.00954437255859375,
0.008056640625,
-0.04541015625,
-0.045135498046875,
0.005924224853515625,
0.11712646484375,
-0.087646484375,
-0.0201568603515625,
0.00605010986328125,
0.01013946533203125,
0.01690673828125,
0.0007171630859375,
-0.0297088623046875,
-0.024078369140625,
-0.06951904296875,
0.010528564453125,
0.015411376953125,
-0.054290771484375,
-0.01471710205078125,
0.010894775390625,
-0.061431884765625,
-0.01300048828125,
0.048828125,
-0.0477294921875,
0.003265380859375,
0.06610107421875,
0.02032470703125,
-0.00243377685546875,
-0.0271453857421875,
-0.010650634765625,
-0.1162109375,
-0.018524169921875,
-0.008453369140625,
0.08624267578125,
-0.0128173828125,
0.00391387939453125,
-0.024688720703125,
0.04949951171875,
0.022918701171875,
-0.014068603515625,
0.0200958251953125,
0.0081329345703125,
0.00047469139099121094,
-0.00513458251953125,
0.017242431640625,
-0.0261383056640625,
0.0030994415283203125,
0.021240234375,
-0.027069091796875,
0.057586669921875,
-0.022613525390625,
-0.022308349609375,
0.0297393798828125,
-0.045806884765625,
-0.0123443603515625,
-0.061370849609375,
-0.03009033203125,
0.0052490234375,
-0.003570556640625,
-0.00458526611328125,
-0.07049560546875,
-0.036956787109375,
-0.0022029876708984375,
-0.0001232624053955078,
-0.0194091796875,
0.0293426513671875,
0.04937744140625,
0.034271240234375,
-0.016571044921875,
-0.07171630859375,
0.01045989990234375,
0.03717041015625,
-0.0107269287109375,
0.041290283203125,
0.032379150390625,
-0.0079193115234375,
0.0303802490234375,
-0.006038665771484375,
0.0026874542236328125,
-0.042022705078125,
0.09466552734375,
-0.0228118896484375,
-0.0183258056640625,
0.01317596435546875,
-0.06732177734375,
0.02685546875,
-0.00872039794921875,
-0.00371551513671875,
-0.033935546875,
0.0192718505859375,
0.036163330078125,
-0.020751953125,
0.045196533203125,
-0.012664794921875,
0.008544921875,
0.004726409912109375,
-0.017547607421875,
0.05926513671875,
0.0213623046875,
0.00445556640625,
0.003658294677734375,
-0.0090179443359375,
0.013916015625,
0.0206756591796875,
0.00395965576171875,
-0.0219573974609375,
-0.0012979507446289062,
0.06317138671875,
-0.01983642578125,
0.011627197265625,
-0.0022411346435546875,
0.060333251953125,
0.004550933837890625,
-0.046966552734375,
-0.00930023193359375,
-0.0005464553833007812,
0.053131103515625,
0.021240234375,
-0.0014133453369140625,
0.052947998046875,
0.014129638671875,
-0.032562255859375,
-0.03363037109375,
-0.0265350341796875,
-0.0003917217254638672,
-0.0758056640625,
0.0193328857421875,
0.023162841796875,
-0.0158538818359375,
-0.002399444580078125,
0.023834228515625,
0.0241546630859375,
-0.01453399658203125,
-0.0138397216796875,
0.01534271240234375,
0.00559234619140625,
0.055877685546875,
0.0296173095703125,
-0.0560302734375,
0.0009646415710449219,
0.03143310546875,
-0.0222625732421875,
-0.0076904296875,
0.00433349609375,
0.042877197265625,
0.033660888671875,
-0.01084136962890625,
-0.01039886474609375,
-0.0151824951171875,
-0.033050537109375,
-0.027496337890625,
-0.01062774658203125,
0.0258331298828125,
0.007465362548828125,
0.0003452301025390625,
-0.04229736328125,
-0.032806396484375,
0.03778076171875,
-0.0009326934814453125,
0.005596160888671875,
0.01313018798828125,
0.03570556640625,
-0.050445556640625,
-0.005401611328125,
0.010162353515625,
0.01288604736328125,
-0.042449951171875,
-0.01042938232421875,
-0.00463104248046875,
-0.040496826171875,
-0.04205322265625,
0.006591796875,
-0.019073486328125,
0.004009246826171875,
-0.0352783203125,
0.05938720703125,
-0.02093505859375,
-0.011077880859375,
-0.027984619140625,
0.033843994140625,
-0.00875091552734375,
-0.00911712646484375,
0.02545166015625,
-0.0241241455078125,
-0.0357666015625,
-0.017791748046875,
-0.026519775390625,
-0.041290283203125,
0.0227508544921875,
0.005084991455078125,
-0.014801025390625,
0.0302734375,
-0.0142364501953125,
-0.006298065185546875,
-0.01499176025390625,
-0.007045745849609375,
-0.0116729736328125,
0.0180206298828125,
-0.0236663818359375,
0.0665283203125,
-0.00275421142578125,
0.0557861328125,
0.00629425048828125,
0.01276397705078125,
0.0009126663208007812,
-0.011138916015625,
0.0028095245361328125,
-0.031646728515625,
-0.004734039306640625,
-0.028045654296875,
-0.007625579833984375,
0.0439453125,
0.08154296875,
-0.00768280029296875,
0.006374359130859375,
-0.01482391357421875,
-0.002262115478515625,
-0.031158447265625,
-0.0032196044921875,
-0.017303466796875,
0.0063934326171875,
-0.007598876953125,
-0.0204010009765625,
0.0298614501953125,
-0.018768310546875,
0.02001953125,
0.0168609619140625,
-0.0467529296875,
0.033782958984375,
0.021392822265625,
-0.0909423828125,
0.05194091796875,
0.03436279296875,
0.0186920166015625,
0.03839111328125,
-0.051666259765625,
0.0168304443359375,
0.0173492431640625,
-0.01248931884765625,
0.0236663818359375,
0.028564453125,
0.10101318359375,
0.008544921875,
-0.02197265625,
0.07159423828125,
-0.0305938720703125,
0.019775390625,
0.01203155517578125,
0.041015625,
-0.031219482421875,
0.0154266357421875,
0.0008287429809570312,
-0.020477294921875,
0.036041259765625,
-0.00940704345703125,
-0.00356292724609375,
-0.0079345703125,
0.0455322265625,
-0.014617919921875,
-0.029754638671875,
0.0246734619140625,
0.0006413459777832031,
-0.002288818359375,
-0.048614501953125,
-0.0293121337890625,
-0.017578125,
-0.004520416259765625,
0.0300445556640625,
-0.00904083251953125,
0.010223388671875,
-0.0006260871887207031,
-0.016845703125,
0.0271148681640625,
-0.03118896484375,
-0.044464111328125,
0.0037784576416015625,
-0.05169677734375,
0.0031909942626953125,
0.035400390625,
0.0159149169921875,
0.03643798828125,
0.03375244140625,
0.006343841552734375,
0.0010080337524414062,
-0.0117034912109375,
0.0075836181640625,
-0.060638427734375,
-0.022674560546875,
0.00815582275390625,
0.01461029052734375,
-0.0080718994140625,
0.03802490234375,
-0.004756927490234375,
-0.0458984375,
-0.0121917724609375,
-0.016754150390625,
0.0682373046875,
-0.02117919921875,
-0.02398681640625,
0.0256195068359375,
0.00701141357421875,
-0.016510009765625,
0.0254364013671875,
0.017364501953125,
-0.01274871826171875,
-0.0007877349853515625,
0.018798828125,
-0.019439697265625,
-0.008392333984375,
0.0183258056640625,
-0.06158447265625,
0.052764892578125,
-0.0037136077880859375,
0.00844573974609375,
-0.00620269775390625,
0.0301055908203125,
-0.01326751708984375,
0.006427764892578125,
-0.00270843505859375,
0.0041656494140625,
-0.00914764404296875,
0.003543853759765625,
-0.0240631103515625,
-0.01502227783203125,
-0.006046295166015625,
0.047882080078125,
0.031463623046875,
0.0097198486328125,
-0.033905029296875,
-0.01038360595703125,
0.018341064453125,
0.054962158203125,
0.01261138916015625,
0.017364501953125,
-0.0213623046875,
0.06805419921875,
0.03009033203125,
-0.050506591796875,
0.03155517578125,
-0.0276641845703125,
-0.055328369140625,
0.00010436773300170898,
0.01088714599609375,
0.0022029876708984375,
0.01947021484375,
0.00846099853515625,
-0.01253509521484375,
0.01401519775390625,
0.0059814453125,
-0.01026153564453125,
-0.003520965576171875,
0.021484375,
0.033172607421875,
-0.038299560546875,
-0.0447998046875,
-0.0157318115234375,
0.042938232421875,
0.0218048095703125,
0.0477294921875,
0.0199127197265625,
0.021575927734375,
0.03533935546875,
0.0115203857421875,
0.0243682861328125,
0.022308349609375,
-0.0174560546875,
0.060455322265625,
0.0007648468017578125,
0.0134735107421875,
-0.059906005859375,
0.0129241943359375,
0.006114959716796875,
0.0516357421875,
-0.050994873046875,
-0.0254669189453125,
0.0035266876220703125,
-0.01031494140625,
0.01959228515625,
-0.0270538330078125,
0.02618408203125,
-0.0238189697265625,
-0.035491943359375,
-0.0545654296875,
0.0015935897827148438,
0.01348114013671875,
0.0162506103515625,
-0.021209716796875,
0.00846099853515625,
-0.01093292236328125,
-0.0016508102416992188,
-0.052276611328125,
0.0015592575073242188,
0.0164642333984375,
0.059814453125,
0.029052734375,
0.04962158203125,
0.00008875131607055664,
-0.0269317626953125,
-0.005489349365234375,
0.0187225341796875,
0.023834228515625,
0.007171630859375,
-0.006755828857421875,
-0.006359100341796875,
0.02288818359375,
0.027984619140625,
0.0191497802734375,
0.030364990234375,
0.041748046875,
0.0208282470703125,
0.0000629425048828125,
-0.00955963134765625,
-0.018096923828125,
-0.02716064453125,
0.01386260986328125,
-0.028106689453125,
0.045166015625,
0.005092620849609375,
-0.003078460693359375,
-0.0076141357421875,
0.034942626953125,
0.021514892578125,
-0.00042366981506347656,
0.0094146728515625,
0.01433563232421875,
-0.02490234375,
0.0186004638671875,
0.01361083984375,
0.0428466796875,
0.02001953125,
-0.0831298828125,
-0.0012197494506835938,
-0.0191650390625,
-0.06439208984375,
0.032135009765625,
0.052703857421875,
-0.03515625,
0.003498077392578125,
-0.010955810546875,
-0.006134033203125,
0.009490966796875,
-0.0004818439483642578,
-0.00855255126953125,
0.0386962890625,
0.0294036865234375,
0.01390838623046875,
-0.0428466796875,
-0.01215362548828125,
0.0019664764404296875,
0.01171875,
0.01457977294921875,
0.02569580078125,
0.007171630859375,
0.01410675048828125,
-0.057647705078125,
0.01531219482421875,
-0.040252685546875,
-0.0638427734375,
0.0628662109375,
0.027862548828125,
-0.0107879638671875,
0.0007452964782714844,
-0.0001583099365234375,
0.037841796875,
0.04608154296875,
-0.01100921630859375,
0.01456451416015625,
0.00754547119140625,
0.0111846923828125,
-0.030059814453125,
0.02801513671875,
-0.0209503173828125,
-0.006591796875,
-0.0662841796875,
-0.041839599609375,
0.0599365234375,
0.02777099609375,
-0.00212860107421875,
0.0083160400390625,
0.0272674560546875,
-0.00351715087890625,
0.0198211669921875,
0.007843017578125,
0.0538330078125,
0.037811279296875,
-0.04632568359375,
-0.049713134765625,
0.009613037109375,
-0.0077362060546875,
-0.0002796649932861328,
0.0093231201171875,
0.04925537109375,
0.0175628662109375,
-0.096435546875,
0.038787841796875,
0.06427001953125,
0.056976318359375,
-0.00368499755859375,
0.0206146240234375,
0.053924560546875,
-0.02734375,
-0.00946807861328125,
0.0219268798828125,
-0.0309295654296875,
-0.05352783203125,
0.0130157470703125,
0.0279693603515625,
-0.0160064697265625,
0.0139312744140625,
-0.0765380859375,
0.002288818359375,
0.005889892578125,
0.002559661865234375,
-0.0555419921875,
0.02642822265625,
-0.006011962890625,
0.042083740234375,
-0.019195556640625,
-0.0007905960083007812,
0.0018301010131835938,
0.04656982421875,
-0.0297698974609375,
-0.026031494140625,
-0.03973388671875,
0.0202789306640625,
-0.04864501953125,
0.020599365234375,
0.015716552734375,
-0.036773681640625,
0.048492431640625,
0.0156707763671875,
0.03814697265625,
0.046844482421875,
-0.00514984130859375,
-0.0267181396484375,
0.01369476318359375,
0.002010345458984375,
-0.00685882568359375,
-0.06768798828125,
-0.0036678314208984375,
-0.060638427734375,
0.006877899169921875,
0.0247650146484375,
0.0015316009521484375,
0.03076171875,
-0.01024627685546875,
-0.05108642578125,
0.02069091796875,
0.00832366943359375,
-0.03765869140625,
-0.05908203125,
-0.0036182403564453125,
-0.0005559921264648438,
0.0284423828125,
-0.02996826171875,
-0.01324462890625,
-0.02154541015625,
0.029510498046875,
-0.0015401840209960938,
-0.01171875,
0.06396484375,
-0.0185394287109375,
-0.04193115234375,
-0.035858154296875,
-0.02728271484375,
-0.012298583984375,
-0.0192413330078125,
-0.007293701171875,
0.0123291015625,
0.00627899169921875,
-0.051910400390625,
-0.0234222412109375,
0.031646728515625,
0.05999755859375,
0.0135040283203125,
-0.054168701171875,
-0.033599853515625,
-0.035125732421875,
0.06829833984375,
0.0002808570861816406,
0.0156402587890625,
-0.0034847259521484375,
0.0220184326171875,
-0.055145263671875,
-0.0675048828125,
-0.02227783203125,
0.01226806640625,
-0.038360595703125,
-0.01433563232421875,
0.0127716064453125,
0.0015230178833007812,
0.01751708984375,
-0.00737762451171875,
-0.01148223876953125,
0.0015201568603515625,
0.0181884765625,
0.008819580078125,
-0.07904052734375,
-0.00693511962890625,
0.03302001953125,
-0.019805908203125,
0.0186767578125,
0.0037593841552734375,
0.0038394927978515625,
0.035186767578125,
0.0243072509765625,
-0.0386962890625,
-0.038848876953125,
-0.0118255615234375,
0.032012939453125,
-0.0267791748046875,
0.042633056640625,
-0.026214599609375,
0.004062652587890625,
-0.02618408203125,
0.00933074951171875,
0.0123443603515625,
0.0009851455688476562,
-0.0193634033203125,
0.0164642333984375,
0.005950927734375,
0.044677734375,
-0.01125335693359375,
0.0015840530395507812,
0.000995635986328125,
0.0129852294921875,
0.0204315185546875,
-0.0077362060546875,
0.062347412109375,
-0.0268707275390625,
-0.007526397705078125,
-0.04827880859375,
-0.01067352294921875,
-0.058563232421875,
0.02630615234375,
0.01202392578125,
-0.0271453857421875,
0.045074462890625
] |
45ca54644e9cfc823df5c2c735b0950cdd8e91fe
|
Wordpress Stackexchange
Q: Add something to beginning of the content I'm using
add_action('the_content', 'myFunction', 10)
to append data to the end of the content.
How can I place content at the beginning of the content?
A: the_content is also a filter, into which the content is passed as an argument. You simply prepend your content and then return like so.
add_filter('the_content','prepend_this');
function prepend_this($content)
{
$content = "string to prepend" . $content;
return $content
}
|
Q: Add something to beginning of the content I'm using
add_action('the_content', 'myFunction', 10)
to append data to the end of the content.
How can I place content at the beginning of the content?
A: the_content is also a filter, into which the content is passed as an argument. You simply prepend your content and then return like so.
add_filter('the_content','prepend_this');
function prepend_this($content)
{
$content = "string to prepend" . $content;
return $content
}
|
wordpress
|
{
"language": "en",
"length": 72,
"provenance": "stackexchange_00019.jsonl.gz:419281",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49786"
}
|
[
0.025634765625,
-0.00087738037109375,
-0.007671356201171875,
-0.052276611328125,
0.0229339599609375,
-0.026092529296875,
0.035919189453125,
0.01454925537109375,
0.0232391357421875,
0.0011234283447265625,
-0.008056640625,
-0.063232421875,
0.006988525390625,
-0.04693603515625,
-0.013427734375,
-0.052154541015625,
0.0300750732421875,
-0.0232086181640625,
0.0269012451171875,
-0.004650115966796875,
-0.0260772705078125,
0.01561737060546875,
0.03363037109375,
0.0184478759765625,
0.00040984153747558594,
0.0025386810302734375,
0.063232421875,
-0.0015544891357421875,
0.00785064697265625,
-0.0019378662109375,
0.016357421875,
-0.024627685546875,
0.0211944580078125,
0.03448486328125,
-0.042144775390625,
-0.0032253265380859375,
0.0011196136474609375,
0.004024505615234375,
0.0032215118408203125,
0.01123809814453125,
0.0235595703125,
0.0009965896606445312,
0.0107421875,
0.0557861328125,
-0.0030117034912109375,
-0.0276947021484375,
0.04547119140625,
-0.050384521484375,
-0.00004380941390991211,
-0.01445770263671875,
0.022125244140625,
-0.011688232421875,
0.0294952392578125,
-0.06573486328125,
0.006282806396484375,
0.00962066650390625,
-0.044097900390625,
0.019317626953125,
0.0301513671875,
0.0277099609375,
-0.010284423828125,
-0.0003540515899658203,
-0.00034046173095703125,
-0.031494140625,
0.00742340087890625,
-0.0151519775390625,
0.0268707275390625,
-0.005451202392578125,
-0.063720703125,
0.00992584228515625,
0.06475830078125,
-0.0273590087890625,
0.011444091796875,
-0.0318603515625,
0.00574493408203125,
-0.01450347900390625,
-0.0199737548828125,
-0.0051727294921875,
0.02801513671875,
0.00852203369140625,
-0.023651123046875,
0.018646240234375,
0.0272369384765625,
-0.07818603515625,
0.0197601318359375,
-0.05474853515625,
-0.03265380859375,
0.01505279541015625,
-0.00860595703125,
-0.01885986328125,
-0.0202789306640625,
0.0272064208984375,
0.0178985595703125,
-0.0526123046875,
-0.04669189453125,
-0.0264739990234375,
0.001827239990234375,
0.02191162109375,
0.004428863525390625,
0.026031494140625,
0.0113372802734375,
-0.057464599609375,
0.061248779296875,
-0.043060302734375,
0.0265655517578125,
0.019439697265625,
-0.03009033203125,
-0.05657958984375,
0.040863037109375,
0.0301666259765625,
-0.0136871337890625,
0.030731201171875,
-0.003040313720703125,
-0.018035888671875,
-0.0394287109375,
0.031585693359375,
-0.0106201171875,
-0.005218505859375,
0.01361846923828125,
0.01468658447265625,
-0.0007748603820800781,
-0.008514404296875,
-0.015777587890625,
-0.032135009765625,
0.01311492919921875,
-0.038970947265625,
-0.04754638671875,
0.035064697265625,
-0.006755828857421875,
0.058380126953125,
-0.01708984375,
0.005832672119140625,
0.02728271484375,
-0.0134735107421875,
-0.033203125,
-0.03265380859375,
-0.0012722015380859375,
-0.043853759765625,
-0.003948211669921875,
0.0017805099487304688,
0.010955810546875,
-0.01107025146484375,
0.0166168212890625,
0.0065460205078125,
0.01113128662109375,
-0.0031948089599609375,
0.003681182861328125,
0.035308837890625,
-0.01148223876953125,
-0.05523681640625,
0.069580078125,
-0.049652099609375,
0.01434326171875,
-0.01401519775390625,
-0.042510986328125,
0.00997161865234375,
-0.06292724609375,
0.00988006591796875,
-0.0140380859375,
-0.0003116130828857422,
-0.007190704345703125,
-0.0169677734375,
-0.0010786056518554688,
-0.05474853515625,
-0.0599365234375,
0.00453948974609375,
-0.051513671875,
-0.00940704345703125,
0.0134735107421875,
0.0250396728515625,
-0.0089569091796875,
0.0275421142578125,
0.009857177734375,
-0.0208892822265625,
-0.03167724609375,
-0.018310546875,
0.010345458984375,
0.041717529296875,
-0.0189208984375,
0.083740234375,
0.0218048095703125,
-0.03326416015625,
0.037078857421875,
-0.00016367435455322266,
-0.035736083984375,
0.012176513671875,
0.03265380859375,
0.047607421875,
-0.01470947265625,
0.0157318115234375,
0.041015625,
0.027374267578125,
-0.050872802734375,
-0.0226287841796875,
-0.01110076904296875,
-0.005443572998046875,
-0.029632568359375,
-0.018463134765625,
-0.01067352294921875,
0.046966552734375,
0.03387451171875,
-0.004444122314453125,
0.0201263427734375,
0.03656005859375,
-0.00678253173828125,
0.0018291473388671875,
-0.0038814544677734375,
0.0106964111328125,
0.01226806640625,
-0.0199432373046875,
0.01117706298828125,
0.0005955696105957031,
0.024871826171875,
-0.08782958984375,
-0.06439208984375,
0.0340576171875,
-0.04229736328125,
0.0122222900390625,
0.004817962646484375,
0.06024169921875,
-0.0094146728515625,
-0.0052490234375,
-0.0246124267578125,
-0.05487060546875,
0.06500244140625,
-0.0399169921875,
-0.01187896728515625,
-0.032012939453125,
0.01947021484375,
-0.00928497314453125,
-0.0704345703125,
0.056488037109375,
0.03240966796875,
-0.007587432861328125,
-0.044830322265625,
0.00510406494140625,
-0.0090789794921875,
-0.041961669921875,
-0.01433563232421875,
0.06329345703125,
0.050048828125,
0.052398681640625,
0.006221771240234375,
-0.0179443359375,
0.09197998046875,
-0.0244903564453125,
0.0205535888671875,
-0.035552978515625,
0.0399169921875,
0.09405517578125,
0.01100921630859375,
-0.004375457763671875,
-0.007404327392578125,
-0.042449951171875,
0.014068603515625,
0.002399444580078125,
-0.008941650390625,
-0.00732421875,
-0.03985595703125,
0.006923675537109375,
0.01142120361328125,
-0.036651611328125,
-0.02874755859375,
-0.00714874267578125,
0.008636474609375,
0.0447998046875,
0.037689208984375,
0.037872314453125,
-0.0014543533325195312,
0.0169525146484375,
0.0218658447265625,
0.024688720703125,
-0.0189208984375,
0.0140533447265625,
-0.0020732879638671875,
-0.057830810546875,
-0.00920867919921875,
0.0202484130859375,
-0.036956787109375,
-0.0298919677734375,
-0.005504608154296875,
0.0235595703125,
-0.0044708251953125,
-0.017333984375,
0.007183074951171875,
0.01041412353515625,
-0.0020160675048828125,
-0.005096435546875,
-0.0104827880859375,
-0.045501708984375,
-0.0004706382751464844,
0.019989013671875,
-0.03839111328125,
0.0256805419921875,
-0.027679443359375,
-0.032989501953125,
0.03363037109375,
-0.0008630752563476562,
0.01459503173828125,
-0.0203399658203125,
0.021575927734375,
0.042724609375,
-0.00887298583984375,
-0.02264404296875,
-0.007415771484375,
0.0426025390625,
-0.0054168701171875,
0.00839996337890625,
-0.01207733154296875,
-0.01113128662109375,
-0.028961181640625,
0.0010442733764648438,
0.036712646484375,
0.0226593017578125,
0.02911376953125,
-0.0032100677490234375,
0.0112152099609375,
0.04412841796875,
-0.040924072265625,
-0.046539306640625,
0.03839111328125,
-0.07952880859375,
-0.047271728515625,
0.0156402587890625,
-0.06201171875,
-0.003444671630859375,
0.0762939453125,
-0.0186614990234375,
-0.006015777587890625,
0.0067291259765625,
-0.01003265380859375,
-0.0101776123046875,
-0.020751953125,
0.01070404052734375,
-0.0032367706298828125,
0.02435302734375,
0.0115203857421875,
0.054534912109375,
0.0030612945556640625,
-0.017120361328125,
0.0152130126953125,
-0.00408172607421875,
-0.0166778564453125,
-0.00396728515625,
0.0200958251953125,
-0.016265869140625,
-0.006435394287109375,
0.0031261444091796875,
0.03179931640625,
0.0237884521484375,
-0.034576416015625,
-0.0112762451171875,
-0.04833984375,
0.0199737548828125,
-0.009674072265625,
0.0557861328125,
0.055572509765625,
0.0115509033203125,
0.03485107421875,
-0.03912353515625,
0.02301025390625,
0.0072021484375,
-0.0313720703125,
-0.027435302734375,
0.052001953125,
-0.03375244140625,
-0.0277862548828125,
-0.0218353271484375,
-0.04632568359375,
0.0024394989013671875,
0.034942626953125,
-0.0257568359375,
-0.004840850830078125,
-0.0333251953125,
-0.072265625,
0.0086517333984375,
-0.01522064208984375,
-0.02093505859375,
0.0179595947265625,
-0.001979827880859375,
0.053253173828125,
0.036865234375,
-0.005016326904296875,
-0.010528564453125,
-0.028717041015625,
0.039581298828125,
0.01021575927734375,
0.045684814453125,
-0.040435791015625,
-0.034759521484375,
-0.0158233642578125,
0.09625244140625,
-0.0665283203125,
-0.01268768310546875,
0.00957489013671875,
0.0148162841796875,
-0.0027923583984375,
-0.044952392578125,
-0.051177978515625,
-0.035064697265625,
-0.0006885528564453125,
-0.008209228515625,
-0.0176544189453125,
0.007404327392578125,
-0.0260772705078125,
0.047149658203125,
-0.0027141571044921875,
-0.00727081298828125,
0.041259765625,
-0.05224609375,
-0.0229034423828125,
0.054779052734375,
-0.03118896484375,
0.00919342041015625,
-0.040252685546875,
0.0010404586791992188,
-0.0440673828125,
-0.0038318634033203125,
-0.035980224609375,
0.050445556640625,
0.0335693359375,
-0.020416259765625,
-0.01349639892578125,
0.033935546875,
0.0173492431640625,
0.0014905929565429688,
0.043304443359375,
0.026824951171875,
0.0150146484375,
-0.060577392578125,
0.0263824462890625,
-0.077392578125,
-0.00731658935546875,
-0.01122283935546875,
0.005374908447265625,
0.044281005859375,
-0.035369873046875,
0.01358795166015625,
-0.0280303955078125,
-0.00687408447265625,
-0.0423583984375,
-0.0345458984375,
0.01078033447265625,
0.0307464599609375,
-0.0178375244140625,
0.037139892578125,
-0.039337158203125,
-0.042816162109375,
0.0203094482421875,
-0.009735107421875,
-0.0212554931640625,
0.0108795166015625,
0.06768798828125,
0.0281524658203125,
-0.003849029541015625,
0.023406982421875,
0.0023708343505859375,
0.033172607421875,
-0.04595947265625,
0.027801513671875,
0.0010709762573242188,
-0.0299835205078125,
0.0811767578125,
-0.03173828125,
0.06097412109375,
-0.046844482421875,
0.060333251953125,
0.007503509521484375,
0.00868988037109375,
0.03936767578125,
0.0014410018920898438,
-0.01837158203125,
-0.0226898193359375,
-0.04827880859375,
0.0257720947265625,
0.0294342041015625,
-0.0046539306640625,
-0.042205810546875,
0.05706787109375,
0.005252838134765625,
0.0199737548828125,
0.0006775856018066406,
0.036102294921875,
0.00835418701171875,
0.0166473388671875,
0.01461029052734375,
-0.036865234375,
0.004955291748046875,
0.020843505859375,
0.01543426513671875,
-0.01497650146484375,
-0.00547027587890625,
0.0489501953125,
0.01221466064453125,
0.023162841796875,
0.0180816650390625,
0.0020961761474609375,
0.035125732421875,
0.01483154296875,
-0.0201416015625,
-0.0220489501953125,
0.00481414794921875,
0.05615234375,
-0.0176544189453125,
0.048919677734375,
-0.005489349365234375,
0.00531768798828125,
0.03857421875,
0.0153045654296875,
0.0382080078125,
0.056549072265625,
0.0067596435546875,
0.006549835205078125,
-0.0102996826171875,
-0.01468658447265625,
0.0218048095703125,
-0.0201873779296875,
-0.03594970703125,
0.0017461776733398438,
-0.003818511962890625,
0.02471923828125,
0.03094482421875,
0.01160430908203125,
0.00609588623046875,
0.01366424560546875,
-0.01129150390625,
0.0157623291015625,
0.0062713623046875,
-0.0025005340576171875,
0.00878143310546875,
0.002841949462890625,
0.01157379150390625,
-0.040771484375,
-0.00948333740234375,
0.035980224609375,
-0.021636962890625,
0.0149688720703125,
-0.009185791015625,
0.0107421875,
0.0036773681640625,
0.0170135498046875,
0.00791168212890625,
0.0006890296936035156,
-0.005931854248046875,
0.007152557373046875,
0.046600341796875,
0.007080078125,
0.059478759765625,
-0.004634857177734375,
0.032806396484375,
-0.032318115234375,
-0.05023193359375,
0.01171112060546875,
-0.027130126953125,
-0.0201873779296875,
-0.0290069580078125,
-0.018768310546875,
0.0015239715576171875,
0.017425537109375,
0.04217529296875,
-0.018798828125,
0.0017728805541992188,
-0.03814697265625,
0.050079345703125,
-0.062286376953125,
0.0012378692626953125,
0.0201568603515625,
-0.003208160400390625,
-0.04339599609375,
0.021881103515625,
-0.0170440673828125,
0.02001953125,
-0.0626220703125,
-0.08587646484375,
-0.0367431640625,
-0.018951416015625,
-0.0023193359375,
0.007572174072265625,
-0.0251312255859375,
-0.0309295654296875,
-0.018890380859375,
0.02081298828125,
0.007404327392578125,
0.016845703125,
0.01666259765625,
0.0438232421875,
-0.0059051513671875,
0.06439208984375,
0.031463623046875,
0.0247039794921875,
-0.02801513671875,
-0.039886474609375,
0.0015954971313476562,
-0.0361328125,
0.00557708740234375,
-0.0028667449951171875,
0.0036773681640625,
-0.004688262939453125,
0.01453399658203125,
0.004573822021484375,
0.016937255859375,
-0.0217132568359375,
-0.01467132568359375,
-0.01271820068359375,
0.01383209228515625,
-0.01042938232421875,
-0.0121307373046875,
0.039703369140625,
-0.00897216796875,
0.04412841796875,
0.00818634033203125,
0.0164642333984375,
-0.00933074951171875,
-0.01329803466796875,
0.005115509033203125,
0.0156097412109375,
-0.0007681846618652344,
0.01285552978515625,
0.025299072265625,
0.00954437255859375,
0.052398681640625,
0.0147247314453125,
0.02764892578125,
0.018707275390625,
0.025238037109375,
-0.033447265625,
-0.03375244140625,
0.043853759765625,
0.019195556640625,
-0.03314208984375,
0.02587890625,
-0.0274810791015625,
0.019317626953125,
0.036865234375,
0.0343017578125,
-0.0667724609375,
0.0121612548828125,
-0.0372314453125,
-0.01508331298828125,
0.0455322265625,
-0.0041351318359375,
0.01528167724609375,
-0.0091705322265625,
0.0706787109375,
0.03302001953125,
0.0227203369140625,
0.05731201171875,
-0.0116424560546875,
-0.049530029296875,
-0.032379150390625,
-0.0836181640625,
-0.0012769699096679688,
0.00015723705291748047,
0.0643310546875,
0.0053863525390625,
0.001251220703125,
-0.0295562744140625,
0.01364898681640625,
-0.01267242431640625,
0.000957489013671875,
-0.017120361328125,
0.0296783447265625,
-0.0236358642578125,
0.0303802490234375,
0.016845703125,
-0.0218353271484375,
0.013092041015625,
0.04217529296875,
-0.03125,
0.02557373046875,
0.014007568359375,
-0.02972412109375,
-0.037628173828125,
-0.0199127197265625,
0.00798797607421875,
-0.005306243896484375,
-0.01151275634765625,
0.0153656005859375,
-0.0265045166015625,
-0.033416748046875,
0.022552490234375,
-0.055389404296875,
0.017578125,
-0.0784912109375,
0.02056884765625,
0.0277252197265625,
-0.0308837890625,
-0.0037593841552734375,
-0.015045166015625,
0.0210723876953125,
-0.03558349609375,
0.00351715087890625,
-0.0205078125,
0.0071258544921875,
0.0212860107421875,
-0.01177978515625,
-0.05584716796875,
0.114013671875,
0.03057861328125,
-0.0155487060546875,
-0.0253448486328125,
0.059478759765625,
-0.053436279296875,
0.0185089111328125,
-0.01097869873046875,
0.049560546875,
-0.027679443359375,
0.044189453125,
-0.053131103515625,
-0.03460693359375,
0.01137542724609375,
0.07147216796875,
0.054931640625,
0.01166534423828125,
-0.03973388671875,
-0.0239715576171875,
0.0276947021484375,
-0.0071868896484375,
-0.015838623046875,
0.04888916015625,
-0.0156402587890625,
-0.01483917236328125,
0.0177154541015625,
-0.0161590576171875,
0.0191192626953125,
-0.01000213623046875,
-0.02044677734375,
-0.0011720657348632812,
0.003993988037109375,
0.0042877197265625,
0.020050048828125,
0.0308074951171875,
-0.0192718505859375,
-0.005741119384765625,
0.0189208984375,
-0.047637939453125,
-0.00995635986328125,
0.048583984375,
0.0077056884765625,
0.004150390625,
-0.0034084320068359375,
-0.0360107421875,
0.044586181640625,
0.0112457275390625,
0.0718994140625,
0.047576904296875,
0.0278778076171875,
0.06646728515625,
0.0186920166015625,
0.039794921875,
0.0211181640625,
-0.0206451416015625,
0.0244903564453125,
0.0261993408203125,
0.01213836669921875,
-0.05462646484375,
-0.0302734375,
0.01441192626953125,
0.046966552734375,
-0.024322509765625,
0.02044677734375,
0.0164794921875,
0.00795745849609375,
0.00037288665771484375,
-0.03857421875,
0.018890380859375,
-0.013214111328125,
-0.01233673095703125,
-0.0555419921875,
-0.019439697265625,
0.0560302734375,
0.026885986328125,
0.023162841796875,
0.033447265625,
-0.0272979736328125,
-0.047088623046875,
-0.02557373046875,
0.023773193359375,
0.038604736328125,
0.020263671875,
-0.007106781005859375,
0.0625,
-0.00494384765625,
-0.0010232925415039062,
-0.0283203125,
0.01371002197265625,
-0.0010519027709960938,
0.036834716796875,
0.00592041015625,
0.0295257568359375,
-0.0090789794921875,
-0.0063018798828125,
0.037933349609375,
0.024078369140625,
0.0357666015625,
0.0189056396484375,
-0.015655517578125,
0.0116424560546875,
0.0240325927734375,
-0.019805908203125,
0.03839111328125,
-0.034515380859375,
0.068603515625,
0.03314208984375,
0.007183074951171875,
-0.01398468017578125,
0.00991058349609375,
0.07135009765625,
0.0239105224609375,
-0.004100799560546875,
0.006092071533203125,
-0.0433349609375,
0.01812744140625,
0.0080108642578125,
0.0543212890625,
0.035675048828125,
-0.07830810546875,
0.0194091796875,
-0.06549072265625,
-0.1131591796875,
0.06207275390625,
0.0654296875,
-0.006671905517578125,
-0.0146636962890625,
0.004421234130859375,
0.01116943359375,
-0.0134735107421875,
0.0012874603271484375,
-0.012298583984375,
0.0308837890625,
0.049102783203125,
0.0162506103515625,
-0.01352691650390625,
0.0147247314453125,
0.0150299072265625,
-0.0002560615539550781,
0.0068817138671875,
0.02398681640625,
0.00821685791015625,
0.0193328857421875,
-0.00934600830078125,
-0.00626373291015625,
0.02294921875,
-0.0018186569213867188,
0.0252838134765625,
0.0457763671875,
0.0105743408203125,
-0.0269317626953125,
0.00495147705078125,
-0.042938232421875,
0.06903076171875,
-0.0584716796875,
-0.00366973876953125,
-0.0254669189453125,
0.032257080078125,
-0.061676025390625,
0.061767578125,
-0.007678985595703125,
0.042205810546875,
-0.0227813720703125,
-0.0501708984375,
0.0863037109375,
0.0361328125,
0.01378631591796875,
-0.00505828857421875,
0.033966064453125,
-0.0257415771484375,
-0.0020618438720703125,
0.01064300537109375,
-0.00545501708984375,
0.023345947265625,
0.038299560546875,
-0.033966064453125,
0.0069732666015625,
-0.00015842914581298828,
0.030517578125,
-0.0021305084228515625,
0.0426025390625,
0.045166015625,
-0.005138397216796875,
-0.018218994140625,
0.0112457275390625,
0.049163818359375,
-0.00980377197265625,
0.0182952880859375,
-0.0198822021484375,
-0.00626373291015625,
0.020050048828125,
0.044647216796875,
-0.0158843994140625,
-0.03631591796875,
0.006427764892578125,
-0.0186767578125,
-0.0111541748046875,
-0.047454833984375,
-0.017181396484375,
0.020263671875,
0.0224609375,
-0.01132965087890625,
-0.0212860107421875,
-0.008544921875,
-0.01251220703125,
0.06536865234375,
-0.0238037109375,
0.0023555755615234375,
-0.00504302978515625,
0.01125335693359375,
-0.035491943359375,
-0.045135498046875,
-0.0404052734375,
0.038848876953125,
-0.045928955078125,
0.016082763671875,
0.034912109375,
-0.0136871337890625,
0.0187835693359375,
0.0186920166015625,
-0.007434844970703125,
0.074462890625,
-0.0562744140625,
-0.0277862548828125,
0.045745849609375,
-0.018798828125,
-0.0094757080078125,
0.01259613037109375,
0.00366973876953125,
-0.01971435546875,
-0.007488250732421875,
-0.0074920654296875,
-0.006671905517578125,
0.00510406494140625,
-0.0323486328125,
-0.0677490234375,
0.001552581787109375,
0.00167083740234375,
-0.0401611328125,
-0.018310546875,
-0.01338958740234375,
-0.0166168212890625,
-0.00949859619140625,
-0.0200347900390625,
0.01312255859375,
-0.017822265625,
0.030975341796875,
-0.02215576171875,
0.04132080078125,
0.0119781494140625,
-0.063232421875,
-0.037384033203125,
-0.0538330078125,
-0.03717041015625,
-0.00926971435546875,
0.0229339599609375,
-0.04730224609375,
0.070068359375,
0.036865234375,
-0.0262908935546875,
0.03460693359375,
0.02301025390625,
-0.048858642578125,
-0.0130157470703125,
-0.034637451171875,
-0.0183868408203125,
-0.02520751953125,
0.06689453125,
0.044708251953125,
0.01299285888671875,
-0.028228759765625,
0.021484375,
0.018341064453125,
0.010162353515625,
0.01409912109375,
-0.00010484457015991211,
-0.0084228515625,
-0.01092529296875,
-0.0236053466796875,
-0.00464630126953125,
0.0003108978271484375,
-0.00733184814453125,
-0.024505615234375,
-0.0126953125,
0.016387939453125,
0.030853271484375,
-0.07318115234375,
-0.036651611328125,
0.08197021484375,
-0.039947509765625,
0.00890350341796875,
0.0014543533325195312,
0.025665283203125,
0.028350830078125,
0.006557464599609375,
0.01078033447265625,
-0.00873565673828125,
-0.0205841064453125,
0.007114410400390625,
0.01079559326171875,
0.006526947021484375,
0.00670623779296875,
-0.031768798828125,
-0.01461029052734375,
0.02008056640625,
-0.0091705322265625,
0.03778076171875,
0.0126190185546875,
0.0316162109375,
-0.00830841064453125,
0.07110595703125,
-0.01995849609375,
0.03985595703125,
-0.027923583984375,
0.0260009765625,
-0.039276123046875,
0.0117034912109375,
-0.00662994384765625,
-0.0149688720703125,
0.0131378173828125,
-0.0087890625,
0.005462646484375,
-0.020416259765625,
-0.0178070068359375,
-0.042388916015625,
-0.012542724609375,
-0.00006854534149169922
] |
b60f4e1e71cbba2c325420514934a38804f5fc5a
|
Wordpress Stackexchange
Q: Displaying wp menus by name without using theme locations I used wp menus in the past but always registering a location and then using:
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
To display a menu on that location on my theme I would first create a menu, and then assign it to that location.
Well now what I would like to do is to create all the menus I want using some standard name like my-menu-1, my-menu-2, my-menu-x. And then I want to display those menus on my theme but without using any location, just printing them using code identifying them by name.
How could I do that?
A: Umm u can do that easily. And this is the way I do
how i register my menu in functions.php
add_action('init', 'register_custom_menu');
function register_custom_menu() {
register_nav_menu('custom_menu', __('Custom Menu'));
}
Then in ur admin panel u create different menu by ur desired name. And get the menu where ever u want like this. EX:- if I made two menu in admin by name "Menu 1" and "Menu 2"
wp_nav_menu(array('menu' => 'Menu 1'));
wp_nav_menu(array('menu' => 'Menu 2'));
|
Q: Displaying wp menus by name without using theme locations I used wp menus in the past but always registering a location and then using:
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
To display a menu on that location on my theme I would first create a menu, and then assign it to that location.
Well now what I would like to do is to create all the menus I want using some standard name like my-menu-1, my-menu-2, my-menu-x. And then I want to display those menus on my theme but without using any location, just printing them using code identifying them by name.
How could I do that?
A: Umm u can do that easily. And this is the way I do
how i register my menu in functions.php
add_action('init', 'register_custom_menu');
function register_custom_menu() {
register_nav_menu('custom_menu', __('Custom Menu'));
}
Then in ur admin panel u create different menu by ur desired name. And get the menu where ever u want like this. EX:- if I made two menu in admin by name "Menu 1" and "Menu 2"
wp_nav_menu(array('menu' => 'Menu 1'));
wp_nav_menu(array('menu' => 'Menu 2'));
|
wordpress
|
{
"language": "en",
"length": 187,
"provenance": "stackexchange_00019.jsonl.gz:419287",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49808"
}
|
[
0.045989990234375,
0.01715087890625,
0.014739990234375,
0.047393798828125,
0.039642333984375,
-0.045745849609375,
0.09161376953125,
-0.07611083984375,
-0.0119781494140625,
0.00909423828125,
-0.02166748046875,
0.01511383056640625,
-0.0338134765625,
-0.0216064453125,
-0.01247406005859375,
-0.0377197265625,
0.0216827392578125,
0.0031948089599609375,
0.01555633544921875,
-0.01256561279296875,
0.01153564453125,
0.00439453125,
0.0032825469970703125,
0.05914306640625,
0.041595458984375,
-0.09423828125,
-0.00036406517028808594,
-0.00395965576171875,
0.010498046875,
-0.006450653076171875,
0.0200042724609375,
0.01473236083984375,
0.009368896484375,
-0.010955810546875,
0.049560546875,
-0.003154754638671875,
-0.0133819580078125,
0.01427459716796875,
0.038909912109375,
-0.0192718505859375,
0.0372314453125,
-0.034393310546875,
0.034912109375,
0.01439666748046875,
0.01397705078125,
-0.03118896484375,
0.036376953125,
-0.05169677734375,
-0.0129241943359375,
-0.043731689453125,
0.026824951171875,
0.0154571533203125,
0.045867919921875,
-0.007106781005859375,
-0.025970458984375,
-0.006366729736328125,
-0.0007572174072265625,
-0.0489501953125,
0.0243682861328125,
0.01418304443359375,
-0.0235137939453125,
-0.0223388671875,
0.027923583984375,
-0.0242919921875,
-0.0005445480346679688,
0.04296875,
0.013763427734375,
0.00023734569549560547,
-0.075439453125,
-0.0019702911376953125,
0.042633056640625,
-0.062744140625,
-0.015960693359375,
0.006122589111328125,
-0.0265350341796875,
-0.03472900390625,
-0.0191650390625,
-0.05816650390625,
0.040863037109375,
0.0137481689453125,
-0.0085906982421875,
-0.0033359527587890625,
-0.03765869140625,
-0.00962066650390625,
0.009735107421875,
0.010498046875,
-0.0185546875,
-0.015899658203125,
-0.00482940673828125,
-0.04156494140625,
-0.0149383544921875,
-0.020111083984375,
-0.0458984375,
0.0247650146484375,
0.01702880859375,
-0.02813720703125,
0.01122283935546875,
0.061431884765625,
-0.0180206298828125,
0.03887939453125,
-0.02166748046875,
-0.04071044921875,
0.0733642578125,
-0.061187744140625,
0.0186614990234375,
0.10107421875,
0.023284912109375,
-0.001495361328125,
0.03680419921875,
-0.008697509765625,
0.02740478515625,
0.02447509765625,
-0.0162353515625,
-0.0312347412109375,
-0.0199432373046875,
0.018524169921875,
-0.02484130859375,
-0.0020904541015625,
0.0165557861328125,
-0.00033783912658691406,
-0.01549530029296875,
0.00616455078125,
0.0207366943359375,
0.0305938720703125,
-0.005138397216796875,
0.03314208984375,
0.016632080078125,
-0.061737060546875,
-0.032440185546875,
0.007213592529296875,
-0.018798828125,
0.0037136077880859375,
0.050872802734375,
0.050628662109375,
0.018218994140625,
-0.0170135498046875,
0.0288848876953125,
-0.00934600830078125,
0.006793975830078125,
0.009368896484375,
0.016510009765625,
-0.003787994384765625,
0.0070343017578125,
-0.006893157958984375,
0.0022525787353515625,
-0.0210418701171875,
0.00704193115234375,
0.033233642578125,
0.00902557373046875,
-0.0050048828125,
0.019805908203125,
-0.00823211669921875,
0.023040771484375,
0.01568603515625,
-0.0174407958984375,
0.00852203369140625,
-0.001155853271484375,
-0.01020050048828125,
-0.0257720947265625,
-0.020782470703125,
-0.024566650390625,
-0.0192718505859375,
0.0010671615600585938,
-0.06524658203125,
-0.0655517578125,
0.0218353271484375,
-0.01169586181640625,
-0.0096893310546875,
0.0172271728515625,
0.00775146484375,
0.00417327880859375,
-0.0197906494140625,
-0.0018014907836914062,
0.0144500732421875,
0.001522064208984375,
0.040802001953125,
0.00431060791015625,
-0.004848480224609375,
-0.00036525726318359375,
0.056884765625,
-0.0079498291015625,
-0.0496826171875,
-0.020721435546875,
-0.0010280609130859375,
-0.086181640625,
0.06787109375,
-0.005096435546875,
0.08831787109375,
0.037384033203125,
0.004138946533203125,
0.05096435546875,
-0.01410675048828125,
-0.023681640625,
-0.0189666748046875,
-0.0108489990234375,
-0.012603759765625,
0.0189971923828125,
0.01092529296875,
0.003108978271484375,
-0.0026493072509765625,
-0.009918212890625,
0.00792694091796875,
0.006710052490234375,
-0.0026340484619140625,
-0.01222991943359375,
0.00489044189453125,
-0.01010894775390625,
0.03546142578125,
0.035125732421875,
0.026702880859375,
-0.01611328125,
0.0198974609375,
0.026214599609375,
-0.127197265625,
-0.07080078125,
0.01267242431640625,
-0.031707763671875,
0.0150299072265625,
-0.0021076202392578125,
0.01137542724609375,
0.00395965576171875,
-0.0183563232421875,
0.0030345916748046875,
0.006748199462890625,
0.027557373046875,
-0.0369873046875,
-0.0134124755859375,
-0.04132080078125,
-0.0083770751953125,
-0.00835418701171875,
-0.042633056640625,
0.062347412109375,
0.0183258056640625,
0.01274871826171875,
-0.0188140869140625,
0.01139068603515625,
0.030364990234375,
-0.042694091796875,
0.004673004150390625,
0.028900146484375,
0.019805908203125,
0.036041259765625,
-0.0035076141357421875,
-0.01355743408203125,
0.0611572265625,
-0.049652099609375,
-0.0111083984375,
0.002227783203125,
-0.0254974365234375,
-0.038116455078125,
0.06280517578125,
-0.0189971923828125,
0.0301666259765625,
-0.01416778564453125,
0.0085296630859375,
0.0224761962890625,
-0.0303955078125,
-0.0021800994873046875,
0.031463623046875,
-0.0009274482727050781,
-0.00711822509765625,
0.01287841796875,
0.017791748046875,
-0.006557464599609375,
-0.00510406494140625,
0.0237884521484375,
-0.00699615478515625,
-0.0177459716796875,
-0.061431884765625,
0.01349639892578125,
0.04339599609375,
0.0213775634765625,
-0.008026123046875,
-0.02276611328125,
0.0077972412109375,
-0.037109375,
-0.020263671875,
0.0164794921875,
-0.00646209716796875,
-0.042572021484375,
-0.032867431640625,
0.01558685302734375,
-0.0254364013671875,
-0.017364501953125,
-0.01715087890625,
-0.06976318359375,
0.003925323486328125,
-0.01042938232421875,
-0.0130615234375,
0.014068603515625,
0.02117919921875,
0.024566650390625,
-0.0234832763671875,
0.036346435546875,
-0.0252532958984375,
0.0008473396301269531,
0.0198516845703125,
0.0288848876953125,
-0.026092529296875,
0.01160430908203125,
0.06304931640625,
0.03314208984375,
0.00669097900390625,
-0.0222625732421875,
-0.0032329559326171875,
-0.0038509368896484375,
0.0180206298828125,
0.0034046173095703125,
-0.0082550048828125,
-0.03167724609375,
-0.007152557373046875,
0.01540374755859375,
0.00815582275390625,
-0.0121917724609375,
-0.0164642333984375,
-0.04119873046875,
-0.0347900390625,
-0.0273590087890625,
-0.07489013671875,
-0.031036376953125,
-0.0026397705078125,
-0.011016845703125,
0.040557861328125,
0.0249786376953125,
0.00576019287109375,
-0.04180908203125,
0.045562744140625,
0.0183258056640625,
0.0302734375,
-0.00942230224609375,
-0.0243377685546875,
-0.0057220458984375,
-0.0538330078125,
-0.00853729248046875,
0.0034198760986328125,
0.002437591552734375,
0.005767822265625,
0.00304412841796875,
0.009979248046875,
-0.03338623046875,
0.045654296875,
0.048858642578125,
-0.0034999847412109375,
0.03521728515625,
0.040618896484375,
-0.04962158203125,
-0.01220703125,
0.0086669921875,
0.033203125,
-0.00037169456481933594,
-0.01096343994140625,
-0.016448974609375,
-0.0024166107177734375,
-0.0215606689453125,
0.0367431640625,
0.006072998046875,
-0.01419830322265625,
0.0291748046875,
0.04522705078125,
-0.030914306640625,
-0.04052734375,
-0.0189971923828125,
-0.05133056640625,
0.0146942138671875,
0.038177490234375,
0.013824462890625,
-0.0240936279296875,
0.00998687744140625,
0.0073394775390625,
-0.00032830238342285156,
0.00865936279296875,
-0.0181732177734375,
0.005084991455078125,
-0.00818634033203125,
0.014434814453125,
-0.003662109375,
0.0243072509765625,
-0.0176239013671875,
0.0004277229309082031,
0.01568603515625,
0.0058746337890625,
-0.00836181640625,
0.010650634765625,
-0.0276641845703125,
-0.06890869140625,
0.04833984375,
-0.0321044921875,
0.033843994140625,
-0.040008544921875,
-0.0286102294921875,
0.00435638427734375,
0.1099853515625,
-0.0260467529296875,
-0.00691986083984375,
0.0092315673828125,
0.01245880126953125,
-0.024871826171875,
-0.042022705078125,
-0.037872314453125,
-0.0196685791015625,
-0.1243896484375,
0.03472900390625,
-0.01172637939453125,
-0.0264129638671875,
-0.00466156005859375,
-0.01525115966796875,
-0.050262451171875,
-0.06329345703125,
0.040069580078125,
-0.0291748046875,
0.023834228515625,
0.0309906005859375,
0.0120086669921875,
-0.0203704833984375,
-0.026580810546875,
-0.0061492919921875,
-0.058441162109375,
-0.01445770263671875,
-0.0230865478515625,
0.06201171875,
0.01071929931640625,
0.00823211669921875,
-0.0037631988525390625,
0.0430908203125,
0.03350830078125,
0.062469482421875,
0.0286102294921875,
0.017822265625,
0.0149078369140625,
-0.04168701171875,
0.02618408203125,
-0.045074462890625,
0.0129547119140625,
-0.00344085693359375,
-0.03375244140625,
0.0129241943359375,
-0.015380859375,
0.03399658203125,
0.021148681640625,
-0.033447265625,
-0.033111572265625,
-0.00919342041015625,
0.0005941390991210938,
-0.0016107559204101562,
0.014862060546875,
-0.017791748046875,
0.002529144287109375,
-0.0341796875,
0.00225067138671875,
-0.0452880859375,
-0.01029205322265625,
0.035125732421875,
0.06707763671875,
0.026458740234375,
0.0014448165893554688,
-0.042877197265625,
0.022491455078125,
0.038543701171875,
-0.00907135009765625,
0.01551055908203125,
0.00799560546875,
-0.0267486572265625,
0.00882720947265625,
0.021759033203125,
0.0011453628540039062,
0.03509521484375,
-0.009674072265625,
0.0167999267578125,
-0.0263824462890625,
0.006793975830078125,
0.010711669921875,
-0.034637451171875,
0.037261962890625,
0.024169921875,
-0.06475830078125,
-0.034454345703125,
0.08026123046875,
0.023773193359375,
-0.005794525146484375,
-0.082275390625,
0.037109375,
-0.026092529296875,
0.040374755859375,
0.050140380859375,
0.0380859375,
0.0019025802612304688,
-0.0206451416015625,
0.031524658203125,
0.004669189453125,
0.0289459228515625,
0.01385498046875,
0.0168609619140625,
0.0276641845703125,
0.0227203369140625,
-0.001201629638671875,
0.01052093505859375,
-0.0025730133056640625,
0.0440673828125,
0.0203857421875,
-0.009185791015625,
-0.0595703125,
0.001140594482421875,
0.044586181640625,
-0.01241302490234375,
-0.0027027130126953125,
0.007770538330078125,
0.00765228271484375,
0.020660400390625,
-0.01239013671875,
0.002353668212890625,
-0.017791748046875,
-0.01297760009765625,
0.0269927978515625,
0.03314208984375,
-0.01010894775390625,
0.004398345947265625,
0.0780029296875,
0.012115478515625,
0.0292510986328125,
-0.0157318115234375,
0.01329803466796875,
-0.0128631591796875,
0.033416748046875,
0.020294189453125,
-0.006580352783203125,
0.0203704833984375,
-0.02130126953125,
0.006572723388671875,
-0.00415802001953125,
-0.0015153884887695312,
0.01959228515625,
0.01055145263671875,
0.00852203369140625,
0.0035839080810546875,
0.0004730224609375,
-0.005886077880859375,
0.0012416839599609375,
0.054962158203125,
-0.0626220703125,
-0.07794189453125,
-0.050750732421875,
-0.007106781005859375,
0.06207275390625,
-0.0634765625,
0.005924224853515625,
-0.00968170166015625,
0.0167236328125,
0.00514984130859375,
0.0019397735595703125,
-0.022216796875,
0.004207611083984375,
0.018035888671875,
-0.03369140625,
-0.0030879974365234375,
0.0238800048828125,
-0.0626220703125,
-0.03179931640625,
-0.0189971923828125,
-0.0263824462890625,
0.053802490234375,
-0.06524658203125,
0.007411956787109375,
-0.0203094482421875,
0.018218994140625,
-0.05560302734375,
0.0128326416015625,
0.06365966796875,
0.06488037109375,
-0.0772705078125,
0.03338623046875,
-0.046295166015625,
0.00853729248046875,
-0.00701141357421875,
-0.04425048828125,
-0.032318115234375,
-0.032501220703125,
-0.0026340484619140625,
0.0023136138916015625,
0.0132293701171875,
-0.004528045654296875,
-0.0235443115234375,
-0.0005955696105957031,
0.0016088485717773438,
-0.0228271484375,
-0.0172576904296875,
0.03631591796875,
0.01465606689453125,
0.016937255859375,
0.007965087890625,
0.0057373046875,
-0.0034236907958984375,
-0.01128387451171875,
0.022186279296875,
-0.038116455078125,
-0.037384033203125,
-0.0284423828125,
-0.02386474609375,
0.032623291015625,
0.060791015625,
-0.01033782958984375,
0.040496826171875,
-0.003570556640625,
0.01346588134765625,
-0.01430511474609375,
-0.03594970703125,
-0.0474853515625,
-0.0005469322204589844,
0.04425048828125,
-0.0185089111328125,
-0.005870819091796875,
0.01328277587890625,
0.031707763671875,
0.0007319450378417969,
-0.0224609375,
0.0023593902587890625,
-0.00801849365234375,
-0.056243896484375,
0.06219482421875,
0.093505859375,
0.0252838134765625,
0.05078125,
0.0027942657470703125,
0.00506591796875,
0.000030159950256347656,
-0.004192352294921875,
-0.01371002197265625,
0.049285888671875,
0.0821533203125,
0.0096282958984375,
-0.0025272369384765625,
0.050933837890625,
-0.036834716796875,
-0.00020694732666015625,
0.05255126953125,
0.053192138671875,
-0.0767822265625,
0.02008056640625,
0.025665283203125,
0.0204010009765625,
0.020172119140625,
0.01308441162109375,
-0.043182373046875,
-0.039276123046875,
0.0011644363403320312,
-0.0270233154296875,
-0.0247955322265625,
-0.006435394287109375,
0.0241851806640625,
-0.002094268798828125,
-0.00811767578125,
0.0285797119140625,
0.0029697418212890625,
0.0012197494506835938,
-0.030609130859375,
0.00043129920959472656,
-0.0036029815673828125,
-0.0291290283203125,
0.004756927490234375,
0.005695343017578125,
-0.027435302734375,
-0.03411865234375,
0.040618896484375,
-0.0236968994140625,
0.028411865234375,
-0.0007271766662597656,
0.0230712890625,
0.0102691650390625,
0.047210693359375,
-0.0178985595703125,
0.0150604248046875,
0.005962371826171875,
0.0124359130859375,
-0.0079803466796875,
-0.01180267333984375,
0.020721435546875,
-0.007625579833984375,
-0.034210205078125,
0.0167999267578125,
-0.0253448486328125,
-0.0189208984375,
-0.012908935546875,
-0.0037670135498046875,
0.103271484375,
-0.017578125,
-0.04107666015625,
-0.01029205322265625,
-0.01873779296875,
0.00984954833984375,
0.021331787109375,
0.0304718017578125,
-0.034912109375,
-0.0248870849609375,
0.02655029296875,
-0.01317596435546875,
0.00437164306640625,
0.03143310546875,
-0.0037555694580078125,
0.08404541015625,
-0.033660888671875,
-0.033843994140625,
0.0309906005859375,
0.055145263671875,
-0.0119781494140625,
0.047119140625,
-0.0426025390625,
0.057098388671875,
0.038360595703125,
0.025482177734375,
-0.04681396484375,
0.0015306472778320312,
-0.0016613006591796875,
0.0188140869140625,
0.007289886474609375,
0.003078460693359375,
-0.0049591064453125,
0.0177001953125,
0.04437255859375,
0.045654296875,
0.01678466796875,
0.003482818603515625,
-0.01113128662109375,
-0.017669677734375,
0.0019626617431640625,
-0.01413726806640625,
0.01611328125,
-0.004932403564453125,
-0.0369873046875,
-0.001232147216796875,
0.014862060546875,
0.02099609375,
-0.01311492919921875,
-0.019439697265625,
-0.047119140625,
-0.00939178466796875,
0.00962066650390625,
0.007083892822265625,
-0.0209197998046875,
0.0219879150390625,
0.001567840576171875,
-0.0086517333984375,
-0.005046844482421875,
-0.027923583984375,
0.0261383056640625,
0.020782470703125,
-0.01364898681640625,
0.03173828125,
0.0277099609375,
-0.00795745849609375,
-0.00441741943359375,
-0.0027790069580078125,
0.0298309326171875,
-0.03265380859375,
0.047332763671875,
0.037567138671875,
0.050201416015625,
-0.030975341796875,
-0.0748291015625,
0.06103515625,
0.07373046875,
-0.01134490966796875,
-0.033111572265625,
0.00914764404296875,
0.0167999267578125,
0.0113525390625,
0.01216888427734375,
0.042510986328125,
-0.0034332275390625,
0.01441192626953125,
0.00411224365234375,
-0.007080078125,
0.021820068359375,
0.006679534912109375,
0.005817413330078125,
0.040740966796875,
0.0024013519287109375,
0.011993408203125,
-0.0604248046875,
0.0673828125,
0.038177490234375,
0.0506591796875,
-0.0223846435546875,
0.06756591796875,
-0.00508880615234375,
-0.01326751708984375,
-0.0230255126953125,
0.0340576171875,
-0.0006422996520996094,
0.026947021484375,
-0.05267333984375,
-0.016510009765625,
0.00119781494140625,
0.032867431640625,
0.037689208984375,
0.01666259765625,
0.06353759765625,
0.023223876953125,
-0.02996826171875,
0.00450897216796875,
0.0343017578125,
-0.022918701171875,
-0.0263824462890625,
-0.039703369140625,
-0.02264404296875,
0.00615692138671875,
-0.003360748291015625,
0.0252838134765625,
-0.0206451416015625,
0.0242156982421875,
-0.0214691162109375,
0.020782470703125,
-0.00937652587890625,
-0.0099029541015625,
-0.005878448486328125,
-0.0258636474609375,
0.0070343017578125,
0.006488800048828125,
-0.12457275390625,
-0.045135498046875,
-0.032318115234375,
0.005428314208984375,
0.05450439453125,
0.05218505859375,
0.01026153564453125,
0.005413055419921875,
0.0305023193359375,
-0.004199981689453125,
0.0052642822265625,
-0.0055389404296875,
0.0103607177734375,
0.0263519287109375,
0.020355224609375,
0.0252685546875,
-0.045806884765625,
-0.02252197265625,
-0.005664825439453125,
0.01445770263671875,
0.0259857177734375,
0.01922607421875,
0.01861572265625,
0.0135955810546875,
-0.039215087890625,
0.0289154052734375,
-0.03765869140625,
-0.037017822265625,
-0.0016956329345703125,
0.0033092498779296875,
0.01393890380859375,
-0.002567291259765625,
-0.02001953125,
0.0384521484375,
0.05682373046875,
-0.046661376953125,
0.01470184326171875,
0.0286102294921875,
-0.00020682811737060547,
-0.04949951171875,
0.0209197998046875,
-0.006626129150390625,
-0.044708251953125,
-0.03302001953125,
0.0101776123046875,
0.025238037109375,
0.0703125,
-0.0154266357421875,
0.00829315185546875,
0.0017547607421875,
-0.058868408203125,
0.0350341796875,
-0.04290771484375,
0.047607421875,
0.04022216796875,
0.039642333984375,
-0.0176544189453125,
-0.0247039794921875,
-0.0239715576171875,
-0.0005292892456054688,
0.002010345458984375,
-0.0015773773193359375,
-0.020660400390625,
0.00885009765625,
0.04046630859375,
0.0177154541015625,
0.04730224609375,
-0.02056884765625,
0.0160980224609375,
0.0207672119140625,
0.01238250732421875,
-0.0028362274169921875,
-0.056427001953125,
-0.035003662109375,
-0.08111572265625,
0.021881103515625,
0.0528564453125,
-0.048553466796875,
0.023712158203125,
-0.0828857421875,
0.01024627685546875,
0.05548095703125,
-0.005939483642578125,
-0.0177459716796875,
0.0009946823120117188,
-0.035552978515625,
0.049591064453125,
-0.018157958984375,
-0.003284454345703125,
0.0025806427001953125,
0.00881195068359375,
-0.0072174072265625,
0.011688232421875,
-0.01178741455078125,
0.0253143310546875,
0.0094451904296875,
-0.014495849609375,
0.005123138427734375,
-0.007099151611328125,
-0.014434814453125,
-0.01256561279296875,
0.0025463104248046875,
0.033782958984375,
0.0171356201171875,
-0.035430908203125,
-0.0274200439453125,
0.0072479248046875,
-0.00653839111328125,
0.0051116943359375,
0.0239105224609375,
-0.0254364013671875,
-0.039825439453125,
0.00951385498046875,
-0.00949859619140625,
0.00908660888671875,
-0.043548583984375,
-0.08502197265625,
0.03179931640625,
-0.0012121200561523438,
-0.047515869140625,
-0.0188751220703125,
-0.0099945068359375,
-0.0212554931640625,
0.0130157470703125,
-0.0116424560546875,
-0.0291595458984375,
-0.0040740966796875,
0.042724609375,
0.0031299591064453125,
0.066162109375,
-0.027374267578125,
0.00023758411407470703,
-0.035247802734375,
0.0208892822265625,
0.01229095458984375,
0.01042938232421875,
0.03900146484375,
-0.007793426513671875,
0.022552490234375,
0.04827880859375,
-0.03887939453125,
-0.0176849365234375,
-0.03277587890625,
-0.042877197265625,
-0.023651123046875,
-0.040252685546875,
-0.0225067138671875,
-0.028839111328125,
0.056488037109375,
0.040924072265625,
0.013671875,
-0.0157928466796875,
-0.007541656494140625,
-0.0283355712890625,
0.0029449462890625,
-0.0037841796875,
0.0023746490478515625,
-0.04742431640625,
-0.00909423828125,
0.01617431640625,
-0.03387451171875,
-0.04412841796875,
0.0196075439453125,
-0.0677490234375,
-0.00591278076171875,
-0.0269317626953125,
0.00045180320739746094,
-0.034271240234375,
-0.05633544921875,
0.044464111328125,
-0.03204345703125,
-0.0136871337890625,
-0.01482391357421875,
0.052886962890625,
-0.0090484619140625,
-0.005157470703125,
0.01554107666015625,
0.00251007080078125,
-0.042694091796875,
-0.006473541259765625,
-0.006107330322265625,
0.04461669921875,
-0.029937744140625,
-0.029449462890625,
-0.022186279296875,
0.031768798828125,
0.022247314453125,
0.05029296875,
-0.03753662109375,
0.04718017578125,
0.0305938720703125,
-0.0001310110092163086,
0.01812744140625,
0.067626953125,
0.01027679443359375,
0.06732177734375,
0.0022220611572265625,
-0.045989990234375,
0.017486572265625,
-0.057220458984375,
-0.0012292861938476562,
-0.0223388671875,
0.01213836669921875,
-0.04583740234375,
0.016357421875,
-0.0034008026123046875,
-0.00007349252700805664,
0.027435302734375
] |
fd28bcd0e119145abe8e1a48cc2dc35f9a54f82f
|
Wordpress Stackexchange
Q: One site, 2 distinct sections: two different top nav menus? I have a site that is in two distinct halves. I'd like the same template to apply to the whole site (from a look & feel perspective), but for each 'half' of the site to have its own top nav menu. No side menus are in use.
The home page is going to be a custom page that directs the user to one or other of the two sides.
How might I go about achieving this?
Many thanks
Austen
A: The easiest solution would be to set a cookie. Then check what cookie the user have before you print the menu.
Another solution would be to add a query variable so that the two halves have different urls, for example mysite.com/?half=A and mysite.com/?half=B. Then you check the query var before you print the menu. This solution would make it possible with permalinks for the two different halves. (and you can make the urls pretty if you want)
|
Q: One site, 2 distinct sections: two different top nav menus? I have a site that is in two distinct halves. I'd like the same template to apply to the whole site (from a look & feel perspective), but for each 'half' of the site to have its own top nav menu. No side menus are in use.
The home page is going to be a custom page that directs the user to one or other of the two sides.
How might I go about achieving this?
Many thanks
Austen
A: The easiest solution would be to set a cookie. Then check what cookie the user have before you print the menu.
Another solution would be to add a query variable so that the two halves have different urls, for example mysite.com/?half=A and mysite.com/?half=B. Then you check the query var before you print the menu. This solution would make it possible with permalinks for the two different halves. (and you can make the urls pretty if you want)
A: Use a custom menu with wp_nav_menu(). Then check whether you're on part one or part two:
if ( ! is_home() || is_front_page() )
{
$args = array(); // Define your menu here
$query_string = explode( '/', $_SERVER['REQUEST_URI'] );
// You need to var_dump( $query_string );
// to see which index/key is matching your requested query string part
if ( 'PART_ONE' === $query_string[0] )
{
wp_nav_menu( array_merge( $args, array( 'menu' => 'MENU PART ONE' ) ) );
}
else
{
wp_nav_menu( array_merge( $args, array( 'menu' => 'MENU PART TWO' ) ) );
}
}
A: I believe the simplest solution would be to create two nav menus in the Wordpress backend, then load different headers based upon the page the visitor is on.
Start by copying your header.php 2 times, giving your three header files. Example: header.php, headerA.php, headerB.php
Now, open you original header.php and replace all the code with something like this:
<?php
if (is_page('contact')){
<?php include(TEMPLATEPATH.'/headerA.php'); ?>
}
elseif (is_page('gallery')){
<?php include(TEMPLATEPATH.'/headerB.php'); ?>
}
else {
<?php include(TEMPLATEPATH.'/headerA.php'); ?>
}
?>
This will tell Wordress which header to load, based on the type of page the visitor is on.
Also, make sure you load the correct menu in each header file using:
<?php wp_nav_menu( array('menu' => 'Menu A )); ?>
|
wordpress
|
{
"language": "en",
"length": 380,
"provenance": "stackexchange_00019.jsonl.gz:419292",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49823"
}
|
[
0.034088134765625,
-0.0126953125,
0.02081298828125,
0.02703857421875,
-0.01099395751953125,
-0.01404571533203125,
0.0633544921875,
-0.05413818359375,
-0.0418701171875,
-0.00299072265625,
-0.0209503173828125,
0.038818359375,
-0.053741455078125,
-0.02911376953125,
0.04974365234375,
-0.0301513671875,
0.0386962890625,
-0.003971099853515625,
0.0054473876953125,
-0.01433563232421875,
-0.0281829833984375,
0.0176849365234375,
0.0032863616943359375,
0.11126708984375,
0.040802001953125,
-0.037811279296875,
0.005428314208984375,
0.024932861328125,
0.0008478164672851562,
0.00502777099609375,
0.0194549560546875,
-0.0179595947265625,
-0.015899658203125,
-0.0016889572143554688,
0.043792724609375,
-0.01371002197265625,
0.01397705078125,
0.0078277587890625,
0.027313232421875,
0.0242156982421875,
0.0092315673828125,
-0.01052093505859375,
0.0231170654296875,
0.0750732421875,
-0.009735107421875,
-0.0408935546875,
0.01459503173828125,
-0.06610107421875,
-0.00698089599609375,
0.01161956787109375,
0.0198822021484375,
-0.02130126953125,
0.01470184326171875,
-0.0252838134765625,
-0.0200958251953125,
-0.0127105712890625,
0.05157470703125,
-0.07550048828125,
0.042327880859375,
-0.028076171875,
-0.03900146484375,
-0.0325927734375,
0.041778564453125,
-0.0249481201171875,
-0.03851318359375,
-0.00934600830078125,
-0.01898193359375,
0.0147705078125,
-0.0377197265625,
-0.040252685546875,
0.0433349609375,
-0.0224151611328125,
0.0158843994140625,
-0.0215606689453125,
-0.0445556640625,
-0.0010433197021484375,
0.01296234130859375,
-0.01432037353515625,
0.01117706298828125,
-0.0269317626953125,
-0.049285888671875,
0.02777099609375,
-0.052978515625,
-0.058746337890625,
0.00832366943359375,
-0.038177490234375,
-0.02655029296875,
0.00988006591796875,
-0.0163726806640625,
0.0276336669921875,
-0.01226043701171875,
0.00543212890625,
-0.05145263671875,
0.051666259765625,
0.020355224609375,
0.00494384765625,
0.00934600830078125,
0.0789794921875,
-0.03399658203125,
0.0228271484375,
-0.0166778564453125,
-0.0260009765625,
0.03485107421875,
-0.057830810546875,
0.0169677734375,
0.021270751953125,
0.0264129638671875,
0.0282440185546875,
0.06500244140625,
0.012939453125,
-0.0029926300048828125,
0.10400390625,
-0.0018329620361328125,
-0.02276611328125,
-0.016357421875,
-0.00855255126953125,
-0.036468505859375,
0.001811981201171875,
0.00620269775390625,
-0.0347900390625,
-0.011871337890625,
0.016387939453125,
0.0283203125,
0.0303497314453125,
-0.01015472412109375,
0.0174713134765625,
0.00560760498046875,
-0.06781005859375,
-0.038238525390625,
0.0156097412109375,
-0.014801025390625,
0.003620147705078125,
0.04400634765625,
0.0738525390625,
0.020782470703125,
-0.01000213623046875,
0.032318115234375,
-0.00962066650390625,
0.01107025146484375,
-0.007144927978515625,
0.0216827392578125,
0.0059051513671875,
0.0027408599853515625,
-0.00704193115234375,
-0.04705810546875,
0.01202392578125,
0.0297088623046875,
0.020355224609375,
-0.0161285400390625,
-0.0518798828125,
-0.01155853271484375,
0.00998687744140625,
0.024322509765625,
-0.018951416015625,
-0.01021575927734375,
-0.039398193359375,
-0.0271453857421875,
-0.0195465087890625,
0.027191162109375,
-0.00223541259765625,
-0.0253448486328125,
0.01739501953125,
0.049072265625,
-0.05419921875,
-0.035247802734375,
-0.0372314453125,
-0.03997802734375,
0.0031452178955078125,
0.0111083984375,
-0.02392578125,
-0.00775146484375,
-0.031768798828125,
0.0238189697265625,
0.006954193115234375,
0.0033168792724609375,
0.041748046875,
0.0230865478515625,
-0.013824462890625,
-0.021240234375,
0.059906005859375,
0.01218414306640625,
-0.05035400390625,
-0.021575927734375,
0.0017881393432617188,
-0.066162109375,
0.060516357421875,
-0.0064697265625,
0.06512451171875,
0.0178375244140625,
0.0032825469970703125,
0.0262908935546875,
0.0068817138671875,
-0.0120697021484375,
0.01837158203125,
0.00574493408203125,
-0.035675048828125,
-0.0116119384765625,
-0.0132598876953125,
-0.00728607177734375,
0.002552032470703125,
-0.0288238525390625,
0.06414794921875,
-0.036956787109375,
0.03765869140625,
0.00359344482421875,
0.0296173095703125,
-0.0032405853271484375,
0.034454345703125,
-0.011199951171875,
0.040374755859375,
0.0162811279296875,
0.029571533203125,
-0.021087646484375,
-0.05242919921875,
-0.003803253173828125,
0.01139068603515625,
-0.0179290771484375,
-0.0059967041015625,
0.00589752197265625,
-0.00939178466796875,
0.022064208984375,
0.019927978515625,
-0.002376556396484375,
0.004451751708984375,
0.05645751953125,
-0.01116180419921875,
-0.016143798828125,
-0.033172607421875,
0.00907135009765625,
0.0246734619140625,
-0.10400390625,
0.03839111328125,
0.035247802734375,
0.0345458984375,
-0.01508331298828125,
0.047637939453125,
0.0401611328125,
0.034759521484375,
-0.028717041015625,
-0.0034542083740234375,
0.023345947265625,
0.0237274169921875,
0.003993988037109375,
0.0180816650390625,
0.033355712890625,
-0.0292510986328125,
0.0012836456298828125,
0.01157379150390625,
-0.011932373046875,
-0.006252288818359375,
0.0457763671875,
-0.0165252685546875,
0.043304443359375,
-0.06597900390625,
0.01255035400390625,
0.036285400390625,
-0.01361083984375,
-0.0039005279541015625,
0.0294647216796875,
-0.012176513671875,
0.005504608154296875,
0.04107666015625,
-0.00608062744140625,
0.0168914794921875,
0.01849365234375,
-0.0166473388671875,
0.039581298828125,
0.03277587890625,
-0.0109100341796875,
-0.0278167724609375,
0.00012934207916259766,
0.02520751953125,
-0.01096343994140625,
0.00989532470703125,
0.05523681640625,
-0.02801513671875,
-0.02508544921875,
-0.006046295166015625,
0.004047393798828125,
0.0013723373413085938,
-0.00946044921875,
0.0222320556640625,
-0.033111572265625,
-0.024932861328125,
0.01007080078125,
-0.0310821533203125,
-0.03338623046875,
-0.00638580322265625,
0.021636962890625,
-0.002079010009765625,
0.033905029296875,
-0.01187896728515625,
-0.013275146484375,
0.0093231201171875,
-0.0095367431640625,
-0.03857421875,
0.031341552734375,
-0.0138702392578125,
0.0241851806640625,
-0.0184783935546875,
0.066162109375,
0.053680419921875,
-0.0162200927734375,
0.01329803466796875,
-0.01102447509765625,
0.0152740478515625,
0.0016717910766601562,
0.0130767822265625,
0.005657196044921875,
-0.02203369140625,
-0.0146942138671875,
-0.0025081634521484375,
0.022064208984375,
0.00420379638671875,
0.031341552734375,
-0.0072479248046875,
0.0053863525390625,
0.02044677734375,
-0.017333984375,
-0.026580810546875,
0.0125732421875,
-0.027191162109375,
0.0740966796875,
0.003475189208984375,
0.01096343994140625,
-0.053436279296875,
0.041351318359375,
0.020294189453125,
-0.004123687744140625,
-0.040924072265625,
-0.050994873046875,
-0.060638427734375,
-0.06842041015625,
0.00308990478515625,
-0.005184173583984375,
0.0128326416015625,
0.0016965866088867188,
-0.0438232421875,
-0.02081298828125,
-0.01265716552734375,
-0.00896453857421875,
0.05621337890625,
0.0176239013671875,
-0.035858154296875,
-0.0113067626953125,
-0.0017824172973632812,
-0.0110626220703125,
0.0188751220703125,
0.003841400146484375,
-0.0150146484375,
0.002288818359375,
-0.025909423828125,
-0.007732391357421875,
0.02105712890625,
0.01007843017578125,
-0.00765228271484375,
0.01038360595703125,
0.0487060546875,
0.0086212158203125,
-0.01812744140625,
-0.04046630859375,
-0.0253448486328125,
-0.073974609375,
-0.0240325927734375,
0.07220458984375,
0.005451202392578125,
-0.044952392578125,
-0.0167999267578125,
0.02203369140625,
-0.039337158203125,
0.0214691162109375,
-0.017547607421875,
0.036041259765625,
0.00698089599609375,
0.0186767578125,
-0.03662109375,
0.0189361572265625,
-0.02203369140625,
-0.023345947265625,
-0.01513671875,
-0.0171051025390625,
-0.032012939453125,
0.0269012451171875,
-0.02490234375,
-0.035125732421875,
0.05987548828125,
0.0246124267578125,
0.0176849365234375,
0.008270263671875,
-0.04254150390625,
0.023834228515625,
0.09747314453125,
-0.044769287109375,
-0.00978851318359375,
0.0022296905517578125,
0.00670623779296875,
0.01186370849609375,
-0.035980224609375,
-0.0323486328125,
-0.0419921875,
-0.088134765625,
0.0300750732421875,
0.01428985595703125,
-0.025665283203125,
-0.0267791748046875,
-0.0294647216796875,
-0.061248779296875,
-0.04205322265625,
0.0276336669921875,
-0.037017822265625,
-0.01392364501953125,
0.003192901611328125,
-0.0362548828125,
-0.020233154296875,
-0.01947021484375,
-0.032073974609375,
0.04193115234375,
-0.00823211669921875,
-0.004459381103515625,
-0.021881103515625,
0.01229095458984375,
-0.01070404052734375,
0.0115966796875,
0.0175933837890625,
-0.0184783935546875,
0.037353515625,
0.0022296905517578125,
0.03741455078125,
0.0171966552734375,
-0.01132965087890625,
-0.0015592575073242188,
-0.037811279296875,
0.0164337158203125,
-0.0166473388671875,
-0.01419830322265625,
-0.0205535888671875,
-0.043365478515625,
0.0147705078125,
-0.00699615478515625,
-0.0222015380859375,
-0.07171630859375,
-0.03521728515625,
-0.0081024169921875,
-0.01190948486328125,
0.034088134765625,
-0.043487548828125,
-0.017333984375,
-0.050628662109375,
-0.0089111328125,
-0.00739288330078125,
-0.00977325439453125,
0.0267333984375,
-0.0064849853515625,
0.005756378173828125,
-0.020172119140625,
-0.01190948486328125,
-0.0007777214050292969,
0.0293426513671875,
0.01519012451171875,
0.0163726806640625,
0.01509857177734375,
-0.01409912109375,
-0.0009207725524902344,
0.009368896484375,
0.011383056640625,
0.0100860595703125,
0.0172576904296875,
0.0099639892578125,
0.0013494491577148438,
-0.0017671585083007812,
0.0189208984375,
-0.0237884521484375,
0.016754150390625,
-0.03424072265625,
0.0140380859375,
-0.05682373046875,
0.0282745361328125,
0.03369140625,
-0.031829833984375,
-0.06732177734375,
0.006866455078125,
-0.02142333984375,
0.051666259765625,
0.0970458984375,
0.0229034423828125,
0.0076751708984375,
0.01611328125,
0.055877685546875,
-0.0030002593994140625,
-0.02215576171875,
0.0276031494140625,
-0.0126495361328125,
0.0224761962890625,
0.0015430450439453125,
-0.0207672119140625,
-0.0308380126953125,
-0.0154571533203125,
0.06280517578125,
0.01551055908203125,
-0.03466796875,
0.012969970703125,
-0.020538330078125,
-0.02044677734375,
-0.002101898193359375,
-0.00872039794921875,
-0.002590179443359375,
-0.012359619140625,
-0.01256561279296875,
0.0248260498046875,
0.019805908203125,
-0.039703369140625,
-0.01654052734375,
-0.0029277801513671875,
0.00882720947265625,
-0.007503509521484375,
0.03216552734375,
0.021240234375,
0.01004791259765625,
0.0084991455078125,
-0.0242462158203125,
-0.0273590087890625,
-0.0193328857421875,
0.0285797119140625,
0.005031585693359375,
0.0294647216796875,
-0.0026531219482421875,
0.0036563873291015625,
0.06707763671875,
-0.01428985595703125,
0.00707244873046875,
0.01212310791015625,
0.044708251953125,
0.027923583984375,
0.0005664825439453125,
-0.0259552001953125,
-0.050872802734375,
0.0127716064453125,
0.0027179718017578125,
-0.041778564453125,
-0.04327392578125,
-0.0186920166015625,
0.01427459716796875,
0.0202178955078125,
-0.0218505859375,
-0.005634307861328125,
-0.0013742446899414062,
-0.031097412109375,
-0.01447296142578125,
0.0225830078125,
-0.043670654296875,
0.0014019012451171875,
0.003353118896484375,
0.00435638427734375,
0.0030879974365234375,
-0.0005211830139160156,
-0.1029052734375,
-0.0296173095703125,
-0.0225067138671875,
0.0121612548828125,
0.06671142578125,
-0.03399658203125,
0.0023193359375,
-0.0360107421875,
0.025848388671875,
-0.0283660888671875,
-0.001583099365234375,
0.0634765625,
0.023529052734375,
-0.0762939453125,
0.0231170654296875,
-0.0777587890625,
0.0014886856079101562,
-0.040496826171875,
-0.07818603515625,
-0.03973388671875,
-0.02532958984375,
0.028564453125,
0.005535125732421875,
0.00412750244140625,
-0.03692626953125,
-0.01287841796875,
0.0152587890625,
0.0299835205078125,
-0.022064208984375,
-0.0211181640625,
0.0643310546875,
-0.014923095703125,
0.0653076171875,
0.0037631988525390625,
0.0255126953125,
-0.0209503173828125,
-0.0276947021484375,
-0.019500732421875,
-0.00951385498046875,
-0.0015668869018554688,
0.00024080276489257812,
0.0209197998046875,
0.0477294921875,
0.077880859375,
0.0117950439453125,
0.02667236328125,
-0.02288818359375,
0.00899505615234375,
-0.0222320556640625,
-0.0162811279296875,
-0.0465087890625,
-0.00446319580078125,
0.0030517578125,
0.00017058849334716797,
0.045013427734375,
0.016998291015625,
-0.043212890625,
0.0380859375,
0.0022411346435546875,
0.06304931640625,
-0.0078277587890625,
-0.026336669921875,
0.0164031982421875,
0.06524658203125,
-0.0008521080017089844,
0.056488037109375,
0.01186370849609375,
0.0229644775390625,
0.050018310546875,
-0.0217437744140625,
0.002262115478515625,
0.031524658203125,
0.0142669677734375,
-0.038330078125,
0.015228271484375,
-0.0021724700927734375,
-0.00592803955078125,
-0.01172637939453125,
0.0518798828125,
0.05792236328125,
-0.0933837890625,
0.018463134765625,
0.02276611328125,
0.00862884521484375,
-0.028564453125,
0.025421142578125,
-0.002300262451171875,
-0.015411376953125,
-0.01367950439453125,
0.0185699462890625,
-0.006343841552734375,
0.01308441162109375,
0.016754150390625,
-0.0009603500366210938,
-0.020751953125,
-0.002719879150390625,
0.005046844482421875,
0.0022716522216796875,
-0.007274627685546875,
-0.01367950439453125,
0.0259552001953125,
0.0013446807861328125,
-0.018157958984375,
0.0167388916015625,
-0.04534912109375,
-0.033721923828125,
0.023406982421875,
-0.039947509765625,
0.00977325439453125,
0.027740478515625,
0.0154266357421875,
-0.0087432861328125,
0.020355224609375,
-0.016448974609375,
0.0115203857421875,
-0.03570556640625,
0.00984954833984375,
0.03582763671875,
0.00873565673828125,
0.012847900390625,
-0.046417236328125,
-0.01389312744140625,
-0.01148223876953125,
-0.038909912109375,
-0.006923675537109375,
-0.01018524169921875,
-0.00325775146484375,
0.09326171875,
-0.03863525390625,
-0.023040771484375,
0.0204315185546875,
-0.004680633544921875,
-0.0188140869140625,
-0.00513458251953125,
0.03094482421875,
-0.0782470703125,
-0.05523681640625,
0.01491546630859375,
-0.041900634765625,
-0.01041412353515625,
-0.0177459716796875,
-0.07794189453125,
0.08367919921875,
0.00385284423828125,
0.04376220703125,
0.0238800048828125,
0.028961181640625,
-0.0231781005859375,
-0.00815582275390625,
-0.029693603515625,
0.09295654296875,
0.0299530029296875,
0.010986328125,
-0.010406494140625,
0.01071929931640625,
0.019439697265625,
-0.01511383056640625,
-0.006317138671875,
0.00940704345703125,
-0.01288604736328125,
0.0229644775390625,
0.040679931640625,
-0.020751953125,
-0.029754638671875,
0.04754638671875,
-0.0260467529296875,
-0.00794219970703125,
0.002475738525390625,
-0.01513671875,
0.01873779296875,
0.007335662841796875,
-0.056427001953125,
-0.022857666015625,
0.0062713623046875,
-0.009674072265625,
0.0167083740234375,
0.00971221923828125,
-0.050384521484375,
0.0173187255859375,
0.034423828125,
-0.0201568603515625,
-0.0029125213623046875,
0.006122589111328125,
-0.00879669189453125,
-0.017852783203125,
0.0028362274169921875,
-0.0305938720703125,
0.0169830322265625,
0.0058441162109375,
-0.017425537109375,
0.04425048828125,
0.03350830078125,
-0.0028533935546875,
-0.01163482666015625,
-0.007904052734375,
0.0175323486328125,
-0.01360321044921875,
0.041046142578125,
0.041595458984375,
0.052978515625,
-0.0374755859375,
-0.0589599609375,
0.050537109375,
0.09765625,
-0.0251617431640625,
-0.0239105224609375,
0.0014696121215820312,
0.00807952880859375,
0.019561767578125,
0.007221221923828125,
0.04913330078125,
0.045074462890625,
0.0323486328125,
-0.0013132095336914062,
0.0104827880859375,
0.00860595703125,
-0.0094146728515625,
0.005939483642578125,
0.056121826171875,
-0.006866455078125,
0.04156494140625,
-0.0693359375,
0.0298919677734375,
-0.0103607177734375,
0.05609130859375,
0.034576416015625,
0.04541015625,
-0.0012836456298828125,
-0.019195556640625,
0.00244140625,
0.04022216796875,
-0.0174407958984375,
-0.01406097412109375,
-0.028778076171875,
-0.0811767578125,
0.01317596435546875,
0.034912109375,
0.0182647705078125,
0.008697509765625,
0.033477783203125,
0.0059661865234375,
-0.0166015625,
-0.006839752197265625,
0.01111602783203125,
-0.027587890625,
0.0292510986328125,
-0.00839996337890625,
-0.0071563720703125,
0.0025691986083984375,
-0.0214080810546875,
-0.0274810791015625,
0.0015153884887695312,
0.037750244140625,
-0.0079498291015625,
0.0159454345703125,
0.00354766845703125,
-0.041229248046875,
-0.028167724609375,
0.0172882080078125,
0.0347900390625,
0.037200927734375,
-0.08056640625,
-0.0144805908203125,
-0.040008544921875,
-0.059173583984375,
0.043792724609375,
0.052337646484375,
0.006679534912109375,
-0.007598876953125,
0.047698974609375,
-0.019805908203125,
0.01971435546875,
-0.03759765625,
0.040069580078125,
0.0297698974609375,
-0.004993438720703125,
0.029693603515625,
-0.085693359375,
-0.050689697265625,
-0.04693603515625,
0.037200927734375,
0.039215087890625,
0.032928466796875,
0.0239715576171875,
0.0307769775390625,
-0.0025463104248046875,
0.033233642578125,
-0.03338623046875,
-0.0275726318359375,
0.06182861328125,
-0.01654052734375,
-0.00391387939453125,
-0.01543426513671875,
-0.03460693359375,
-0.010589599609375,
0.043792724609375,
-0.027618408203125,
0.0171356201171875,
-0.0203704833984375,
0.0080108642578125,
-0.046539306640625,
0.0286407470703125,
-0.0216522216796875,
-0.05169677734375,
-0.026763916015625,
0.005645751953125,
0.0179443359375,
0.058502197265625,
0.00711822509765625,
0.0294036865234375,
0.0209808349609375,
-0.0115203857421875,
0.042144775390625,
-0.031036376953125,
0.0640869140625,
0.049468994140625,
-0.005039215087890625,
0.026214599609375,
-0.0027904510498046875,
-0.02203369140625,
0.018096923828125,
0.003009796142578125,
-0.011993408203125,
0.004222869873046875,
-0.0313720703125,
0.0823974609375,
0.032440185546875,
0.052520751953125,
-0.03021240234375,
-0.005939483642578125,
0.06646728515625,
0.01300048828125,
0.00287628173828125,
-0.0214080810546875,
-0.021148681640625,
-0.0183258056640625,
0.01837158203125,
0.03271484375,
0.02886962890625,
0.02264404296875,
-0.03094482421875,
0.00626373291015625,
0.00978851318359375,
-0.01474761962890625,
-0.0099945068359375,
0.008148193359375,
-0.021514892578125,
0.015838623046875,
-0.0345458984375,
-0.0188751220703125,
-0.019012451171875,
-0.032440185546875,
-0.0197296142578125,
0.0010690689086914062,
-0.05419921875,
0.015045166015625,
-0.013671875,
0.0009655952453613281,
0.033355712890625,
-0.00238037109375,
-0.01202392578125,
-0.020843505859375,
-0.0030536651611328125,
0.0364990234375,
-0.007293701171875,
-0.031982421875,
-0.025421142578125,
-0.024383544921875,
0.005664825439453125,
0.02850341796875,
0.0234375,
-0.0113525390625,
-0.065185546875,
0.01129913330078125,
-0.0289154052734375,
-0.028076171875,
-0.053070068359375,
-0.016387939453125,
0.07525634765625,
0.01776123046875,
-0.009613037109375,
-0.0268707275390625,
-0.00014507770538330078,
-0.006130218505859375,
-0.016632080078125,
-0.0130615234375,
-0.03546142578125,
-0.004138946533203125,
0.0423583984375,
0.01229095458984375,
0.04486083984375,
-0.0159759521484375,
0.019073486328125,
-0.0257720947265625,
0.05853271484375,
0.0396728515625,
0.017425537109375,
0.00325775146484375,
0.011627197265625,
-0.0172119140625,
0.01220703125,
-0.0206146240234375,
-0.060821533203125,
-0.013824462890625,
-0.04986572265625,
0.008941650390625,
0.011688232421875,
-0.042755126953125,
-0.03167724609375,
0.02972412109375,
0.04852294921875,
0.01373291015625,
-0.0006837844848632812,
-0.0007228851318359375,
-0.02752685546875,
-0.0035724639892578125,
0.005840301513671875,
0.006168365478515625,
-0.05047607421875,
0.00878143310546875,
0.0102081298828125,
-0.0596923828125,
-0.00728607177734375,
-0.006137847900390625,
-0.078857421875,
0.0304412841796875,
-0.019561767578125,
0.010528564453125,
-0.056396484375,
0.0308380126953125,
0.01800537109375,
-0.0310516357421875,
-0.00975799560546875,
-0.04302978515625,
0.01214599609375,
-0.0160980224609375,
-0.06683349609375,
0.01446533203125,
0.062469482421875,
-0.052215576171875,
-0.017425537109375,
0.016937255859375,
0.007053375244140625,
-0.0240631103515625,
0.0034198760986328125,
-0.00588226318359375,
0.0265045166015625,
0.0071868896484375,
0.02154541015625,
-0.00714111328125,
0.0010633468627929688,
-0.0038661956787109375,
0.010467529296875,
0.0306243896484375,
0.06329345703125,
0.0222625732421875,
0.053131103515625,
-0.0196075439453125,
-0.03564453125,
0.007144927978515625,
-0.07208251953125,
0.00014913082122802734,
0.0283050537109375,
0.003559112548828125,
-0.0396728515625,
0.016754150390625,
0.031005859375,
0.0262603759765625,
0.0112762451171875
] |
7ff584253c2115275c9a247c9b700004fb990cdb
|
Wordpress Stackexchange
Q: Unregister Nav Menu from Child-Theme I like to use the Starkers Theme and build child-theme.
So, I`d like to remove the this primary menu
Starkers (functions.php)
function starkers_setup() {
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'starkers' ),
) );
}
endif;
My child-theme functions.php looks like this:
unregister_nav_menu( array(
'primary' => __( 'Primary Navigation', 'starkers' ),
));
// my new nav
register_nav_menus(array(
'primary_navigation' => __('Main', 'starkers'),
'utility_navigation' => __('Meta', 'starkers')
));
But it doesn´t work for me.
What´s wrong?
Thanks
A: This should definitely work for you, I just checked out
add_action( 'after_setup_theme', 'remove_default_menu', 11 );
function remove_default_menu(){
unregister_nav_menu('primary');
}
|
Q: Unregister Nav Menu from Child-Theme I like to use the Starkers Theme and build child-theme.
So, I`d like to remove the this primary menu
Starkers (functions.php)
function starkers_setup() {
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'starkers' ),
) );
}
endif;
My child-theme functions.php looks like this:
unregister_nav_menu( array(
'primary' => __( 'Primary Navigation', 'starkers' ),
));
// my new nav
register_nav_menus(array(
'primary_navigation' => __('Main', 'starkers'),
'utility_navigation' => __('Meta', 'starkers')
));
But it doesn´t work for me.
What´s wrong?
Thanks
A: This should definitely work for you, I just checked out
add_action( 'after_setup_theme', 'remove_default_menu', 11 );
function remove_default_menu(){
unregister_nav_menu('primary');
}
A: The Starkers theme setup is hooked to after_setup_theme, at a priority of 10. So you basically have to wrap the unregister function inside another function (child themes functions.php file) and add it later than the parent themes setup function, so it gets first added by the parent and later on removed by the child.
function wpse_remove_parent_theme_locations()
{
// @link http://codex.wordpress.org/Function_Reference/unregister_nav_menu
unregister_nav_menu( 'primary' );
}
add_action( 'after_setup_theme', 'wpse_remove_parent_theme_locations', 20 );
A: The other solutions didn't work for me.
This one worked:
function remove_parent_theme_locations()
{
unregister_nav_menu( 'primary' );
}
add_action( 'init', 'remove_parent_theme_locations', 20 );
|
wordpress
|
{
"language": "en",
"length": 203,
"provenance": "stackexchange_00019.jsonl.gz:419300",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49861"
}
|
[
0.0309295654296875,
0.0079498291015625,
0.02569580078125,
0.007396697998046875,
0.0193328857421875,
-0.018096923828125,
0.05804443359375,
-0.061065673828125,
0.002086639404296875,
0.029327392578125,
0.026275634765625,
0.0028324127197265625,
-0.028717041015625,
-0.033538818359375,
-0.0299530029296875,
-0.0012044906616210938,
0.0243377685546875,
-0.0124969482421875,
0.0364990234375,
-0.0178985595703125,
0.005001068115234375,
-0.009490966796875,
0.06890869140625,
0.06890869140625,
0.0295257568359375,
-0.04071044921875,
-0.013946533203125,
-0.0069580078125,
-0.01474761962890625,
-0.039276123046875,
-0.0016298294067382812,
0.046417236328125,
-0.040496826171875,
0.024810791015625,
0.0552978515625,
-0.047607421875,
-0.02520751953125,
0.0361328125,
0.056488037109375,
-0.03277587890625,
0.018402099609375,
-0.01337432861328125,
-0.036468505859375,
0.00565338134765625,
-0.04815673828125,
-0.04339599609375,
0.01666259765625,
-0.004085540771484375,
0.0224456787109375,
-0.045196533203125,
0.051788330078125,
-0.0140533447265625,
0.06939697265625,
-0.06640625,
-0.03485107421875,
0.00811767578125,
-0.027313232421875,
-0.01190948486328125,
-0.0005316734313964844,
0.08978271484375,
0.0224151611328125,
0.0271453857421875,
-0.0276031494140625,
-0.046844482421875,
-0.01430511474609375,
0.0086669921875,
0.00910186767578125,
0.01233673095703125,
-0.07794189453125,
0.0114593505859375,
0.05841064453125,
-0.043792724609375,
-0.004611968994140625,
0.01165008544921875,
-0.007549285888671875,
-0.02301025390625,
0.007122039794921875,
0.0035381317138671875,
0.027557373046875,
0.00762176513671875,
0.004253387451171875,
0.00783538818359375,
-0.06951904296875,
-0.00513458251953125,
0.0172576904296875,
0.0186309814453125,
-0.0038242340087890625,
-0.017425537109375,
-0.048675537109375,
-0.0293426513671875,
-0.035858154296875,
-0.025482177734375,
-0.025115966796875,
-0.00954437255859375,
-0.034881591796875,
0.014739990234375,
0.05303955078125,
0.06524658203125,
-0.018402099609375,
-0.0052490234375,
0.015960693359375,
-0.04864501953125,
0.026123046875,
-0.048065185546875,
0.0194091796875,
0.04339599609375,
-0.026611328125,
-0.016448974609375,
0.055633544921875,
0.0384521484375,
0.0347900390625,
0.0136871337890625,
-0.016571044921875,
-0.0254974365234375,
-0.01407623291015625,
0.0193939208984375,
-0.0207977294921875,
0.005016326904296875,
-0.00012069940567016602,
0.011444091796875,
-0.0182342529296875,
0.02069091796875,
-0.01058197021484375,
-0.0022296905517578125,
-0.0206146240234375,
-0.0286712646484375,
-0.00844573974609375,
0.005481719970703125,
-0.003314971923828125,
0.037872314453125,
-0.040802001953125,
-0.041259765625,
0.06707763671875,
0.06378173828125,
0.02978515625,
-0.0305633544921875,
0.018310546875,
0.043701171875,
0.02825927734375,
-0.0024471282958984375,
0.0328369140625,
-0.034423828125,
-0.037445068359375,
0.0335693359375,
-0.0120849609375,
0.0084075927734375,
0.019989013671875,
0.00887298583984375,
0.0174713134765625,
-0.0222930908203125,
-0.0135955810546875,
-0.016845703125,
0.039520263671875,
0.01548004150390625,
-0.0264129638671875,
0.002246856689453125,
0.005504608154296875,
-0.0016164779663085938,
-0.038482666015625,
-0.010711669921875,
-0.01861572265625,
-0.0207672119140625,
-0.0133819580078125,
-0.06048583984375,
-0.0775146484375,
0.007633209228515625,
0.010894775390625,
-0.006366729736328125,
0.026947021484375,
-0.0310821533203125,
0.03973388671875,
-0.07501220703125,
-0.0333251953125,
0.0203857421875,
0.01629638671875,
0.06549072265625,
-0.00876617431640625,
0.02410888671875,
-0.0014781951904296875,
0.028350830078125,
-0.0090179443359375,
-0.065673828125,
0.0097503662109375,
-0.0037631988525390625,
-0.080078125,
0.015655517578125,
-0.0027008056640625,
0.051116943359375,
0.038177490234375,
0.01047515869140625,
0.01861572265625,
-0.0034885406494140625,
0.005413055419921875,
-0.01438140869140625,
0.01611328125,
-0.034088134765625,
-0.01459503173828125,
-0.0232086181640625,
0.0009474754333496094,
0.01332855224609375,
-0.014190673828125,
-0.0227813720703125,
0.0245208740234375,
-0.033294677734375,
-0.06695556640625,
0.00626373291015625,
-0.032958984375,
0.053985595703125,
-0.0175933837890625,
0.0266265869140625,
0.029144287109375,
0.00653076171875,
-0.03900146484375,
-0.0225067138671875,
-0.020721435546875,
-0.02374267578125,
-0.0168609619140625,
0.04571533203125,
0.0018873214721679688,
0.01001739501953125,
0.0101776123046875,
-0.0164337158203125,
0.02960205078125,
0.0192108154296875,
0.06646728515625,
-0.00943756103515625,
-0.0238494873046875,
-0.045623779296875,
0.022125244140625,
-0.017730712890625,
-0.04241943359375,
0.08160400390625,
0.0005979537963867188,
0.03778076171875,
-0.027252197265625,
-0.006805419921875,
0.0025997161865234375,
-0.019195556640625,
0.002185821533203125,
0.02276611328125,
0.023834228515625,
0.032989501953125,
-0.046539306640625,
-0.0411376953125,
0.027099609375,
-0.07073974609375,
-0.0181732177734375,
-0.0081634521484375,
-0.031829833984375,
-0.005889892578125,
0.051727294921875,
0.059844970703125,
0.0300750732421875,
0.059539794921875,
0.032379150390625,
0.0296630859375,
-0.0161895751953125,
-0.05108642578125,
0.03857421875,
-0.0021038055419921875,
0.0161895751953125,
-0.007648468017578125,
-0.0347900390625,
0.0063934326171875,
0.02362060546875,
-0.00885772705078125,
0.01336669921875,
-0.003627777099609375,
-0.0338134765625,
0.0014495849609375,
0.023712158203125,
0.00661468505859375,
-0.0202484130859375,
0.00313568115234375,
0.050201416015625,
0.031646728515625,
-0.027191162109375,
-0.0102081298828125,
0.0028553009033203125,
0.00788116455078125,
0.00200653076171875,
0.039276123046875,
0.0250091552734375,
-0.00881195068359375,
-0.019378662109375,
-0.054840087890625,
0.01381683349609375,
0.0167083740234375,
0.0012884140014648438,
-0.0193634033203125,
0.01390838623046875,
0.0251922607421875,
-0.025360107421875,
0.03863525390625,
0.01364898681640625,
-0.018707275390625,
0.039825439453125,
0.0149993896484375,
-0.003864288330078125,
0.0173797607421875,
0.054473876953125,
0.038330078125,
0.01421356201171875,
-0.00751495361328125,
0.01392364501953125,
-0.004795074462890625,
-0.0026397705078125,
0.0095367431640625,
0.007549285888671875,
0.0193023681640625,
-0.03692626953125,
0.0200958251953125,
0.007785797119140625,
-0.0114898681640625,
-0.0186004638671875,
-0.027587890625,
-0.037567138671875,
-0.020233154296875,
-0.049530029296875,
0.006500244140625,
-0.0004992485046386719,
0.00827789306640625,
0.0304107666015625,
0.0240020751953125,
0.00579833984375,
-0.03509521484375,
0.038238525390625,
0.00949859619140625,
0.0294647216796875,
-0.034332275390625,
-0.06658935546875,
-0.047943115234375,
-0.0843505859375,
-0.0218658447265625,
-0.0024280548095703125,
0.017364501953125,
0.0184478759765625,
-0.004123687744140625,
0.007717132568359375,
-0.0309600830078125,
0.034027099609375,
-0.0002276897430419922,
0.006031036376953125,
0.0186309814453125,
0.020172119140625,
0.00415802001953125,
-0.034271240234375,
0.0233306884765625,
0.0022125244140625,
-0.003421783447265625,
-0.031646728515625,
-0.015716552734375,
-0.017852783203125,
0.01313018798828125,
0.04345703125,
-0.00833892822265625,
-0.01126861572265625,
-0.0014553070068359375,
0.033935546875,
-0.036773681640625,
-0.01263427734375,
-0.0273284912109375,
-0.048797607421875,
0.050140380859375,
0.056915283203125,
-0.007106781005859375,
-0.0266265869140625,
-0.01287841796875,
0.005374908447265625,
-0.0025386810302734375,
0.037567138671875,
-0.0103912353515625,
0.055511474609375,
-0.02996826171875,
-0.0223236083984375,
-0.047119140625,
0.0192413330078125,
-0.013031005859375,
0.0126495361328125,
-0.0015888214111328125,
0.019317626953125,
0.00638580322265625,
-0.0113372802734375,
-0.034393310546875,
-0.025482177734375,
0.033416748046875,
-0.01418304443359375,
-0.01174163818359375,
-0.007381439208984375,
-0.00007593631744384766,
-0.00373077392578125,
0.037872314453125,
-0.09088134765625,
-0.0176544189453125,
-0.0069427490234375,
0.02008056640625,
0.01212310791015625,
-0.021697998046875,
-0.0269012451171875,
-0.004344940185546875,
-0.090576171875,
-0.00656890869140625,
-0.0079193115234375,
-0.050872802734375,
-0.006122589111328125,
-0.0276031494140625,
-0.0462646484375,
-0.04718017578125,
0.0482177734375,
-0.00743865966796875,
-0.00707244873046875,
0.018096923828125,
-0.01021575927734375,
-0.036590576171875,
-0.0171051025390625,
0.0054779052734375,
-0.046417236328125,
-0.01457977294921875,
-0.061676025390625,
0.0888671875,
0.060089111328125,
-0.038909912109375,
-0.007213592529296875,
0.04071044921875,
0.051025390625,
0.04254150390625,
0.01367950439453125,
-0.041046142578125,
0.0275115966796875,
-0.015777587890625,
0.0110626220703125,
-0.0118408203125,
0.01062774658203125,
-0.0098876953125,
-0.058746337890625,
-0.0472412109375,
-0.0230255126953125,
-0.004627227783203125,
0.046478271484375,
-0.03631591796875,
-0.0379638671875,
-0.021575927734375,
-0.0283966064453125,
-0.0310211181640625,
0.004772186279296875,
-0.018707275390625,
0.0025997161865234375,
-0.03350830078125,
0.0175018310546875,
-0.028717041015625,
-0.01158905029296875,
-0.0035877227783203125,
0.0118560791015625,
0.02130126953125,
-0.0182647705078125,
0.041168212890625,
0.029327392578125,
0.0445556640625,
-0.00359344482421875,
0.0203094482421875,
0.0075836181640625,
-0.016845703125,
0.0249176025390625,
0.026702880859375,
0.007293701171875,
-0.01593017578125,
0.0518798828125,
0.016204833984375,
-0.01052093505859375,
0.02166748046875,
0.0110321044921875,
0.0006737709045410156,
-0.01300811767578125,
0.004253387451171875,
0.0074310302734375,
-0.00566864013671875,
-0.0035552978515625,
0.0237274169921875,
-0.0261688232421875,
-0.019287109375,
0.01544952392578125,
-0.01140594482421875,
0.053131103515625,
0.025604248046875,
0.046142578125,
0.00672149658203125,
-0.01299285888671875,
0.0172576904296875,
0.029510498046875,
-0.040740966796875,
0.0295257568359375,
-0.0186767578125,
0.065673828125,
-0.022796630859375,
0.03619384765625,
-0.035308837890625,
-0.01268768310546875,
0.07208251953125,
0.02325439453125,
0.00533294677734375,
-0.08636474609375,
0.0045928955078125,
0.047821044921875,
-0.04302978515625,
0.014739990234375,
0.050628662109375,
-0.00135040283203125,
-0.018096923828125,
-0.028076171875,
0.01212310791015625,
-0.0307159423828125,
-0.041259765625,
-0.0239105224609375,
0.0195159912109375,
-0.0340576171875,
-0.0086669921875,
0.0128631591796875,
0.03863525390625,
-0.0181732177734375,
-0.0276336669921875,
-0.0172271728515625,
-0.014892578125,
0.039337158203125,
-0.0102996826171875,
-0.0099334716796875,
0.049163818359375,
0.0035915374755859375,
0.08489990234375,
-0.0130615234375,
0.01294708251953125,
0.0162811279296875,
0.0173492431640625,
0.0285186767578125,
-0.0027408599853515625,
-0.00600433349609375,
-0.000553131103515625,
0.0154266357421875,
0.017547607421875,
-0.0792236328125,
-0.04351806640625,
-0.035888671875,
0.026397705078125,
0.06201171875,
-0.046295166015625,
-0.018310546875,
-0.00763702392578125,
-0.04449462890625,
-0.047149658203125,
0.0399169921875,
-0.0654296875,
-0.00213623046875,
0.01428985595703125,
-0.039764404296875,
-0.0230712890625,
0.038970947265625,
-0.1085205078125,
-0.0128936767578125,
-0.033172607421875,
-0.01004791259765625,
0.03515625,
-0.04791259765625,
0.00617218017578125,
-0.044525146484375,
0.041839599609375,
-0.05828857421875,
0.00006288290023803711,
0.06085205078125,
0.051361083984375,
0.01181793212890625,
-0.029693603515625,
-0.0288238525390625,
-0.029998779296875,
0.0126953125,
-0.0265655517578125,
-0.023956298828125,
-0.006992340087890625,
0.010467529296875,
-0.0214996337890625,
0.037078857421875,
0.0008511543273925781,
-0.00339508056640625,
0.035064697265625,
0.01511383056640625,
-0.004940032958984375,
-0.0051422119140625,
0.01885986328125,
0.028045654296875,
0.0120391845703125,
0.038360595703125,
0.0239410400390625,
0.002471923828125,
-0.037872314453125,
0.00429534912109375,
-0.026519775390625,
0.00847625732421875,
-0.0235137939453125,
0.010101318359375,
0.02496337890625,
0.03839111328125,
0.0173187255859375,
0.02215576171875,
-0.01357269287109375,
0.00618743896484375,
-0.02001953125,
-0.004116058349609375,
-0.0243377685546875,
0.0228118896484375,
-0.0200042724609375,
0.007778167724609375,
0.022247314453125,
0.01209259033203125,
0.0125274658203125,
-0.03497314453125,
0.0107421875,
-0.02227783203125,
-0.0007371902465820312,
-0.042236328125,
0.053985595703125,
0.037841796875,
-0.03680419921875,
0.0287017822265625,
-0.01116943359375,
0.0018892288208007812,
0.0279541015625,
-0.0258026123046875,
0.003749847412109375,
0.019287109375,
0.04443359375,
0.0016431808471679688,
0.0266571044921875,
0.05328369140625,
-0.01416015625,
-0.045440673828125,
0.03350830078125,
0.014862060546875,
-0.048309326171875,
-0.014801025390625,
-0.0015153884887695312,
0.01947021484375,
0.0026760101318359375,
0.02276611328125,
-0.038238525390625,
0.0111846923828125,
-0.02923583984375,
-0.032623291015625,
-0.029541015625,
0.0007867813110351562,
0.0304412841796875,
0.006893157958984375,
0.0085296630859375,
0.058868408203125,
-0.0008540153503417969,
0.01345062255859375,
-0.038604736328125,
-0.019317626953125,
-0.001750946044921875,
-0.03839111328125,
0.0250396728515625,
0.01256561279296875,
-0.0225982666015625,
-0.081787109375,
-0.0007395744323730469,
0.005863189697265625,
-0.00739288330078125,
0.0628662109375,
-0.0233001708984375,
-0.0024662017822265625,
0.031646728515625,
-0.0307159423828125,
0.0270233154296875,
-0.0036296844482421875,
-0.041473388671875,
0.00292205810546875,
-0.0100250244140625,
0.0684814453125,
-0.08203125,
-0.055511474609375,
0.00815582275390625,
-0.063232421875,
-0.04937744140625,
-0.007625579833984375,
-0.029998779296875,
0.0572509765625,
-0.0294952392578125,
-0.018463134765625,
0.006805419921875,
0.0300445556640625,
0.010009765625,
-0.04840087890625,
0.06622314453125,
-0.06817626953125,
-0.044647216796875,
0.00632476806640625,
-0.015594482421875,
-0.0282745361328125,
-0.061004638671875,
-0.044769287109375,
0.1031494140625,
0.0264434814453125,
-0.01009368896484375,
-0.00394439697265625,
0.062164306640625,
-0.05364990234375,
0.03704833984375,
-0.00283050537109375,
0.058929443359375,
0.08294677734375,
0.006500244140625,
-0.005031585693359375,
-0.02960205078125,
0.00922393798828125,
0.06024169921875,
-0.0106658935546875,
-0.01041412353515625,
0.0266571044921875,
0.015869140625,
0.03338623046875,
0.03082275390625,
-0.006977081298828125,
-0.01317596435546875,
-0.016754150390625,
-0.1026611328125,
-0.036712646484375,
0.02154541015625,
0.00948333740234375,
-0.03448486328125,
-0.026214599609375,
-0.0136260986328125,
0.0235595703125,
0.01470184326171875,
-0.0008215904235839844,
0.023681640625,
-0.0193328857421875,
0.0015478134155273438,
0.0022983551025390625,
0.032958984375,
0.0196380615234375,
-0.0109100341796875,
0.009796142578125,
-0.03131103515625,
0.0167694091796875,
-0.0076751708984375,
0.041961669921875,
0.0092620849609375,
-0.0242462158203125,
0.0158538818359375,
0.0145111083984375,
-0.035919189453125,
0.01336669921875,
-0.007778167724609375,
0.04254150390625,
-0.01441192626953125,
0.0176544189453125,
0.0178375244140625,
0.047576904296875,
-0.012603759765625,
-0.012664794921875,
-0.0029239654541015625,
0.02252197265625,
-0.0055999755859375,
-0.039703369140625,
0.017120361328125,
-0.02056884765625,
-0.0269622802734375,
0.004734039306640625,
-0.02117919921875,
-0.0400390625,
-0.00922393798828125,
-0.0036449432373046875,
-0.00829315185546875,
0.0161590576171875,
0.0140838623046875,
0.00016939640045166016,
0.00897979736328125,
-0.0220947265625,
-0.0006518363952636719,
-0.01043701171875,
-0.01129913330078125,
0.0086212158203125,
0.01421356201171875,
-0.003566741943359375,
0.0570068359375,
0.004547119140625,
-0.0079803466796875,
-0.0274505615234375,
0.024383544921875,
-0.0158843994140625,
0.02764892578125,
-0.03607177734375,
-0.0191650390625,
-0.0006699562072753906,
0.0173187255859375,
0.01203155517578125,
0.0186004638671875,
0.044403076171875,
0.04638671875,
-0.003314971923828125,
-0.0123138427734375,
0.007526397705078125,
-0.0275726318359375,
-0.06549072265625,
-0.01377105712890625,
-0.035308837890625,
0.0229949951171875,
0.022705078125,
0.0184173583984375,
0.0249481201171875,
0.01146697998046875,
-0.03759765625,
0.023468017578125,
-0.002429962158203125,
-0.0419921875,
0.0013408660888671875,
-0.0085601806640625,
0.04180908203125,
0.006622314453125,
-0.0775146484375,
-0.025909423828125,
0.018798828125,
-0.0159149169921875,
0.0239715576171875,
0.03662109375,
-0.01806640625,
0.0272216796875,
-0.0024547576904296875,
0.0012006759643554688,
-0.01239776611328125,
0.00008416175842285156,
-0.004863739013671875,
0.039154052734375,
0.01392364501953125,
0.031494140625,
-0.01071929931640625,
-0.0166168212890625,
0.016326904296875,
0.001232147216796875,
0.0218505859375,
0.017578125,
0.00586700439453125,
0.01258087158203125,
-0.039215087890625,
0.004711151123046875,
-0.0286102294921875,
-0.0299530029296875,
-0.006557464599609375,
0.00728607177734375,
0.0019474029541015625,
0.0012292861938476562,
-0.072509765625,
0.01454925537109375,
0.0665283203125,
-0.01146697998046875,
0.053741455078125,
0.0246124267578125,
0.0109100341796875,
-0.083251953125,
-0.0007004737854003906,
-0.0099334716796875,
-0.02142333984375,
0.0099639892578125,
0.00905609130859375,
0.0093536376953125,
0.060455322265625,
0.0158843994140625,
0.033111572265625,
0.0298919677734375,
-0.021209716796875,
0.01885986328125,
-0.011688232421875,
-0.006015777587890625,
0.0223846435546875,
0.0604248046875,
-0.04840087890625,
-0.006389617919921875,
-0.007259368896484375,
-0.0086822509765625,
0.01323699951171875,
0.01042938232421875,
0.01462554931640625,
-0.047943115234375,
0.0491943359375,
0.03369140625,
0.040863037109375,
-0.052703857421875,
-0.003032684326171875,
0.06402587890625,
-0.006015777587890625,
0.03057861328125,
0.003475189208984375,
-0.021575927734375,
-0.0281829833984375,
0.0026454925537109375,
0.007965087890625,
-0.020904541015625,
-0.0093994140625,
-0.03521728515625,
0.019195556640625,
0.035308837890625,
0.0217742919921875,
-0.06976318359375,
0.0269317626953125,
0.006134033203125,
0.06427001953125,
-0.0128326416015625,
0.0172119140625,
-0.041595458984375,
-0.08447265625,
-0.02685546875,
-0.00464630126953125,
-0.058990478515625,
0.06304931640625,
-0.007144927978515625,
-0.0259552001953125,
-0.01346588134765625,
0.0173797607421875,
0.0163116455078125,
-0.0240936279296875,
-0.0263214111328125,
0.02899169921875,
-0.00952911376953125,
-0.04931640625,
-0.0166015625,
-0.0281982421875,
0.037322998046875,
0.00021457672119140625,
0.00009363889694213867,
-0.056060791015625,
-0.0390625,
0.0025310516357421875,
0.005802154541015625,
0.0258026123046875,
-0.02398681640625,
-0.0467529296875,
0.06268310546875,
-0.00024127960205078125,
-0.02557373046875,
-0.00476837158203125,
0.014251708984375,
-0.00024259090423583984,
-0.018524169921875,
0.01161956787109375,
-0.052398681640625,
0.0125885009765625,
0.02532958984375,
0.0189971923828125,
0.0867919921875,
-0.0084991455078125,
0.028076171875,
0.00467681884765625,
0.0231170654296875,
-0.0030345916748046875,
0.01336669921875,
-0.00464630126953125,
0.0118560791015625,
0.005138397216796875,
0.022125244140625,
-0.0301361083984375,
-0.0135345458984375,
-0.0062713623046875,
-0.0214996337890625,
0.007396697998046875,
-0.00849151611328125,
-0.005687713623046875,
-0.009429931640625,
-0.008331298828125,
-0.0113677978515625,
-0.0057830810546875,
0.00897979736328125,
-0.049560546875,
-0.075927734375,
0.01435089111328125,
-0.0264434814453125,
0.007083892822265625,
-0.09588623046875,
-0.01122283935546875,
0.03887939453125,
-0.01038360595703125,
-0.016265869140625,
-0.0164947509765625,
-0.03411865234375,
-0.00342559814453125,
-0.00254058837890625,
0.005725860595703125,
-0.0219573974609375,
0.0211639404296875,
-0.007785797119140625,
-0.004230499267578125,
0.0046844482421875,
-0.00872802734375,
-0.006610870361328125,
-0.0112457275390625,
0.044647216796875,
0.03485107421875,
0.007503509521484375,
-0.046844482421875,
0.0253448486328125,
0.011444091796875,
0.0283203125,
-0.0521240234375,
-0.056640625,
0.00009840726852416992,
0.0214996337890625,
0.003520965576171875,
0.04083251953125,
-0.0270538330078125,
0.0406494140625,
0.00952911376953125,
0.012176513671875,
-0.01000213623046875,
0.048858642578125,
-0.00620269775390625,
0.0325927734375,
0.01114654541015625,
-0.00878143310546875,
0.049163818359375,
-0.01082611083984375,
0.00209808349609375,
0.0004916191101074219,
-0.007080078125,
-0.07977294921875,
0.03759765625,
-0.0125274658203125,
0.0235748291015625,
0.031463623046875
] |
1de7faa6afd05ec68d23fc0c276292d6bf5a8bab
|
Wordpress Stackexchange
Q: why does WordPress need two cookies for auth/login I can see two cookies: auth and login cookies in wordpress. Why do we need two?
I think one is enough.
A: "On login, wordpress uses the wordpress_[hash] cookie to store your authentication details. It's use is limited to the admin console area, /wp-admin/
After login, wordpress sets the wordpress_logged_in_[hash] cookie, which indicates when you're logged in, and who you are, for most interface use.
Wordpress also sets a few wp-settings-{time}-[UID] cookies. The number on the end is your individual user ID from the users database table. This is used to customize your view of admin interface, and possibly also the main site interface."
When in doubt, check the Codex first.
|
Q: why does WordPress need two cookies for auth/login I can see two cookies: auth and login cookies in wordpress. Why do we need two?
I think one is enough.
A: "On login, wordpress uses the wordpress_[hash] cookie to store your authentication details. It's use is limited to the admin console area, /wp-admin/
After login, wordpress sets the wordpress_logged_in_[hash] cookie, which indicates when you're logged in, and who you are, for most interface use.
Wordpress also sets a few wp-settings-{time}-[UID] cookies. The number on the end is your individual user ID from the users database table. This is used to customize your view of admin interface, and possibly also the main site interface."
When in doubt, check the Codex first.
A: I believe the two cookies are to do with SSL. When using the admin area you want it secure and so you cannot have the authentication cookie details always presented to everyone on your site (such as non-SSL connections). However there are times you want to be known as logged in but not using the secure connection. So by separating them you can edit your site with the auth cookie details and remain logged in across the entire site with the logged in cookie.
http://codex.wordpress.org/WordPress_Cookies
|
wordpress
|
{
"language": "en",
"length": 206,
"provenance": "stackexchange_00019.jsonl.gz:419315",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/49909"
}
|
[
0.0216522216796875,
-0.006870269775390625,
-0.00487518310546875,
0.01290130615234375,
-0.01250457763671875,
-0.038177490234375,
0.039886474609375,
-0.0172119140625,
-0.0545654296875,
0.0175628662109375,
-0.001789093017578125,
0.0254364013671875,
-0.02313232421875,
-0.034759521484375,
0.042694091796875,
-0.041351318359375,
0.0247344970703125,
-0.0401611328125,
-0.008514404296875,
-0.03887939453125,
0.0161895751953125,
-0.016937255859375,
0.0265960693359375,
0.045989990234375,
0.057159423828125,
-0.04107666015625,
0.048980712890625,
-0.0369873046875,
0.05023193359375,
-0.0017442703247070312,
0.031982421875,
-0.043304443359375,
0.0110321044921875,
0.05548095703125,
-0.049957275390625,
-0.0572509765625,
-0.031463623046875,
0.0298309326171875,
-0.0076904296875,
0.01078033447265625,
0.004230499267578125,
0.0030231475830078125,
0.0677490234375,
0.0035610198974609375,
0.00577545166015625,
-0.011962890625,
0.01497650146484375,
-0.0178985595703125,
0.007465362548828125,
-0.01397705078125,
0.019866943359375,
0.027862548828125,
0.04962158203125,
-0.002017974853515625,
-0.01316070556640625,
0.01377105712890625,
0.050201416015625,
-0.0572509765625,
0.03131103515625,
-0.048309326171875,
-0.042144775390625,
-0.0362548828125,
0.046478271484375,
0.00908660888671875,
-0.009185791015625,
-0.010528564453125,
-0.024322509765625,
0.0157470703125,
-0.061248779296875,
-0.0186920166015625,
0.038299560546875,
-0.03839111328125,
-0.0021877288818359375,
-0.01442718505859375,
0.00024771690368652344,
0.025543212890625,
-0.016265869140625,
0.0039005279541015625,
0.0167694091796875,
0.0085601806640625,
-0.03765869140625,
-0.036865234375,
-0.0755615234375,
-0.0126953125,
0.0221710205078125,
0.050262451171875,
-0.0158233642578125,
-0.022735595703125,
0.024871826171875,
-0.01200103759765625,
-0.0014781951904296875,
-0.0132904052734375,
0.0198974609375,
0.0296783447265625,
-0.031097412109375,
-0.024566650390625,
-0.01788330078125,
0.015960693359375,
-0.00848388671875,
-0.006866455078125,
0.0023975372314453125,
-0.0146026611328125,
-0.0115814208984375,
-0.00992584228515625,
0.00841522216796875,
0.0391845703125,
0.01092529296875,
0.058197021484375,
0.03424072265625,
0.00992584228515625,
0.00939178466796875,
0.01442718505859375,
0.002101898193359375,
-0.09222412109375,
0.0186920166015625,
0.00445556640625,
-0.023345947265625,
0.038543701171875,
0.036163330078125,
-0.053802490234375,
-0.03887939453125,
-0.02099609375,
-0.00479888916015625,
0.0225830078125,
-0.00437164306640625,
-0.032257080078125,
0.00201416015625,
0.03375244140625,
-0.04241943359375,
0.0723876953125,
-0.02294921875,
-0.00502777099609375,
0.0215911865234375,
-0.0073699951171875,
-0.05218505859375,
-0.02813720703125,
0.03955078125,
-0.02362060546875,
-0.029144287109375,
0.043670654296875,
-0.02655029296875,
-0.045623779296875,
0.0010271072387695312,
-0.025634765625,
0.0068511962890625,
-0.0091705322265625,
0.022613525390625,
0.047821044921875,
-0.00946807861328125,
-0.0160980224609375,
0.0251007080078125,
-0.002437591552734375,
-0.0421142578125,
0.023345947265625,
0.032501220703125,
0.058868408203125,
-0.01389312744140625,
0.0240020751953125,
0.007686614990234375,
0.056854248046875,
-0.01861572265625,
-0.005298614501953125,
0.020751953125,
-0.0033092498779296875,
-0.0178680419921875,
0.0091552734375,
-0.01678466796875,
-0.01275634765625,
0.0268402099609375,
-0.0241241455078125,
0.044342041015625,
-0.034027099609375,
0.06317138671875,
0.010406494140625,
-0.001972198486328125,
0.01541900634765625,
-0.006153106689453125,
0.04241943359375,
0.02484130859375,
0.019287109375,
0.019378662109375,
-0.0130767822265625,
0.0814208984375,
-0.01556396484375,
-0.026580810546875,
0.0595703125,
0.006282806396484375,
0.09027099609375,
-0.0263671875,
0.036102294921875,
-0.043426513671875,
0.039825439453125,
-0.039886474609375,
0.06304931640625,
-0.037139892578125,
-0.04461669921875,
-0.00033783912658691406,
0.01548004150390625,
-0.02874755859375,
-0.01454925537109375,
0.041259765625,
-0.0216217041015625,
-0.00534820556640625,
-0.02783203125,
-0.0706787109375,
-0.0282440185546875,
-0.0113983154296875,
0.0123138427734375,
-0.0233001708984375,
0.0191650390625,
0.0224609375,
0.01018524169921875,
-0.02825927734375,
-0.004261016845703125,
-0.01045989990234375,
-0.0165252685546875,
-0.041839599609375,
0.03582763671875,
-0.0143585205078125,
0.0377197265625,
-0.028106689453125,
-0.0259552001953125,
-0.0279998779296875,
-0.03485107421875,
0.0576171875,
-0.0250396728515625,
-0.0015583038330078125,
-0.030059814453125,
0.042388916015625,
-0.0159454345703125,
-0.023834228515625,
0.05133056640625,
0.020599365234375,
0.0311126708984375,
-0.010894775390625,
0.00470733642578125,
-0.008148193359375,
-0.05511474609375,
0.006595611572265625,
0.04443359375,
0.026275634765625,
0.0318603515625,
-0.01100921630859375,
0.0321044921875,
0.0244903564453125,
-0.0325927734375,
0.006862640380859375,
0.013519287109375,
-0.002414703369140625,
0.046539306640625,
0.02423095703125,
-0.01493072509765625,
-0.006626129150390625,
-0.06549072265625,
-0.01544189453125,
0.0179901123046875,
-0.047515869140625,
-0.0283203125,
0.0281219482421875,
-0.00853729248046875,
-0.00923919677734375,
-0.045318603515625,
0.013458251953125,
-0.039459228515625,
-0.0274200439453125,
-0.0305328369140625,
-0.0175628662109375,
-0.0265045166015625,
-0.0010194778442382812,
-0.0239410400390625,
0.030975341796875,
-0.024444580078125,
0.0006103515625,
-0.0014867782592773438,
0.0711669921875,
-0.0148773193359375,
-0.00936126708984375,
-0.0162200927734375,
0.017791748046875,
-0.001705169677734375,
-0.0270843505859375,
-0.0230560302734375,
-0.06829833984375,
-0.01323699951171875,
0.0198516845703125,
-0.00774383544921875,
-0.001171112060546875,
0.007328033447265625,
0.0304718017578125,
-0.0239410400390625,
0.0232696533203125,
0.0006341934204101562,
-0.0311431884765625,
0.0601806640625,
-0.0323486328125,
-0.05322265625,
0.00726318359375,
-0.0164337158203125,
0.0184783935546875,
-0.02655029296875,
0.0279083251953125,
0.05267333984375,
-0.00830841064453125,
0.002605438232421875,
-0.018646240234375,
0.0058135986328125,
-0.002773284912109375,
-0.0203399658203125,
-0.0225982666015625,
-0.0216217041015625,
0.01274871826171875,
0.063720703125,
0.016754150390625,
0.008941650390625,
-0.0106353759765625,
-0.04864501953125,
-0.03656005859375,
0.0157928466796875,
-0.08984375,
-0.061767578125,
-0.07501220703125,
-0.06988525390625,
0.02557373046875,
-0.035858154296875,
-0.01971435546875,
0.01377105712890625,
-0.005916595458984375,
0.02099609375,
-0.024566650390625,
-0.01548004150390625,
-0.01383209228515625,
-0.037445068359375,
-0.018463134765625,
0.029998779296875,
-0.00983428955078125,
0.00969696044921875,
0.00604248046875,
0.0159759521484375,
-0.018402099609375,
-0.0192108154296875,
-0.033599853515625,
-0.006076812744140625,
-0.033843994140625,
-0.07257080078125,
-0.047149658203125,
-0.00015556812286376953,
0.00958251953125,
-0.0072479248046875,
-0.0018863677978515625,
-0.033172607421875,
0.04522705078125,
-0.0135498046875,
-0.001667022705078125,
-0.0421142578125,
0.00861358642578125,
-0.04144287109375,
-0.03472900390625,
-0.01084136962890625,
-0.006175994873046875,
-0.06219482421875,
0.04150390625,
-0.032562255859375,
-0.032562255859375,
-0.052032470703125,
0.0489501953125,
-0.0232696533203125,
-0.036529541015625,
-0.0665283203125,
-0.01026153564453125,
-0.006988525390625,
-0.03997802734375,
-0.024322509765625,
0.061492919921875,
-0.01233673095703125,
-0.01340484619140625,
0.0144805908203125,
0.031585693359375,
-0.045806884765625,
-0.032135009765625,
-0.014923095703125,
-0.03607177734375,
-0.02239990234375,
-0.025238037109375,
-0.025421142578125,
-0.04071044921875,
0.0545654296875,
-0.0008587837219238281,
0.0130615234375,
-0.0394287109375,
-0.036712646484375,
-0.020111083984375,
0.08892822265625,
-0.043365478515625,
0.0041351318359375,
0.00044846534729003906,
0.023956298828125,
-0.03076171875,
-0.07196044921875,
-0.0462646484375,
-0.020294189453125,
-0.0055999755859375,
-0.006443023681640625,
0.0107269287109375,
-0.007541656494140625,
0.004665374755859375,
0.0114593505859375,
0.00786590576171875,
-0.0213470458984375,
0.0229339599609375,
-0.007171630859375,
0.0360107421875,
-0.0168304443359375,
0.0240020751953125,
-0.018096923828125,
0.01171875,
-0.020477294921875,
0.00128173828125,
-0.005153656005859375,
0.0158843994140625,
0.0025787353515625,
0.0232086181640625,
-0.0357666015625,
0.008026123046875,
0.0121917724609375,
-0.047210693359375,
0.009033203125,
0.0018548965454101562,
0.0513916015625,
-0.0021953582763671875,
0.01275634765625,
-0.006099700927734375,
-0.0021572113037109375,
0.003993988037109375,
-0.0260772705078125,
-0.0195770263671875,
-0.0219879150390625,
-0.034942626953125,
0.0012454986572265625,
0.009002685546875,
-0.0098419189453125,
-0.03375244140625,
-0.022918701171875,
0.00911712646484375,
0.0267181396484375,
0.01213836669921875,
0.00681304931640625,
-0.038238525390625,
-0.0408935546875,
0.0443115234375,
0.048553466796875,
-0.0172882080078125,
0.0014619827270507812,
0.052398681640625,
0.020660400390625,
-0.030792236328125,
-0.033538818359375,
0.00789642333984375,
0.021942138671875,
0.0109710693359375,
0.045074462890625,
0.015838623046875,
-0.0005927085876464844,
0.03594970703125,
0.0013628005981445312,
0.0116119384765625,
-0.043701171875,
0.0298309326171875,
-0.033172607421875,
-0.025177001953125,
0.0281524658203125,
-0.06378173828125,
0.053466796875,
0.01253509521484375,
0.0302734375,
-0.004703521728515625,
0.02447509765625,
-0.000011146068572998047,
0.0285491943359375,
-0.052520751953125,
-0.0015316009521484375,
-0.02899169921875,
0.008514404296875,
-0.00772857666015625,
0.02227783203125,
0.0130157470703125,
-0.0022716522216796875,
0.01335906982421875,
0.0196533203125,
-0.0222930908203125,
0.0019550323486328125,
-0.0628662109375,
0.0122528076171875,
-0.01513671875,
0.0219573974609375,
-0.01090240478515625,
0.0160675048828125,
-0.02496337890625,
0.09698486328125,
0.01451873779296875,
-0.06207275390625,
0.043609619140625,
-0.01739501953125,
-0.0217742919921875,
0.031524658203125,
-0.0253448486328125,
0.041900634765625,
-0.0187225341796875,
-0.035186767578125,
-0.00798797607421875,
-0.02587890625,
-0.0653076171875,
-0.043975830078125,
0.0023899078369140625,
-0.021881103515625,
0.0033626556396484375,
0.0034732818603515625,
0.0526123046875,
-0.01482391357421875,
0.0235443115234375,
-0.01678466796875,
0.009124755859375,
0.0027790069580078125,
0.0545654296875,
0.045379638671875,
-0.055267333984375,
0.00274658203125,
0.021575927734375,
-0.006206512451171875,
-0.0323486328125,
-0.03607177734375,
0.0457763671875,
0.03619384765625,
0.01334381103515625,
0.019805908203125,
-0.0159149169921875,
0.0151824951171875,
0.034759521484375,
0.00736236572265625,
-0.025909423828125,
-0.043609619140625,
0.01233673095703125,
0.034149169921875,
0.0174713134765625,
-0.063720703125,
0.01152801513671875,
0.005237579345703125,
0.00986480712890625,
-0.0054779052734375,
0.04180908203125,
-0.0489501953125,
-0.0086669921875,
0.00237274169921875,
-0.00592803955078125,
-0.0006046295166015625,
-0.008514404296875,
-0.053131103515625,
-0.0288543701171875,
-0.003681182861328125,
0.01444244384765625,
0.035308837890625,
-0.03765869140625,
0.0265960693359375,
-0.01067352294921875,
-0.00739288330078125,
0.0203704833984375,
0.01922607421875,
0.0227813720703125,
0.00954437255859375,
-0.0189666748046875,
-0.0258331298828125,
-0.020050048828125,
-0.0068511962890625,
-0.01342010498046875,
-0.04022216796875,
-0.0182342529296875,
-0.0002351999282836914,
0.006252288818359375,
0.01045989990234375,
0.00798797607421875,
0.02197265625,
0.001438140869140625,
0.01415252685546875,
-0.017547607421875,
0.006927490234375,
-0.0264129638671875,
0.0362548828125,
0.029693603515625,
-0.01319122314453125,
0.0188140869140625,
0.05279541015625,
0.01495361328125,
-0.0211639404296875,
0.031951904296875,
0.01204681396484375,
-0.039398193359375,
-0.0411376953125,
-0.0012578964233398438,
-0.025054931640625,
0.05352783203125,
-0.027740478515625,
0.001934051513671875,
0.02069091796875,
0.01282501220703125,
-0.0025177001953125,
-0.00827789306640625,
0.04071044921875,
-0.0240478515625,
0.0504150390625,
0.0149993896484375,
0.06817626953125,
-0.02911376953125,
-0.015838623046875,
0.0145263671875,
-0.01306915283203125,
0.045196533203125,
0.0007967948913574219,
0.0083770751953125,
-0.00677490234375,
0.0243682861328125,
0.0173187255859375,
0.029296875,
0.0182342529296875,
0.035491943359375,
-0.01444244384765625,
-0.00965118408203125,
-0.057525634765625,
-0.00902557373046875,
0.0243682861328125,
-0.0018482208251953125,
-0.03424072265625,
0.025665283203125,
-0.0268402099609375,
0.020111083984375,
0.0482177734375,
0.07427978515625,
-0.087890625,
0.0309295654296875,
0.0039005279541015625,
-0.018310546875,
0.033477783203125,
0.0060882568359375,
-0.020843505859375,
-0.042205810546875,
0.036834716796875,
0.025421142578125,
0.003017425537109375,
0.019989013671875,
0.0177154541015625,
-0.005367279052734375,
0.002666473388671875,
0.03564453125,
0.01509857177734375,
-0.041534423828125,
0.0177001953125,
0.02581787109375,
0.0219879150390625,
0.0190887451171875,
-0.002201080322265625,
0.0228271484375,
-0.04229736328125,
-0.06329345703125,
-0.011474609375,
-0.01316070556640625,
-0.045257568359375,
0.0311737060546875,
0.003604888916015625,
0.08233642578125,
0.0287628173828125,
0.0202789306640625,
-0.016143798828125,
-0.030181884765625,
0.07135009765625,
-0.03216552734375,
-0.01812744140625,
0.04583740234375,
0.0211334228515625,
-0.042999267578125,
0.038360595703125,
-0.030426025390625,
-0.032562255859375,
-0.02972412109375,
-0.039093017578125,
0.031768798828125,
-0.0051422119140625,
-0.0005803108215332031,
0.039764404296875,
0.06640625,
-0.01404571533203125,
-0.0153350830078125,
0.018463134765625,
-0.05889892578125,
-0.0389404296875,
-0.0195159912109375,
-0.043121337890625,
0.0199737548828125,
-0.018341064453125,
-0.08819580078125,
0.1087646484375,
0.02752685546875,
0.058990478515625,
-0.006259918212890625,
0.032562255859375,
-0.0225677490234375,
-0.001739501953125,
-0.00589752197265625,
0.06536865234375,
0.00823974609375,
-0.01244354248046875,
0.0012302398681640625,
0.00669097900390625,
0.0023479461669921875,
-0.008819580078125,
0.08599853515625,
0.031036376953125,
-0.038970947265625,
-0.027099609375,
-0.003204345703125,
0.0005173683166503906,
-0.0367431640625,
0.052520751953125,
0.01123809814453125,
0.02996826171875,
0.06298828125,
-0.01435089111328125,
0.035003662109375,
0.0003592967987060547,
-0.0012607574462890625,
0.0218353271484375,
0.003726959228515625,
-0.0296783447265625,
0.0135498046875,
0.047210693359375,
-0.06280517578125,
0.0232086181640625,
0.03192138671875,
0.01715087890625,
0.0032501220703125,
0.00909423828125,
-0.003635406494140625,
-0.004306793212890625,
-0.0118255615234375,
-0.0188140869140625,
0.0232391357421875,
-0.00609588623046875,
0.005214691162109375,
0.035858154296875,
0.0206146240234375,
-0.01206207275390625,
0.03564453125,
0.0162811279296875,
0.039642333984375,
-0.024322509765625,
0.006046295166015625,
0.01012420654296875,
0.02593994140625,
-0.020233154296875,
0.027740478515625,
0.03021240234375,
0.0399169921875,
-0.0452880859375,
-0.0287017822265625,
-0.0012054443359375,
0.003520965576171875,
0.03875732421875,
0.007415771484375,
0.0732421875,
0.0133209228515625,
0.009918212890625,
0.0298309326171875,
0.01187896728515625,
0.0323486328125,
-0.040740966796875,
0.0283203125,
0.08404541015625,
-0.0161590576171875,
0.05645751953125,
-0.0236358642578125,
0.0202484130859375,
-0.0009708404541015625,
-0.00800323486328125,
0.001392364501953125,
0.02191162109375,
0.0390625,
0.01032257080078125,
-0.0084686279296875,
0.048675537109375,
0.00628662109375,
0.0113067626953125,
-0.03631591796875,
-0.06549072265625,
0.02044677734375,
0.03472900390625,
0.0269775390625,
0.004291534423828125,
0.04632568359375,
0.035888671875,
-0.034027099609375,
-0.01511383056640625,
-0.0082855224609375,
-0.0219573974609375,
0.0343017578125,
-0.02880859375,
0.0216827392578125,
0.02142333984375,
-0.019439697265625,
-0.0276336669921875,
-0.0298919677734375,
0.05987548828125,
0.01111602783203125,
-0.00971221923828125,
0.00719451904296875,
-0.05218505859375,
0.0054779052734375,
0.0217742919921875,
0.046356201171875,
0.041748046875,
-0.05511474609375,
0.008209228515625,
-0.032958984375,
-0.0733642578125,
0.0364990234375,
0.0455322265625,
-0.01030731201171875,
-0.0104827880859375,
0.038787841796875,
-0.01084136962890625,
-0.00640869140625,
0.006046295166015625,
0.0290679931640625,
-0.0261688232421875,
0.0084228515625,
-0.0033435821533203125,
-0.050567626953125,
-0.00952911376953125,
0.0037670135498046875,
-0.006622314453125,
0.00518798828125,
-0.0033054351806640625,
0.047515869140625,
-0.0065460205078125,
0.007518768310546875,
0.01029205322265625,
-0.00250244140625,
0.0289764404296875,
-0.01428985595703125,
-0.0062408447265625,
0.004093170166015625,
-0.00301361083984375,
-0.035675048828125,
0.0865478515625,
-0.01497650146484375,
0.022003173828125,
0.08038330078125,
-0.0177154541015625,
-0.0049896240234375,
-0.018707275390625,
0.020263671875,
-0.0245208740234375,
-0.10699462890625,
-0.06011962890625,
0.05767822265625,
-0.0087738037109375,
0.040771484375,
-0.032867431640625,
0.0246429443359375,
-0.0208282470703125,
-0.053466796875,
0.0161895751953125,
-0.06634521484375,
-0.006439208984375,
0.013763427734375,
0.04840087890625,
0.03216552734375,
-0.007480621337890625,
-0.02301025390625,
0.01212310791015625,
0.00656890869140625,
-0.0135650634765625,
-0.008941650390625,
-0.01087188720703125,
0.0472412109375,
0.05877685546875,
0.049652099609375,
-0.013702392578125,
0.0071258544921875,
0.042083740234375,
-0.0152587890625,
0.035736083984375,
-0.01552581787109375,
-0.0074615478515625,
-0.0085601806640625,
-0.038726806640625,
0.00966644287109375,
-0.0272979736328125,
-0.059234619140625,
-0.054931640625,
0.022918701171875,
0.013702392578125,
-0.003734588623046875,
-0.030242919921875,
0.01436614990234375,
-0.0257720947265625,
0.04302978515625,
-0.0040130615234375,
-0.022430419921875,
-0.0012388229370117188,
0.024658203125,
-0.00788116455078125,
-0.01629638671875,
-0.038970947265625,
0.025726318359375,
-0.0311126708984375,
-0.0012254714965820312,
0.005405426025390625,
-0.0186614990234375,
0.02105712890625,
-0.004207611083984375,
0.01267242431640625,
0.0352783203125,
0.02178955078125,
0.006008148193359375,
0.033233642578125,
0.016357421875,
-0.043243408203125,
-0.05780029296875,
0.0153350830078125,
-0.0157928466796875,
-0.0090484619140625,
-0.02130126953125,
-0.006130218505859375,
-0.00690460205078125,
-0.047454833984375,
-0.0731201171875,
0.0889892578125,
-0.030914306640625,
-0.0275726318359375,
-0.05279541015625,
0.00506591796875,
-0.0145111083984375,
-0.0031375885009765625,
-0.0256500244140625,
-0.01336669921875,
-0.00168609619140625,
0.05279541015625,
0.0211029052734375,
-0.033721923828125,
0.0302886962890625,
0.03155517578125,
-0.0281524658203125,
0.055389404296875,
0.04095458984375,
-0.005584716796875,
0.0050201416015625,
-0.0001291036605834961,
0.022491455078125,
0.0396728515625,
-0.033111572265625,
0.01904296875,
-0.0188751220703125,
0.0031986236572265625,
0.00472259521484375,
-0.008575439453125,
0.045440673828125,
0.033203125,
-0.01107025146484375,
-0.0035247802734375,
-0.020233154296875,
-0.0196380615234375,
-0.0460205078125,
-0.050201416015625,
0.01506805419921875,
-0.001964569091796875,
-0.00278472900390625,
-0.041900634765625,
0.0126190185546875,
-0.0006971359252929688,
-0.01413726806640625,
-0.0205535888671875,
0.005771636962890625,
-0.053253173828125,
-0.004528045654296875,
-0.01540374755859375,
-0.007617950439453125,
-0.0223388671875,
0.043060302734375,
0.012115478515625,
-0.013275146484375,
0.0146942138671875,
-0.0036163330078125,
-0.0163726806640625,
0.0213470458984375,
0.02935791015625,
0.035369873046875,
0.005218505859375,
-0.039154052734375,
0.002613067626953125,
0.0105743408203125,
0.021270751953125,
-0.029693603515625,
-0.059295654296875,
-0.021270751953125,
0.000568389892578125,
0.002460479736328125,
-0.00586700439453125,
0.01438140869140625,
-0.0162811279296875,
0.0016202926635742188,
0.01041412353515625,
0.022064208984375,
-0.035064697265625,
-0.0333251953125,
0.059173583984375,
-0.009674072265625,
-0.037200927734375,
-0.0099029541015625,
-0.00843048095703125,
0.02252197265625,
-0.019439697265625,
0.07232666015625,
-0.0194244384765625,
0.00940704345703125,
0.0006074905395507812,
0.005649566650390625,
0.020355224609375
] |
ef4d350d5a7674d3404881ff41225317dd25bae8
|
Wordpress Stackexchange
Q: What is the difference between terms and tags? I am working on a problem to get the most recently used tags within the last 30 days.
My current thought process is not working, so I am trying to come up with an alternative method.
I came across get_term and get_terms, thinking they may be a way to an actual functioning solution to my problem.
However, searching for "What is the difference between terms and tags in WordPress" is too general and I cannot find an answer.
What is the difference between tags and terms? It what situations would get_term or get_terms be used?
Thanks.
A: In general everything is a »Taxonomy«:
*
*category
*term
*link_category
*terms...
But there's also the difference between "hierarchical" and non-hierarchical (a.k.a. flat) Taxonomies - I guess I don't have to explain that.
|
Q: What is the difference between terms and tags? I am working on a problem to get the most recently used tags within the last 30 days.
My current thought process is not working, so I am trying to come up with an alternative method.
I came across get_term and get_terms, thinking they may be a way to an actual functioning solution to my problem.
However, searching for "What is the difference between terms and tags in WordPress" is too general and I cannot find an answer.
What is the difference between tags and terms? It what situations would get_term or get_terms be used?
Thanks.
A: In general everything is a »Taxonomy«:
*
*category
*term
*link_category
*terms...
But there's also the difference between "hierarchical" and non-hierarchical (a.k.a. flat) Taxonomies - I guess I don't have to explain that.
A: Simple yet tough question, taxonomies are just groups of categories, while terms are just single categories within these groups.*
So, for example, if you create a new post and choose category for it - the category itself is a term, and opening YourWordpressURL/wp-admin/edit-tags.php?taxonomy=category you're going to see all the categories (taxonomy).
Terms and Tags are similar at first glance, they just work differently:
http://lorelle.wordpress.com/2005/09/09/categories-versus-tags-whats-the-difference-and-which-one/
http://www.usabilitypost.com/2008/10/17/categories-vs-tags/
*this is possibly sometimes not true, as terms don't have to be categories, but I hate word "terms", it just confuses me, categories fits better
|
wordpress
|
{
"language": "en",
"length": 229,
"provenance": "stackexchange_00019.jsonl.gz:419344",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50013"
}
|
[
0.03741455078125,
-0.0009760856628417969,
-0.0238189697265625,
-0.02783203125,
0.032806396484375,
-0.0288543701171875,
0.03424072265625,
0.0035381317138671875,
0.006023406982421875,
0.00843048095703125,
-0.06646728515625,
0.00554656982421875,
-0.026519775390625,
-0.0016469955444335938,
-0.01557159423828125,
-0.05706787109375,
0.0300445556640625,
-0.05023193359375,
0.00792694091796875,
-0.021026611328125,
0.01139068603515625,
-0.01218414306640625,
0.057342529296875,
0.03472900390625,
0.041351318359375,
-0.071533203125,
0.005092620849609375,
-0.01934814453125,
0.017181396484375,
-0.030181884765625,
0.026092529296875,
0.022308349609375,
0.036712646484375,
0.0029926300048828125,
-0.04302978515625,
-0.0154876708984375,
-0.0309600830078125,
0.00957489013671875,
-0.0099029541015625,
0.002414703369140625,
0.0135955810546875,
0.0067138671875,
0.01277923583984375,
0.045745849609375,
-0.0215606689453125,
-0.0212860107421875,
0.01132965087890625,
-0.0311126708984375,
0.00400543212890625,
-0.059417724609375,
0.0513916015625,
-0.01045989990234375,
0.07330322265625,
-0.02838134765625,
-0.043609619140625,
-0.0011358261108398438,
0.0178070068359375,
-0.0203704833984375,
0.02166748046875,
-0.053192138671875,
-0.0287933349609375,
-0.0051422119140625,
0.03912353515625,
0.039337158203125,
0.012420654296875,
0.0263671875,
0.038787841796875,
0.027069091796875,
-0.040771484375,
-0.0108489990234375,
-0.00925445556640625,
-0.040802001953125,
0.006343841552734375,
-0.01253509521484375,
-0.01377105712890625,
-0.02410888671875,
0.0114593505859375,
-0.0272064208984375,
0.007671356201171875,
-0.0006585121154785156,
0.027557373046875,
0.0016622543334960938,
-0.037200927734375,
0.02001953125,
0.0012302398681640625,
0.029449462890625,
-0.01096343994140625,
-0.029510498046875,
-0.0194244384765625,
-0.0109710693359375,
-0.01715087890625,
-0.0010538101196289062,
-0.0654296875,
0.042266845703125,
0.01383209228515625,
-0.02166748046875,
0.0137481689453125,
0.03302001953125,
-0.023223876953125,
0.0169830322265625,
-0.04583740234375,
0.00011235475540161133,
0.005756378173828125,
-0.0287628173828125,
0.0292816162109375,
0.05523681640625,
-0.0182952880859375,
-0.000774383544921875,
0.06951904296875,
0.0185394287109375,
0.035003662109375,
0.07342529296875,
0.00814056396484375,
-0.037445068359375,
-0.0008559226989746094,
-0.0101776123046875,
-0.020965576171875,
0.040863037109375,
0.019989013671875,
0.007587432861328125,
-0.01203155517578125,
-0.00360870361328125,
0.0165252685546875,
0.042510986328125,
0.0011701583862304688,
0.02825927734375,
0.0007777214050292969,
-0.0290069580078125,
-0.054656982421875,
0.055084228515625,
-0.013153076171875,
0.0234527587890625,
0.0259857177734375,
-0.004665374755859375,
-0.0264892578125,
-0.0244293212890625,
-0.01497650146484375,
-0.025604248046875,
-0.0116729736328125,
0.0175018310546875,
-0.0221099853515625,
-0.0025920867919921875,
0.039337158203125,
-0.045166015625,
-0.032135009765625,
-0.0051727294921875,
0.0227508544921875,
0.0322265625,
-0.033203125,
-0.035614013671875,
0.04345703125,
-0.0278167724609375,
0.0501708984375,
-0.013458251953125,
-0.0782470703125,
-0.00788116455078125,
-0.03656005859375,
-0.0118560791015625,
-0.0226898193359375,
-0.046142578125,
0.0246124267578125,
-0.0105133056640625,
0.011383056640625,
-0.0029163360595703125,
-0.01441192626953125,
0.0153961181640625,
-0.03509521484375,
-0.0029964447021484375,
0.0205230712890625,
-0.03582763671875,
0.0684814453125,
-0.0186004638671875,
0.038177490234375,
0.00762939453125,
-0.005023956298828125,
-0.0005660057067871094,
-0.02716064453125,
0.0236663818359375,
0.01611328125,
-0.01129913330078125,
-0.0134735107421875,
-0.0474853515625,
0.0222015380859375,
-0.0205078125,
-0.0224151611328125,
-0.0018444061279296875,
-0.0003571510314941406,
0.021514892578125,
0.0269622802734375,
0.01523590087890625,
0.0270843505859375,
-0.004749298095703125,
-0.0212249755859375,
0.053314208984375,
0.0404052734375,
-0.02679443359375,
-0.0743408203125,
-0.004245758056640625,
-0.0217742919921875,
-0.072509765625,
-0.01629638671875,
0.0304107666015625,
-0.0105743408203125,
0.0143585205078125,
-0.033477783203125,
0.020111083984375,
-0.025787353515625,
0.038665771484375,
-0.040191650390625,
0.0087127685546875,
0.01523590087890625,
-0.03472900390625,
-0.01421356201171875,
0.024261474609375,
0.023406982421875,
-0.0109405517578125,
-0.051483154296875,
-0.01837158203125,
-0.0045318603515625,
-0.0144805908203125,
0.0198516845703125,
0.006092071533203125,
0.0028896331787109375,
0.0029659271240234375,
0.0184478759765625,
0.0069732666015625,
-0.0148162841796875,
0.0094146728515625,
0.018035888671875,
0.0435791015625,
-0.018157958984375,
-0.018951416015625,
0.05120849609375,
0.06536865234375,
0.01470184326171875,
0.01390838623046875,
0.04400634765625,
-0.06414794921875,
0.003814697265625,
0.0278167724609375,
0.0224761962890625,
0.0074615478515625,
-0.055084228515625,
-0.040771484375,
0.046142578125,
-0.0345458984375,
-0.0178070068359375,
-0.018798828125,
-0.01371002197265625,
-0.010345458984375,
0.0310821533203125,
-0.006694793701171875,
0.021392822265625,
0.0258331298828125,
-0.01262664794921875,
0.023406982421875,
-0.027435302734375,
0.006927490234375,
0.038177490234375,
-0.0210723876953125,
0.00327301025390625,
-0.0401611328125,
-0.003662109375,
-0.02587890625,
-0.006793975830078125,
0.03466796875,
0.00328826904296875,
0.02874755859375,
-0.036407470703125,
0.022064208984375,
0.028594970703125,
0.0286407470703125,
0.01849365234375,
0.039031982421875,
0.0206298828125,
0.0215911865234375,
-0.023773193359375,
-0.037841796875,
0.01313018798828125,
0.0243377685546875,
-0.00492095947265625,
0.00855255126953125,
0.005218505859375,
-0.0020580291748046875,
-0.0007166862487792969,
-0.01800537109375,
0.0173797607421875,
0.019378662109375,
-0.047393798828125,
-0.0104827880859375,
0.01385498046875,
0.0200042724609375,
-0.0296783447265625,
0.02374267578125,
-0.010833740234375,
0.007049560546875,
-0.044342041015625,
-0.0058746337890625,
-0.0022830963134765625,
-0.019683837890625,
0.029937744140625,
0.050567626953125,
0.0235748291015625,
-0.016815185546875,
0.0272674560546875,
-0.0110321044921875,
0.04632568359375,
-0.0306854248046875,
-0.0313720703125,
0.0877685546875,
-0.1552734375,
-0.035552978515625,
0.00965118408203125,
0.00832366943359375,
-0.019500732421875,
-0.03948974609375,
-0.049285888671875,
-0.0016946792602539062,
-0.087646484375,
-0.0227813720703125,
0.004878997802734375,
-0.05072021484375,
-0.001544952392578125,
-0.007244110107421875,
-0.022979736328125,
-0.011444091796875,
0.0095977783203125,
0.01523590087890625,
0.0203704833984375,
-0.01271820068359375,
-0.0232696533203125,
-0.020477294921875,
-0.04168701171875,
0.02313232421875,
-0.00690460205078125,
-0.00695037841796875,
0.002758026123046875,
0.059661865234375,
0.0005555152893066406,
-0.0218963623046875,
-0.00540924072265625,
-0.0160369873046875,
-0.0033893585205078125,
-0.0103912353515625,
0.009124755859375,
-0.02239990234375,
0.0195159912109375,
0.00353240966796875,
-0.007537841796875,
0.0283203125,
-0.017303466796875,
-0.025115966796875,
-0.0169219970703125,
-0.0026264190673828125,
0.034912109375,
-0.0011014938354492188,
-0.0176544189453125,
0.0220947265625,
0.05169677734375,
-0.01499176025390625,
-0.051666259765625,
0.0082550048828125,
-0.0241546630859375,
0.04095458984375,
0.0128326416015625,
-0.007183074951171875,
-0.004261016845703125,
0.03887939453125,
-0.0171661376953125,
-0.006649017333984375,
-0.0163421630859375,
-0.0210723876953125,
0.0382080078125,
-0.01540374755859375,
-0.0165863037109375,
0.0010471343994140625,
-0.026519775390625,
-0.051544189453125,
0.03729248046875,
-0.033966064453125,
-0.023681640625,
-0.0286712646484375,
0.00798797607421875,
-0.01386260986328125,
-0.056610107421875,
0.03533935546875,
-0.073486328125,
-0.01690673828125,
-0.040191650390625,
-0.00511932373046875,
0.0084381103515625,
0.06488037109375,
-0.0012969970703125,
-0.0160369873046875,
0.0028743743896484375,
0.0029010772705078125,
-0.030914306640625,
-0.03125,
-0.03961181640625,
-0.01287841796875,
-0.0457763671875,
0.01165771484375,
-0.01861572265625,
0.0186920166015625,
-0.0565185546875,
0.0579833984375,
-0.043243408203125,
-0.0227508544921875,
0.0386962890625,
-0.0278472900390625,
0.024810791015625,
0.00325775146484375,
-0.004608154296875,
-0.01116180419921875,
-0.037261962890625,
-0.0015430450439453125,
0.0285797119140625,
0.0007367134094238281,
0.0079498291015625,
-0.042694091796875,
0.01080322265625,
-0.0245208740234375,
0.00919342041015625,
0.0183258056640625,
0.00443267822265625,
-0.00824737548828125,
0.021331787109375,
0.009033203125,
0.039520263671875,
-0.0277099609375,
-0.01131439208984375,
-0.025909423828125,
-0.03424072265625,
-0.06182861328125,
-0.0137786865234375,
0.03143310546875,
0.01187896728515625,
0.07354736328125,
-0.0242462158203125,
0.0230712890625,
-0.033050537109375,
-0.021575927734375,
-0.029541015625,
-0.0263671875,
-0.00278472900390625,
-0.0213470458984375,
-0.0004165172576904297,
-0.04071044921875,
0.046112060546875,
0.048065185546875,
-0.017059326171875,
-0.01085662841796875,
0.0540771484375,
0.01212310791015625,
-0.039306640625,
-0.0394287109375,
0.0184783935546875,
0.04052734375,
-0.02056884765625,
0.026824951171875,
0.0007228851318359375,
-0.0338134765625,
0.085693359375,
-0.0178680419921875,
0.006450653076171875,
0.009613037109375,
0.029876708984375,
0.0029850006103515625,
-0.00783538818359375,
0.00585174560546875,
0.00983428955078125,
-0.0218048095703125,
0.005420684814453125,
-0.0360107421875,
-0.023895263671875,
-0.0182342529296875,
0.07171630859375,
-0.032562255859375,
0.0335693359375,
-0.0517578125,
-0.007068634033203125,
0.010772705078125,
0.0162200927734375,
-0.0253143310546875,
-0.001628875732421875,
0.011932373046875,
-0.0439453125,
-0.01849365234375,
-0.005672454833984375,
-0.03497314453125,
-0.0306549072265625,
-0.016448974609375,
0.01435089111328125,
-0.033905029296875,
-0.0110931396484375,
0.001316070556640625,
-0.0014200210571289062,
0.06304931640625,
-0.0128631591796875,
-0.060699462890625,
0.03961181640625,
-0.0219879150390625,
-0.0108642578125,
0.057373046875,
-0.004970550537109375,
0.01428985595703125,
-0.0294036865234375,
-0.0262451171875,
0.012969970703125,
0.0029144287109375,
-0.050689697265625,
-0.0290679931640625,
-0.043670654296875,
-0.007724761962890625,
-0.019134521484375,
0.00881195068359375,
0.033050537109375,
-0.07012939453125,
0.039825439453125,
-0.0006122589111328125,
-0.009735107421875,
-0.007083892822265625,
0.0205535888671875,
0.026336669921875,
-0.002532958984375,
0.00634765625,
-0.021209716796875,
0.015777587890625,
-0.0268402099609375,
-0.0093536376953125,
0.01549530029296875,
0.0182952880859375,
-0.01210784912109375,
-0.0181427001953125,
0.037567138671875,
0.00722503662109375,
-0.033935546875,
0.02142333984375,
0.01508331298828125,
-0.0090179443359375,
-0.0216217041015625,
-0.027313232421875,
0.019775390625,
0.02325439453125,
-0.04229736328125,
0.0948486328125,
0.003681182861328125,
0.07562255859375,
0.004058837890625,
-0.00749969482421875,
0.032745361328125,
0.031524658203125,
-0.03662109375,
-0.0152587890625,
0.02349853515625,
-0.02874755859375,
-0.0102081298828125,
-0.039093017578125,
-0.04388427734375,
0.050018310546875,
0.004978179931640625,
0.06103515625,
-0.03546142578125,
-0.03302001953125,
0.00047206878662109375,
-0.01038360595703125,
0.0550537109375,
0.0230255126953125,
-0.073974609375,
-0.0163116455078125,
-0.0550537109375,
-0.0014219284057617188,
-0.06744384765625,
-0.041961669921875,
-0.032928466796875,
0.02734375,
-0.031768798828125,
0.0162811279296875,
0.0069122314453125,
0.055206298828125,
0.00244903564453125,
0.032470703125,
-0.0250091552734375,
0.0263671875,
0.0272979736328125,
-0.068115234375,
0.005615234375,
-0.00787353515625,
0.0012025833129882812,
-0.04351806640625,
0.0035247802734375,
-0.0418701171875,
-0.0010499954223632812,
-0.0882568359375,
-0.0137939453125,
-0.01776123046875,
-0.02215576171875,
0.022064208984375,
0.0066070556640625,
0.01454925537109375,
0.0307159423828125,
-0.0010776519775390625,
0.013275146484375,
0.00597381591796875,
-0.0127716064453125,
0.0023975372314453125,
-0.003307342529296875,
0.043060302734375,
-0.0175323486328125,
0.035400390625,
0.0068359375,
-0.0032482147216796875,
0.0064544677734375,
-0.0287933349609375,
0.019561767578125,
0.029266357421875,
0.061370849609375,
-0.0526123046875,
-0.0321044921875,
-0.0174560546875,
0.0224456787109375,
-0.0016727447509765625,
0.048736572265625,
0.04193115234375,
0.025634765625,
-0.0223541259765625,
-0.03875732421875,
0.05078125,
0.0218658447265625,
-0.01239776611328125,
0.05328369140625,
-0.03228759765625,
-0.02935791015625,
0.01194000244140625,
0.029022216796875,
-0.01384735107421875,
-0.01495361328125,
0.028778076171875,
-0.01122283935546875,
-0.0399169921875,
0.053131103515625,
-0.05438232421875,
-0.06402587890625,
-0.031036376953125,
-0.0281524658203125,
-0.01074981689453125,
-0.00904083251953125,
0.03436279296875,
-0.00942230224609375,
-0.028564453125,
0.045684814453125,
0.0143280029296875,
0.0159912109375,
-0.02545166015625,
-0.0189361572265625,
-0.007049560546875,
-0.0161590576171875,
0.0245819091796875,
-0.0231781005859375,
-0.00911712646484375,
-0.04608154296875,
-0.00011986494064331055,
0.0119781494140625,
-0.01110076904296875,
0.010498046875,
-0.027496337890625,
-0.01255035400390625,
-0.004344940185546875,
-0.01763916015625,
-0.022979736328125,
-0.02764892578125,
-0.051025390625,
-0.0256195068359375,
0.0104217529296875,
0.0121002197265625,
0.0272979736328125,
0.00464630126953125,
0.01019287109375,
-0.034881591796875,
0.00389862060546875,
-0.0237579345703125,
-0.0625,
0.0458984375,
-0.01241302490234375,
-0.0087738037109375,
0.029388427734375,
0.0233154296875,
-0.0088043212890625,
0.00127410888671875,
-0.027984619140625,
-0.0186920166015625,
0.01558685302734375,
-0.01898193359375,
-0.034423828125,
0.032989501953125,
-0.008209228515625,
-0.052093505859375,
0.05889892578125,
0.050018310546875,
-0.003997802734375,
0.0036754608154296875,
0.025177001953125,
-0.061614990234375,
-0.016021728515625,
-0.0638427734375,
0.03839111328125,
-0.00927734375,
0.03704833984375,
-0.03594970703125,
0.021240234375,
0.0029926300048828125,
-0.0259246826171875,
0.0662841796875,
0.01204681396484375,
-0.0008387565612792969,
-0.01267242431640625,
0.057830810546875,
0.032501220703125,
-0.0212554931640625,
0.033721923828125,
0.03106689453125,
0.00855255126953125,
0.058013916015625,
0.01348114013671875,
0.039581298828125,
-0.006015777587890625,
0.00927734375,
0.057891845703125,
0.0099334716796875,
-0.01119232177734375,
-0.033294677734375,
0.01134490966796875,
-0.04443359375,
-0.01070404052734375,
0.017578125,
0.02264404296875,
0.018310546875,
0.0125274658203125,
0.0268096923828125,
-0.056732177734375,
-0.0096435546875,
-0.025054931640625,
0.03936767578125,
-0.01064300537109375,
0.06866455078125,
0.044342041015625,
0.0242156982421875,
0.08502197265625,
-0.01629638671875,
0.0511474609375,
-0.00315093994140625,
-0.02996826171875,
0.044097900390625,
-0.009765625,
0.019866943359375,
-0.0859375,
-0.0183258056640625,
0.054595947265625,
0.07928466796875,
-0.033538818359375,
-0.052276611328125,
0.00414276123046875,
0.005290985107421875,
0.01461029052734375,
-0.003398895263671875,
0.00299835205078125,
0.0187225341796875,
0.057098388671875,
-0.057525634765625,
0.0101776123046875,
0.0297698974609375,
0.0014514923095703125,
0.006069183349609375,
0.041168212890625,
-0.023773193359375,
0.0020084381103515625,
-0.0291595458984375,
0.02880859375,
0.02130126953125,
0.007381439208984375,
-0.03070068359375,
0.046295166015625,
0.007320404052734375,
0.007274627685546875,
-0.0134429931640625,
0.03277587890625,
0.00846099853515625,
0.0133514404296875,
-0.028778076171875,
-0.0269927978515625,
0.02301025390625,
0.02740478515625,
0.03240966796875,
-0.029693603515625,
-0.011810302734375,
0.0374755859375,
0.02044677734375,
-0.0009813308715820312,
0.048828125,
0.021270751953125,
-0.034515380859375,
-0.019622802734375,
-0.00908660888671875,
0.044403076171875,
-0.0010967254638671875,
0.035675048828125,
0.007167816162109375,
0.046630859375,
-0.053436279296875,
0.08636474609375,
-0.0203857421875,
0.0278472900390625,
0.0304107666015625,
-0.05963134765625,
0.004886627197265625,
-0.04010009765625,
-0.0243377685546875,
-0.0122833251953125,
-0.0278472900390625,
0.01447296142578125,
-0.004856109619140625,
0.0097198486328125,
-0.00534820556640625,
0.04095458984375,
0.00966644287109375,
-0.0252685546875,
-0.002117156982421875,
0.0181121826171875,
0.02398681640625,
0.033843994140625,
0.01226806640625,
0.007411956787109375,
-0.04144287109375,
-0.01522064208984375,
0.0219879150390625,
-0.0025234222412109375,
-0.0216064453125,
0.0528564453125,
0.009185791015625,
-0.0007090568542480469,
-0.031982421875,
0.08282470703125,
-0.09405517578125,
-0.04791259765625,
0.0833740234375,
-0.0248870849609375,
-0.02349853515625,
0.00421142578125,
-0.002208709716796875,
0.01148223876953125,
0.03997802734375,
-0.03985595703125,
-0.00494384765625,
0.00444793701171875,
0.0077972412109375,
-0.0186614990234375,
0.0318603515625,
-0.0231170654296875,
-0.0120391845703125,
-0.0278778076171875,
-0.039886474609375,
0.0218353271484375,
-0.0106048583984375,
0.00778961181640625,
0.00528717041015625,
-0.005645751953125,
-0.0204925537109375,
0.00563812255859375,
-0.0175628662109375,
-0.0215606689453125,
0.004665374755859375,
0.036956787109375,
-0.04864501953125,
0.004764556884765625,
-0.034820556640625,
0.00399017333984375,
-0.007808685302734375,
0.04034423828125,
0.00183868408203125,
-0.07379150390625,
-0.034820556640625,
-0.0093231201171875,
0.0238494873046875,
-0.0255584716796875,
0.01800537109375,
-0.028472900390625,
0.01403045654296875,
-0.0090484619140625,
-0.043426513671875,
-0.02691650390625,
-0.048858642578125,
-0.0030536651611328125,
0.0149688720703125,
-0.0201568603515625,
-0.0272216796875,
-0.03369140625,
0.00884246826171875,
0.021453857421875,
-0.0021762847900390625,
0.0174560546875,
0.017913818359375,
-0.045135498046875,
-0.039215087890625,
0.0209808349609375,
-0.0560302734375,
0.0222320556640625,
0.0078887939453125,
-0.032623291015625,
-0.006557464599609375,
-0.0294342041015625,
-0.031005859375,
-0.0202484130859375,
0.03216552734375,
0.0239410400390625,
-0.03240966796875,
0.01995849609375,
0.0460205078125,
0.038421630859375,
0.0986328125,
0.014068603515625,
-0.01666259765625,
-0.0335693359375,
0.0273284912109375,
-0.049896240234375,
-0.0177154541015625,
0.049468994140625,
-0.01224517822265625,
-0.04779052734375,
-0.04425048828125,
-0.01117706298828125,
-0.0180206298828125,
-0.0706787109375,
-0.1129150390625,
0.06231689453125,
-0.0284271240234375,
-0.037506103515625,
-0.0482177734375,
-0.01335906982421875,
0.002742767333984375,
0.0028972625732421875,
-0.0146331787109375,
0.004177093505859375,
-0.037933349609375,
0.0163726806640625,
0.029937744140625,
-0.0007805824279785156,
0.0396728515625,
0.019317626953125,
-0.0227203369140625,
0.01538848876953125,
0.003208160400390625,
-0.00910186767578125,
0.01107025146484375,
0.010162353515625,
-0.01068115234375,
0.016204833984375,
-0.037872314453125,
-0.010284423828125,
-0.041290283203125,
-0.0035877227783203125,
0.006458282470703125,
-0.048919677734375,
0.01824951171875,
-0.01222991943359375,
0.006229400634765625,
-0.016998291015625,
-0.017181396484375,
-0.0204620361328125,
-0.004589080810546875,
0.034149169921875,
-0.01971435546875,
-0.00641632080078125,
0.0296173095703125,
-0.06719970703125,
-0.03076171875,
0.00875091552734375,
-0.0279693603515625,
0.022705078125,
-0.023590087890625,
-0.07073974609375,
0.020660400390625,
-0.042633056640625,
-0.01233673095703125,
-0.08453369140625,
-0.01418304443359375,
-0.00637054443359375,
-0.00811767578125,
-0.0259246826171875,
-0.004169464111328125,
0.00864410400390625,
-0.0252838134765625,
0.01485443115234375,
0.01418304443359375,
0.00905609130859375,
0.0162353515625,
0.02099609375,
0.0445556640625,
-0.03167724609375,
0.036224365234375,
-0.005855560302734375,
-0.006805419921875,
0.039215087890625,
0.0011444091796875,
0.02435302734375,
-0.021331787109375,
0.07867431640625,
0.0228271484375,
0.04681396484375,
0.0151214599609375,
0.045196533203125,
-0.0133056640625,
0.053314208984375,
-0.042816162109375,
-0.018585205078125,
-0.032440185546875,
-0.0163116455078125,
0.0096282958984375,
-0.00936126708984375,
-0.00522613525390625,
-0.030731201171875,
0.0033397674560546875,
-0.0153045654296875,
-0.0177764892578125,
0.023284912109375
] |
719a2c07b5ec9842a983d2c30ddb1fd79acbcbbd
|
Wordpress Stackexchange
Q: Passing variables to templates (alternatives to globalizing variables) I want to make my WP code simpler (there's some mess within header.php, page.php etc.). So, for example, I want to set something like this global:
$foo = get_option('foo');
So $foo will work properly used anywhere in page.php, header.php, footer.php, loop.php and also within different theme files linked to functions.php (require_once).
I already know two ways of achieving this, both require editing functions.php:
Global dynamic function
function foo() {
return 'bar';
}
Global constant
define('FOO_BAR', 'directory');
Do I really need to fire a function in multiple places just for one variable? Isn't it an overkill?
A: You could also use this function:
set_query_var('foo', $foo);
WP will extract and expose all query variables in every template it loads, so you will be able to access it as $foo
|
Q: Passing variables to templates (alternatives to globalizing variables) I want to make my WP code simpler (there's some mess within header.php, page.php etc.). So, for example, I want to set something like this global:
$foo = get_option('foo');
So $foo will work properly used anywhere in page.php, header.php, footer.php, loop.php and also within different theme files linked to functions.php (require_once).
I already know two ways of achieving this, both require editing functions.php:
Global dynamic function
function foo() {
return 'bar';
}
Global constant
define('FOO_BAR', 'directory');
Do I really need to fire a function in multiple places just for one variable? Isn't it an overkill?
A: You could also use this function:
set_query_var('foo', $foo);
WP will extract and expose all query variables in every template it loads, so you will be able to access it as $foo
|
wordpress
|
{
"language": "en",
"length": 136,
"provenance": "stackexchange_00019.jsonl.gz:419345",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50014"
}
|
[
0.004085540771484375,
-0.00885772705078125,
-0.0266876220703125,
-0.0242919921875,
0.00891876220703125,
-0.0187835693359375,
0.031341552734375,
-0.0022907257080078125,
0.032318115234375,
-0.005710601806640625,
-0.053192138671875,
-0.009613037109375,
-0.01263427734375,
0.000522613525390625,
-0.0105438232421875,
-0.0271148681640625,
0.029693603515625,
-0.021636962890625,
0.01082611083984375,
-0.0240478515625,
-0.0044403076171875,
-0.0022373199462890625,
0.032623291015625,
0.06439208984375,
0.044281005859375,
-0.07159423828125,
-0.0105438232421875,
0.007526397705078125,
-0.005786895751953125,
-0.0164642333984375,
0.01428985595703125,
0.036224365234375,
0.01690673828125,
0.00930023193359375,
0.016265869140625,
0.0005583763122558594,
0.003520965576171875,
0.006771087646484375,
0.024383544921875,
-0.0035858154296875,
0.0233154296875,
-0.021942138671875,
0.0117034912109375,
0.041046142578125,
-0.005023956298828125,
-0.041473388671875,
0.04254150390625,
-0.036041259765625,
-0.0128326416015625,
0.047637939453125,
0.03497314453125,
0.001819610595703125,
0.039825439453125,
0.0023746490478515625,
0.00860595703125,
0.00728607177734375,
0.0218048095703125,
-0.040496826171875,
0.030303955078125,
0.004695892333984375,
-0.035888671875,
-0.01629638671875,
0.030975341796875,
-0.025115966796875,
0.043609619140625,
-0.0008025169372558594,
0.0003299713134765625,
0.055328369140625,
-0.05926513671875,
0.0148162841796875,
0.0266265869140625,
-0.045135498046875,
-0.01519775390625,
-0.018463134765625,
-0.00036215782165527344,
-0.03271484375,
0.030487060546875,
-0.013427734375,
-0.017486572265625,
0.0175323486328125,
-0.0289459228515625,
-0.028533935546875,
-0.0179901123046875,
-0.03521728515625,
0.00974273681640625,
-0.002269744873046875,
-0.007381439208984375,
0.0142059326171875,
-0.004795074462890625,
-0.0418701171875,
-0.0185699462890625,
0.034454345703125,
-0.0384521484375,
-0.0192718505859375,
-0.0265655517578125,
-0.01284027099609375,
-0.016845703125,
0.005901336669921875,
-0.0212860107421875,
0.02374267578125,
-0.03631591796875,
-0.01442718505859375,
0.023956298828125,
-0.024017333984375,
-0.020965576171875,
0.06707763671875,
0.029754638671875,
0.08209228515625,
0.00928497314453125,
0.0134429931640625,
0.016876220703125,
-0.02947998046875,
0.02935791015625,
0.00836944580078125,
-0.03729248046875,
-0.005573272705078125,
0.002838134765625,
-0.008209228515625,
0.00766754150390625,
0.0135345458984375,
0.01442718505859375,
0.0153045654296875,
0.0316162109375,
0.006755828857421875,
-0.01451873779296875,
-0.0162353515625,
-0.02471923828125,
-0.038604736328125,
-0.043304443359375,
0.036956787109375,
-0.0200958251953125,
0.0120391845703125,
0.0633544921875,
0.016845703125,
-0.00934600830078125,
-0.0271453857421875,
0.004886627197265625,
0.03314208984375,
0.03265380859375,
-0.0198211669921875,
0.021392822265625,
-0.02618408203125,
-0.01229095458984375,
0.022216796875,
0.004390716552734375,
0.011871337890625,
0.057830810546875,
0.028045654296875,
-0.048675537109375,
-0.044586181640625,
0.024261474609375,
0.06329345703125,
0.03326416015625,
-0.0081787109375,
-0.0171051025390625,
-0.00379180908203125,
-0.01377105712890625,
-0.00820159912109375,
-0.0174560546875,
0.01221466064453125,
-0.041717529296875,
-0.035919189453125,
0.0008006095886230469,
-0.0404052734375,
-0.0296478271484375,
0.02301025390625,
0.0033626556396484375,
0.01079559326171875,
0.0022754669189453125,
0.00580596923828125,
0.0048065185546875,
0.0171356201171875,
-0.017547607421875,
0.004215240478515625,
0.0096282958984375,
0.00571441650390625,
-0.05206298828125,
0.031585693359375,
0.039398193359375,
-0.060272216796875,
-0.038909912109375,
-0.039703369140625,
0.059722900390625,
-0.0228118896484375,
-0.04010009765625,
0.00508880615234375,
-0.006664276123046875,
0.007541656494140625,
0.01415252685546875,
-0.0037441253662109375,
0.01222991943359375,
0.0258331298828125,
-0.0269775390625,
0.021026611328125,
0.0140380859375,
0.0128631591796875,
-0.020355224609375,
0.019866943359375,
-0.004062652587890625,
-0.03118896484375,
0.0117340087890625,
0.01088714599609375,
0.0219268798828125,
-0.023468017578125,
-0.00014472007751464844,
-0.01352691650390625,
0.0027103424072265625,
0.0252685546875,
-0.0203399658203125,
0.00033664703369140625,
0.0218353271484375,
-0.0132293701171875,
-0.0118865966796875,
-0.0135040283203125,
-0.03887939453125,
0.01491546630859375,
-0.01113128662109375,
0.07733154296875,
0.0239105224609375,
0.057342529296875,
0.052642822265625,
-0.062164306640625,
0.046722412109375,
0.00838470458984375,
0.03436279296875,
-0.0006995201110839844,
-0.0439453125,
-0.0198516845703125,
-0.034271240234375,
-0.001544952392578125,
-0.061798095703125,
0.088134765625,
-0.0277557373046875,
0.0155792236328125,
0.00884246826171875,
-0.004428863525390625,
-0.01398468017578125,
-0.06573486328125,
0.0075836181640625,
0.03314208984375,
0.046905517578125,
0.0736083984375,
-0.01020050048828125,
-0.0307464599609375,
0.06170654296875,
-0.041046142578125,
0.0074462890625,
-0.044097900390625,
0.00766754150390625,
0.004062652587890625,
0.0184326171875,
-0.036407470703125,
0.01146697998046875,
-0.07666015625,
0.006610870361328125,
0.0172119140625,
-0.038482666015625,
-0.0084381103515625,
0.0099639892578125,
0.016510009765625,
-0.025177001953125,
-0.016265869140625,
0.031890869140625,
-0.033355712890625,
0.062042236328125,
-0.048736572265625,
-0.00543212890625,
-0.02093505859375,
-0.0291290283203125,
-0.0031909942626953125,
0.034912109375,
-0.02593994140625,
-0.00986480712890625,
-0.025787353515625,
-0.0516357421875,
-0.022796630859375,
-0.020599365234375,
0.039459228515625,
-0.0226593017578125,
-0.052581787109375,
-0.01082611083984375,
0.005924224853515625,
-0.0433349609375,
-0.0026683807373046875,
0.0298004150390625,
-0.0325927734375,
-0.0028934478759765625,
-0.01006317138671875,
0.06585693359375,
0.010345458984375,
0.0207061767578125,
0.0281982421875,
-0.0171966552734375,
0.06927490234375,
-0.018096923828125,
-0.0313720703125,
0.0297393798828125,
-0.007617950439453125,
0.00835418701171875,
-0.02032470703125,
0.040924072265625,
0.040679931640625,
-0.00815582275390625,
-0.014892578125,
-0.008880615234375,
0.0274658203125,
0.0180511474609375,
-0.009552001953125,
-0.00647735595703125,
-0.02545166015625,
-0.00661468505859375,
-0.0048675537109375,
0.0167694091796875,
0.016357421875,
0.006084442138671875,
-0.0196380615234375,
-0.005764007568359375,
0.00872802734375,
-0.045654296875,
-0.037353515625,
0.054473876953125,
-0.03851318359375,
-0.0073699951171875,
-0.0126953125,
-0.025787353515625,
-0.027435302734375,
-0.01427459716796875,
-0.005710601806640625,
0.05462646484375,
-0.03564453125,
-0.07916259765625,
-0.046539306640625,
-0.09783935546875,
-0.035552978515625,
-0.013519287109375,
-0.00396728515625,
-0.0131988525390625,
0.0797119140625,
-0.003448486328125,
-0.036468505859375,
-0.010955810546875,
-0.026885986328125,
0.014434814453125,
0.00893402099609375,
0.049652099609375,
-0.0577392578125,
0.01526641845703125,
-0.01009368896484375,
0.0111846923828125,
0.02789306640625,
-0.0244598388671875,
-0.0107421875,
0.01065826416015625,
0.030120849609375,
0.032684326171875,
0.020111083984375,
-0.002773284912109375,
0.00733184814453125,
0.018585205078125,
-0.052459716796875,
-0.033050537109375,
0.00905609130859375,
-0.04248046875,
-0.01168060302734375,
0.04669189453125,
-0.0222320556640625,
-0.025238037109375,
0.00656890869140625,
0.01241302490234375,
-0.004848480224609375,
-0.008148193359375,
-0.00444793701171875,
-0.0007548332214355469,
0.0082244873046875,
0.0264892578125,
0.00835418701171875,
0.032684326171875,
-0.0193328857421875,
0.009368896484375,
0.0228118896484375,
0.0035190582275390625,
0.010955810546875,
-0.0063323974609375,
-0.002239227294921875,
-0.037078857421875,
0.050628662109375,
0.0221405029296875,
0.0029888153076171875,
-0.020965576171875,
-0.02838134765625,
-0.00479888916015625,
0.0633544921875,
-0.0207061767578125,
-0.0198516845703125,
-0.004108428955078125,
0.0224761962890625,
-0.05657958984375,
-0.035186767578125,
-0.01123809814453125,
-0.01305389404296875,
-0.019317626953125,
-0.0009293556213378906,
-0.00955963134765625,
-0.0006136894226074219,
-0.04364013671875,
0.0305938720703125,
-0.028717041015625,
-0.0214691162109375,
0.0208892822265625,
-0.04144287109375,
0.0037555694580078125,
0.0151824951171875,
-0.0152587890625,
-0.01554107666015625,
-0.0032672882080078125,
-0.04156494140625,
-0.0162353515625,
-0.0188140869140625,
0.01983642578125,
0.04766845703125,
0.0204925537109375,
-0.03997802734375,
-0.01983642578125,
0.0228729248046875,
-0.01403045654296875,
0.0014848709106445312,
0.024505615234375,
0.01947021484375,
0.0239715576171875,
0.006412506103515625,
0.0277252197265625,
-0.0120391845703125,
0.01605224609375,
-0.0062255859375,
-0.050872802734375,
-0.0306396484375,
-0.0284423828125,
-0.03521728515625,
0.003047943115234375,
-0.037109375,
-0.06793212890625,
0.018798828125,
0.031402587890625,
0.0152130126953125,
-0.00015652179718017578,
-0.000058770179748535156,
0.0176239013671875,
-0.058563232421875,
0.06488037109375,
0.0491943359375,
-0.009368896484375,
-0.011749267578125,
0.06048583984375,
0.0237274169921875,
-0.047515869140625,
0.0029773712158203125,
0.0019273757934570312,
0.03424072265625,
-0.0220489501953125,
0.0156707763671875,
-0.00897979736328125,
-0.02520751953125,
0.026153564453125,
-0.0029087066650390625,
0.04302978515625,
-0.036590576171875,
0.014556884765625,
-0.00736236572265625,
-0.0307159423828125,
0.036346435546875,
0.02667236328125,
-0.01387786865234375,
0.042572021484375,
0.0012350082397460938,
-0.054046630859375,
-0.01666259765625,
0.061767578125,
-0.0172119140625,
0.03802490234375,
-0.042205810546875,
-0.02783203125,
0.019012451171875,
-0.035186767578125,
0.015625,
-0.0021457672119140625,
0.0136566162109375,
-0.00024366378784179688,
-0.002033233642578125,
0.014984130859375,
0.09832763671875,
0.0616455078125,
-0.01540374755859375,
0.0419921875,
0.049560546875,
-0.01806640625,
0.020538330078125,
-0.01751708984375,
0.0498046875,
-0.0034465789794921875,
-0.045379638671875,
-0.002918243408203125,
-0.0010051727294921875,
0.032928466796875,
0.00323486328125,
-0.01255035400390625,
0.0162200927734375,
-0.003833770751953125,
0.01493072509765625,
0.00910186767578125,
-0.0174102783203125,
-0.01898193359375,
-0.011199951171875,
0.0692138671875,
0.0181121826171875,
0.00955963134765625,
-0.0028209686279296875,
0.0880126953125,
-0.01300811767578125,
0.04400634765625,
-0.0189971923828125,
-0.021026611328125,
-0.0080108642578125,
0.01143646240234375,
0.025665283203125,
-0.00833892822265625,
0.0089111328125,
-0.0121002197265625,
0.03106689453125,
-0.0145721435546875,
-0.0024776458740234375,
0.0204925537109375,
0.036376953125,
0.00421905517578125,
-0.005863189697265625,
-0.01535797119140625,
-0.0167694091796875,
-0.0221099853515625,
0.015960693359375,
-0.015625,
-0.04168701171875,
-0.0185546875,
0.002994537353515625,
0.03533935546875,
0.0104522705078125,
-0.00771331787109375,
-0.05120849609375,
-0.0421142578125,
-0.0133209228515625,
0.005413055419921875,
-0.003734588623046875,
-0.0224456787109375,
-0.02484130859375,
0.00077056884765625,
0.01212310791015625,
-0.0027103424072265625,
-0.06134033203125,
-0.045562744140625,
-0.019622802734375,
-0.0051422119140625,
0.04571533203125,
-0.04315185546875,
0.0174102783203125,
-0.0012760162353515625,
-0.006931304931640625,
0.023040771484375,
0.0165863037109375,
0.05426025390625,
0.048919677734375,
-0.052734375,
-0.0034427642822265625,
-0.06512451171875,
0.0024089813232421875,
-0.0679931640625,
-0.06524658203125,
-0.048980712890625,
0.0101165771484375,
-0.0049285888671875,
0.019287109375,
0.0022640228271484375,
0.00202178955078125,
0.00982666015625,
-0.005970001220703125,
-0.014739990234375,
0.02154541015625,
0.006744384765625,
-0.0025310516357421875,
0.0008182525634765625,
-0.00482177734375,
0.00023734569549560547,
-0.0225982666015625,
-0.0205841064453125,
-0.0172882080078125,
0.0173187255859375,
-0.0226287841796875,
-0.0120849609375,
-0.062042236328125,
0.0245819091796875,
0.03753662109375,
0.08868408203125,
0.0030517578125,
0.04266357421875,
-0.018218994140625,
-0.0029087066650390625,
-0.0113372802734375,
-0.0013990402221679688,
-0.017974853515625,
-0.0116119384765625,
0.055023193359375,
-0.0100250244140625,
-0.053314208984375,
-0.007061004638671875,
-0.0145416259765625,
0.03350830078125,
0.02008056640625,
-0.00006747245788574219,
-0.02984619140625,
-0.072265625,
0.06268310546875,
0.1070556640625,
0.0267486572265625,
0.06292724609375,
-0.0165863037109375,
0.0135650634765625,
0.01006317138671875,
0.050567626953125,
-0.01508331298828125,
-0.0177001953125,
0.0141448974609375,
-0.0005359649658203125,
-0.017120361328125,
-0.023590087890625,
-0.023406982421875,
0.01348114013671875,
0.07012939453125,
0.085693359375,
-0.048492431640625,
0.0020694732666015625,
0.0291748046875,
-0.0209197998046875,
0.01666259765625,
-0.006389617919921875,
-0.0124359130859375,
-0.0282745361328125,
0.05267333984375,
-0.006114959716796875,
-0.0131988525390625,
0.026458740234375,
0.0003459453582763672,
-0.005146026611328125,
-0.0172882080078125,
0.01617431640625,
0.00868988037109375,
-0.031890869140625,
0.055572509765625,
0.0180511474609375,
0.03741455078125,
-0.01502227783203125,
0.0011539459228515625,
-0.004180908203125,
-0.01282501220703125,
-0.038604736328125,
0.01242828369140625,
-0.04278564453125,
0.00992584228515625,
-0.0357666015625,
0.0001627206802368164,
0.042694091796875,
0.03887939453125,
0.00713348388671875,
-0.0202178955078125,
0.037261962890625,
0.00670623779296875,
0.0012674331665039062,
-0.0182647705078125,
0.004169464111328125,
0.0131683349609375,
-0.0259552001953125,
0.0150146484375,
-0.016937255859375,
-0.006099700927734375,
-0.00934600830078125,
0.05194091796875,
0.07275390625,
-0.01200103759765625,
-0.03167724609375,
0.04931640625,
-0.005054473876953125,
-0.01885986328125,
0.01922607421875,
0.018829345703125,
-0.05078125,
-0.05987548828125,
0.0270538330078125,
-0.07666015625,
-0.01505279541015625,
0.0090179443359375,
-0.059326171875,
0.11297607421875,
0.006011962890625,
0.044189453125,
0.030364990234375,
0.03369140625,
-0.038787841796875,
0.0158538818359375,
-0.0306854248046875,
0.0660400390625,
0.04168701171875,
0.028289794921875,
-0.053314208984375,
-0.022857666015625,
0.01319122314453125,
0.059326171875,
0.04278564453125,
0.005809783935546875,
0.00540924072265625,
-0.01462554931640625,
0.016693115234375,
0.054901123046875,
-0.007488250732421875,
-0.0009169578552246094,
0.04052734375,
0.03759765625,
0.03717041015625,
-0.041046142578125,
0.01071929931640625,
-0.05029296875,
0.0313720703125,
0.058837890625,
0.005847930908203125,
-0.0016126632690429688,
0.00505828857421875,
0.0113067626953125,
-0.0567626953125,
-0.0007762908935546875,
0.0234375,
0.01264190673828125,
-0.0034008026123046875,
0.019622802734375,
-0.0058135986328125,
0.0155792236328125,
-0.041961669921875,
0.00501251220703125,
0.022705078125,
0.01096343994140625,
-0.02764892578125,
0.0131988525390625,
-0.014617919921875,
0.020538330078125,
-0.0095062255859375,
-0.033355712890625,
0.0093231201171875,
0.05755615234375,
0.08251953125,
0.028350830078125,
0.0399169921875,
-0.042083740234375,
-0.0297088623046875,
0.038116455078125,
0.0858154296875,
-0.03765869140625,
-0.0197601318359375,
0.00146484375,
-0.001728057861328125,
-0.00862884521484375,
-0.0291900634765625,
0.000370025634765625,
-0.006069183349609375,
0.0239105224609375,
-0.0236663818359375,
0.0209503173828125,
0.0161895751953125,
-0.008514404296875,
-0.01000213623046875,
0.0233612060546875,
-0.00708770751953125,
0.033538818359375,
-0.050323486328125,
-0.0291290283203125,
0.02581787109375,
0.08282470703125,
0.04248046875,
0.0277099609375,
-0.0006976127624511719,
-0.047698974609375,
-0.028656005859375,
0.038970947265625,
0.0013036727905273438,
0.035186767578125,
-0.040924072265625,
-0.020965576171875,
-0.01042938232421875,
0.044830322265625,
-0.0013475418090820312,
0.0178985595703125,
0.028717041015625,
0.035247802734375,
-0.0197601318359375,
-0.0184173583984375,
0.021331787109375,
-0.023681640625,
0.054168701171875,
-0.0224456787109375,
-0.0011186599731445312,
-0.05303955078125,
-0.041412353515625,
-0.042022705078125,
0.03533935546875,
-0.031097412109375,
0.0074310302734375,
0.02825927734375,
0.00476837158203125,
-0.032318115234375,
0.006671905517578125,
-0.046356201171875,
0.06939697265625,
0.01131439208984375,
-0.022552490234375,
-0.0101318359375,
0.01763916015625,
-0.061553955078125,
0.017364501953125,
0.044952392578125,
-0.023223876953125,
0.0058746337890625,
-0.01480865478515625,
-0.002513885498046875,
0.00357818603515625,
-0.005100250244140625,
-0.0229644775390625,
-0.0261077880859375,
0.028045654296875,
-0.0185089111328125,
-0.049468994140625,
-0.0278472900390625,
-0.03106689453125,
0.0282745361328125,
0.03045654296875,
0.00945281982421875,
0.006320953369140625,
0.03704833984375,
0.0017833709716796875,
0.0273895263671875,
-0.02142333984375,
0.002117156982421875,
-0.003345489501953125,
-0.0020847320556640625,
0.01715087890625,
-0.01251220703125,
-0.006557464599609375,
0.040679931640625,
0.019317626953125,
-0.046478271484375,
0.0333251953125,
-0.00867462158203125,
0.003963470458984375,
-0.0254669189453125,
0.047821044921875,
0.0128326416015625,
-0.00344085693359375,
0.00992584228515625,
0.007785797119140625,
0.054168701171875,
0.07391357421875,
0.000255584716796875,
0.0197296142578125,
0.01461029052734375,
0.017852783203125,
0.007335662841796875,
0.0233612060546875,
-0.0167083740234375,
0.0215606689453125,
-0.047119140625,
-0.0207672119140625,
-0.005954742431640625,
-0.03131103515625,
-0.002376556396484375,
0.006229400634765625,
0.0235137939453125,
-0.00980377197265625,
-0.016845703125,
-0.024261474609375,
-0.00930023193359375,
0.0299072265625,
-0.007965087890625,
0.0019779205322265625,
0.0026683807373046875,
0.00875091552734375,
-0.052642822265625,
-0.025726318359375,
-0.016632080078125,
-0.027740478515625,
-0.00836944580078125,
0.0260009765625,
-0.0150299072265625,
-0.036590576171875,
-0.062286376953125,
0.0033626556396484375,
0.021728515625,
-0.005615234375,
-0.040496826171875,
-0.0140838623046875,
-0.01123046875,
0.06719970703125,
-0.0224151611328125,
-0.03369140625,
0.006458282470703125,
0.0214996337890625,
-0.0096893310546875,
0.01397705078125,
-0.04833984375,
-0.028076171875,
0.0016050338745117188,
0.0428466796875,
0.06390380859375,
-0.0033626556396484375,
0.005832672119140625,
0.050628662109375,
-0.0028896331787109375,
0.10888671875,
-0.07080078125,
-0.023590087890625,
0.03985595703125,
-0.0024242401123046875,
-0.048095703125,
-0.076171875,
0.023956298828125,
-0.05255126953125,
0.0287322998046875,
0.0023097991943359375,
-0.020172119140625,
-0.005191802978515625,
-0.058319091796875,
-0.0972900390625,
0.047576904296875,
-0.0137786865234375,
-0.045989990234375,
-0.034423828125,
-0.024749755859375,
-0.0015249252319335938,
0.0384521484375,
0.0049896240234375,
-0.059112548828125,
-0.05596923828125,
0.0239410400390625,
0.017578125,
-0.024566650390625,
0.045074462890625,
-0.009033203125,
-0.061065673828125,
-0.0086669921875,
-0.0166778564453125,
0.009857177734375,
-0.0322265625,
-0.00850677490234375,
0.02801513671875,
0.040313720703125,
-0.00661468505859375,
-0.0282440185546875,
0.0240325927734375,
-0.01369476318359375,
-0.0156707763671875,
-0.01486968994140625,
-0.03814697265625,
-0.0198516845703125,
0.05218505859375,
0.06494140625,
0.021240234375,
-0.0311737060546875,
0.01398468017578125,
0.0012845993041992188,
-0.067626953125,
0.007190704345703125,
0.034454345703125,
-0.05096435546875,
-0.0035991668701171875,
0.004253387451171875,
-0.0019931793212890625,
0.0258026123046875,
0.002468109130859375,
-0.01421356201171875,
-0.0030879974365234375,
0.0134124755859375,
-0.0172271728515625,
-0.043975830078125,
-0.028411865234375,
0.032562255859375,
-0.018829345703125,
0.00592041015625,
-0.0006923675537109375,
0.0259857177734375,
0.018157958984375,
0.03338623046875,
-0.0031833648681640625,
0.0228118896484375,
-0.06280517578125,
-0.00267791748046875,
-0.01399993896484375,
0.02740478515625,
-0.0440673828125,
-0.0185699462890625,
-0.01593017578125,
0.039215087890625,
-0.0021800994873046875,
0.03955078125,
-0.0275421142578125,
0.11798095703125,
0.0367431640625,
0.037017822265625,
-0.031280517578125,
0.030853271484375,
-0.01441192626953125,
0.00637054443359375,
-0.0087890625,
0.0203094482421875,
0.0182342529296875,
-0.00406646728515625,
-0.00684356689453125,
-0.0240936279296875,
-0.025848388671875,
-0.040374755859375,
0.011444091796875,
0.0008182525634765625,
-0.00641632080078125,
0.033355712890625
] |
dce1701145384d4280c92c4e783e6b010fad9889
|
Wordpress Stackexchange
Q: The purpose of the post_date_gmt? Why do we have 2 date fields in the wp_posts? What's the purpose of the post_date_gmt? When does storing the Greenwich time get handy?
A: Some countries use a Daylight Saving Time (DST):
Typically clocks are adjusted forward one hour near the start of spring and are adjusted backward in autumn.
Sometimes there is no 2 am. Sometimes you get 2 am two times. To avoid cron jobs running twice or not at all WP needs the GMT (or more precise: UTC). UNIX time stamps cannot be used because they start in 1970 … and there is still the Year 2038 problem.
If you want to write an imaginary diary of Gaius Julius Caesar or James T. Kirk … you will run into problems with the current system too, but they may be solvable at least. :)
|
Q: The purpose of the post_date_gmt? Why do we have 2 date fields in the wp_posts? What's the purpose of the post_date_gmt? When does storing the Greenwich time get handy?
A: Some countries use a Daylight Saving Time (DST):
Typically clocks are adjusted forward one hour near the start of spring and are adjusted backward in autumn.
Sometimes there is no 2 am. Sometimes you get 2 am two times. To avoid cron jobs running twice or not at all WP needs the GMT (or more precise: UTC). UNIX time stamps cannot be used because they start in 1970 … and there is still the Year 2038 problem.
If you want to write an imaginary diary of Gaius Julius Caesar or James T. Kirk … you will run into problems with the current system too, but they may be solvable at least. :)
|
wordpress
|
{
"language": "en",
"length": 143,
"provenance": "stackexchange_00019.jsonl.gz:419350",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50034"
}
|
[
0.03582763671875,
-0.0002294778823852539,
0.005970001220703125,
0.000179290771484375,
-0.00560760498046875,
-0.020751953125,
0.03179931640625,
-0.03192138671875,
-0.0128173828125,
0.01213836669921875,
0.020111083984375,
-0.003192901611328125,
0.004863739013671875,
-0.04864501953125,
0.021240234375,
-0.005977630615234375,
0.03912353515625,
-0.0750732421875,
-0.036163330078125,
-0.02960205078125,
0.001316070556640625,
-0.006008148193359375,
0.0162506103515625,
0.025634765625,
0.07403564453125,
-0.05072021484375,
0.0016536712646484375,
-0.03375244140625,
0.06390380859375,
0.00539398193359375,
0.036407470703125,
-0.0217437744140625,
0.03594970703125,
-0.041046142578125,
0.051422119140625,
0.0135650634765625,
0.0218658447265625,
-0.02392578125,
-0.00383758544921875,
0.0206146240234375,
0.006313323974609375,
-0.006317138671875,
0.013885498046875,
-0.005535125732421875,
-0.0157623291015625,
0.00601959228515625,
0.00650787353515625,
-0.0037746429443359375,
0.022308349609375,
0.018646240234375,
0.04058837890625,
0.004108428955078125,
0.05328369140625,
0.0172119140625,
-0.03338623046875,
-0.03076171875,
0.0123138427734375,
-0.032684326171875,
0.051116943359375,
-0.04400634765625,
-0.04266357421875,
-0.04815673828125,
0.03973388671875,
-0.014190673828125,
0.00007361173629760742,
0.00292205810546875,
0.041168212890625,
0.0058746337890625,
-0.0867919921875,
-0.0232086181640625,
0.055267333984375,
-0.0350341796875,
-0.0156402587890625,
-0.01149749755859375,
-0.033203125,
0.01509857177734375,
-0.00734710693359375,
-0.016937255859375,
0.0204010009765625,
0.0012416839599609375,
-0.0196990966796875,
0.025665283203125,
-0.00797271728515625,
-0.0648193359375,
0.0236663818359375,
-0.03070068359375,
-0.031646728515625,
-0.007801055908203125,
-0.052001953125,
-0.038787841796875,
-0.036956787109375,
0.039306640625,
-0.0770263671875,
-0.032623291015625,
-0.0290985107421875,
-0.0206451416015625,
0.005855560302734375,
0.049774169921875,
-0.048614501953125,
-0.055267333984375,
-0.00598907470703125,
0.006744384765625,
-0.06982421875,
0.01506805419921875,
-0.01058197021484375,
0.03729248046875,
0.037017822265625,
0.0222625732421875,
0.00811767578125,
0.002838134765625,
-0.00261688232421875,
0.00022530555725097656,
0.02606201171875,
-0.03961181640625,
0.01184844970703125,
-0.0033111572265625,
-0.0002911090850830078,
0.033660888671875,
0.01465606689453125,
-0.035308837890625,
-0.00302886962890625,
0.01471710205078125,
0.0220184326171875,
-0.02801513671875,
0.01351165771484375,
0.0007610321044921875,
-0.0271759033203125,
-0.018951416015625,
-0.0061187744140625,
0.06488037109375,
-0.005420684814453125,
-0.0166168212890625,
0.006084442138671875,
0.0186920166015625,
-0.020660400390625,
-0.035430908203125,
0.038818359375,
-0.07275390625,
-0.02630615234375,
0.038482666015625,
-0.035736083984375,
-0.0556640625,
-0.002597808837890625,
-0.049835205078125,
-0.006542205810546875,
-0.027130126953125,
0.0146484375,
0.067138671875,
-0.00598907470703125,
0.001140594482421875,
0.0158233642578125,
0.033447265625,
-0.002368927001953125,
0.0058441162109375,
0.0071563720703125,
-0.039154052734375,
0.006378173828125,
-0.024383544921875,
0.04852294921875,
-0.02703857421875,
-0.040618896484375,
-0.0255126953125,
0.020721435546875,
-0.052642822265625,
-0.06689453125,
0.05157470703125,
-0.02490234375,
-0.0096435546875,
0.0242462158203125,
-0.0069122314453125,
-0.0015506744384765625,
0.01331329345703125,
0.0384521484375,
0.00023651123046875,
-0.0012464523315429688,
0.00698089599609375,
0.0226287841796875,
-0.061004638671875,
0.014404296875,
0.0386962890625,
-0.00045228004455566406,
-0.01371002197265625,
-0.007755279541015625,
0.011566162109375,
0.007305145263671875,
0.005001068115234375,
0.0194549560546875,
0.041748046875,
-0.0210418701171875,
0.0228271484375,
-0.0117034912109375,
0.017913818359375,
-0.034820556640625,
0.0152435302734375,
0.0026073455810546875,
-0.0107269287109375,
-0.038665771484375,
-0.00426483154296875,
-0.0084686279296875,
-0.006458282470703125,
0.0015716552734375,
0.035369873046875,
-0.039703369140625,
0.016845703125,
-0.09075927734375,
0.046417236328125,
-0.0458984375,
0.0299224853515625,
-0.0204315185546875,
-0.003997802734375,
0.0091400146484375,
-0.006866455078125,
-0.0008568763732910156,
-0.043121337890625,
-0.037872314453125,
0.00887298583984375,
-0.0239105224609375,
0.0311431884765625,
-0.0090789794921875,
0.0284271240234375,
-0.0203704833984375,
-0.04144287109375,
-0.0106964111328125,
-0.01381683349609375,
0.049530029296875,
0.0289306640625,
-0.0162353515625,
0.0083465576171875,
0.041748046875,
0.038055419921875,
-0.044281005859375,
-0.0027599334716796875,
-0.0163116455078125,
-0.01175689697265625,
-0.046478271484375,
-0.0018863677978515625,
-0.0093231201171875,
-0.0053253173828125,
0.00286102294921875,
0.0352783203125,
0.0265960693359375,
0.017669677734375,
-0.002574920654296875,
0.0187835693359375,
0.041839599609375,
-0.04168701171875,
-0.00055694580078125,
0.00033354759216308594,
-0.01467132568359375,
0.0276336669921875,
-0.01678466796875,
-0.01190185546875,
0.00421905517578125,
-0.07135009765625,
-0.022247314453125,
0.039276123046875,
-0.056640625,
-0.052032470703125,
0.01476287841796875,
0.004154205322265625,
0.0145263671875,
-0.005603790283203125,
0.0163726806640625,
-0.0115509033203125,
0.060150146484375,
-0.006099700927734375,
0.048614501953125,
0.012725830078125,
-0.010467529296875,
-0.00830078125,
0.016632080078125,
-0.02984619140625,
0.00453948974609375,
0.0013360977172851562,
0.01959228515625,
-0.01432037353515625,
0.0174713134765625,
-0.00852203369140625,
-0.0200653076171875,
-0.0138092041015625,
-0.019195556640625,
-0.01242828369140625,
-0.050323486328125,
0.001556396484375,
0.01122283935546875,
-0.0257720947265625,
0.004459381103515625,
0.0274505615234375,
0.037689208984375,
0.000606536865234375,
0.0261993408203125,
-0.01177215576171875,
-0.0340576171875,
0.06597900390625,
-0.007171630859375,
-0.059234619140625,
-0.05596923828125,
0.0198516845703125,
0.002582550048828125,
-0.025390625,
-0.0276336669921875,
0.02239990234375,
0.006618499755859375,
-0.01849365234375,
0.0123748779296875,
0.01477813720703125,
-0.0028438568115234375,
0.015838623046875,
0.005962371826171875,
0.007236480712890625,
-0.04998779296875,
0.01149749755859375,
0.01995849609375,
0.0189666748046875,
-0.025421142578125,
-0.05218505859375,
-0.025848388671875,
0.01413726806640625,
-0.0909423828125,
-0.019287109375,
-0.066650390625,
-0.056732177734375,
0.0032749176025390625,
-0.01076507568359375,
-0.0124664306640625,
0.0143280029296875,
-0.01309967041015625,
0.0263671875,
0.010406494140625,
-0.00749969482421875,
-0.0272064208984375,
-0.03192138671875,
-0.047119140625,
-0.009979248046875,
-0.0010023117065429688,
0.0104827880859375,
0.00548553466796875,
0.06268310546875,
-0.0025539398193359375,
-0.074951171875,
-0.04486083984375,
-0.00676727294921875,
-0.04913330078125,
-0.007099151611328125,
-0.02020263671875,
0.01505279541015625,
0.00389862060546875,
0.00965118408203125,
-0.01316070556640625,
-0.0041656494140625,
-0.01497650146484375,
-0.0311279296875,
0.013671875,
0.01074981689453125,
0.061859130859375,
-0.0181121826171875,
-0.061737060546875,
0.046478271484375,
0.04833984375,
-0.032012939453125,
0.00177764892578125,
-0.02783203125,
-0.05340576171875,
-0.031463623046875,
0.05877685546875,
-0.016082763671875,
-0.045196533203125,
-0.0306243896484375,
0.0186920166015625,
0.00937652587890625,
0.0509033203125,
0.0157318115234375,
0.006359100341796875,
-0.0232391357421875,
-0.0273590087890625,
-0.055999755859375,
-0.0232391357421875,
-0.043792724609375,
0.034149169921875,
-0.013458251953125,
-0.0027103424072265625,
-0.0154876708984375,
0.0110931396484375,
0.0045623779296875,
-0.07061767578125,
0.0380859375,
-0.0307769775390625,
0.0222930908203125,
-0.049102783203125,
-0.0290985107421875,
-0.005462646484375,
0.11346435546875,
-0.0675048828125,
-0.01371002197265625,
-0.013916015625,
0.021881103515625,
-0.0198974609375,
-0.042510986328125,
-0.029571533203125,
-0.01267242431640625,
-0.034271240234375,
0.0076141357421875,
-0.008453369140625,
-0.0012140274047851562,
-0.03814697265625,
0.061553955078125,
-0.034912109375,
-0.01727294921875,
0.02508544921875,
-0.01397705078125,
0.0184173583984375,
0.0160675048828125,
0.0149078369140625,
-0.0010528564453125,
-0.015960693359375,
-0.015838623046875,
-0.031280517578125,
-0.0302734375,
0.045562744140625,
0.0265655517578125,
0.007587432861328125,
-0.0531005859375,
0.00925445556640625,
0.04449462890625,
0.03155517578125,
0.037872314453125,
0.005519866943359375,
-0.045928955078125,
0.049652099609375,
0.048614501953125,
0.035675048828125,
0.0158233642578125,
-0.00464630126953125,
-0.004184722900390625,
-0.024383544921875,
0.0224151611328125,
-0.005161285400390625,
0.00982666015625,
0.00432586669921875,
-0.0231475830078125,
-0.024505615234375,
-0.02655029296875,
0.018646240234375,
0.04058837890625,
-0.014495849609375,
0.020477294921875,
-0.0306549072265625,
-0.03173828125,
0.00965118408203125,
0.03472900390625,
-0.00283050537109375,
0.013092041015625,
0.004009246826171875,
0.022857666015625,
-0.036865234375,
-0.06976318359375,
-0.00867462158203125,
0.0296173095703125,
0.0255126953125,
0.017547607421875,
-0.0180206298828125,
-0.0162200927734375,
0.052642822265625,
0.000050008296966552734,
-0.027740478515625,
-0.049224853515625,
0.055877685546875,
-0.0264739990234375,
-0.027740478515625,
0.0181121826171875,
-0.0733642578125,
0.0867919921875,
0.0294342041015625,
0.006805419921875,
-0.0209197998046875,
-0.01180267333984375,
0.034698486328125,
0.0267791748046875,
-0.02862548828125,
-0.039306640625,
-0.0158233642578125,
0.0233306884765625,
-0.042266845703125,
-0.01148223876953125,
-0.01366424560546875,
0.002223968505859375,
-0.04486083984375,
-0.011627197265625,
0.016510009765625,
-0.024139404296875,
-0.0017023086547851562,
-0.028961181640625,
0.02728271484375,
0.0005736351013183594,
-0.00396728515625,
-0.016143798828125,
-0.0184783935546875,
0.0706787109375,
0.0166473388671875,
-0.0516357421875,
0.056304931640625,
-0.0020160675048828125,
-0.0234527587890625,
0.022430419921875,
0.012359619140625,
0.03460693359375,
0.04486083984375,
0.0115509033203125,
-0.006244659423828125,
0.0242462158203125,
0.01444244384765625,
-0.032379150390625,
-0.006893157958984375,
0.015838623046875,
-0.02142333984375,
0.01271820068359375,
0.0257110595703125,
0.029022216796875,
-0.01186370849609375,
-0.026641845703125,
0.08245849609375,
0.021209716796875,
0.062255859375,
0.0250701904296875,
-0.045135498046875,
-0.0171356201171875,
0.041717529296875,
-0.082275390625,
-0.0267486572265625,
0.005321502685546875,
-0.00696563720703125,
0.00830841064453125,
-0.0272979736328125,
-0.0286712646484375,
0.057464599609375,
-0.0038242340087890625,
-0.01024627685546875,
0.0173187255859375,
0.047943115234375,
-0.007175445556640625,
-0.017547607421875,
-0.013336181640625,
0.0026493072509765625,
0.023529052734375,
0.004070281982421875,
0.006160736083984375,
0.0068817138671875,
0.04986572265625,
-0.054443359375,
0.051177978515625,
-0.039215087890625,
-0.042816162109375,
-0.05010986328125,
-0.0311279296875,
-0.011962890625,
0.037811279296875,
-0.0069427490234375,
0.005672454833984375,
-0.0301666259765625,
0.006198883056640625,
-0.03753662109375,
-0.006473541259765625,
0.00476837158203125,
0.0181732177734375,
-0.0501708984375,
0.03387451171875,
-0.0005478858947753906,
-0.0010347366333007812,
-0.04852294921875,
-0.0267791748046875,
-0.048858642578125,
-0.0041961669921875,
-0.048736572265625,
-0.048736572265625,
-0.0440673828125,
0.021728515625,
0.04278564453125,
0.04949951171875,
-0.032257080078125,
-0.09417724609375,
0.001758575439453125,
-0.0025196075439453125,
0.044677734375,
0.07513427734375,
-0.0233306884765625,
0.057159423828125,
0.0023632049560546875,
0.032623291015625,
0.011016845703125,
0.039886474609375,
0.0116424560546875,
-0.03228759765625,
0.024169921875,
-0.045806884765625,
-0.0283050537109375,
-0.00859832763671875,
-0.0160675048828125,
-0.00707244873046875,
-0.0038585662841796875,
-0.005565643310546875,
0.022979736328125,
-0.0033435821533203125,
0.01477813720703125,
-0.013336181640625,
-0.0248565673828125,
-0.027435302734375,
-0.0092926025390625,
0.00286102294921875,
0.00174713134765625,
0.02764892578125,
-0.036407470703125,
0.0010271072387695312,
-0.003574371337890625,
-0.0238494873046875,
-0.004138946533203125,
0.02093505859375,
0.05780029296875,
-0.0357666015625,
0.041107177734375,
0.013519287109375,
0.05450439453125,
0.0472412109375,
0.0430908203125,
0.0379638671875,
-0.0256805419921875,
-0.06927490234375,
-0.0174102783203125,
0.0265960693359375,
-0.0016689300537109375,
-0.0106658935546875,
0.044647216796875,
-0.00799560546875,
0.0261383056640625,
0.05596923828125,
0.059844970703125,
-0.057037353515625,
0.0014181137084960938,
-0.0177764892578125,
-0.03082275390625,
0.0283966064453125,
0.02276611328125,
-0.0048828125,
0.01448822021484375,
0.021636962890625,
-0.07781982421875,
-0.01396942138671875,
0.020416259765625,
-0.0302886962890625,
-0.01177215576171875,
0.0018463134765625,
0.024688720703125,
0.0294189453125,
-0.0120086669921875,
0.0221710205078125,
0.01099395751953125,
0.046173095703125,
-0.03582763671875,
-0.04486083984375,
0.003662109375,
-0.05279541015625,
-0.0933837890625,
-0.047454833984375,
-0.034637451171875,
0.0113067626953125,
-0.0159149169921875,
0.0012216567993164062,
0.10443115234375,
0.03936767578125,
0.02130126953125,
-0.027374267578125,
-0.002262115478515625,
0.06597900390625,
-0.0670166015625,
-0.035736083984375,
0.01305389404296875,
0.04827880859375,
0.0030612945556640625,
0.044342041015625,
-0.0008459091186523438,
-0.038909912109375,
-0.0106048583984375,
-0.06689453125,
0.013519287109375,
-0.0046844482421875,
-0.0209503173828125,
0.005687713623046875,
-0.01006317138671875,
0.00930023193359375,
-0.0062408447265625,
0.01331329345703125,
-0.03790283203125,
0.00250244140625,
-0.01195526123046875,
0.0012722015380859375,
0.01788330078125,
-0.0016384124755859375,
-0.01232147216796875,
0.05859375,
-0.024322509765625,
-0.004444122314453125,
-0.00475311279296875,
0.038604736328125,
0.0185546875,
0.039276123046875,
-0.009185791015625,
0.01751708984375,
-0.042510986328125,
0.001018524169921875,
-0.0212860107421875,
0.0045623779296875,
-0.0222015380859375,
0.0088958740234375,
0.05419921875,
0.01099395751953125,
-0.05755615234375,
-0.0094757080078125,
0.0517578125,
0.04541015625,
0.02276611328125,
0.046173095703125,
-0.01309967041015625,
0.0293121337890625,
0.00821685791015625,
-0.017425537109375,
0.015869140625,
-0.015655517578125,
-0.051055908203125,
0.020782470703125,
0.01297760009765625,
0.018310546875,
-0.01078033447265625,
-0.028289794921875,
-0.00044345855712890625,
-0.01739501953125,
-0.006786346435546875,
-0.0013742446899414062,
0.0286865234375,
0.00943756103515625,
0.0350341796875,
-0.031646728515625,
-0.0130767822265625,
-0.012451171875,
0.055206298828125,
0.003765106201171875,
-0.00836944580078125,
0.052398681640625,
0.01148223876953125,
-0.02728271484375,
0.0345458984375,
0.0198822021484375,
0.0141754150390625,
0.005950927734375,
0.035552978515625,
0.0022678375244140625,
0.008148193359375,
-0.042083740234375,
0.044830322265625,
0.02276611328125,
0.0283355712890625,
-0.0572509765625,
0.004871368408203125,
0.004894256591796875,
-0.0095062255859375,
0.0006604194641113281,
-0.04339599609375,
-0.005794525146484375,
-0.019012451171875,
-0.059814453125,
-0.0008759498596191406,
0.0199432373046875,
0.047027587890625,
-0.00098419189453125,
0.032684326171875,
0.05316162109375,
-0.07470703125,
0.0262298583984375,
-0.05755615234375,
0.032562255859375,
0.0014123916625976562,
0.036376953125,
0.0019168853759765625,
0.053558349609375,
0.0296173095703125,
-0.01287078857421875,
-0.00010436773300170898,
0.0283050537109375,
0.041778564453125,
-0.022308349609375,
0.057342529296875,
0.0241546630859375,
-0.0013933181762695312,
-0.0203094482421875,
0.0156707763671875,
0.031524658203125,
0.064453125,
0.02679443359375,
-0.07080078125,
-0.01244354248046875,
0.01629638671875,
-0.04534912109375,
-0.041595458984375,
-0.0203094482421875,
-0.0248870849609375,
0.01763916015625,
0.001445770263671875,
0.0318603515625,
0.0192413330078125,
-0.004070281982421875,
-0.050262451171875,
0.032470703125,
-0.017120361328125,
-0.039520263671875,
0.07269287109375,
0.0023860931396484375,
0.0823974609375,
-0.0270233154296875,
0.006927490234375,
-0.00998687744140625,
0.0155181884765625,
-0.0211639404296875,
0.01071929931640625,
0.019927978515625,
0.01113128662109375,
-0.005950927734375,
0.0211029052734375,
-0.017486572265625,
0.0134429931640625,
-0.023101806640625,
0.04443359375,
0.0347900390625,
-0.0133056640625,
0.027008056640625,
-0.061553955078125,
-0.034637451171875,
-0.035614013671875,
0.034881591796875,
0.0292205810546875,
-0.000476837158203125,
0.026580810546875,
0.0216217041015625,
0.016937255859375,
-0.040496826171875,
0.0268402099609375,
0.00039076805114746094,
0.0221710205078125,
-0.005374908447265625,
-0.0160369873046875,
-0.0086822509765625,
-0.0137176513671875,
0.0316162109375,
0.0296478271484375,
-0.0229949951171875,
0.00913238525390625,
-0.01495361328125,
0.0171051025390625,
-0.006439208984375,
-0.013519287109375,
-0.0200958251953125,
-0.0114593505859375,
0.0438232421875,
0.02044677734375,
-0.0131378173828125,
-0.01529693603515625,
-0.01464080810546875,
0.0165863037109375,
0.01474761962890625,
-0.020294189453125,
0.0304107666015625,
-0.033355712890625,
0.038726806640625,
0.028106689453125,
-0.0117340087890625,
0.03375244140625,
-0.01409912109375,
-0.02655029296875,
0.0208282470703125,
0.0017795562744140625,
0.0007677078247070312,
-0.0083160400390625,
0.04443359375,
-0.0159454345703125,
0.0196685791015625,
0.0152435302734375,
-0.01568603515625,
-0.007717132568359375,
0.007617950439453125,
-0.0262451171875,
-0.0074005126953125,
-0.01031494140625,
-0.0102386474609375,
-0.035552978515625,
-0.004024505615234375,
0.017730712890625,
-0.0330810546875,
-0.0260009765625,
-0.042144775390625,
-0.007366180419921875,
-0.0007009506225585938,
-0.0263671875,
0.0254669189453125,
-0.0193328857421875,
-0.00960540771484375,
-0.0028133392333984375,
0.00251007080078125,
0.0111541748046875,
-0.0231475830078125,
-0.0031757354736328125,
-0.015625,
-0.031097412109375,
-0.04888916015625,
0.049896240234375,
-0.0160675048828125,
0.01556396484375,
0.0181884765625,
-0.034912109375,
0.037841796875,
0.01605224609375,
0.045013427734375,
0.0596923828125,
0.01340484619140625,
-0.0169830322265625,
0.017425537109375,
0.00341033935546875,
0.006805419921875,
-0.037689208984375,
0.00018787384033203125,
-0.0230255126953125,
-0.0094757080078125,
-0.03594970703125,
0.0295562744140625,
0.025543212890625,
-0.020843505859375,
-0.048431396484375,
0.02215576171875,
-0.0064697265625,
-0.027862548828125,
-0.045623779296875,
-0.0234375,
-0.037322998046875,
0.07635498046875,
-0.00433349609375,
-0.044952392578125,
-0.01261138916015625,
0.05694580078125,
0.005558013916015625,
0.0234222412109375,
0.037750244140625,
-0.00641632080078125,
-0.054901123046875,
-0.0164794921875,
-0.03839111328125,
0.0107421875,
-0.006954193115234375,
0.01454925537109375,
0.002208709716796875,
0.0239410400390625,
-0.022796630859375,
0.0146636962890625,
-0.00806427001953125,
0.00847625732421875,
-0.0078887939453125,
-0.006381988525390625,
-0.0236663818359375,
0.0249786376953125,
0.05029296875,
0.07733154296875,
0.0174713134765625,
-0.05938720703125,
-0.019439697265625,
-0.04693603515625,
-0.0166168212890625,
-0.0194091796875,
0.0219573974609375,
-0.07781982421875,
-0.013458251953125,
0.03399658203125,
-0.009796142578125,
0.01009368896484375,
-0.0024509429931640625,
-0.021484375,
-0.012451171875,
0.004619598388671875,
-0.02374267578125,
-0.0236358642578125,
0.0792236328125,
-0.045623779296875,
0.00836944580078125,
0.05816650390625,
-0.043548583984375,
-0.02301025390625,
0.011871337890625,
0.034942626953125,
0.0244140625,
0.019378662109375,
-0.0284881591796875,
-0.002399444580078125,
0.016143798828125,
0.0084381103515625,
-0.0128936767578125,
-0.0209808349609375,
0.0151214599609375,
-0.00855255126953125,
-0.01250457763671875,
-0.01175689697265625,
0.0258636474609375,
-0.0175933837890625,
-0.03228759765625,
0.0154571533203125,
0.0182952880859375,
-0.006786346435546875,
-0.03125,
0.057373046875,
-0.027679443359375,
-0.033538818359375,
-0.048828125,
-0.004337310791015625,
0.01172637939453125,
-0.0092315673828125,
-0.0194244384765625,
0.00560760498046875,
-0.029510498046875,
-0.078857421875,
-0.0258026123046875,
-0.0103912353515625
] |
a6531bd48ee071cd3824a519b7a031259d127f9a
|
Wordpress Stackexchange
Q: Retrieving custom fields with $wpdb->get_results I'm trying to use $wpdb->get_results to retrieve an array of all posts including custom fields. I can retrieve the meta_key and meta_value columns like this:
[meta_key] => state [meta_value] => california
but I'm trying to list them in the object like this:
[meta_key] => meta_value [state] => california [city] => san francisco
The Query:
global $wpdb;
$query = "
SELECT ID, post_date, post_title, post_content, guid, meta_key, meta_value
FROM wp_posts INNER JOIN wp_postmeta
ON (wp_posts.ID = wp_postmeta.post_id)
";
$results = $wpdb->get_results($query);
foreach($results as $result) {
print_r($result);
}
Is it possible to use an alias and/or subquery to achieve this?
SELECT ID, post_date, post_title, post_content, guid, meta_value AS (subquery here??)
A: Note, before going further: Take care about portability and security:
function wpse50056_get_post_meta()
{
global $wpdb;
$results = $wpdb->get_results( "
SELECT
ID,
post_date,
post_title,
post_content,
meta_key,
meta_value
FROM {$wpdb->posts}
INNER JOIN {$wpdb->postmeta}
ON ( $wpdb->posts.ID = {$wpdb->postmeta}.post_id )
" );
foreach( $results as $result )
{
printf( '<pre>%s</pre>', htmlspecialchars( var_export( $result, true ) ) );
}
}
add_action( 'shutdown', 'wpse50056_get_post_meta' );
|
Q: Retrieving custom fields with $wpdb->get_results I'm trying to use $wpdb->get_results to retrieve an array of all posts including custom fields. I can retrieve the meta_key and meta_value columns like this:
[meta_key] => state [meta_value] => california
but I'm trying to list them in the object like this:
[meta_key] => meta_value [state] => california [city] => san francisco
The Query:
global $wpdb;
$query = "
SELECT ID, post_date, post_title, post_content, guid, meta_key, meta_value
FROM wp_posts INNER JOIN wp_postmeta
ON (wp_posts.ID = wp_postmeta.post_id)
";
$results = $wpdb->get_results($query);
foreach($results as $result) {
print_r($result);
}
Is it possible to use an alias and/or subquery to achieve this?
SELECT ID, post_date, post_title, post_content, guid, meta_value AS (subquery here??)
A: Note, before going further: Take care about portability and security:
function wpse50056_get_post_meta()
{
global $wpdb;
$results = $wpdb->get_results( "
SELECT
ID,
post_date,
post_title,
post_content,
meta_key,
meta_value
FROM {$wpdb->posts}
INNER JOIN {$wpdb->postmeta}
ON ( $wpdb->posts.ID = {$wpdb->postmeta}.post_id )
" );
foreach( $results as $result )
{
printf( '<pre>%s</pre>', htmlspecialchars( var_export( $result, true ) ) );
}
}
add_action( 'shutdown', 'wpse50056_get_post_meta' );
A: Just for clarity, to not get the extra quotes that benhass was talking about (i still get them with the code provided by kaiser and WP 3.7.1), don't use the prepare method at all (ok in this case, as we only use parameters provided by the $wpdb object itself):
function wpse50056_get_post_meta() {
global $wpdb;
$query =
" SELECT
ID,
post_date,
post_title,
post_content,
meta_key,
meta_value
FROM $wpdb->posts
INNER JOIN $wpdb->postmeta
ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id)
";
$results = $wpdb->get_results( $query );
foreach( $results as $result ) {
echo '<pre>'; print_r( $result ); echo '</pre>';
}
}
add_action( 'shutdown', 'wpse50056_get_post_meta' );
But of course, REMEMBER, as soon as you use other parameters in the query, the use of $wpdb->prepare is recommended to prevent SQL injection.
|
wordpress
|
{
"language": "en",
"length": 299,
"provenance": "stackexchange_00019.jsonl.gz:419357",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50056"
}
|
[
0.01297760009765625,
-0.007671356201171875,
0.0037384033203125,
0.009246826171875,
-0.019073486328125,
-0.030059814453125,
0.0250701904296875,
-0.0305633544921875,
0.0382080078125,
0.006122589111328125,
-0.044891357421875,
-0.0406494140625,
-0.01233673095703125,
-0.0274810791015625,
-0.021881103515625,
-0.0498046875,
0.05889892578125,
-0.033905029296875,
0.0302886962890625,
0.0155792236328125,
0.006977081298828125,
0.05841064453125,
-0.00798797607421875,
0.004955291748046875,
0.03729248046875,
-0.06744384765625,
0.03814697265625,
0.006866455078125,
0.03692626953125,
-0.0008115768432617188,
0.0309906005859375,
-0.01038360595703125,
0.0285797119140625,
-0.0178985595703125,
0.039642333984375,
0.017059326171875,
0.051605224609375,
-0.0220489501953125,
0.0116119384765625,
0.01467132568359375,
0.01125335693359375,
-0.00815582275390625,
-0.035797119140625,
0.007282257080078125,
-0.038055419921875,
-0.049285888671875,
0.04315185546875,
0.005107879638671875,
0.01058197021484375,
0.0095062255859375,
-0.0171966552734375,
0.0044097900390625,
0.0005345344543457031,
0.006130218505859375,
-0.00717926025390625,
-0.0318603515625,
-0.04046630859375,
-0.0087738037109375,
0.050506591796875,
0.00347137451171875,
-0.0235748291015625,
-0.05059814453125,
0.0183563232421875,
-0.0343017578125,
0.00379180908203125,
-0.0036468505859375,
0.0513916015625,
0.021575927734375,
-0.01708984375,
-0.019134521484375,
0.00753021240234375,
0.003818511962890625,
0.005443572998046875,
-0.0239715576171875,
-0.00504302978515625,
-0.03302001953125,
0.0081329345703125,
-0.048614501953125,
-0.006153106689453125,
0.0263214111328125,
-0.0047607421875,
-0.0142822265625,
-0.0657958984375,
-0.0099334716796875,
0.040618896484375,
0.0112457275390625,
-0.021728515625,
-0.01006317138671875,
-0.03778076171875,
-0.03155517578125,
-0.01209259033203125,
-0.0660400390625,
-0.05352783203125,
0.0169525146484375,
0.0084075927734375,
-0.040618896484375,
0.01052093505859375,
0.032989501953125,
-0.03338623046875,
0.002593994140625,
0.0047149658203125,
-0.007724761962890625,
-0.0010099411010742188,
-0.024139404296875,
0.0157623291015625,
0.0210723876953125,
-0.027740478515625,
-0.007144927978515625,
0.0305328369140625,
0.027618408203125,
-0.01140594482421875,
-0.017333984375,
-0.0031337738037109375,
-0.02972412109375,
-0.0191802978515625,
0.033660888671875,
-0.0004949569702148438,
-0.0389404296875,
0.007778167724609375,
-0.046356201171875,
0.01430511474609375,
0.02215576171875,
-0.0036182403564453125,
-0.0158538818359375,
0.026885986328125,
0.004962921142578125,
-0.037994384765625,
0.00811767578125,
-0.057586669921875,
0.0310211181640625,
-0.038726806640625,
0.0271148681640625,
0.0340576171875,
0.0177764892578125,
-0.004726409912109375,
-0.01345062255859375,
0.009429931640625,
-0.02545166015625,
-0.02191162109375,
0.056488037109375,
-0.006916046142578125,
-0.040863037109375,
-0.0005173683166503906,
0.0009613037109375,
-0.033660888671875,
-0.015289306640625,
0.0268707275390625,
0.027435302734375,
-0.0266876220703125,
-0.0211334228515625,
-0.02191162109375,
0.032318115234375,
-0.0060272216796875,
0.0198822021484375,
0.0155792236328125,
-0.00466156005859375,
0.040008544921875,
-0.028839111328125,
-0.011871337890625,
-0.03369140625,
0.024932861328125,
-0.00995635986328125,
-0.0304107666015625,
-0.01395416259765625,
-0.0389404296875,
0.002994537353515625,
0.0010128021240234375,
-0.0038909912109375,
0.032989501953125,
0.08074951171875,
0.048095703125,
-0.0216217041015625,
0.011138916015625,
0.0122833251953125,
-0.0203399658203125,
-0.01163482666015625,
-0.01074981689453125,
-0.0207672119140625,
0.032928466796875,
-0.020843505859375,
-0.02581787109375,
-0.018218994140625,
0.036346435546875,
0.0098114013671875,
-0.07427978515625,
0.059814453125,
-0.00550079345703125,
0.051116943359375,
0.047882080078125,
-0.01617431640625,
0.032684326171875,
0.004795074462890625,
-0.0247802734375,
-0.0009703636169433594,
0.01087188720703125,
0.0023555755615234375,
-0.007167816162109375,
0.005687713623046875,
0.005443572998046875,
-0.023590087890625,
0.038818359375,
0.0282745361328125,
0.00395965576171875,
0.02362060546875,
-0.03399658203125,
0.04119873046875,
-0.0166015625,
0.018707275390625,
-0.00939178466796875,
-0.01300811767578125,
0.0170440673828125,
-0.0229339599609375,
-0.01499176025390625,
0.02093505859375,
-0.0232391357421875,
0.0020904541015625,
-0.016387939453125,
0.01788330078125,
-0.0236968994140625,
0.0205841064453125,
-0.01611328125,
-0.07061767578125,
-0.0304412841796875,
0.0293426513671875,
0.0197601318359375,
-0.03814697265625,
0.00569915771484375,
-0.00351715087890625,
0.0740966796875,
0.002628326416015625,
0.02215576171875,
-0.015045166015625,
-0.01485443115234375,
0.020294189453125,
-0.01458740234375,
0.0001990795135498047,
-0.0041046142578125,
-0.03948974609375,
0.0095977783203125,
0.02838134765625,
0.045135498046875,
0.02490234375,
-0.0229339599609375,
-0.037445068359375,
0.058319091796875,
-0.001644134521484375,
0.013275146484375,
-0.027679443359375,
0.024688720703125,
0.03662109375,
-0.0293121337890625,
-0.00885772705078125,
0.04345703125,
-0.00418853759765625,
0.0014219284057617188,
0.04266357421875,
-0.03173828125,
-0.0035037994384765625,
0.0034770965576171875,
-0.0026950836181640625,
-0.0013513565063476562,
-0.034576416015625,
-0.0216522216796875,
-0.011749267578125,
0.044952392578125,
0.0159912109375,
0.054473876953125,
0.0268707275390625,
-0.00789642333984375,
0.00562286376953125,
-0.006252288818359375,
-0.0208587646484375,
-0.00568389892578125,
-0.014801025390625,
0.0208892822265625,
-0.0015707015991210938,
-0.061981201171875,
0.01849365234375,
0.032196044921875,
-0.01334381103515625,
0.026519775390625,
0.04736328125,
-0.0404052734375,
-0.004619598388671875,
0.0249786376953125,
-0.0298309326171875,
-0.02581787109375,
0.0308837890625,
-0.0192718505859375,
0.001422882080078125,
0.0226287841796875,
0.041961669921875,
-0.0267486572265625,
0.038604736328125,
-0.0213470458984375,
0.0028228759765625,
0.05096435546875,
-0.011505126953125,
0.0167694091796875,
-0.0181121826171875,
0.037872314453125,
0.05615234375,
-0.027374267578125,
0.017791748046875,
-0.0179443359375,
-0.02423095703125,
-0.034088134765625,
0.0205535888671875,
-0.0114593505859375,
-0.05889892578125,
-0.026947021484375,
0.00392913818359375,
0.037139892578125,
0.07452392578125,
0.004009246826171875,
-0.0516357421875,
0.0130767822265625,
0.048309326171875,
-0.0899658203125,
-0.14208984375,
0.022369384765625,
-0.033050537109375,
-0.01052093505859375,
-0.02545166015625,
-0.0257415771484375,
0.0164337158203125,
-0.04766845703125,
0.004058837890625,
0.01474761962890625,
0.0014896392822265625,
-0.081298828125,
-0.025360107421875,
-0.07965087890625,
-0.0291595458984375,
-0.016021728515625,
0.016693115234375,
0.00048232078552246094,
0.066162109375,
0.01203155517578125,
-0.060821533203125,
-0.00902557373046875,
0.054290771484375,
-0.0243377685546875,
-0.01001739501953125,
-0.0240020751953125,
-0.0211334228515625,
0.005901336669921875,
-0.007472991943359375,
0.0235748291015625,
0.0009164810180664062,
0.004901885986328125,
-0.0015554428100585938,
0.054779052734375,
0.01654052734375,
0.037933349609375,
-0.0178070068359375,
-0.04937744140625,
0.03857421875,
0.0274200439453125,
-0.0138092041015625,
-0.0181121826171875,
-0.04180908203125,
-0.05792236328125,
0.0010166168212890625,
0.053375244140625,
0.016815185546875,
0.00400543212890625,
-0.0115814208984375,
0.045928955078125,
0.01517486572265625,
0.006717681884765625,
-0.043304443359375,
0.05413818359375,
0.023651123046875,
0.07501220703125,
-0.031585693359375,
0.0105133056640625,
-0.031585693359375,
-0.01537322998046875,
-0.003681182861328125,
0.00429534912109375,
0.0070037841796875,
-0.0343017578125,
-0.030975341796875,
-0.031280517578125,
0.07073974609375,
-0.004077911376953125,
0.00004011392593383789,
-0.046234130859375,
-0.037506103515625,
-0.041717529296875,
0.0616455078125,
0.0145111083984375,
-0.0219268798828125,
-0.01538848876953125,
0.0036792755126953125,
-0.01061248779296875,
0.0218658447265625,
-0.01033782958984375,
0.01074981689453125,
-0.09918212890625,
0.01415252685546875,
0.0025005340576171875,
-0.032073974609375,
0.00023555755615234375,
-0.007015228271484375,
-0.06689453125,
-0.04547119140625,
0.018402099609375,
-0.007015228271484375,
0.023162841796875,
0.00970458984375,
0.005985260009765625,
0.0017719268798828125,
0.0037517547607421875,
-0.0213470458984375,
-0.07330322265625,
-0.02349853515625,
0.04327392578125,
0.052825927734375,
-0.0160064697265625,
-0.0198516845703125,
-0.0021839141845703125,
0.058074951171875,
0.006420135498046875,
-0.00495147705078125,
0.0071258544921875,
0.0255126953125,
-0.0170440673828125,
-0.0166778564453125,
0.002719879150390625,
-0.03082275390625,
-0.0137481689453125,
-0.033599853515625,
-0.01390838623046875,
0.01068878173828125,
-0.034088134765625,
0.0035915374755859375,
-0.02587890625,
-0.020294189453125,
0.022552490234375,
0.0233612060546875,
-0.0020236968994140625,
0.0214996337890625,
-0.04583740234375,
0.0124359130859375,
0.0271759033203125,
-0.00550079345703125,
0.034149169921875,
0.07269287109375,
-0.0164794921875,
0.0089263916015625,
0.002651214599609375,
-0.00024580955505371094,
-0.057464599609375,
-0.0721435546875,
-0.01007843017578125,
0.01045989990234375,
-0.019195556640625,
0.0269012451171875,
-0.00933074951171875,
-0.01064300537109375,
0.054656982421875,
-0.033905029296875,
0.005207061767578125,
0.006988525390625,
0.0200653076171875,
0.0157623291015625,
0.0088043212890625,
-0.006893157958984375,
0.013946533203125,
-0.012054443359375,
0.0194091796875,
-0.00897216796875,
-0.037200927734375,
-0.0135955810546875,
0.0496826171875,
0.0023174285888671875,
0.0198974609375,
-0.038238525390625,
-0.034454345703125,
0.0274200439453125,
-0.02740478515625,
0.044403076171875,
-0.034759521484375,
0.0255126953125,
-0.005779266357421875,
0.01180267333984375,
0.03997802734375,
0.019683837890625,
-0.0006513595581054688,
-0.020111083984375,
0.05096435546875,
0.01953125,
0.0114898681640625,
0.0133514404296875,
0.0004734992980957031,
0.044525146484375,
-0.043792724609375,
-0.03485107421875,
-0.014862060546875,
-0.042755126953125,
0.0121002197265625,
0.051300048828125,
-0.03460693359375,
0.043975830078125,
0.093994140625,
-0.02435302734375,
0.0092926025390625,
-0.030792236328125,
0.0484619140625,
-0.060150146484375,
0.00449371337890625,
0.0231781005859375,
-0.005924224853515625,
-0.034423828125,
0.11395263671875,
-0.04052734375,
0.054229736328125,
0.0017757415771484375,
0.04461669921875,
0.00809478759765625,
0.0645751953125,
0.0051116943359375,
-0.047576904296875,
0.00860595703125,
0.0653076171875,
-0.02496337890625,
-0.024658203125,
-0.002040863037109375,
0.01308441162109375,
0.03857421875,
0.0218353271484375,
0.00841522216796875,
0.019317626953125,
-0.025482177734375,
-0.033599853515625,
0.0550537109375,
0.0186920166015625,
-0.031280517578125,
-0.031585693359375,
-0.047698974609375,
-0.01230621337890625,
-0.002288818359375,
0.01528167724609375,
-0.019805908203125,
-0.00539398193359375,
0.050506591796875,
-0.05316162109375,
0.0560302734375,
-0.021820068359375,
-0.0316162109375,
0.0202484130859375,
-0.007720947265625,
-0.019256591796875,
-0.0283966064453125,
-0.0181121826171875,
-0.0187225341796875,
-0.0067291259765625,
0.048065185546875,
-0.04046630859375,
0.017425537109375,
-0.044097900390625,
0.0413818359375,
-0.055877685546875,
0.0019817352294921875,
0.053070068359375,
0.04730224609375,
0.0292816162109375,
-0.0158233642578125,
-0.00799560546875,
-0.0001627206802368164,
0.06671142578125,
-0.024444580078125,
0.0284423828125,
-0.03704833984375,
0.0164031982421875,
0.038543701171875,
0.024505615234375,
-0.021759033203125,
-0.01375579833984375,
-0.021148681640625,
0.009002685546875,
0.045135498046875,
-0.00479888916015625,
0.0816650390625,
-0.010009765625,
0.0595703125,
0.01959228515625,
0.0304718017578125,
-0.0201568603515625,
-0.020751953125,
-0.006439208984375,
-0.08056640625,
-0.01203155517578125,
-0.00310516357421875,
-0.0294342041015625,
0.02655029296875,
0.01519775390625,
0.00594329833984375,
0.052154541015625,
-0.027130126953125,
-0.0008249282836914062,
-0.004024505615234375,
-0.009429931640625,
-0.041259765625,
0.00909423828125,
0.053131103515625,
-0.0011129379272460938,
0.005664825439453125,
-0.036346435546875,
-0.023681640625,
0.01496124267578125,
-0.01081085205078125,
0.006927490234375,
0.02520751953125,
-0.0506591796875,
0.04498291015625,
0.061065673828125,
0.027923583984375,
0.0290679931640625,
-0.025177001953125,
-0.00115203857421875,
-0.00027298927307128906,
0.00392913818359375,
0.0157470703125,
-0.0031032562255859375,
0.09100341796875,
0.0115203857421875,
-0.040008544921875,
0.07635498046875,
-0.04266357421875,
0.01467132568359375,
-0.01038360595703125,
0.034393310546875,
-0.0305328369140625,
0.0228424072265625,
0.023406982421875,
0.0167083740234375,
0.020050048828125,
0.02203369140625,
-0.045166015625,
-0.0186309814453125,
-0.038543701171875,
0.01373291015625,
-0.041290283203125,
-0.0092010498046875,
0.049285888671875,
-0.003688812255859375,
-0.026397705078125,
0.00511932373046875,
0.0100555419921875,
0.0137786865234375,
-0.0046234130859375,
-0.00867462158203125,
0.021392822265625,
-0.0081634521484375,
0.01065826416015625,
-0.02276611328125,
-0.0018129348754882812,
-0.08489990234375,
-0.03472900390625,
-0.0377197265625,
-0.02410888671875,
-0.0275726318359375,
0.0180816650390625,
0.033721923828125,
0.035308837890625,
0.00101470947265625,
0.00811767578125,
-0.000766754150390625,
0.043548583984375,
-0.06011962890625,
-0.03570556640625,
-0.0322265625,
0.0618896484375,
0.0144500732421875,
0.03387451171875,
0.02520751953125,
-0.019012451171875,
-0.006755828857421875,
0.0229034423828125,
0.052459716796875,
-0.0254364013671875,
-0.00424957275390625,
0.027252197265625,
0.036529541015625,
-0.0002053976058959961,
-0.01751708984375,
0.051025390625,
-0.053436279296875,
-0.0164642333984375,
0.00556182861328125,
-0.01538848876953125,
-0.0377197265625,
-0.0114898681640625,
-0.058074951171875,
0.042724609375,
0.012237548828125,
0.0010290145874023438,
0.0173797607421875,
0.0014886856079101562,
-0.041717529296875,
-0.0223388671875,
-0.02288818359375,
0.0711669921875,
-0.01544189453125,
0.042083740234375,
-0.047882080078125,
-0.02325439453125,
0.0199432373046875,
0.050079345703125,
0.0169219970703125,
0.00717926025390625,
-0.06414794921875,
-0.0267486572265625,
0.0170745849609375,
0.0242919921875,
0.00859832763671875,
0.05010986328125,
0.003551483154296875,
0.07928466796875,
0.0784912109375,
-0.08453369140625,
0.01309967041015625,
0.005390167236328125,
0.00662994384765625,
0.0239410400390625,
0.005077362060546875,
-0.0003707408905029297,
0.004673004150390625,
0.0355224609375,
0.0202789306640625,
-0.0094757080078125,
-0.0193939208984375,
-0.01239013671875,
0.02001953125,
0.038543701171875,
0.07427978515625,
-0.055908203125,
-0.043212890625,
-0.0321044921875,
0.052337646484375,
0.0247802734375,
0.004535675048828125,
0.0011615753173828125,
0.01517486572265625,
0.04766845703125,
-0.01210784912109375,
-0.0081024169921875,
0.0308074951171875,
-0.00907135009765625,
0.059295654296875,
-0.00665283203125,
0.000988006591796875,
-0.043121337890625,
0.0489501953125,
0.02197265625,
0.042022705078125,
-0.06829833984375,
-0.0533447265625,
0.00962066650390625,
0.00396728515625,
-0.0143585205078125,
-0.00009864568710327148,
-0.003170013427734375,
0.0233612060546875,
0.05499267578125,
-0.032012939453125,
0.00853729248046875,
0.01441192626953125,
0.0009617805480957031,
-0.0030193328857421875,
-0.0052032470703125,
-0.01568603515625,
0.003681182861328125,
-0.04345703125,
0.00872039794921875,
0.0406494140625,
0.05352783203125,
0.0169525146484375,
0.045166015625,
0.0128173828125,
-0.0265655517578125,
-0.0222930908203125,
0.0325927734375,
0.01611328125,
0.0181732177734375,
-0.02679443359375,
-0.030120849609375,
0.004756927490234375,
0.035308837890625,
0.03509521484375,
-0.0006866455078125,
0.046630859375,
0.059234619140625,
-0.0123443603515625,
-0.00830078125,
0.03668212890625,
-0.003429412841796875,
-0.035797119140625,
-0.0270233154296875,
-0.006824493408203125,
0.0087127685546875,
0.003429412841796875,
0.00351715087890625,
0.02142333984375,
-0.0068511962890625,
-0.0037822723388671875,
0.0338134765625,
0.005596160888671875,
0.020904541015625,
0.03753662109375,
-0.0142364501953125,
-0.006969451904296875,
0.00211334228515625,
-0.07244873046875,
0.00148773193359375,
-0.046142578125,
-0.026824951171875,
0.0014467239379882812,
0.031524658203125,
-0.00864410400390625,
0.0175018310546875,
-0.02685546875,
-0.03497314453125,
0.01058197021484375,
0.0287933349609375,
-0.0118255615234375,
0.04150390625,
0.0213775634765625,
-0.002750396728515625,
-0.05108642578125,
-0.0191497802734375,
0.00138092041015625,
0.00897979736328125,
0.0193023681640625,
-0.006977081298828125,
0.030517578125,
0.031341552734375,
-0.04083251953125,
0.01910400390625,
-0.046905517578125,
-0.0350341796875,
0.0273895263671875,
-0.03369140625,
-0.0022182464599609375,
0.007415771484375,
0.0241241455078125,
0.0006060600280761719,
0.051727294921875,
-0.047027587890625,
-0.0548095703125,
0.01128387451171875,
0.043670654296875,
0.01346588134765625,
0.00905609130859375,
-0.02740478515625,
-0.005115509033203125,
-0.035675048828125,
-0.02880859375,
0.061187744140625,
0.059539794921875,
0.0218353271484375,
0.0115509033203125,
0.026153564453125,
-0.0203399658203125,
0.04156494140625,
-0.00952911376953125,
0.08880615234375,
0.038818359375,
-0.034271240234375,
0.009765625,
0.014373779296875,
-0.01239013671875,
0.01715087890625,
0.01018524169921875,
0.0145111083984375,
0.024322509765625,
0.001247406005859375,
-0.0201568603515625,
0.00200653076171875,
0.03924560546875,
0.02166748046875,
0.023193359375,
-0.0218353271484375,
-0.006656646728515625,
-0.044342041015625,
-0.032867431640625,
-0.0323486328125,
-0.039886474609375,
0.01003265380859375,
0.032684326171875,
-0.0059967041015625,
-0.0202178955078125,
-0.02899169921875,
-0.027557373046875,
0.032470703125,
0.004016876220703125,
-0.0297393798828125,
-0.0028705596923828125,
-0.0090484619140625,
0.022064208984375,
0.00778961181640625,
-0.036529541015625,
0.004535675048828125,
0.0238189697265625,
0.007232666015625,
-0.01617431640625,
-0.030975341796875,
0.028839111328125,
-0.006916046142578125,
-0.00405120849609375,
0.0022869110107421875,
-0.02294921875,
-0.0307769775390625,
-0.01064300537109375,
0.005580902099609375,
0.02313232421875,
0.057342529296875,
-0.018402099609375,
0.01558685302734375,
-0.00013303756713867188,
-0.044189453125,
-0.073974609375,
0.0269775390625,
-0.08197021484375,
-0.0116119384765625,
0.046478271484375,
0.0149993896484375,
0.05352783203125,
-0.0049896240234375,
-0.03594970703125,
0.047576904296875,
0.01177215576171875,
-0.0251922607421875,
-0.025360107421875,
-0.01995849609375,
0.0237579345703125,
-0.00974273681640625,
-0.007297515869140625,
-0.0091552734375,
-0.06341552734375,
0.0006561279296875,
0.0178375244140625,
-0.01314544677734375,
0.023406982421875,
0.01549530029296875,
-0.06396484375,
0.0159454345703125,
-0.00818634033203125,
-0.0037059783935546875,
0.0208587646484375,
0.004589080810546875,
0.0178680419921875,
0.017578125,
-0.04864501953125,
-0.022216796875,
-0.0301971435546875,
-0.00559234619140625,
0.0155792236328125,
-0.028778076171875,
-0.05029296875,
-0.01554107666015625,
0.07244873046875,
0.02484130859375,
0.024383544921875,
-0.0259857177734375,
-0.003082275390625,
-0.007045745849609375,
-0.0184326171875,
-0.021270751953125,
0.0135955810546875,
-0.0640869140625,
-0.025360107421875,
-0.01055145263671875,
-0.007137298583984375,
0.00699615478515625,
-0.0287322998046875,
-0.012603759765625,
-0.0007281303405761719,
0.0268707275390625,
0.0225982666015625,
-0.028076171875,
0.01763916015625,
0.034881591796875,
-0.047454833984375,
-0.0552978515625,
0.010711669921875,
-0.00127410888671875,
-0.0181121826171875,
-0.031280517578125,
-0.0246124267578125,
-0.0020961761474609375,
0.0208587646484375,
-0.00785064697265625,
0.015869140625,
0.0254364013671875,
0.00983428955078125,
-0.00122833251953125,
-0.018280029296875,
0.0084991455078125,
-0.0011568069458007812,
-0.00684356689453125,
0.0062408447265625,
0.0017795562744140625,
0.00879669189453125,
0.033782958984375,
-0.0297393798828125,
0.08087158203125,
-0.016357421875,
0.02264404296875,
0.02459716796875,
-0.004497528076171875,
0.0523681640625,
0.017242431640625,
-0.00327301025390625,
0.0036907196044921875,
-0.0290985107421875,
-0.034271240234375,
0.0036144256591796875,
0.02008056640625,
-0.0164642333984375,
0.0126953125
] |
157fec0e0a96b8e3ea0317428f9f2aa893a64f55
|
Wordpress Stackexchange
Q: difference between add_options and register_setting I am confused. Want to save data for my plugin. There are people who use add_options and there are others who use register_settings. My question is What is difference between add_options and register_setting?
A: register_setting() uses Settings API, which is just an API for options.php, is easier to use, more secure and preffered way of storing options since WordPress 2.7.
If you need to store only a few options or doing simple plugin just for yourself - it's really up to you which one to use :)
Here's the Settings API (well) explained: http://www.chipbennett.net/2011/02/17/incorporating-the-settings-api-in-wordpress-themes/
Basically it makes a few things much easier, you don't have to render whole forms all over again (great for plugins/themes with many options), you don't need to care about nonces etc.
So, to sum up, both these functions actually do the same thing :)
|
Q: difference between add_options and register_setting I am confused. Want to save data for my plugin. There are people who use add_options and there are others who use register_settings. My question is What is difference between add_options and register_setting?
A: register_setting() uses Settings API, which is just an API for options.php, is easier to use, more secure and preffered way of storing options since WordPress 2.7.
If you need to store only a few options or doing simple plugin just for yourself - it's really up to you which one to use :)
Here's the Settings API (well) explained: http://www.chipbennett.net/2011/02/17/incorporating-the-settings-api-in-wordpress-themes/
Basically it makes a few things much easier, you don't have to render whole forms all over again (great for plugins/themes with many options), you don't need to care about nonces etc.
So, to sum up, both these functions actually do the same thing :)
|
wordpress
|
{
"language": "en",
"length": 145,
"provenance": "stackexchange_00019.jsonl.gz:419362",
"question_score": "8",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50071"
}
|
[
0.053497314453125,
-0.010986328125,
0.031219482421875,
-0.0296173095703125,
0.002288818359375,
-0.01163482666015625,
0.024200439453125,
-0.0198211669921875,
-0.002655029296875,
0.01068115234375,
-0.0361328125,
0.031951904296875,
-0.047515869140625,
-0.01432037353515625,
0.00016009807586669922,
-0.05078125,
0.0211181640625,
-0.0225372314453125,
0.005035400390625,
-0.03497314453125,
0.0172882080078125,
-0.02764892578125,
0.006839752197265625,
0.09490966796875,
0.0361328125,
-0.0792236328125,
0.03326416015625,
-0.012542724609375,
0.016448974609375,
-0.01265716552734375,
0.0110626220703125,
0.00919342041015625,
0.016082763671875,
0.0355224609375,
-0.032562255859375,
0.0232391357421875,
0.047393798828125,
-0.00476837158203125,
-0.0020694732666015625,
0.059051513671875,
0.04443359375,
-0.0223541259765625,
0.0202484130859375,
-0.004795074462890625,
0.00678253173828125,
-0.0462646484375,
0.072265625,
-0.023529052734375,
-0.006256103515625,
-0.057861328125,
0.0219879150390625,
-0.038177490234375,
0.057647705078125,
-0.0229339599609375,
-0.03228759765625,
-0.0242156982421875,
-0.0023670196533203125,
0.03668212890625,
0.0284576416015625,
-0.01467132568359375,
-0.04156494140625,
0.018798828125,
0.0184173583984375,
-0.0181121826171875,
0.042755126953125,
-0.005168914794921875,
0.0210723876953125,
0.043609619140625,
-0.07745361328125,
0.00267791748046875,
0.03533935546875,
-0.05377197265625,
0.0050811767578125,
-0.020782470703125,
-0.033294677734375,
0.01177215576171875,
-0.004787445068359375,
-0.00958251953125,
0.0380859375,
-0.0244140625,
-0.005573272705078125,
0.0006337165832519531,
0.0152130126953125,
-0.0190277099609375,
-0.005855560302734375,
-0.00046944618225097656,
-0.003864288330078125,
-0.0112762451171875,
0.0047760009765625,
-0.0207977294921875,
0.0039825439453125,
-0.06646728515625,
-0.00559234619140625,
0.05499267578125,
0.01259613037109375,
-0.032958984375,
0.032745361328125,
-0.005634307861328125,
0.005748748779296875,
-0.00926971435546875,
0.044464111328125,
-0.06488037109375,
0.038970947265625,
0.0010776519775390625,
0.03155517578125,
0.08135986328125,
0.007244110107421875,
-0.040008544921875,
0.0268096923828125,
-0.0184173583984375,
0.024322509765625,
0.041473388671875,
0.0298004150390625,
-0.04339599609375,
0.0286865234375,
-0.0389404296875,
-0.01000213623046875,
0.05340576171875,
0.0265350341796875,
-0.0255279541015625,
0.0235748291015625,
0.024871826171875,
0.04339599609375,
0.0023746490478515625,
-0.02398681640625,
-0.00911712646484375,
-0.0245513916015625,
-0.0701904296875,
-0.0528564453125,
0.045684814453125,
-0.01346588134765625,
-0.006130218505859375,
0.06402587890625,
0.036651611328125,
-0.01023101806640625,
-0.0306243896484375,
0.0270538330078125,
0.00704193115234375,
-0.01378631591796875,
0.04571533203125,
-0.002109527587890625,
-0.06988525390625,
-0.0509033203125,
0.00757598876953125,
-0.0080718994140625,
0.0171356201171875,
0.0107421875,
0.0286102294921875,
0.001678466796875,
-0.036285400390625,
0.0164337158203125,
-0.0146331787109375,
0.00634765625,
-0.00048613548278808594,
-0.0106658935546875,
0.032867431640625,
-0.03515625,
0.0067291259765625,
-0.00897216796875,
0.020660400390625,
-0.041046142578125,
-0.02069091796875,
-0.00295257568359375,
-0.034515380859375,
-0.03948974609375,
0.0400390625,
0.009307861328125,
0.005970001220703125,
0.00867462158203125,
-0.041290283203125,
0.04376220703125,
0.0220184326171875,
-0.0149688720703125,
-0.02020263671875,
0.01070404052734375,
-0.01415252685546875,
0.0034313201904296875,
0.0265960693359375,
0.004283905029296875,
-0.003055572509765625,
-0.0227508544921875,
-0.04376220703125,
0.01146697998046875,
-0.0234832763671875,
-0.0645751953125,
0.04656982421875,
-0.01018524169921875,
0.029327392578125,
0.03594970703125,
-0.0123291015625,
0.04315185546875,
0.0214691162109375,
0.045684814453125,
0.00016868114471435547,
0.019622802734375,
-0.035980224609375,
-0.0101776123046875,
0.0025310516357421875,
-0.00649261474609375,
-0.037933349609375,
-0.042022705078125,
-0.002094268798828125,
0.00687408447265625,
0.0156402587890625,
-0.03656005859375,
-0.0054779052734375,
-0.0200653076171875,
0.0308990478515625,
-0.058074951171875,
-0.005054473876953125,
0.0252532958984375,
-0.0236663818359375,
-0.0229339599609375,
-0.006927490234375,
0.00982666015625,
0.0250244140625,
-0.042022705078125,
0.0694580078125,
0.0222930908203125,
0.04156494140625,
0.040496826171875,
-0.02130126953125,
0.039794921875,
-0.0208282470703125,
0.053955078125,
-0.020599365234375,
-0.0084228515625,
-0.041656494140625,
0.049896240234375,
-0.03228759765625,
0.013519287109375,
0.0672607421875,
-0.0213623046875,
-0.0105438232421875,
-0.0243682861328125,
-0.01153564453125,
-0.00382232666015625,
-0.0772705078125,
0.0203857421875,
0.058685302734375,
0.0164794921875,
0.0251007080078125,
-0.00843048095703125,
0.00865936279296875,
0.035064697265625,
-0.02667236328125,
0.00449371337890625,
0.003452301025390625,
-0.00616455078125,
-0.00843048095703125,
0.048797607421875,
-0.020721435546875,
0.008941650390625,
-0.0167388916015625,
0.01013946533203125,
-0.005443572998046875,
-0.0689697265625,
-0.0258941650390625,
0.034393310546875,
-0.0168914794921875,
-0.0111846923828125,
-0.07904052734375,
0.0260009765625,
-0.055084228515625,
-0.0256500244140625,
0.005077362060546875,
0.0012273788452148438,
0.00762939453125,
0.005893707275390625,
-0.00017905235290527344,
0.0120391845703125,
-0.038543701171875,
-0.0112762451171875,
0.00847625732421875,
0.0031528472900390625,
0.0029659271240234375,
-0.054107666015625,
0.0171051025390625,
0.0093994140625,
-0.0049591064453125,
-0.0238037109375,
-0.00789642333984375,
-0.06298828125,
-0.01425933837890625,
0.015228271484375,
-0.06854248046875,
-0.00868988037109375,
0.016876220703125,
-0.00243377685546875,
-0.008056640625,
0.033416748046875,
0.005794525146484375,
-0.021881103515625,
0.0008544921875,
0.0115814208984375,
-0.023895263671875,
0.01096343994140625,
-0.00011485815048217773,
0.004375457763671875,
-0.01544952392578125,
0.06463623046875,
0.048797607421875,
-0.025604248046875,
0.0098724365234375,
0.0233306884765625,
-0.0112457275390625,
0.02496337890625,
0.00247955322265625,
0.0019989013671875,
0.03472900390625,
-0.08050537109375,
0.0213165283203125,
0.01120758056640625,
-0.03497314453125,
-0.00302886962890625,
-0.03216552734375,
-0.04534912109375,
-0.019195556640625,
-0.059051513671875,
0.0157012939453125,
-0.029937744140625,
-0.08197021484375,
0.017242431640625,
-0.0189361572265625,
-0.0295562744140625,
0.0021305084228515625,
-0.001983642578125,
0.030517578125,
-0.01509857177734375,
-0.01531219482421875,
0.00972747802734375,
-0.022979736328125,
-0.0304107666015625,
-0.0189208984375,
0.01496124267578125,
-0.001537322998046875,
0.00777435302734375,
0.0777587890625,
0.01416015625,
-0.0277099609375,
0.036529541015625,
-0.082275390625,
-0.0134124755859375,
0.03265380859375,
0.00377655029296875,
-0.009552001953125,
-0.00554656982421875,
0.00487518310546875,
0.01776123046875,
0.0087890625,
-0.0175018310546875,
-0.024749755859375,
-0.0036334991455078125,
-0.0010662078857421875,
0.010162353515625,
0.034210205078125,
-0.0021343231201171875,
-0.0076904296875,
0.01474761962890625,
-0.04638671875,
-0.045806884765625,
0.006389617919921875,
-0.048828125,
0.0308990478515625,
0.0328369140625,
0.001556396484375,
0.01180267333984375,
0.0180816650390625,
-0.046875,
-0.02734375,
0.01197052001953125,
-0.0498046875,
0.033477783203125,
-0.02471923828125,
-0.048309326171875,
0.0025196075439453125,
-0.025054931640625,
-0.036224365234375,
-0.0218353271484375,
-0.030120849609375,
-0.01139068603515625,
-0.0176239013671875,
-0.01499176025390625,
-0.02734375,
-0.10870361328125,
0.054290771484375,
-0.0384521484375,
-0.0174102783203125,
-0.0295562744140625,
-0.0338134765625,
0.0144500732421875,
0.1265869140625,
-0.03509521484375,
-0.0193023681640625,
0.0252838134765625,
0.03729248046875,
-0.038787841796875,
-0.0220794677734375,
-0.022430419921875,
-0.020294189453125,
0.01251983642578125,
-0.00658416748046875,
-0.02392578125,
0.007305145263671875,
-0.047576904296875,
0.026641845703125,
-0.012542724609375,
-0.00673675537109375,
0.033660888671875,
-0.01529693603515625,
0.0223846435546875,
-0.01812744140625,
0.0235748291015625,
-0.041259765625,
0.002124786376953125,
-0.026824951171875,
-0.040283203125,
-0.0158843994140625,
0.03192138671875,
0.021209716796875,
0.01348876953125,
-0.053375244140625,
0.0166168212890625,
0.050750732421875,
0.0010843276977539062,
0.0030231475830078125,
0.0311279296875,
0.027435302734375,
-0.0164794921875,
-0.039886474609375,
0.0112762451171875,
-0.062255859375,
-0.017303466796875,
-0.05548095703125,
-0.058074951171875,
-0.005146026611328125,
0.00005429983139038086,
0.04949951171875,
-0.0090789794921875,
-0.01212310791015625,
-0.055023193359375,
0.019256591796875,
-0.01244354248046875,
-0.0151214599609375,
-0.014373779296875,
-0.0117340087890625,
0.03302001953125,
-0.045074462890625,
0.0204315185546875,
-0.05963134765625,
0.005283355712890625,
0.01239776611328125,
0.10516357421875,
0.016815185546875,
0.015167236328125,
-0.0025196075439453125,
-0.0229034423828125,
0.014312744140625,
0.00751495361328125,
0.020843505859375,
0.0035381317138671875,
-0.0027599334716796875,
0.0257720947265625,
-0.007904052734375,
-0.0119171142578125,
-0.0210113525390625,
0.039947509765625,
0.01110076904296875,
0.00431060791015625,
-0.017578125,
-0.0037994384765625,
0.044952392578125,
0.004932403564453125,
-0.0191650390625,
0.0017385482788085938,
0.005908966064453125,
0.0038013458251953125,
-0.0174560546875,
0.01531219482421875,
-0.01294708251953125,
-0.0018472671508789062,
-0.0009703636169433594,
0.01617431640625,
0.031646728515625,
0.035491943359375,
-0.0031185150146484375,
-0.0237579345703125,
-0.0099945068359375,
-0.009765625,
0.01004791259765625,
0.028961181640625,
0.0293426513671875,
0.0298614501953125,
0.01094818115234375,
0.0061492919921875,
-0.051239013671875,
-0.004833221435546875,
0.038330078125,
-0.032318115234375,
-0.074462890625,
0.0032596588134765625,
-0.01479339599609375,
0.060699462890625,
0.049713134765625,
0.0207672119140625,
0.045806884765625,
0.0038852691650390625,
0.01525115966796875,
0.0008702278137207031,
0.02044677734375,
-0.0226898193359375,
-0.0247955322265625,
0.009307861328125,
-0.01189422607421875,
-0.009429931640625,
-0.0105743408203125,
0.022247314453125,
-0.027862548828125,
0.003864288330078125,
0.0044708251953125,
0.005054473876953125,
0.0131378173828125,
0.003070831298828125,
0.021026611328125,
0.00939178466796875,
0.00727081298828125,
-0.016815185546875,
0.021087646484375,
-0.0123138427734375,
0.01541900634765625,
0.0081329345703125,
0.013824462890625,
-0.01514434814453125,
-0.0253448486328125,
0.04327392578125,
-0.005428314208984375,
-0.0255126953125,
0.0311126708984375,
0.0003898143768310547,
-0.059783935546875,
-0.02099609375,
0.01245880126953125,
0.036346435546875,
-0.0183868408203125,
0.0093536376953125,
0.027587890625,
0.0188446044921875,
0.005672454833984375,
0.038909912109375,
-0.046905517578125,
-0.0014600753784179688,
0.01910400390625,
-0.0377197265625,
-0.0150909423828125,
-0.004055023193359375,
-0.0307159423828125,
-0.0215606689453125,
-0.0141143798828125,
-0.0201416015625,
0.0244903564453125,
-0.01947021484375,
0.04345703125,
-0.0206146240234375,
-0.01134490966796875,
-0.016448974609375,
0.002803802490234375,
0.040924072265625,
0.01470947265625,
-0.055816650390625,
-0.0048980712890625,
-0.0291595458984375,
0.003116607666015625,
-0.01194000244140625,
-0.040496826171875,
-0.02227783203125,
-0.002696990966796875,
-0.003292083740234375,
0.01837158203125,
-0.0266876220703125,
-0.01739501953125,
0.0187530517578125,
0.0221405029296875,
-0.0025539398193359375,
0.01654052734375,
-0.0005202293395996094,
0.0138397216796875,
0.004119873046875,
0.016510009765625,
0.005016326904296875,
-0.00983428955078125,
-0.020477294921875,
-0.009857177734375,
0.01000213623046875,
-0.044830322265625,
-0.04595947265625,
-0.011260986328125,
-0.022125244140625,
0.039215087890625,
0.032073974609375,
-0.00838470458984375,
0.00518798828125,
0.00836181640625,
0.00261688232421875,
-0.003265380859375,
0.01090240478515625,
0.033538818359375,
-0.004825592041015625,
0.043548583984375,
-0.02752685546875,
0.0026111602783203125,
-0.0020694732666015625,
0.005916595458984375,
0.0206298828125,
-0.01111602783203125,
0.011199951171875,
0.0154266357421875,
-0.03350830078125,
0.0261993408203125,
0.01554107666015625,
0.0166778564453125,
0.040374755859375,
-0.01763916015625,
0.0281524658203125,
0.01953125,
0.0117645263671875,
-0.053802490234375,
-0.0180206298828125,
0.05914306640625,
0.047882080078125,
-0.0203094482421875,
0.06195068359375,
-0.033172607421875,
0.0394287109375,
0.09423828125,
0.07672119140625,
-0.1341552734375,
0.004932403564453125,
0.0121612548828125,
-0.00333404541015625,
0.034454345703125,
0.0321044921875,
-0.0307769775390625,
-0.03753662109375,
0.03192138671875,
-0.034576416015625,
0.0032558441162109375,
0.03759765625,
0.012786865234375,
-0.0343017578125,
-0.01617431640625,
-0.0192413330078125,
0.0210723876953125,
0.039337158203125,
0.046539306640625,
-0.037109375,
0.0260009765625,
0.004016876220703125,
0.0132598876953125,
-0.0079345703125,
-0.031494140625,
-0.0711669921875,
-0.0243988037109375,
-0.0304718017578125,
-0.05548095703125,
0.0180206298828125,
-0.00484466552734375,
0.05047607421875,
0.02850341796875,
0.00485992431640625,
-0.0025615692138671875,
-0.0177459716796875,
0.043121337890625,
-0.0196380615234375,
-0.017547607421875,
0.0006279945373535156,
0.0192108154296875,
-0.04339599609375,
0.0201873779296875,
-0.033538818359375,
0.00624847412109375,
0.00341033935546875,
-0.0161895751953125,
0.054412841796875,
-0.050323486328125,
0.0032939910888671875,
0.039459228515625,
-0.00951385498046875,
-0.00943756103515625,
-0.016845703125,
0.00829315185546875,
-0.04949951171875,
-0.033843994140625,
-0.01174163818359375,
-0.055023193359375,
0.01763916015625,
-0.031707763671875,
0.00397491455078125,
0.10736083984375,
-0.038909912109375,
-0.0299072265625,
0.01241302490234375,
0.06585693359375,
-0.01035308837890625,
0.054351806640625,
-0.022003173828125,
0.021759033203125,
-0.00670623779296875,
-0.0325927734375,
-0.011138916015625,
0.0272216796875,
-0.054046630859375,
-0.0205078125,
0.11138916015625,
0.0280914306640625,
-0.0151824951171875,
-0.01434326171875,
0.031951904296875,
-0.036041259765625,
-0.0518798828125,
0.056854248046875,
0.01194000244140625,
0.015167236328125,
0.08978271484375,
-0.01029205322265625,
0.0350341796875,
0.025360107421875,
0.0185699462890625,
0.030548095703125,
-0.010650634765625,
-0.01218414306640625,
-0.0233612060546875,
0.03619384765625,
0.0180816650390625,
-0.031524658203125,
-0.0194549560546875,
-0.036651611328125,
-0.0130462646484375,
0.0043182373046875,
-0.0188751220703125,
0.0308380126953125,
0.0228729248046875,
-0.011688232421875,
0.0245208740234375,
0.00640869140625,
0.02777099609375,
0.03240966796875,
0.004611968994140625,
0.0623779296875,
0.016387939453125,
0.0240936279296875,
0.037689208984375,
-0.0140838623046875,
-0.01357269287109375,
-0.0006475448608398438,
0.017425537109375,
-0.028900146484375,
-0.018218994140625,
0.0182037353515625,
0.005035400390625,
-0.006877899169921875,
-0.061614990234375,
0.009735107421875,
0.01221466064453125,
0.0215911865234375,
0.00321197509765625,
0.025543212890625,
-0.097412109375,
-0.0164794921875,
-0.059722900390625,
0.0002834796905517578,
0.018829345703125,
0.0121612548828125,
-0.0029735565185546875,
0.001964569091796875,
-0.024078369140625,
-0.01397705078125,
-0.0247802734375,
0.018218994140625,
0.00991058349609375,
0.0102386474609375,
-0.01161956787109375,
0.0709228515625,
-0.004009246826171875,
-0.01105499267578125,
-0.04241943359375,
0.05938720703125,
-0.0016088485717773438,
0.052032470703125,
-0.08984375,
-0.048248291015625,
0.035308837890625,
0.05999755859375,
0.0022296905517578125,
0.0105438232421875,
0.048614501953125,
0.0496826171875,
-0.0131988525390625,
-0.005054473876953125,
0.047119140625,
-0.00875091552734375,
-0.040008544921875,
-0.0202178955078125,
-0.0347900390625,
0.015289306640625,
-0.0174713134765625,
0.00402069091796875,
-0.0163116455078125,
0.0173187255859375,
-0.01702880859375,
0.03656005859375,
-0.013427734375,
-0.012725830078125,
0.01105499267578125,
-0.0186614990234375,
0.039581298828125,
-0.0077972412109375,
-0.026763916015625,
-0.0027256011962890625,
-0.020843505859375,
-0.03369140625,
0.0175628662109375,
0.02777099609375,
-0.01087188720703125,
0.038421630859375,
0.0081787109375,
-0.04638671875,
0.03857421875,
0.00830078125,
0.00775146484375,
0.0034351348876953125,
-0.00412750244140625,
-0.0230560302734375,
-0.020355224609375,
-0.0186920166015625,
0.022247314453125,
0.0261077880859375,
-0.0013170242309570312,
0.007640838623046875,
0.005985260009765625,
-0.004184722900390625,
-0.00974273681640625,
-0.0051116943359375,
0.01084136962890625,
-0.03057861328125,
0.056427001953125,
0.01483917236328125,
-0.0172576904296875,
-0.0165252685546875,
-0.047698974609375,
0.0347900390625,
0.0287933349609375,
-0.029815673828125,
0.01190185546875,
0.0287017822265625,
0.006374359130859375,
-0.0198974609375,
0.00904083251953125,
-0.02801513671875,
-0.047760009765625,
0.00302886962890625,
0.0257720947265625,
-0.035125732421875,
-0.0200347900390625,
0.00299835205078125,
0.0233917236328125,
-0.013214111328125,
0.00408172607421875,
-0.00893402099609375,
0.01395416259765625,
-0.0460205078125,
0.0099334716796875,
-0.01186370849609375,
-0.01458740234375,
0.015777587890625,
-0.0200042724609375,
0.007129669189453125,
0.0015869140625,
0.04864501953125,
0.01739501953125,
-0.0469970703125,
-0.0215606689453125,
0.0426025390625,
0.04949951171875,
0.0021800994873046875,
0.0276031494140625,
0.009307861328125,
-0.00914764404296875,
0.0005564689636230469,
-0.016571044921875,
-0.0172882080078125,
-0.03533935546875,
-0.0205230712890625,
0.01029205322265625,
-0.02215576171875,
-0.050323486328125,
-0.06512451171875,
-0.00653076171875,
0.007205963134765625,
-0.027801513671875,
-0.0172882080078125,
-0.03521728515625,
-0.0121917724609375,
0.049224853515625,
-0.04547119140625,
-0.049652099609375,
0.0098724365234375,
0.01030731201171875,
0.007251739501953125,
0.01152801513671875,
-0.0439453125,
-0.0223236083984375,
-0.0032501220703125,
0.020294189453125,
0.01212310791015625,
-0.017242431640625,
-0.01168060302734375,
0.06915283203125,
0.005954742431640625,
0.11260986328125,
-0.0017995834350585938,
-0.0157623291015625,
0.010498046875,
0.007312774658203125,
-0.0255126953125,
-0.06329345703125,
-0.0009832382202148438,
-0.0345458984375,
-0.007659912109375,
-0.0655517578125,
0.007061004638671875,
0.006885528564453125,
-0.04534912109375,
-0.0694580078125,
0.060760498046875,
-0.02301025390625,
-0.0198211669921875,
-0.05560302734375,
0.00914764404296875,
0.01068878173828125,
0.01471710205078125,
-0.0131072998046875,
-0.015899658203125,
-0.035400390625,
0.0254974365234375,
0.0211639404296875,
0.0226287841796875,
0.0281829833984375,
-0.0251617431640625,
-0.056182861328125,
-0.009674072265625,
-0.005123138427734375,
0.0270233154296875,
0.042510986328125,
-0.0183563232421875,
0.047607421875,
0.0579833984375,
-0.0166473388671875,
0.0035648345947265625,
-0.02789306640625,
-0.032012939453125,
-0.0268402099609375,
-0.033233642578125,
0.0258941650390625,
0.0251617431640625,
0.03973388671875,
0.0426025390625,
0.0007481575012207031,
-0.061004638671875,
-0.00395965576171875,
-0.024871826171875,
0.0082855224609375,
-0.031829833984375,
0.0014638900756835938,
-0.052459716796875,
-0.0215606689453125,
-0.00516510009765625,
0.0009398460388183594,
0.0206451416015625,
0.008636474609375,
-0.0061187744140625,
-0.0065460205078125,
0.03887939453125,
-0.004390716552734375,
-0.0526123046875,
-0.047882080078125,
0.0063323974609375,
-0.0014715194702148438,
-0.0006351470947265625,
0.010284423828125,
0.0261077880859375,
-0.01497650146484375,
0.05841064453125,
0.028472900390625,
0.001583099365234375,
-0.037933349609375,
0.0190582275390625,
-0.0010089874267578125,
0.021148681640625,
-0.0249176025390625,
-0.0428466796875,
0.008575439453125,
0.019378662109375,
-0.00452423095703125,
0.00228118896484375,
-0.04217529296875,
0.08905029296875,
0.0135955810546875,
0.042816162109375,
0.02972412109375,
0.0095977783203125,
-0.01959228515625,
0.0458984375,
-0.02008056640625,
-0.034912109375,
-0.0270843505859375,
-0.01195526123046875,
-0.001033782958984375,
-0.030426025390625,
0.0101470947265625,
-0.048797607421875,
0.0504150390625,
-0.04852294921875,
-0.0254364013671875,
0.044464111328125
] |
8a6d158dbd57c1d043561eb1a3a68c32a2c32ec5
|
Wordpress Stackexchange
Q: wp_generate_attachment_metadata gives me an empty array I have a custom post type and a metabox with a file input.
I can insert the attachment, but I can't update the attachment metadata and I don't know how to fix it because I don't receive any error.
Here is my code:
$attach_id = wp_insert_attachment( $attachment, $filename, $post_id );
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );
wp_update_attachment_metadata( $attach_id, $attach_data );
echo $attach_id;
echo '<pre>';
print_r($filename);
echo '</pre>';
echo '<pre>';
print_r($attach_data);
echo '</pre>';
and here is the output:
96
Array
(
[name] => one.png
[type] => image/png
[tmp_name] => /tmp/phphQ0e2v
[error] => 0
[size] => 144555
)
Array
(
)
As you can see, $attach_data is empty :(
A: From comment:
Let WordPress generate a file path and use that for the next steps:
$upload = wp_handle_upload($filename, array('test_form' => false));
$attach_id = wp_insert_attachment( $attachment, $upload['file'], $post_id );
wp_update_attachment_metadata( $attach_id, $attach_data );
|
Q: wp_generate_attachment_metadata gives me an empty array I have a custom post type and a metabox with a file input.
I can insert the attachment, but I can't update the attachment metadata and I don't know how to fix it because I don't receive any error.
Here is my code:
$attach_id = wp_insert_attachment( $attachment, $filename, $post_id );
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );
wp_update_attachment_metadata( $attach_id, $attach_data );
echo $attach_id;
echo '<pre>';
print_r($filename);
echo '</pre>';
echo '<pre>';
print_r($attach_data);
echo '</pre>';
and here is the output:
96
Array
(
[name] => one.png
[type] => image/png
[tmp_name] => /tmp/phphQ0e2v
[error] => 0
[size] => 144555
)
Array
(
)
As you can see, $attach_data is empty :(
A: From comment:
Let WordPress generate a file path and use that for the next steps:
$upload = wp_handle_upload($filename, array('test_form' => false));
$attach_id = wp_insert_attachment( $attachment, $upload['file'], $post_id );
wp_update_attachment_metadata( $attach_id, $attach_data );
A: This is, what finally fixed it for me:
apply_filters('wp_handle_upload', array(
'file' => $file_path,
'url' => $file_url,
'type' => $file_type),
'upload');
Explanation: I'm not quite sure why this fixed the error for me, but I assume that this either has something to do with plugins using the wp_handle_upload hook or that the filters add meta-data to the attachment, which otherwise would be missing in the wp_generate_attachment_metadata function.
Full function:
function add_to_media_lib($file_url, $file_path, $parent_post_id)
{
require_once(ABSPATH . 'wp-admin/includes/image.php');
require_once(ABSPATH . 'wp-admin/includes/file.php');
// Check the type of tile. We'll use this as the 'post_mime_type'.
$file_type = wp_check_filetype(basename($file_url), null);
// Get the path to the upload directory.
$wp_upload_dir = wp_upload_dir();
// Prepare an array of post data for the attachment.
$attachment = array(
'guid' => $wp_upload_dir['url'] . '/' . basename($file_url),
'post_mime_type' => $file_type['type'],
'post_title' => preg_replace('/\.[^.]+$/', '', basename($file_url)),
'post_content' => '',
'post_status' => 'inherit',
'post_parent' => $parent_post_id
);
// Insert the attachment.
$attach_id = wp_insert_attachment($attachment, $file_url, $parent_post_id);
// apply filters (important in some environments)
apply_filters('wp_handle_upload', array('file' => $file_path, 'url' => $file_url, 'type' => $file_type), 'upload');
// Generate the metadata for the attachment, and update the database record.
if ($attach_data = wp_generate_attachment_metadata($attach_id, $file_path)) {
wp_update_attachment_metadata($attach_id, $attach_data);
} else {
echo '<div id="message" class="error"><h1>Failed to create PDF-thumbnail Meta-Data</h1><pre>' . print_r($attach_data) . '</pre></div>';
}
return $attach_id;
}
|
wordpress
|
{
"language": "en",
"length": 358,
"provenance": "stackexchange_00019.jsonl.gz:419373",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50096"
}
|
[
0.0232391357421875,
-0.032623291015625,
-0.01062774658203125,
-0.03594970703125,
-0.006557464599609375,
-0.0192413330078125,
0.027862548828125,
0.001941680908203125,
0.00466156005859375,
0.045257568359375,
-0.0228729248046875,
-0.017822265625,
0.032073974609375,
-0.0144805908203125,
-0.02197265625,
-0.009674072265625,
0.045684814453125,
0.01291656494140625,
0.08203125,
0.0183563232421875,
0.0125579833984375,
0.059295654296875,
0.032958984375,
-0.01291656494140625,
-0.00830841064453125,
0.0211334228515625,
0.01404571533203125,
-0.0201568603515625,
-0.00762939453125,
-0.01171875,
0.00907135009765625,
0.021148681640625,
0.0188751220703125,
0.007965087890625,
-0.0197906494140625,
0.013885498046875,
0.0298309326171875,
-0.00148773193359375,
-0.006908416748046875,
0.04339599609375,
0.0181121826171875,
0.001010894775390625,
0.018829345703125,
-0.0007739067077636719,
0.0010013580322265625,
-0.04095458984375,
0.015594482421875,
-0.05255126953125,
0.041107177734375,
0.02178955078125,
-0.00048422813415527344,
0.03961181640625,
-0.005336761474609375,
-0.0179443359375,
0.0034275054931640625,
0.007659912109375,
-0.0374755859375,
0.0347900390625,
0.0173187255859375,
-0.0018186569213867188,
-0.0266876220703125,
-0.00438690185546875,
0.020843505859375,
-0.0182037353515625,
0.0219573974609375,
0.00029206275939941406,
0.0072479248046875,
0.0159454345703125,
-0.046661376953125,
0.0171356201171875,
0.04290771484375,
-0.040924072265625,
0.0014123916625976562,
-0.004154205322265625,
0.0009088516235351562,
-0.03387451171875,
0.02081298828125,
-0.0238037109375,
-0.0006380081176757812,
0.0164337158203125,
0.0290679931640625,
-0.01222991943359375,
-0.024444580078125,
0.015838623046875,
0.02557373046875,
0.0631103515625,
-0.0037994384765625,
-0.049346923828125,
0.021759033203125,
0.00812530517578125,
-0.01004791259765625,
-0.0238037109375,
0.054107666015625,
0.0021343231201171875,
-0.0153656005859375,
-0.0287933349609375,
0.0088653564453125,
0.019622802734375,
-0.003467559814453125,
0.004047393798828125,
0.025787353515625,
-0.049163818359375,
0.0306396484375,
-0.0328369140625,
0.0189361572265625,
0.023956298828125,
0.0078887939453125,
-0.06768798828125,
-0.01491546630859375,
-0.00341033935546875,
-0.0269927978515625,
0.01477813720703125,
-0.00464630126953125,
-0.0296783447265625,
0.004322052001953125,
0.0288543701171875,
-0.022186279296875,
0.031829833984375,
0.00396728515625,
0.0204620361328125,
-0.002490997314453125,
-0.0019931793212890625,
-0.008056640625,
0.00960540771484375,
0.022247314453125,
-0.0016660690307617188,
-0.027130126953125,
0.017242431640625,
0.039276123046875,
0.00034427642822265625,
-0.058990478515625,
-0.0020599365234375,
0.0989990234375,
0.04132080078125,
0.0523681640625,
-0.013031005859375,
-0.0051116943359375,
-0.02215576171875,
-0.00970458984375,
0.02093505859375,
-0.0104827880859375,
-0.048492431640625,
0.005649566650390625,
-0.0021572113037109375,
-0.0100250244140625,
0.032318115234375,
0.0233612060546875,
0.0206146240234375,
-0.01360321044921875,
-0.069091796875,
0.03240966796875,
-0.038482666015625,
0.042633056640625,
-0.0009393692016601562,
-0.01605224609375,
-0.047637939453125,
0.043792724609375,
-0.057098388671875,
0.005611419677734375,
-0.065673828125,
0.0157928466796875,
-0.0137481689453125,
-0.0098114013671875,
-0.00714874267578125,
-0.0204620361328125,
0.0198516845703125,
-0.03387451171875,
0.002330780029296875,
0.0262908935546875,
0.072021484375,
0.037689208984375,
-0.00482177734375,
0.002567291259765625,
0.0038204193115234375,
-0.01129913330078125,
-0.021636962890625,
0.0012025833129882812,
-0.005802154541015625,
0.030853271484375,
0.017578125,
-0.0086212158203125,
-0.026031494140625,
0.035888671875,
-0.00553131103515625,
-0.04583740234375,
0.0235595703125,
-0.001071929931640625,
0.017120361328125,
0.0205230712890625,
-0.006084442138671875,
0.040557861328125,
0.015167236328125,
-0.050048828125,
0.028656005859375,
-0.0216522216796875,
0.0171966552734375,
-0.049285888671875,
0.01428985595703125,
-0.0217437744140625,
0.006908416748046875,
-0.057373046875,
-0.0123138427734375,
0.01338958740234375,
0.0229644775390625,
-0.00848388671875,
0.010345458984375,
-0.0164642333984375,
0.03570556640625,
-0.072998046875,
0.015228271484375,
0.04498291015625,
-0.00933837890625,
-0.042449951171875,
0.01320648193359375,
0.03302001953125,
0.007354736328125,
-0.028076171875,
-0.0018024444580078125,
-0.041748046875,
0.05126953125,
-0.08367919921875,
-0.005504608154296875,
-0.06964111328125,
-0.0139617919921875,
0.047332763671875,
0.0186920166015625,
-0.01486968994140625,
-0.0003056526184082031,
0.060272216796875,
0.00565338134765625,
0.00141143798828125,
0.01495361328125,
-0.00409698486328125,
-0.040771484375,
-0.037200927734375,
-0.01537322998046875,
-0.033599853515625,
-0.129638671875,
0.002773284912109375,
0.0882568359375,
0.03240966796875,
0.0238800048828125,
0.005695343017578125,
0.0288543701171875,
0.08367919921875,
0.0406494140625,
0.0299072265625,
-0.00989532470703125,
-0.00823974609375,
0.00965118408203125,
-0.01451873779296875,
0.0217132568359375,
0.0226287841796875,
-0.03997802734375,
0.030914306640625,
0.042022705078125,
-0.0237274169921875,
-0.0171356201171875,
0.012237548828125,
0.0008335113525390625,
-0.007617950439453125,
-0.01535797119140625,
0.0236053466796875,
-0.00927734375,
0.023101806640625,
0.048736572265625,
0.0230560302734375,
0.0270233154296875,
-0.0643310546875,
0.0570068359375,
0.008697509765625,
-0.02569580078125,
0.0017042160034179688,
0.038726806640625,
0.0117034912109375,
0.04046630859375,
-0.0111846923828125,
-0.01409912109375,
-0.0003604888916015625,
0.0229949951171875,
-0.02154541015625,
0.0303802490234375,
0.0262603759765625,
-0.00925445556640625,
-0.0272979736328125,
-0.04132080078125,
0.0289764404296875,
-0.019683837890625,
-0.0170440673828125,
-0.0191192626953125,
0.0182647705078125,
0.032073974609375,
-0.003742218017578125,
0.0201873779296875,
0.0142059326171875,
-0.007167816162109375,
0.039703369140625,
-0.0186004638671875,
0.0323486328125,
-0.03070068359375,
0.040863037109375,
0.050262451171875,
-0.043975830078125,
0.0440673828125,
-0.010009765625,
0.01885986328125,
-0.03076171875,
0.046478271484375,
0.016143798828125,
-0.06597900390625,
0.03497314453125,
0.0260009765625,
0.004123687744140625,
0.035797119140625,
-0.0333251953125,
-0.05224609375,
-0.0068206787109375,
-0.0009360313415527344,
-0.08099365234375,
-0.059600830078125,
0.0218963623046875,
-0.07183837890625,
0.0187835693359375,
-0.0185546875,
-0.055328369140625,
-0.0171966552734375,
0.02154541015625,
0.00678253173828125,
0.0020160675048828125,
-0.0413818359375,
-0.024566650390625,
-0.0389404296875,
-0.047637939453125,
-0.029632568359375,
0.018798828125,
-0.003261566162109375,
-0.0031719207763671875,
0.037750244140625,
0.002490997314453125,
-0.01151275634765625,
0.009674072265625,
0.0262298583984375,
0.0107879638671875,
-0.0016279220581054688,
0.0162353515625,
-0.0291595458984375,
0.022003173828125,
-0.020843505859375,
0.058319091796875,
0.042877197265625,
-0.0318603515625,
0.00006759166717529297,
-0.01419830322265625,
-0.01209259033203125,
0.0218353271484375,
0.0240631103515625,
0.004322052001953125,
-0.0026569366455078125,
0.0202484130859375,
-0.03857421875,
0.0260467529296875,
-0.017181396484375,
-0.0002732276916503906,
0.03546142578125,
-0.00682830810546875,
-0.014556884765625,
-0.014678955078125,
0.04266357421875,
-0.0208282470703125,
-0.003322601318359375,
0.00498199462890625,
-0.0205841064453125,
0.0023059844970703125,
-0.022796630859375,
-0.02178955078125,
0.0111846923828125,
0.0037860870361328125,
-0.0175933837890625,
0.03204345703125,
0.0031986236572265625,
0.004154205322265625,
0.0025463104248046875,
0.0126190185546875,
-0.0273284912109375,
-0.047637939453125,
0.061065673828125,
-0.043609619140625,
0.0021381378173828125,
-0.058685302734375,
-0.0256500244140625,
-0.027191162109375,
0.07733154296875,
0.00598907470703125,
-0.0250396728515625,
0.001117706298828125,
0.0248260498046875,
-0.0511474609375,
-0.038055419921875,
0.00018036365509033203,
0.005596160888671875,
-0.020782470703125,
-0.01413726806640625,
0.003566741943359375,
-0.03033447265625,
0.00392913818359375,
-0.0225677490234375,
-0.01560211181640625,
-0.023590087890625,
0.0362548828125,
-0.0285797119140625,
0.0221710205078125,
0.028533935546875,
0.022216796875,
-0.0163421630859375,
-0.0225372314453125,
-0.01020050048828125,
-0.114013671875,
0.002777099609375,
0.0025081634521484375,
0.03143310546875,
-0.058563232421875,
0.06658935546875,
-0.04425048828125,
0.04144287109375,
0.01212310791015625,
-0.0049896240234375,
0.0013103485107421875,
-0.00006949901580810547,
-0.00949859619140625,
-0.019805908203125,
-0.01270294189453125,
-0.02099609375,
-0.01415252685546875,
-0.049407958984375,
-0.03826904296875,
-0.0283966064453125,
-0.048492431640625,
-0.01285552978515625,
-0.00963592529296875,
-0.0198822021484375,
-0.0209503173828125,
-0.0284423828125,
-0.01435089111328125,
0.031951904296875,
-0.006542205810546875,
0.004749298095703125,
-0.0457763671875,
-0.03826904296875,
0.058868408203125,
-0.048553466796875,
-0.01253509521484375,
0.0072479248046875,
0.09393310546875,
0.0156097412109375,
-0.0009279251098632812,
-0.09356689453125,
0.013641357421875,
0.031707763671875,
0.00853729248046875,
0.051513671875,
0.0278472900390625,
-0.007328033447265625,
0.0322265625,
0.016143798828125,
0.04779052734375,
-0.05316162109375,
0.05023193359375,
-0.007709503173828125,
-0.0221405029296875,
0.045135498046875,
-0.00673675537109375,
-0.005481719970703125,
-0.029876708984375,
-0.019500732421875,
0.0010004043579101562,
-0.038360595703125,
0.025634765625,
0.019287109375,
0.033905029296875,
-0.033294677734375,
-0.049224853515625,
0.024261474609375,
-0.048736572265625,
0.023468017578125,
-0.01207733154296875,
-0.00351715087890625,
-0.0064849853515625,
0.0003383159637451172,
0.0083160400390625,
0.006565093994140625,
0.01399993896484375,
0.00533294677734375,
0.03289794921875,
0.035491943359375,
0.0113983154296875,
-0.0272674560546875,
-0.0115966796875,
-0.00543975830078125,
0.016204833984375,
-0.01045989990234375,
-0.0185089111328125,
-0.00004607439041137695,
0.040069580078125,
-0.0162353515625,
0.0183868408203125,
0.00988006591796875,
-0.0024967193603515625,
-0.0244140625,
-0.009368896484375,
-0.01708984375,
0.007053375244140625,
-0.0309295654296875,
0.035186767578125,
0.0372314453125,
-0.0217742919921875,
-0.007793426513671875,
0.0288543701171875,
0.014892578125,
-0.020843505859375,
0.0025806427001953125,
0.0096893310546875,
0.01410675048828125,
0.0308837890625,
0.0211639404296875,
-0.016265869140625,
0.0072174072265625,
-0.006542205810546875,
0.0004703998565673828,
-0.055633544921875,
0.03155517578125,
0.0146942138671875,
0.062225341796875,
-0.023040771484375,
-0.06817626953125,
0.03179931640625,
-0.065673828125,
0.00865936279296875,
0.016876220703125,
-0.032379150390625,
-0.05010986328125,
-0.005550384521484375,
0.0191192626953125,
0.01715087890625,
-0.06103515625,
-0.017974853515625,
0.0166168212890625,
-0.04486083984375,
0.0112152099609375,
-0.032562255859375,
0.0185699462890625,
-0.037872314453125,
-0.03277587890625,
0.018280029296875,
-0.0016584396362304688,
-0.05938720703125,
0.0145263671875,
-0.024688720703125,
-0.0177764892578125,
-0.025909423828125,
0.0770263671875,
0.0008192062377929688,
-0.0159912109375,
-0.0248260498046875,
0.00392913818359375,
-0.045166015625,
-0.00023472309112548828,
0.037322998046875,
0.0007452964782714844,
0.004840850830078125,
-0.00820159912109375,
-0.013458251953125,
-0.0004487037658691406,
0.036041259765625,
-0.019500732421875,
-0.0054168701171875,
-0.045440673828125,
-0.00832366943359375,
0.0491943359375,
-0.00963592529296875,
0.0138092041015625,
0.01556396484375,
-0.0016832351684570312,
-0.02703857421875,
0.089111328125,
0.01678466796875,
0.024627685546875,
-0.01165008544921875,
0.0110626220703125,
0.01027679443359375,
-0.0003924369812011719,
-0.029327392578125,
-0.0211029052734375,
-0.02947998046875,
-0.03961181640625,
0.037200927734375,
0.0394287109375,
0.00821685791015625,
-0.024658203125,
0.004573822021484375,
0.0139923095703125,
0.010498046875,
-0.015716552734375,
0.0108795166015625,
-0.019927978515625,
0.052642822265625,
-0.0234222412109375,
-0.0173187255859375,
0.05450439453125,
-0.03729248046875,
0.0018110275268554688,
0.024810791015625,
0.01190948486328125,
0.00788116455078125,
-0.025848388671875,
-0.0020236968994140625,
0.0294189453125,
-0.0204620361328125,
0.01107025146484375,
0.0777587890625,
0.0172882080078125,
0.0379638671875,
0.021240234375,
0.012969970703125,
0.01363372802734375,
0.031341552734375,
0.0223541259765625,
-0.022613525390625,
0.10650634765625,
0.030059814453125,
-0.0188140869140625,
0.07757568359375,
-0.0307464599609375,
0.032318115234375,
-0.0021495819091796875,
0.038818359375,
-0.005290985107421875,
0.006839752197265625,
0.00647735595703125,
-0.03265380859375,
0.032318115234375,
0.0002980232238769531,
0.00556182861328125,
-0.0196533203125,
0.00873565673828125,
-0.0164642333984375,
-0.02117919921875,
0.0050048828125,
0.0019121170043945312,
0.00437164306640625,
-0.0091400146484375,
0.0039825439453125,
0.00750732421875,
-0.01348876953125,
-0.02178955078125,
0.0096588134765625,
0.002162933349609375,
0.0218658447265625,
0.01358795166015625,
-0.033203125,
-0.013702392578125,
-0.0289306640625,
-0.00868988037109375,
-0.0413818359375,
-0.01538848876953125,
-0.0103607177734375,
0.003814697265625,
0.0965576171875,
0.01904296875,
0.048675537109375,
-0.06732177734375,
0.0048675537109375,
0.0232391357421875,
-0.031341552734375,
-0.054962158203125,
-0.01270294189453125,
0.07684326171875,
-0.029296875,
0.03955078125,
0.021026611328125,
-0.005260467529296875,
-0.004680633544921875,
0.01151275634765625,
0.04962158203125,
-0.04241943359375,
-0.008514404296875,
0.0272979736328125,
0.01953125,
-0.00936126708984375,
0.0293731689453125,
0.0209197998046875,
-0.05010986328125,
-0.037200927734375,
0.0264739990234375,
-0.055938720703125,
-0.03619384765625,
0.0218048095703125,
-0.07806396484375,
0.1103515625,
0.00030684471130371094,
0.0229339599609375,
-0.00843048095703125,
0.034027099609375,
-0.0280303955078125,
0.0019969940185546875,
-0.055328369140625,
0.020050048828125,
0.0294036865234375,
0.0197601318359375,
-0.0300445556640625,
0.0005049705505371094,
-0.0038204193115234375,
0.01244354248046875,
0.051849365234375,
0.0154266357421875,
-0.0157470703125,
0.0026378631591796875,
0.037384033203125,
0.02105712890625,
-0.0175933837890625,
0.03302001953125,
0.017669677734375,
-0.0037708282470703125,
0.0268707275390625,
0.01187896728515625,
0.048187255859375,
-0.057373046875,
-0.01311492919921875,
0.0111846923828125,
0.0138702392578125,
0.0287628173828125,
-0.0184783935546875,
0.024566650390625,
-0.025054931640625,
-0.0180511474609375,
0.0286407470703125,
-0.0001914501190185547,
-0.01342010498046875,
0.029510498046875,
-0.006267547607421875,
-0.0251007080078125,
0.017486572265625,
-0.0244903564453125,
0.04827880859375,
-0.01274871826171875,
0.005077362060546875,
-0.01055145263671875,
0.004436492919921875,
0.021575927734375,
-0.024658203125,
-0.0037860870361328125,
0.0199127197265625,
-0.012786865234375,
0.030517578125,
-0.004718780517578125,
0.02032470703125,
-0.0294952392578125,
0.017120361328125,
0.05810546875,
0.040252685546875,
-0.0294952392578125,
-0.01123809814453125,
0.0192718505859375,
0.025238037109375,
-0.0203857421875,
-0.0035114288330078125,
0.0189056396484375,
-0.0297698974609375,
-0.006683349609375,
-0.06109619140625,
0.0271148681640625,
0.01995849609375,
0.022613525390625,
-0.0130462646484375,
0.0135498046875,
-0.055877685546875,
-0.00403594970703125,
-0.04010009765625,
0.0201263427734375,
0.02520751953125,
0.0538330078125,
-0.0200958251953125,
0.043731689453125,
-0.0209503173828125,
-0.01433563232421875,
-0.007450103759765625,
0.03369140625,
-0.03240966796875,
0.01505279541015625,
-0.022796630859375,
-0.07281494140625,
0.0186920166015625,
0.0271453857421875,
0.05419921875,
0.052734375,
0.048919677734375,
-0.02459716796875,
-0.046173095703125,
0.02203369140625,
-0.01013946533203125,
-0.03753662109375,
-0.016754150390625,
-0.057952880859375,
0.03369140625,
0.033233642578125,
0.0272674560546875,
0.0021820068359375,
-0.003513336181640625,
0.05999755859375,
-0.01450347900390625,
0.032989501953125,
-0.00391387939453125,
-0.02447509765625,
0.03961181640625,
0.001209259033203125,
0.0654296875,
0.016326904296875,
-0.0606689453125,
-0.0112152099609375,
-0.048736572265625,
-0.00698089599609375,
0.02484130859375,
0.0211639404296875,
-0.007659912109375,
0.03375244140625,
-0.05010986328125,
-0.01319122314453125,
0.0338134765625,
-0.009246826171875,
-0.016204833984375,
0.01447296142578125,
0.0156402587890625,
-0.01934814453125,
-0.051788330078125,
-0.0226898193359375,
0.004611968994140625,
0.02337646484375,
-0.015533447265625,
0.078125,
-0.01248931884765625,
-0.00940704345703125,
-0.02215576171875,
0.0426025390625,
-0.0567626953125,
-0.00035500526428222656,
-0.028564453125,
0.0074462890625,
0.0214996337890625,
-0.0031280517578125,
-0.0027027130126953125,
0.006771087646484375,
0.0219573974609375,
-0.0242767333984375,
-0.0300445556640625,
0.001251220703125,
0.03369140625,
0.02093505859375,
0.01178741455078125,
-0.021148681640625,
-0.02490234375,
-0.0182952880859375,
0.0068511962890625,
0.02679443359375,
0.04150390625,
0.0066986083984375,
0.0301666259765625,
0.0186004638671875,
0.0051422119140625,
0.0345458984375,
-0.01328277587890625,
0.05517578125,
0.0253448486328125,
-0.0282440185546875,
-0.0374755859375,
-0.033599853515625,
-0.0210723876953125,
-0.01218414306640625,
-0.01386260986328125,
0.04473876953125,
-0.02593994140625,
-0.0127410888671875,
0.037628173828125,
0.0290069580078125,
0.031768798828125,
-0.03509521484375,
0.006580352783203125,
0.0209808349609375,
0.002521514892578125,
0.044281005859375,
-0.05322265625,
-0.00965118408203125,
-0.067138671875,
-0.00928497314453125,
0.0430908203125,
-0.04205322265625,
0.025665283203125,
-0.03485107421875,
-0.016845703125,
0.014892578125,
-0.002666473388671875,
-0.0274658203125,
0.00634002685546875,
-0.0031147003173828125,
0.003513336181640625,
-0.0272674560546875,
-0.00027489662170410156,
-0.0006341934204101562,
0.058502197265625,
-0.0201263427734375,
-0.0643310546875,
-0.0185699462890625,
0.07440185546875,
-0.059844970703125,
0.0224761962890625,
0.036712646484375,
-0.0302886962890625,
-0.0252838134765625,
0.0263671875,
0.037322998046875,
0.05670166015625,
0.0067901611328125,
-0.044952392578125,
-0.0299224853515625,
-0.007221221923828125,
0.0367431640625,
-0.0082855224609375,
-0.01605224609375,
-0.040679931640625,
-0.0257568359375,
-0.055877685546875,
0.027862548828125,
0.0286865234375,
-0.037750244140625,
-0.08447265625,
-0.0169677734375,
-0.028778076171875,
-0.048187255859375,
-0.038330078125,
0.013092041015625,
-0.00507354736328125,
0.03240966796875,
-0.01119232177734375,
-0.02294921875,
-0.007659912109375,
0.0265350341796875,
-0.00214385986328125,
-0.0289764404296875,
0.04815673828125,
-0.041473388671875,
-0.032012939453125,
-0.016998291015625,
0.002475738525390625,
-0.0219573974609375,
0.00530242919921875,
-0.006481170654296875,
0.038848876953125,
0.0439453125,
-0.00907135009765625,
0.004528045654296875,
0.0150909423828125,
-0.050994873046875,
-0.0265655517578125,
0.0046234130859375,
-0.06805419921875,
0.0186920166015625,
0.0906982421875,
0.1221923828125,
0.0257720947265625,
-0.053924560546875,
0.0213623046875,
-0.009552001953125,
-0.0460205078125,
-0.02783203125,
0.01245880126953125,
-0.045074462890625,
-0.022918701171875,
-0.005260467529296875,
-0.0010881423950195312,
-0.050079345703125,
0.025177001953125,
-0.021392822265625,
-0.004207611083984375,
0.063232421875,
0.0024623870849609375,
-0.00725555419921875,
-0.06341552734375,
0.07391357421875,
-0.0396728515625,
-0.01561737060546875,
0.0092620849609375,
0.036590576171875,
0.0196990966796875,
0.0196380615234375,
0.02301025390625,
0.0025634765625,
-0.004032135009765625,
0.0070953369140625,
0.0242156982421875,
-0.013885498046875,
0.0113067626953125,
-0.022857666015625,
-0.0152740478515625,
-0.00228118896484375,
-0.0185699462890625,
-0.0166778564453125,
-0.00653076171875,
0.0277557373046875,
-0.0113983154296875,
0.080322265625,
-0.022918701171875,
-0.0323486328125,
-0.0238494873046875,
0.0006556510925292969,
-0.01459503173828125,
0.00653076171875,
0.0126190185546875,
-0.01349639892578125,
0.0162200927734375,
-0.00836944580078125,
0.01654052734375,
-0.01727294921875,
0.00205230712890625,
-0.03338623046875,
-0.0122222900390625,
0.020294189453125
] |
08ca7c518031f598569e32c41d6033790d2a2186
|
Wordpress Stackexchange
Q: Check user logged in with JS I use FaceBook JS SDK to check whether the user has permission to log in to my site or not. If user has permission I log him into the WP site.
It is possible to check with JS whether the user already logged in or not? Possible to check existance of wordpress_logged_in_ cookie, and how?
I am trying with this code, but doesn't work:
if (document.cookie.search(/^wordpress_logged_in_\w*/) >= 0) {
// Cookei exsist.
alert("Cookie");
}
thanks,
A: Just use wp_localize_script() and is_user_logged_in().
wp_localize_script(
'my-ajax-request',
'MyAjax',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'logged_in' => is_user_logged_in()
)
);
|
Q: Check user logged in with JS I use FaceBook JS SDK to check whether the user has permission to log in to my site or not. If user has permission I log him into the WP site.
It is possible to check with JS whether the user already logged in or not? Possible to check existance of wordpress_logged_in_ cookie, and how?
I am trying with this code, but doesn't work:
if (document.cookie.search(/^wordpress_logged_in_\w*/) >= 0) {
// Cookei exsist.
alert("Cookie");
}
thanks,
A: Just use wp_localize_script() and is_user_logged_in().
wp_localize_script(
'my-ajax-request',
'MyAjax',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'logged_in' => is_user_logged_in()
)
);
A: <script type="text/javascript">
logged = <?php if(is_user_logged_in()): echo 1 ; else: echo 0 ; endif; ?> ;
if(!logged){
// Execute Google Analytics Code Here
}
</script>
A bit of PHP can make it a whole lot easier.
It will work in wordpress 2.0.0+
|
wordpress
|
{
"language": "en",
"length": 145,
"provenance": "stackexchange_00019.jsonl.gz:419395",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50165"
}
|
[
0.046173095703125,
0.037811279296875,
-0.0019474029541015625,
-0.042755126953125,
0.040924072265625,
-0.0237274169921875,
0.00787353515625,
-0.039276123046875,
-0.0237274169921875,
0.009490966796875,
-0.039093017578125,
0.015960693359375,
-0.022857666015625,
-0.015411376953125,
0.0191497802734375,
-0.0592041015625,
0.0246734619140625,
-0.026947021484375,
0.01271820068359375,
-0.02655029296875,
0.023284912109375,
-0.0121307373046875,
0.0189971923828125,
0.020721435546875,
0.03680419921875,
-0.0306854248046875,
0.08935546875,
-0.0146942138671875,
0.04376220703125,
-0.0018720626831054688,
0.042877197265625,
-0.047821044921875,
-0.008087158203125,
0.06414794921875,
-0.04595947265625,
-0.03521728515625,
-0.0217132568359375,
0.0501708984375,
0.01812744140625,
0.012664794921875,
0.0345458984375,
-0.019500732421875,
-0.0222320556640625,
0.02862548828125,
-0.0214080810546875,
-0.0379638671875,
0.037628173828125,
-0.01465606689453125,
0.031005859375,
0.059722900390625,
0.017242431640625,
-0.0145111083984375,
0.0050506591796875,
0.020721435546875,
-0.0073699951171875,
0.0196990966796875,
0.004306793212890625,
-0.011871337890625,
0.053863525390625,
0.005641937255859375,
-0.029693603515625,
-0.05120849609375,
0.0182952880859375,
-0.033721923828125,
-0.0325927734375,
-0.00833892822265625,
-0.06060791015625,
0.0192718505859375,
0.0089569091796875,
-0.041412353515625,
-0.0204925537109375,
-0.0076751708984375,
-0.0109710693359375,
0.04010009765625,
-0.02655029296875,
-0.0386962890625,
0.007568359375,
-0.0224609375,
0.0147705078125,
0.04595947265625,
-0.048309326171875,
-0.0032367706298828125,
-0.050567626953125,
-0.0014524459838867188,
-0.01354217529296875,
0.035552978515625,
-0.03564453125,
-0.017425537109375,
-0.019989013671875,
-0.0007257461547851562,
-0.0204315185546875,
-0.0094451904296875,
-0.0006070137023925781,
0.01476287841796875,
-0.02801513671875,
-0.0153045654296875,
0.0278778076171875,
0.0682373046875,
-0.005939483642578125,
-0.0190277099609375,
-0.03466796875,
-0.005283355712890625,
-0.05828857421875,
-0.0159149169921875,
-0.00307464599609375,
0.048919677734375,
0.034423828125,
0.0182342529296875,
-0.014251708984375,
-0.00859832763671875,
-0.00841522216796875,
-0.016204833984375,
-0.01284027099609375,
-0.039215087890625,
0.0024509429931640625,
0.05853271484375,
0.00048422813415527344,
-0.007656097412109375,
-0.01116943359375,
0.0087738037109375,
-0.0295867919921875,
-0.0197601318359375,
-0.005496978759765625,
0.035430908203125,
0.0222930908203125,
-0.007762908935546875,
-0.0008778572082519531,
0.030303955078125,
-0.06707763671875,
0.04022216796875,
-0.0172271728515625,
0.0181427001953125,
0.0264434814453125,
0.0137786865234375,
-0.0220947265625,
-0.024261474609375,
0.0679931640625,
0.0126190185546875,
-0.0021533966064453125,
0.0107879638671875,
0.0028133392333984375,
-0.03875732421875,
-0.0214996337890625,
-0.0301513671875,
-0.01467132568359375,
0.0189208984375,
0.00905609130859375,
0.00780487060546875,
-0.002460479736328125,
-0.056488037109375,
0.01873779296875,
-0.01800537109375,
-0.0229034423828125,
0.034881591796875,
0.05621337890625,
-0.01084136962890625,
0.0487060546875,
-0.0312042236328125,
0.035919189453125,
-0.007526397705078125,
0.03082275390625,
-0.00246429443359375,
-0.0078277587890625,
-0.016693115234375,
-0.036895751953125,
-0.0214691162109375,
-0.03363037109375,
-0.00818634033203125,
0.0269012451171875,
0.035888671875,
0.00852203369140625,
-0.0003590583801269531,
0.03839111328125,
0.01319122314453125,
-0.00469970703125,
0.0025634765625,
-0.0066680908203125,
0.03564453125,
0.034881591796875,
-0.0289306640625,
-0.0103912353515625,
-0.0211181640625,
0.09234619140625,
-0.0145263671875,
-0.0218658447265625,
0.01514434814453125,
0.00748443603515625,
0.00939178466796875,
0.0084075927734375,
-0.004428863525390625,
0.022552490234375,
0.03564453125,
-0.0106964111328125,
0.07171630859375,
-0.02288818359375,
-0.0675048828125,
0.015228271484375,
0.01274871826171875,
-0.03240966796875,
-0.001644134521484375,
0.0767822265625,
0.0260772705078125,
-0.028411865234375,
-0.042694091796875,
-0.09283447265625,
0.0017499923706054688,
-0.0169830322265625,
0.034423828125,
0.021575927734375,
0.036468505859375,
-0.0041046142578125,
0.0272216796875,
-0.01375579833984375,
-0.0310821533203125,
-0.015472412109375,
-0.01409912109375,
-0.017486572265625,
0.043975830078125,
-0.006313323974609375,
0.0555419921875,
-0.008514404296875,
-0.0006775856018066406,
-0.01374053955078125,
-0.0235443115234375,
0.024688720703125,
-0.0142822265625,
-0.009765625,
-0.017425537109375,
0.036895751953125,
-0.009857177734375,
0.025970458984375,
0.01522064208984375,
0.0011205673217773438,
0.046600341796875,
-0.0091705322265625,
-0.018829345703125,
-0.0017671585083007812,
-0.043426513671875,
0.0285186767578125,
0.034637451171875,
0.047271728515625,
0.05450439453125,
0.00823974609375,
-0.0010766983032226562,
0.018829345703125,
-0.07769775390625,
0.000007331371307373047,
-0.0035724639892578125,
0.0248870849609375,
0.082275390625,
-0.0266265869140625,
-0.001338958740234375,
0.01084136962890625,
0.00787353515625,
0.00257110595703125,
0.03790283203125,
-0.01055908203125,
0.0272064208984375,
-0.03509521484375,
0.0160369873046875,
-0.027130126953125,
-0.037353515625,
0.0269622802734375,
-0.040435791015625,
0.0117034912109375,
-0.043182373046875,
0.0006313323974609375,
-0.0210113525390625,
0.007068634033203125,
-0.0321044921875,
0.019012451171875,
-0.056488037109375,
0.0007739067077636719,
0.037353515625,
0.042877197265625,
0.01451873779296875,
-0.0282135009765625,
-0.0270233154296875,
0.043975830078125,
0.039642333984375,
-0.022216796875,
-0.005329132080078125,
-0.0380859375,
-0.01421356201171875,
0.0149993896484375,
-0.0066680908203125,
0.0025081634521484375,
0.0009851455688476562,
0.04510498046875,
0.007080078125,
0.040802001953125,
-0.00684356689453125,
-0.03033447265625,
0.057342529296875,
-0.0110321044921875,
-0.051971435546875,
-0.0031452178955078125,
-0.046783447265625,
0.059234619140625,
-0.04351806640625,
0.02655029296875,
0.057769775390625,
0.0012521743774414062,
0.020263671875,
-0.0170440673828125,
-0.01068115234375,
-0.038665771484375,
0.01605224609375,
0.005390167236328125,
-0.05023193359375,
0.030853271484375,
0.09600830078125,
0.031646728515625,
0.0264129638671875,
0.017425537109375,
-0.022003173828125,
-0.00027251243591308594,
0.00707244873046875,
-0.059600830078125,
-0.12078857421875,
-0.0673828125,
-0.09259033203125,
0.0452880859375,
-0.017669677734375,
-0.0237274169921875,
-0.0003669261932373047,
0.0310516357421875,
0.038604736328125,
-0.048065185546875,
0.006923675537109375,
-0.0025081634521484375,
-0.03900146484375,
-0.0079193115234375,
-0.00391387939453125,
-0.0160369873046875,
-0.0172119140625,
0.0026226043701171875,
-0.0183563232421875,
-0.00966644287109375,
-0.037353515625,
-0.03741455078125,
0.056488037109375,
0.0055389404296875,
-0.046295166015625,
-0.0291290283203125,
0.01515960693359375,
0.02728271484375,
-0.0000584721565246582,
-0.0350341796875,
-0.008514404296875,
0.028839111328125,
-0.0279998779296875,
-0.00897979736328125,
-0.055267333984375,
0.0209808349609375,
-0.01373291015625,
-0.0245819091796875,
-0.013427734375,
0.049560546875,
-0.050750732421875,
0.0188751220703125,
-0.0110626220703125,
-0.0258331298828125,
0.03668212890625,
0.0159149169921875,
-0.033782958984375,
0.02685546875,
-0.0288238525390625,
0.044525146484375,
0.0228118896484375,
-0.03271484375,
0.01788330078125,
0.04071044921875,
-0.0020389556884765625,
0.0254669189453125,
-0.00959014892578125,
0.0487060546875,
-0.0227203369140625,
-0.048309326171875,
-0.00986480712890625,
0.000545501708984375,
-0.01265716552734375,
-0.0222625732421875,
-0.038543701171875,
-0.01142120361328125,
0.0274505615234375,
-0.01204681396484375,
0.03485107421875,
-0.0300750732421875,
-0.01136016845703125,
-0.0164642333984375,
0.06280517578125,
0.00783538818359375,
-0.007110595703125,
0.00839996337890625,
-0.003185272216796875,
-0.04962158203125,
-0.0159149169921875,
-0.07080078125,
0.0083465576171875,
-0.037872314453125,
0.01369476318359375,
0.006763458251953125,
-0.0108795166015625,
-0.0173492431640625,
-0.01050567626953125,
-0.0294342041015625,
-0.0286407470703125,
0.0029125213623046875,
-0.030364990234375,
0.03338623046875,
-0.00200653076171875,
0.0176544189453125,
-0.01122283935546875,
0.0294952392578125,
-0.058685302734375,
-0.03076171875,
0.00001722574234008789,
-0.04376220703125,
0.032135009765625,
0.026885986328125,
-0.00971221923828125,
-0.009674072265625,
0.00859832763671875,
-0.0296478271484375,
0.01528167724609375,
0.01194000244140625,
0.039947509765625,
0.034576416015625,
-0.0172576904296875,
-0.0117645263671875,
-0.032806396484375,
0.00971221923828125,
0.004665374755859375,
-0.031341552734375,
-0.0217437744140625,
-0.038665771484375,
-0.04449462890625,
0.009735107421875,
-0.032318115234375,
-0.029541015625,
-0.01345062255859375,
-0.00693511962890625,
0.0036182403564453125,
-0.0082244873046875,
0.005859375,
0.004795074462890625,
-0.026702880859375,
0.034088134765625,
0.02020263671875,
-0.003360748291015625,
-0.0018224716186523438,
0.050201416015625,
0.01345062255859375,
-0.021881103515625,
-0.0095062255859375,
0.00370025634765625,
0.033721923828125,
-0.007595062255859375,
0.0443115234375,
0.0245513916015625,
-0.03253173828125,
0.07476806640625,
0.00577545166015625,
0.01280975341796875,
-0.00274658203125,
0.04339599609375,
-0.0030117034912109375,
-0.0204010009765625,
0.0195159912109375,
0.002452850341796875,
-0.037078857421875,
0.0033359527587890625,
0.0170745849609375,
0.004039764404296875,
0.051849365234375,
-0.0015993118286132812,
-0.017547607421875,
-0.0264739990234375,
0.01430511474609375,
-0.06768798828125,
0.01126861572265625,
-0.040985107421875,
0.03759765625,
0.0216522216796875,
-0.00835418701171875,
0.051971435546875,
0.0286712646484375,
-0.0215301513671875,
-0.01326751708984375,
-0.007030487060546875,
0.00493621826171875,
0.0230865478515625,
-0.01464080810546875,
-0.0176849365234375,
-0.01378631591796875,
-0.0270233154296875,
0.06634521484375,
0.001064300537109375,
-0.07135009765625,
0.04327392578125,
-0.023590087890625,
-0.0043792724609375,
0.0498046875,
0.01152801513671875,
0.02716064453125,
-0.016876220703125,
-0.0303955078125,
-0.0126953125,
-0.007328033447265625,
-0.052459716796875,
-0.050018310546875,
0.02459716796875,
-0.0179595947265625,
0.0185546875,
0.021636962890625,
0.04315185546875,
0.006107330322265625,
0.0290985107421875,
-0.0167388916015625,
0.034393310546875,
0.0191497802734375,
0.06134033203125,
0.01776123046875,
-0.032745361328125,
-0.0287322998046875,
0.060546875,
-0.032379150390625,
-0.0325927734375,
-0.04638671875,
0.0311126708984375,
0.01392364501953125,
0.0110015869140625,
0.0194549560546875,
-0.0140228271484375,
0.025421142578125,
0.0005083084106445312,
-0.0019388198852539062,
-0.01910400390625,
-0.0172271728515625,
-0.0166168212890625,
-0.01348876953125,
0.00647735595703125,
-0.001865386962890625,
0.00948333740234375,
-0.025848388671875,
-0.028533935546875,
-0.01554107666015625,
0.04669189453125,
-0.0275726318359375,
-0.00699615478515625,
-0.0203399658203125,
-0.08001708984375,
-0.03326416015625,
0.01456451416015625,
-0.019317626953125,
0.001079559326171875,
-0.0177001953125,
-0.048431396484375,
0.029205322265625,
0.00397491455078125,
-0.0144195556640625,
-0.02545166015625,
0.025482177734375,
0.020721435546875,
-0.01666259765625,
0.0552978515625,
-0.0144195556640625,
-0.02642822265625,
-0.00554656982421875,
-0.0521240234375,
-0.01407623291015625,
0.0013818740844726562,
-0.0291595458984375,
-0.0258636474609375,
-0.007213592529296875,
0.0249176025390625,
0.0278778076171875,
-0.00925445556640625,
-0.0008997917175292969,
0.0092315673828125,
0.021453857421875,
0.009246826171875,
0.06378173828125,
-0.026763916015625,
0.06793212890625,
0.0300750732421875,
-0.0006394386291503906,
0.00896453857421875,
0.04150390625,
-0.0244140625,
-0.00872802734375,
0.015899658203125,
0.00795745849609375,
-0.01035308837890625,
-0.04766845703125,
0.0204620361328125,
-0.0221405029296875,
0.051055908203125,
-0.00677490234375,
-0.01132965087890625,
0.0216827392578125,
0.01126861572265625,
-0.00746917724609375,
-0.01309967041015625,
0.0736083984375,
-0.0185699462890625,
0.048065185546875,
0.0266265869140625,
0.023529052734375,
-0.013824462890625,
-0.0291290283203125,
0.01409912109375,
0.0386962890625,
0.00974273681640625,
-0.042938232421875,
-0.0225677490234375,
0.02215576171875,
0.04534912109375,
0.0087738037109375,
0.046905517578125,
0.0255889892578125,
0.033905029296875,
0.0242767333984375,
-0.0121917724609375,
-0.0096435546875,
-0.004985809326171875,
0.01331329345703125,
-0.0230865478515625,
-0.01088714599609375,
-0.001972198486328125,
-0.0245208740234375,
0.0047149658203125,
0.07012939453125,
0.060028076171875,
-0.11553955078125,
0.0200653076171875,
0.0032711029052734375,
0.0126800537109375,
0.0230560302734375,
-0.0245819091796875,
-0.005527496337890625,
-0.015380859375,
0.07037353515625,
-0.02569580078125,
-0.0162353515625,
0.0258636474609375,
-0.02203369140625,
-0.0264129638671875,
-0.0254669189453125,
-0.0142669677734375,
0.004314422607421875,
0.004352569580078125,
0.01149749755859375,
0.007022857666015625,
0.004016876220703125,
-0.00927734375,
0.0066986083984375,
0.02130126953125,
-0.02203369140625,
-0.055419921875,
0.007549285888671875,
-0.02105712890625,
-0.0296630859375,
0.00009334087371826172,
0.0037670135498046875,
0.073974609375,
0.051788330078125,
0.004039764404296875,
-0.024139404296875,
0.0217437744140625,
0.004924774169921875,
-0.007213592529296875,
-0.00566864013671875,
0.0287628173828125,
0.0200042724609375,
-0.056243896484375,
0.0212554931640625,
-0.029632568359375,
-0.00896453857421875,
-0.01441192626953125,
-0.0552978515625,
0.0423583984375,
-0.025909423828125,
0.000247955322265625,
0.0283660888671875,
0.04449462890625,
-0.020721435546875,
-0.004558563232421875,
0.038726806640625,
-0.0633544921875,
-0.0168304443359375,
0.0091094970703125,
-0.0191497802734375,
-0.003398895263671875,
0.013519287109375,
-0.051666259765625,
0.0546875,
0.0404052734375,
0.01065826416015625,
-0.0050506591796875,
0.0234375,
-0.033966064453125,
0.005687713623046875,
-0.0408935546875,
0.044921875,
0.02886962890625,
0.0280914306640625,
-0.05120849609375,
-0.01036834716796875,
-0.00855255126953125,
0.0180816650390625,
0.045867919921875,
0.01134490966796875,
-0.007778167724609375,
-0.06072998046875,
-0.055511474609375,
0.0276947021484375,
-0.0182037353515625,
0.0215606689453125,
0.007343292236328125,
0.047821044921875,
0.01922607421875,
-0.03057861328125,
0.0251007080078125,
-0.050201416015625,
-0.049285888671875,
0.01715087890625,
-0.004108428955078125,
-0.0258026123046875,
-0.0131683349609375,
0.033416748046875,
-0.068115234375,
0.00042438507080078125,
0.026214599609375,
0.0020771026611328125,
-0.004444122314453125,
0.038238525390625,
0.01450347900390625,
-0.01018524169921875,
-0.021881103515625,
-0.0252685546875,
0.0237884521484375,
0.0003628730773925781,
0.003753662109375,
-0.0146331787109375,
0.01287841796875,
-0.036865234375,
-0.0025272369384765625,
-0.0124969482421875,
0.0333251953125,
-0.04144287109375,
0.040252685546875,
0.0294036865234375,
0.0211944580078125,
-0.0302581787109375,
-0.0012264251708984375,
0.039398193359375,
0.06121826171875,
-0.034393310546875,
-0.037353515625,
-0.0018758773803710938,
0.0271148681640625,
0.044189453125,
0.0225830078125,
0.07904052734375,
0.0250701904296875,
0.06396484375,
-0.033905029296875,
0.002033233642578125,
0.035247802734375,
0.0249176025390625,
0.01525115966796875,
0.04302978515625,
-0.0640869140625,
-0.00891876220703125,
-0.004482269287109375,
-0.0256195068359375,
0.0055999755859375,
-0.0134735107421875,
0.0286407470703125,
-0.0040130615234375,
0.0604248046875,
0.0006084442138671875,
-0.013824462890625,
0.0091094970703125,
0.013275146484375,
0.01448822021484375,
-0.0164337158203125,
-0.014892578125,
0.04083251953125,
0.0307769775390625,
-0.00359344482421875,
-0.0185394287109375,
0.0074310302734375,
0.021942138671875,
-0.01403045654296875,
-0.01447296142578125,
0.00926971435546875,
-0.0081939697265625,
-0.018341064453125,
0.0107421875,
0.015716552734375,
0.036346435546875,
0.01177978515625,
-0.0098419189453125,
0.06787109375,
0.02471923828125,
-0.032562255859375,
0.05230712890625,
-0.00698089599609375,
0.00513458251953125,
0.031005859375,
0.0290374755859375,
0.07513427734375,
0.00836944580078125,
-0.054229736328125,
-0.009674072265625,
-0.01239776611328125,
-0.049957275390625,
0.035308837890625,
0.045196533203125,
-0.03167724609375,
0.03033447265625,
0.05169677734375,
-0.0049285888671875,
0.01279449462890625,
-0.003448486328125,
0.0093994140625,
-0.036895751953125,
0.026153564453125,
-0.002353668212890625,
-0.043792724609375,
-0.01056671142578125,
-0.0205230712890625,
-0.005279541015625,
0.02593994140625,
-0.0233917236328125,
0.043060302734375,
0.0241851806640625,
0.00891876220703125,
0.011932373046875,
-0.004474639892578125,
-0.0190277099609375,
0.03564453125,
-0.028839111328125,
-0.0164031982421875,
0.007061004638671875,
-0.0631103515625,
0.07635498046875,
-0.0167388916015625,
0.0614013671875,
0.089111328125,
-0.054351806640625,
-0.0022640228271484375,
-0.00887298583984375,
-0.01739501953125,
-0.0545654296875,
-0.058502197265625,
-0.0220184326171875,
0.02874755859375,
-0.01195526123046875,
-0.008331298828125,
-0.0206756591796875,
0.0244140625,
-0.05584716796875,
-0.0421142578125,
-0.014801025390625,
-0.0301666259765625,
-0.07281494140625,
0.01611328125,
0.0168609619140625,
0.032806396484375,
-0.01012420654296875,
-0.01473236083984375,
0.00957489013671875,
0.0141448974609375,
-0.041259765625,
-0.00446319580078125,
0.00705718994140625,
0.025970458984375,
0.05499267578125,
0.046783447265625,
-0.006107330322265625,
0.003910064697265625,
0.034149169921875,
-0.0369873046875,
0.016693115234375,
-0.0295867919921875,
-0.043670654296875,
-0.0302734375,
0.0180511474609375,
0.02264404296875,
0.00626373291015625,
-0.0247650146484375,
-0.0423583984375,
0.022247314453125,
0.0012445449829101562,
-0.03173828125,
-0.0234527587890625,
0.0113677978515625,
-0.045989990234375,
0.05487060546875,
-0.05084228515625,
-0.007640838623046875,
0.02178955078125,
0.031707763671875,
-0.005245208740234375,
0.0246734619140625,
0.004894256591796875,
-0.00392913818359375,
0.04510498046875,
0.00588226318359375,
0.032806396484375,
-0.0230255126953125,
-0.0285491943359375,
-0.02410888671875,
0.0015506744384765625,
0.016510009765625,
0.0213623046875,
-0.0008602142333984375,
0.0207061767578125,
-0.007568359375,
-0.0146026611328125,
-0.0150146484375,
0.00745391845703125,
-0.018524169921875,
-0.02783203125,
-0.0163726806640625,
0.0198516845703125,
0.039581298828125,
-0.030120849609375,
-0.09820556640625,
0.05548095703125,
-0.019622802734375,
-0.0303802490234375,
-0.06927490234375,
0.023529052734375,
0.01409149169921875,
-0.0196380615234375,
-0.0416259765625,
0.016265869140625,
-0.01532745361328125,
0.0239105224609375,
0.00951385498046875,
-0.024658203125,
0.046417236328125,
0.007228851318359375,
-0.092041015625,
-0.00835418701171875,
-0.029693603515625,
0.00469207763671875,
-0.002643585205078125,
0.01776123046875,
0.00885009765625,
0.05126953125,
-0.004001617431640625,
-0.00244140625,
-0.0222625732421875,
-0.03070068359375,
-0.002262115478515625,
-0.030731201171875,
0.0203094482421875,
0.01088714599609375,
0.0274810791015625,
0.0157928466796875,
-0.00612640380859375,
-0.032379150390625,
-0.05865478515625,
-0.0811767578125,
0.003864288330078125,
0.003833770751953125,
0.006618499755859375,
-0.0379638671875,
0.05816650390625,
0.00576019287109375,
-0.0285186767578125,
-0.0302581787109375,
0.0269775390625,
-0.0526123046875,
0.0012788772583007812,
0.0257720947265625,
0.003025054931640625,
-0.03155517578125,
0.0171661376953125,
0.062744140625,
-0.0379638671875,
0.0013456344604492188,
0.011383056640625,
-0.00811767578125,
0.0555419921875,
0.00890350341796875,
0.041778564453125,
0.023712158203125,
-0.03533935546875,
-0.0164947509765625,
0.033172607421875,
0.01030731201171875,
-0.00344085693359375,
-0.04144287109375,
-0.006282806396484375,
0.00799560546875,
-0.0042724609375,
-0.0018110275268554688,
0.006275177001953125,
0.0057220458984375,
-0.005035400390625,
0.0245361328125,
-0.0146942138671875,
-0.033477783203125,
-0.0292816162109375,
0.0199127197265625,
0.045440673828125,
-0.0230712890625,
0.07305908203125,
-0.0222625732421875,
-0.01485443115234375,
-0.0217437744140625,
-0.01155853271484375,
-0.08856201171875,
0.03814697265625,
-0.0204315185546875,
0.0243682861328125,
0.03936767578125
] |
a54bc385ac9f21a8d5347965b6a8399d5c76bf4f
|
Wordpress Stackexchange
Q: How do I create predefined menus for my theme? This is my code thus far:
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu' ),
'extra-menu' => __( 'Extra Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
But this seems to only register 'locations' in which to place custom menus.
What I want is for all the custom menus (and menu items) to be fully setup on after_theme_setup or init.
Thanks
A: For anyone seeking the same solution, here is the code:
function register_my_menus() {
$menus = array(
'Main menu' => array(
'slug' => 'main-menu',
'menu_items' => array(
'Home' => site_url(),
'Search' => site_url('/search/'),
'Online now' => site_url('online-now'),
'Video Chat' => site_url('/video-chat/'),
'Galleries' => site_url('/galleries/'),
'Forums' => site_url('/forums/'),
'Live cams' => site_url('/live-cams/')
)
)
);
foreach($menus as $menu_title => $menu_var) {
register_nav_menu( $menu_var['slug'], $menu_title );
if( !is_nav_menu($menu_title) ) {
$menu_id = wp_create_nav_menu( $menu_title );
foreach( $menu_var['menu_items'] as $menu_item_name => $menu_item_url ) {
$item = array ( 'menu-item-type' => 'custom', 'menu-item-url' => $menu_item_url, 'menu-item-title' => $menu_item_name );
wp_update_nav_menu_item( $menu_id, 0, $item );
}
}
}
}
add_action( 'init', 'register_my_menus' );
All you need to do is modify the $menus array. :)
|
Q: How do I create predefined menus for my theme? This is my code thus far:
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu' ),
'extra-menu' => __( 'Extra Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
But this seems to only register 'locations' in which to place custom menus.
What I want is for all the custom menus (and menu items) to be fully setup on after_theme_setup or init.
Thanks
A: For anyone seeking the same solution, here is the code:
function register_my_menus() {
$menus = array(
'Main menu' => array(
'slug' => 'main-menu',
'menu_items' => array(
'Home' => site_url(),
'Search' => site_url('/search/'),
'Online now' => site_url('online-now'),
'Video Chat' => site_url('/video-chat/'),
'Galleries' => site_url('/galleries/'),
'Forums' => site_url('/forums/'),
'Live cams' => site_url('/live-cams/')
)
)
);
foreach($menus as $menu_title => $menu_var) {
register_nav_menu( $menu_var['slug'], $menu_title );
if( !is_nav_menu($menu_title) ) {
$menu_id = wp_create_nav_menu( $menu_title );
foreach( $menu_var['menu_items'] as $menu_item_name => $menu_item_url ) {
$item = array ( 'menu-item-type' => 'custom', 'menu-item-url' => $menu_item_url, 'menu-item-title' => $menu_item_name );
wp_update_nav_menu_item( $menu_id, 0, $item );
}
}
}
}
add_action( 'init', 'register_my_menus' );
All you need to do is modify the $menus array. :)
A: Example code taken from new2wp.com located HERE
// Function for registering wp_nav_menu() in 3 locations
add_action( 'init', 'register_navmenus' );
function register_navmenus() {
register_nav_menus( array(
'Top' => __( 'Top Navigation' ),
'Header' => __( 'Header Navigation' ),
'Footer' => __( 'Footer Navigation' ),
)
);
// Check if Top menu exists and make it if not
if ( !is_nav_menu( 'Top' )) {
$menu_id = wp_create_nav_menu( 'Top' );
$menu = array( 'menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'),'menu-item-title' => 'Home' );
wp_update_nav_menu_item( $menu_id, 0, $menu );
}
// Check if Header menu exists and make it if not
if ( !is_nav_menu( 'Header' )) {
$menu_id = wp_create_nav_menu( 'Header' );
$menu = array( 'menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'), 'menu-item-title' => 'Home' );
wp_update_nav_menu_item( $menu_id, 0, $menu );
}
// Check if Footer menu exists and make it if not
if ( !is_nav_menu( 'Footer' )) {
$menu_id = wp_create_nav_menu( 'Footer' );
$menu = array( 'menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'), 'menu-item-title' => 'Home' );
wp_update_nav_menu_item( $menu_id, 0, $menu );
}
// Get any menu locations that dont have a menu assigned to it and give it on
/* Currently not working. couldnt fix it.
$loc = array('Top', 'Header', 'Footer');
if ( has_nav_menu( $location )) {
$locations = get_nav_menu_locations();
return (!empty( $locations[ $location ] ));
}
*/
}
/* Delete nav menu in case you need it
wp_delete_nav_menu( $menu );
*/
|
wordpress
|
{
"language": "en",
"length": 420,
"provenance": "stackexchange_00019.jsonl.gz:419398",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50168"
}
|
[
0.072265625,
0.005519866943359375,
0.0501708984375,
0.019500732421875,
0.028594970703125,
-0.026824951171875,
0.10235595703125,
-0.0697021484375,
-0.00836181640625,
0.021484375,
-0.01473236083984375,
0.0222320556640625,
-0.037872314453125,
-0.00627899169921875,
-0.005748748779296875,
-0.0249176025390625,
0.0496826171875,
-0.0184173583984375,
0.045379638671875,
0.00881195068359375,
0.01224517822265625,
0.031036376953125,
0.03857421875,
0.052825927734375,
0.0235748291015625,
-0.042266845703125,
0.003429412841796875,
0.006755828857421875,
-0.004528045654296875,
-0.01751708984375,
0.0169525146484375,
0.0218048095703125,
0.00795745849609375,
0.006748199462890625,
0.0195159912109375,
0.0220489501953125,
0.033050537109375,
0.0019502639770507812,
0.008514404296875,
0.040283203125,
0.03814697265625,
-0.02337646484375,
0.027801513671875,
0.0189056396484375,
0.00257110595703125,
-0.040618896484375,
0.03631591796875,
-0.0445556640625,
-0.005016326904296875,
-0.0204010009765625,
0.01849365234375,
0.01171875,
0.0230255126953125,
0.009674072265625,
-0.015045166015625,
-0.00756072998046875,
0.0164794921875,
-0.049896240234375,
0.0394287109375,
0.04620361328125,
-0.0194549560546875,
-0.01416778564453125,
0.0037994384765625,
-0.064453125,
-0.011199951171875,
0.0171356201171875,
0.038360595703125,
0.01104736328125,
-0.0762939453125,
-0.027130126953125,
0.03387451171875,
-0.0303802490234375,
-0.0098724365234375,
-0.00508880615234375,
-0.0343017578125,
-0.00798797607421875,
-0.01971435546875,
-0.0219268798828125,
0.045257568359375,
-0.01031494140625,
0.0095367431640625,
-0.021453857421875,
0.022613525390625,
-0.000644683837890625,
-0.0036830902099609375,
0.003662109375,
-0.006397247314453125,
-0.007549285888671875,
-0.0304718017578125,
-0.0070953369140625,
-0.0149993896484375,
-0.027923583984375,
-0.032012939453125,
0.0254364013671875,
0.00630950927734375,
-0.012237548828125,
0.0335693359375,
0.0653076171875,
-0.01629638671875,
0.024322509765625,
-0.0223388671875,
-0.022125244140625,
0.043365478515625,
-0.055999755859375,
0.0245513916015625,
0.045928955078125,
-0.0121307373046875,
-0.026214599609375,
0.0330810546875,
0.0204620361328125,
0.01071929931640625,
0.03057861328125,
-0.009857177734375,
-0.01763916015625,
-0.041839599609375,
0.00382232666015625,
-0.0216217041015625,
-0.01398468017578125,
0.007450103759765625,
-0.0012502670288085938,
0.008453369140625,
0.0243377685546875,
0.05010986328125,
0.0179443359375,
-0.0193328857421875,
0.0232086181640625,
0.007701873779296875,
-0.08978271484375,
-0.021881103515625,
0.06109619140625,
-0.020477294921875,
-0.01415252685546875,
0.0440673828125,
0.04559326171875,
-0.0035877227783203125,
-0.03961181640625,
0.053863525390625,
-0.01471710205078125,
-0.010406494140625,
0.018280029296875,
0.036590576171875,
-0.0047149658203125,
-0.01280975341796875,
-0.01033782958984375,
0.016876220703125,
0.002994537353515625,
0.01505279541015625,
0.01018524169921875,
0.005489349365234375,
-0.01995849609375,
0.0267181396484375,
-0.03948974609375,
0.0249481201171875,
-0.00440216064453125,
-0.01065826416015625,
-0.0030117034912109375,
-0.0007419586181640625,
-0.013702392578125,
-0.014556884765625,
-0.0125579833984375,
-0.049346923828125,
-0.0196533203125,
0.00730133056640625,
-0.0892333984375,
-0.07562255859375,
0.016326904296875,
0.0009088516235351562,
0.0016632080078125,
0.02252197265625,
0.041259765625,
0.00911712646484375,
-0.015411376953125,
0.015167236328125,
0.034027099609375,
0.003131866455078125,
0.0308990478515625,
-0.01666259765625,
-0.0170135498046875,
0.04046630859375,
0.021209716796875,
-0.0146484375,
-0.03167724609375,
0.0010738372802734375,
0.005069732666015625,
-0.0975341796875,
0.080322265625,
-0.02197265625,
0.07855224609375,
0.054962158203125,
-0.010833740234375,
0.04168701171875,
-0.017242431640625,
-0.037841796875,
-0.00276947021484375,
-0.01380157470703125,
-0.0015745162963867188,
0.0191650390625,
0.0172882080078125,
-0.00637054443359375,
-0.0037631988525390625,
-0.00646209716796875,
-0.0194244384765625,
0.0259857177734375,
-0.01776123046875,
-0.0506591796875,
0.01526641845703125,
-0.03375244140625,
0.04510498046875,
0.0227508544921875,
0.01371002197265625,
-0.014923095703125,
-0.0030155181884765625,
0.020538330078125,
-0.078857421875,
-0.042724609375,
0.02471923828125,
-0.033905029296875,
-0.00901031494140625,
-0.02142333984375,
-0.0031642913818359375,
-0.0194091796875,
-0.00461578369140625,
-0.006320953369140625,
0.034698486328125,
0.055419921875,
-0.00298309326171875,
-0.035858154296875,
-0.0361328125,
0.0189056396484375,
-0.01189422607421875,
-0.04095458984375,
0.07421875,
0.04376220703125,
-0.019561767578125,
-0.042266845703125,
0.01480865478515625,
0.024627685546875,
-0.0141143798828125,
-0.0303497314453125,
0.04144287109375,
0.041595458984375,
0.0294952392578125,
-0.00902557373046875,
-0.045806884765625,
0.026458740234375,
-0.028533935546875,
0.033416748046875,
-0.052276611328125,
-0.0247039794921875,
0.033905029296875,
0.01242828369140625,
0.03509521484375,
-0.01107025146484375,
-0.0041961669921875,
0.0135955810546875,
0.0308380126953125,
-0.035888671875,
-0.0295257568359375,
0.037139892578125,
-0.016021728515625,
0.006011962890625,
-0.0002474784851074219,
0.010009765625,
0.0007410049438476562,
0.0088653564453125,
0.03900146484375,
-0.0022869110107421875,
0.002941131591796875,
-0.062103271484375,
0.0440673828125,
0.027008056640625,
-0.005573272705078125,
-0.0278167724609375,
-0.01163482666015625,
0.045562744140625,
-0.0298004150390625,
-0.041259765625,
0.0277252197265625,
-0.0093536376953125,
-0.031494140625,
-0.0014619827270507812,
0.039306640625,
0.0009403228759765625,
-0.007068634033203125,
-0.0117340087890625,
-0.09619140625,
0.005283355712890625,
0.02740478515625,
0.007221221923828125,
-0.01123809814453125,
0.030426025390625,
-0.00933074951171875,
-0.04217529296875,
0.044830322265625,
-0.0201263427734375,
-0.0289306640625,
0.06719970703125,
0.002338409423828125,
0.00952911376953125,
0.0057830810546875,
0.070068359375,
0.036163330078125,
-0.0352783203125,
0.021514892578125,
-0.00818634033203125,
-0.00800323486328125,
-0.0127716064453125,
0.031341552734375,
0.00836944580078125,
-0.052764892578125,
0.0173492431640625,
0.0229339599609375,
-0.0010852813720703125,
-0.01181793212890625,
0.000048100948333740234,
-0.02294921875,
-0.0147857666015625,
-0.01526641845703125,
-0.035858154296875,
-0.0012979507446289062,
0.05987548828125,
-0.036895751953125,
0.0484619140625,
-0.01837158203125,
-0.006977081298828125,
-0.045318603515625,
0.0130157470703125,
0.005374908447265625,
-0.0281219482421875,
-0.00559234619140625,
-0.0219573974609375,
-0.0208740234375,
-0.03521728515625,
0.0247344970703125,
-0.0113372802734375,
0.01352691650390625,
-0.0014362335205078125,
0.048553466796875,
0.02093505859375,
-0.0124664306640625,
0.06488037109375,
0.0012531280517578125,
0.01611328125,
0.05682373046875,
0.02789306640625,
-0.024658203125,
-0.0188446044921875,
0.00852203369140625,
0.032470703125,
0.00975799560546875,
-0.02783203125,
-0.0144500732421875,
-0.00962066650390625,
-0.001026153564453125,
0.02008056640625,
0.003330230712890625,
0.0032062530517578125,
0.011505126953125,
0.0210723876953125,
-0.031341552734375,
-0.0240020751953125,
-0.0132598876953125,
-0.0298309326171875,
0.043701171875,
0.0010156631469726562,
0.0133209228515625,
-0.0020732879638671875,
0.035491943359375,
-0.014739990234375,
0.0220947265625,
0.01751708984375,
-0.022247314453125,
0.00933837890625,
-0.01009368896484375,
-0.033355712890625,
-0.01126861572265625,
0.059814453125,
-0.00925445556640625,
-0.00579071044921875,
0.028961181640625,
-0.0114898681640625,
-0.0151824951171875,
0.0013055801391601562,
-0.020721435546875,
-0.01293182373046875,
0.035797119140625,
-0.006435394287109375,
0.07061767578125,
-0.040618896484375,
-0.0276947021484375,
-0.024383544921875,
0.080078125,
-0.08056640625,
-0.034332275390625,
0.0205230712890625,
0.0202484130859375,
0.0423583984375,
-0.0136260986328125,
-0.00506591796875,
-0.041717529296875,
-0.115478515625,
0.0335693359375,
-0.01373291015625,
-0.024993896484375,
-0.02447509765625,
-0.0182952880859375,
-0.051727294921875,
-0.061614990234375,
0.03887939453125,
-0.00862884521484375,
0.01137542724609375,
0.005390167236328125,
0.01520538330078125,
-0.03369140625,
-0.02032470703125,
0.005832672119140625,
-0.10333251953125,
-0.0150146484375,
-0.041107177734375,
0.09698486328125,
0.0277862548828125,
-0.006160736083984375,
-0.020477294921875,
0.05364990234375,
0.031158447265625,
0.0234527587890625,
0.02813720703125,
0.01076507568359375,
0.00701141357421875,
-0.02984619140625,
0.028411865234375,
-0.039398193359375,
0.0010967254638671875,
-0.006038665771484375,
-0.0452880859375,
-0.00276947021484375,
-0.00881195068359375,
0.00293731689453125,
0.0261383056640625,
-0.0380859375,
-0.02532958984375,
-0.00833892822265625,
-0.0108184814453125,
-0.006366729736328125,
0.01427459716796875,
-0.0215911865234375,
0.028778076171875,
-0.0286865234375,
-0.0169677734375,
-0.0484619140625,
-0.01910400390625,
0.02191162109375,
0.0221099853515625,
0.019622802734375,
0.00447845458984375,
0.0217437744140625,
0.03509521484375,
0.040496826171875,
-0.00690460205078125,
0.021728515625,
0.0004773139953613281,
-0.0218048095703125,
0.0263214111328125,
0.0166015625,
-0.007793426513671875,
0.059112548828125,
-0.0101776123046875,
0.04241943359375,
-0.0026493072509765625,
-0.02001953125,
0.04620361328125,
-0.035614013671875,
-0.024200439453125,
-0.0022983551025390625,
-0.027191162109375,
-0.026763916015625,
0.0716552734375,
0.035064697265625,
-0.0026416778564453125,
-0.07904052734375,
-0.00016427040100097656,
-0.0106048583984375,
0.050262451171875,
0.04931640625,
0.024688720703125,
-0.0081024169921875,
0.006610870361328125,
0.0105743408203125,
-0.00623321533203125,
0.0111541748046875,
-0.00420379638671875,
0.01345062255859375,
0.0245819091796875,
-0.0141143798828125,
-0.007526397705078125,
0.013641357421875,
-0.0028553009033203125,
0.042205810546875,
0.01947021484375,
0.005603790283203125,
-0.06890869140625,
0.01290130615234375,
0.0196685791015625,
-0.024505615234375,
0.00023889541625976562,
0.044708251953125,
0.048309326171875,
-0.004100799560546875,
-0.01971435546875,
-0.0194549560546875,
0.005962371826171875,
-0.04669189453125,
0.01520538330078125,
-0.004199981689453125,
0.0025482177734375,
0.00769805908203125,
0.06414794921875,
-0.0105743408203125,
0.0294342041015625,
-0.004451751708984375,
0.04571533203125,
0.034088134765625,
0.0223388671875,
0.02178955078125,
-0.004215240478515625,
-0.00799560546875,
-0.0013828277587890625,
-0.025390625,
-0.0009493827819824219,
-0.01313018798828125,
-0.0164031982421875,
0.00440216064453125,
-0.0130767822265625,
0.01094818115234375,
0.0155181884765625,
-0.0169525146484375,
0.007610321044921875,
0.014892578125,
-0.06378173828125,
-0.050689697265625,
-0.027069091796875,
-0.00220489501953125,
0.025665283203125,
-0.04949951171875,
-0.0169525146484375,
0.0301513671875,
0.0084075927734375,
0.0239105224609375,
-0.0031414031982421875,
-0.0296630859375,
0.035400390625,
0.04541015625,
-0.0087432861328125,
-0.01132965087890625,
0.01061248779296875,
-0.06549072265625,
-0.0280609130859375,
-0.0210113525390625,
-0.0159759521484375,
0.0599365234375,
-0.040008544921875,
0.033477783203125,
-0.0306549072265625,
0.00524139404296875,
-0.0253753662109375,
0.0102996826171875,
0.038726806640625,
0.029144287109375,
-0.0150604248046875,
-0.003009796142578125,
-0.03106689453125,
-0.00089263916015625,
0.0268096923828125,
-0.0257720947265625,
-0.0284576416015625,
-0.046783447265625,
0.020294189453125,
0.009429931640625,
0.052398681640625,
0.0234832763671875,
0.01108551025390625,
0.00768280029296875,
0.00412750244140625,
0.018310546875,
-0.01171875,
0.0123291015625,
0.0307769775390625,
0.01947021484375,
0.00965118408203125,
-0.0223846435546875,
-0.033599853515625,
-0.01360321044921875,
-0.0126800537109375,
-0.018218994140625,
-0.02447509765625,
-0.007061004638671875,
-0.0175933837890625,
0.0457763671875,
0.09039306640625,
-0.003810882568359375,
0.0350341796875,
-0.01531219482421875,
0.0004906654357910156,
-0.007228851318359375,
-0.00255584716796875,
-0.050201416015625,
0.0167388916015625,
0.04473876953125,
-0.0227508544921875,
0.030609130859375,
0.016754150390625,
0.01434326171875,
0.0007801055908203125,
-0.028076171875,
0.004199981689453125,
0.03704833984375,
-0.0648193359375,
0.060821533203125,
0.068359375,
0.00011563301086425781,
0.045196533203125,
-0.00047707557678222656,
-0.0010080337524414062,
0.0252227783203125,
-0.002227783203125,
-0.001338958740234375,
0.0204010009765625,
0.08636474609375,
0.017852783203125,
-0.01448822021484375,
0.06707763671875,
-0.032012939453125,
-0.0159454345703125,
0.074951171875,
0.049591064453125,
-0.08343505859375,
-0.0133209228515625,
0.00943756103515625,
0.006664276123046875,
0.030059814453125,
0.0193634033203125,
-0.0256195068359375,
-0.015655517578125,
0.0113067626953125,
-0.073974609375,
-0.02996826171875,
-0.0091705322265625,
-0.0013628005981445312,
0.006618499755859375,
-0.0018634796142578125,
0.01511383056640625,
-0.0158538818359375,
-0.0013294219970703125,
-0.05419921875,
-0.01369476318359375,
0.006687164306640625,
-0.0209503173828125,
0.024871826171875,
0.019256591796875,
-0.0014524459838867188,
-0.022857666015625,
0.053192138671875,
-0.0311279296875,
0.0201873779296875,
-0.0022182464599609375,
-0.0014429092407226562,
-0.0258331298828125,
0.00943756103515625,
-0.02252197265625,
0.004596710205078125,
-0.0133209228515625,
-0.04888916015625,
-0.00534820556640625,
0.01206207275390625,
0.025177001953125,
-0.01087188720703125,
0.00417327880859375,
0.0037059783935546875,
-0.0273284912109375,
-0.0218048095703125,
-0.0226898193359375,
-0.01090240478515625,
0.08697509765625,
-0.012298583984375,
-0.042022705078125,
0.01116180419921875,
0.0290985107421875,
-0.018402099609375,
0.005336761474609375,
0.04156494140625,
-0.09735107421875,
-0.06298828125,
0.0237274169921875,
-0.040618896484375,
-0.01194000244140625,
-0.003814697265625,
-0.005489349365234375,
0.0767822265625,
-0.055938720703125,
-0.0146331787109375,
0.033203125,
0.03948974609375,
-0.00021183490753173828,
0.042938232421875,
-0.0301055908203125,
0.020751953125,
0.03448486328125,
0.01788330078125,
-0.026153564453125,
-0.01140594482421875,
-0.001705169677734375,
0.04034423828125,
0.01666259765625,
0.01276397705078125,
-0.0241851806640625,
0.0003006458282470703,
0.0531005859375,
0.035430908203125,
0.01386260986328125,
0.0311279296875,
-0.034942626953125,
-0.020294189453125,
-0.0010309219360351562,
-0.0112152099609375,
0.031829833984375,
-0.041534423828125,
-0.06011962890625,
-0.024261474609375,
0.0191497802734375,
0.0126190185546875,
-0.01078033447265625,
-0.0050811767578125,
-0.0241241455078125,
0.0027217864990234375,
0.005214691162109375,
0.02349853515625,
-0.0157623291015625,
-0.016693115234375,
-0.03717041015625,
0.04144287109375,
0.0160064697265625,
-0.010345458984375,
0.023681640625,
0.01415252685546875,
-0.032196044921875,
0.03497314453125,
0.01085662841796875,
-0.02374267578125,
0.00870513916015625,
-0.0294189453125,
0.023681640625,
0.0187225341796875,
0.041900634765625,
0.03814697265625,
0.031463623046875,
-0.0499267578125,
-0.06884765625,
0.06854248046875,
0.08941650390625,
-0.0184783935546875,
-0.02923583984375,
0.005550384521484375,
0.029266357421875,
0.034759521484375,
0.01216888427734375,
0.07855224609375,
0.006076812744140625,
0.035430908203125,
0.00970458984375,
-0.008148193359375,
0.014190673828125,
0.017913818359375,
0.0162506103515625,
0.034912109375,
-0.029388427734375,
0.006328582763671875,
-0.061981201171875,
0.035736083984375,
0.0233917236328125,
0.06878662109375,
0.0252685546875,
0.06536865234375,
-0.01297760009765625,
-0.03399658203125,
0.01284027099609375,
0.038909912109375,
0.00565338134765625,
-0.029876708984375,
-0.0271148681640625,
-0.0672607421875,
0.0177764892578125,
0.0345458984375,
0.0250396728515625,
0.03668212890625,
0.046905517578125,
-0.0164642333984375,
-0.05377197265625,
0.00786590576171875,
0.009490966796875,
-0.0438232421875,
-0.041595458984375,
-0.0221405029296875,
-0.0204620361328125,
0.01117706298828125,
0.005084991455078125,
0.006565093994140625,
0.0020236968994140625,
0.01076507568359375,
-0.045135498046875,
0.01024627685546875,
-0.0154571533203125,
-0.025360107421875,
0.005157470703125,
-0.0170135498046875,
0.0266876220703125,
-0.01049041748046875,
-0.10986328125,
-0.0240631103515625,
-0.0288848876953125,
-0.045318603515625,
0.045196533203125,
0.051605224609375,
-0.0034618377685546875,
0.0056915283203125,
0.00009894371032714844,
0.0154266357421875,
0.006313323974609375,
-0.0145721435546875,
-0.0029544830322265625,
0.030548095703125,
0.04852294921875,
0.03289794921875,
-0.030975341796875,
-0.017913818359375,
-0.007762908935546875,
0.0141143798828125,
0.0125274658203125,
0.044219970703125,
0.00998687744140625,
0.0222930908203125,
-0.00011217594146728516,
-0.0195465087890625,
0.00634002685546875,
-0.0086212158203125,
-0.007793426513671875,
-0.0178680419921875,
-0.0033550262451171875,
-0.005596160888671875,
-0.020538330078125,
0.041534423828125,
0.021087646484375,
-0.019989013671875,
0.04571533203125,
-0.0372314453125,
0.0012388229370117188,
-0.035797119140625,
0.034576416015625,
-0.007476806640625,
-0.023651123046875,
-0.0228729248046875,
-0.007080078125,
0.040557861328125,
0.06683349609375,
0.00994110107421875,
0.0528564453125,
0.0021228790283203125,
0.003040313720703125,
0.01197052001953125,
-0.02947998046875,
0.009490966796875,
0.030517578125,
-0.0008602142333984375,
-0.0169525146484375,
-0.0173492431640625,
-0.011322021484375,
-0.00551605224609375,
0.011993408203125,
-0.0022125244140625,
-0.00039315223693847656,
-0.00026702880859375,
0.045379638671875,
0.031280517578125,
0.04498291015625,
-0.038909912109375,
0.015960693359375,
0.03759765625,
0.00550079345703125,
0.03466796875,
-0.04461669921875,
-0.03289794921875,
-0.051177978515625,
-0.002109527587890625,
0.025146484375,
-0.0274200439453125,
-0.0220947265625,
-0.0711669921875,
-0.01163482666015625,
0.021575927734375,
0.007415771484375,
-0.041534423828125,
0.0198211669921875,
-0.0211029052734375,
0.02874755859375,
-0.0389404296875,
-0.0240936279296875,
-0.0060882568359375,
0.0176239013671875,
0.020843505859375,
0.016571044921875,
-0.038604736328125,
0.007701873779296875,
0.0086669921875,
-0.0126800537109375,
0.0264434814453125,
-0.0038604736328125,
-0.06939697265625,
-0.014007568359375,
-0.01153564453125,
0.02288818359375,
-0.000002682209014892578,
-0.048736572265625,
-0.00847625732421875,
-0.0038547515869140625,
0.0049896240234375,
-0.014678955078125,
-0.00106048583984375,
-0.04913330078125,
-0.0222930908203125,
0.034912109375,
-0.0026073455810546875,
0.0364990234375,
-0.0305328369140625,
-0.08868408203125,
0.06329345703125,
-0.00547027587890625,
-0.040191650390625,
-0.045318603515625,
0.018829345703125,
-0.015289306640625,
-0.0189208984375,
-0.00914764404296875,
-0.031494140625,
0.0177459716796875,
0.047821044921875,
0.026947021484375,
0.03228759765625,
0.027679443359375,
0.0152740478515625,
-0.0482177734375,
-0.0005664825439453125,
-0.014007568359375,
0.01229095458984375,
0.0335693359375,
-0.0168914794921875,
0.02288818359375,
0.0413818359375,
-0.031341552734375,
-0.045074462890625,
-0.0264129638671875,
-0.059326171875,
-0.03851318359375,
-0.01947021484375,
-0.016754150390625,
-0.00946807861328125,
0.06787109375,
0.047149658203125,
0.00864410400390625,
-0.0238037109375,
-0.0012979507446289062,
-0.00452423095703125,
0.0115509033203125,
0.00429534912109375,
0.0099945068359375,
-0.039794921875,
-0.017547607421875,
0.005733489990234375,
-0.01309967041015625,
-0.064453125,
-0.0016355514526367188,
-0.0312042236328125,
-0.005207061767578125,
0.0137176513671875,
0.0092926025390625,
0.022186279296875,
-0.0212249755859375,
0.057403564453125,
-0.04425048828125,
-0.040924072265625,
-0.0005207061767578125,
0.0284423828125,
-0.01018524169921875,
-0.03472900390625,
-0.007350921630859375,
-0.01776123046875,
-0.01824951171875,
-0.0008554458618164062,
-0.006343841552734375,
0.06292724609375,
-0.00876617431640625,
-0.046600341796875,
-0.026702880859375,
0.025787353515625,
0.007793426513671875,
0.0377197265625,
-0.024017333984375,
0.041961669921875,
0.030731201171875,
0.03466796875,
0.00675201416015625,
0.01453399658203125,
0.003040313720703125,
0.0295257568359375,
0.01407623291015625,
-0.031585693359375,
0.02313232421875,
-0.0419921875,
-0.0015745162963867188,
-0.0228271484375,
-0.044952392578125,
-0.0592041015625,
0.0246124267578125,
0.0098724365234375,
-0.01739501953125,
0.034942626953125
] |
a8ab559169921c86a37cd557660539069e4f0869
|
Wordpress Stackexchange
Q: Getting trackback spam, even with trackbacks disabled I'm having a heck of a time having trackbacks being disabled period on my self-hosted blog. I've disabled the "Allow link notifications from other blogs (pingbacks and trackbacks)" option, and have all comments going through disqus, yet for some reason I'm getting 20-50 trackbacks a day to the blog directly (not through disqus). Is there something obvious that I'm missing?
A: If you are using a twentyten/eleven theme, they hardcode the pingback meta tag into the head.php file. Remove that line or use your own theme. Also, and maybe it's only in multisite, but the X-Pingback header is sent along with the xmlrpc endpoint url as well. Removed with the following:
/**
* Remove the X-Pingback header, since pingbacks are disabled
*/
add_filter('wp_headers', 'custom_remove_xmlrpc_header', 1, 2);
function custom_remove_xmlrpc_header($headers, $wp_object){
if (array_key_exists('X-Pingback', $headers))
unset($headers['X-Pingback']);
return $headers;
}
|
Q: Getting trackback spam, even with trackbacks disabled I'm having a heck of a time having trackbacks being disabled period on my self-hosted blog. I've disabled the "Allow link notifications from other blogs (pingbacks and trackbacks)" option, and have all comments going through disqus, yet for some reason I'm getting 20-50 trackbacks a day to the blog directly (not through disqus). Is there something obvious that I'm missing?
A: If you are using a twentyten/eleven theme, they hardcode the pingback meta tag into the head.php file. Remove that line or use your own theme. Also, and maybe it's only in multisite, but the X-Pingback header is sent along with the xmlrpc endpoint url as well. Removed with the following:
/**
* Remove the X-Pingback header, since pingbacks are disabled
*/
add_filter('wp_headers', 'custom_remove_xmlrpc_header', 1, 2);
function custom_remove_xmlrpc_header($headers, $wp_object){
if (array_key_exists('X-Pingback', $headers))
unset($headers['X-Pingback']);
return $headers;
}
|
wordpress
|
{
"language": "en",
"length": 144,
"provenance": "stackexchange_00019.jsonl.gz:419416",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50231"
}
|
[
0.07464599609375,
-0.00630950927734375,
0.0213623046875,
-0.03173828125,
0.0117645263671875,
-0.030914306640625,
0.025146484375,
-0.0335693359375,
0.01337432861328125,
0.0104827880859375,
-0.0294647216796875,
0.0096435546875,
0.0068511962890625,
-0.0206298828125,
0.021026611328125,
-0.01702880859375,
-0.00372314453125,
0.0003368854522705078,
0.011993408203125,
-0.01493072509765625,
0.0275726318359375,
-0.0220489501953125,
-0.01067352294921875,
-0.0005903244018554688,
-0.0103302001953125,
0.0149993896484375,
0.08935546875,
-0.0126495361328125,
0.00457000732421875,
-0.017822265625,
0.0122833251953125,
-0.0274200439453125,
0.0230712890625,
0.032440185546875,
-0.05462646484375,
-0.024688720703125,
-0.0004172325134277344,
0.00493621826171875,
-0.0343017578125,
0.034698486328125,
0.0086212158203125,
-0.018218994140625,
0.0220947265625,
0.0019474029541015625,
-0.007171630859375,
-0.049407958984375,
0.058868408203125,
-0.021453857421875,
0.0189361572265625,
0.03717041015625,
-0.024078369140625,
0.00972747802734375,
-0.0187530517578125,
-0.0136871337890625,
-0.0027713775634765625,
-0.005680084228515625,
-0.01314544677734375,
-0.005100250244140625,
-0.001430511474609375,
-0.005168914794921875,
0.0275726318359375,
0.0200347900390625,
-0.01300048828125,
0.0193328857421875,
0.0266876220703125,
0.02130126953125,
0.096435546875,
0.0205841064453125,
-0.06890869140625,
0.0211334228515625,
0.03033447265625,
-0.048828125,
-0.0108795166015625,
0.01367950439453125,
-0.04840087890625,
0.0035457611083984375,
0.013824462890625,
-0.0271759033203125,
0.018585205078125,
0.00006669759750366211,
-0.01300811767578125,
-0.01849365234375,
-0.038177490234375,
0.0115814208984375,
-0.01200103759765625,
0.036529541015625,
-0.015899658203125,
-0.01971435546875,
-0.009002685546875,
-0.0194244384765625,
-0.00913238525390625,
-0.04705810546875,
-0.0302734375,
0.029693603515625,
0.0018167495727539062,
-0.0223388671875,
0.0035953521728515625,
0.055450439453125,
-0.039031982421875,
-0.031646728515625,
-0.0433349609375,
0.0161285400390625,
-0.08160400390625,
-0.004184722900390625,
-0.01180267333984375,
0.0284271240234375,
0.00298309326171875,
-0.0265045166015625,
0.0311126708984375,
0.0250091552734375,
0.01311492919921875,
0.017425537109375,
-0.01194000244140625,
0.031219482421875,
-0.01580810546875,
-0.0269012451171875,
-0.0723876953125,
0.034088134765625,
-0.0323486328125,
0.0194091796875,
0.006649017333984375,
0.037567138671875,
-0.0338134765625,
0.00202178955078125,
-0.0298004150390625,
-0.032867431640625,
0.01348114013671875,
-0.0110626220703125,
0.0115509033203125,
0.0175628662109375,
-0.040496826171875,
0.005878448486328125,
0.037200927734375,
0.0029048919677734375,
-0.000035703182220458984,
-0.021240234375,
0.044708251953125,
-0.0194854736328125,
-0.039764404296875,
0.026519775390625,
0.025115966796875,
-0.037353515625,
-0.056976318359375,
0.0097198486328125,
0.00827789306640625,
-0.034698486328125,
0.0160369873046875,
0.05352783203125,
0.0022296905517578125,
0.0232086181640625,
0.003414154052734375,
0.01306915283203125,
0.034820556640625,
-0.01470184326171875,
-0.0255889892578125,
-0.0667724609375,
0.00505828857421875,
-0.030609130859375,
0.00473785400390625,
-0.05999755859375,
0.0298309326171875,
-0.0028438568115234375,
-0.0158233642578125,
-0.03460693359375,
-0.045867919921875,
-0.0209808349609375,
-0.019775390625,
-0.0020580291748046875,
0.0191802978515625,
0.01416778564453125,
-0.006351470947265625,
-0.009796142578125,
-0.0186004638671875,
0.0121307373046875,
0.01352691650390625,
0.012939453125,
-0.004016876220703125,
-0.0101470947265625,
0.05487060546875,
-0.05279541015625,
-0.058349609375,
-0.0316162109375,
0.069580078125,
-0.0421142578125,
-0.124755859375,
0.09735107421875,
0.0089263916015625,
0.10784912109375,
0.04443359375,
-0.0156097412109375,
0.11077880859375,
0.0098724365234375,
-0.00905609130859375,
-0.02105712890625,
0.006763458251953125,
-0.0357666015625,
-0.024261474609375,
-0.039215087890625,
-0.00299835205078125,
0.070068359375,
0.008392333984375,
0.036041259765625,
-0.0308990478515625,
-0.00478363037109375,
-0.067626953125,
0.005962371826171875,
-0.0276641845703125,
0.05291748046875,
-0.017242431640625,
0.044708251953125,
0.03076171875,
0.01323699951171875,
-0.03680419921875,
0.012451171875,
0.0046539306640625,
-0.0279083251953125,
-0.01502227783203125,
0.0726318359375,
0.000021576881408691406,
0.03106689453125,
0.016571044921875,
-0.0258331298828125,
0.0225982666015625,
0.0023250579833984375,
-0.016571044921875,
-0.01161956787109375,
-0.0268096923828125,
-0.0036029815673828125,
-0.002025604248046875,
-0.012115478515625,
0.042755126953125,
0.0465087890625,
-0.04241943359375,
0.0204620361328125,
0.007587432861328125,
-0.01525115966796875,
0.03460693359375,
-0.0703125,
0.0377197265625,
0.0247802734375,
0.04449462890625,
-0.02032470703125,
0.01454925537109375,
0.033416748046875,
0.004611968994140625,
-0.05523681640625,
0.00839996337890625,
0.00959014892578125,
0.0013837814331054688,
-0.018768310546875,
0.0303802490234375,
-0.020355224609375,
0.0362548828125,
-0.03448486328125,
0.049163818359375,
0.0190582275390625,
-0.0310211181640625,
-0.0206756591796875,
-0.008758544921875,
0.01131439208984375,
0.01496124267578125,
0.0009026527404785156,
-0.01375579833984375,
-0.0002180337905883789,
0.036865234375,
-0.02325439453125,
0.040802001953125,
0.0299530029296875,
0.0013828277587890625,
-0.025115966796875,
-0.000518798828125,
-0.0298004150390625,
0.01061248779296875,
0.036590576171875,
0.038848876953125,
0.01318359375,
-0.0007872581481933594,
-0.0261993408203125,
-0.005931854248046875,
0.02496337890625,
-0.024749755859375,
-0.007251739501953125,
-0.00811004638671875,
-0.006870269775390625,
-0.00960540771484375,
-0.060546875,
0.02630615234375,
0.01325225830078125,
-0.0638427734375,
-0.040496826171875,
-0.00080108642578125,
0.0286865234375,
-0.0255889892578125,
-0.00638580322265625,
-0.001033782958984375,
-0.006267547607421875,
-0.03875732421875,
-0.054595947265625,
0.02667236328125,
-0.0277099609375,
0.0205841064453125,
0.0760498046875,
0.0521240234375,
-0.0198822021484375,
0.0198974609375,
0.00015532970428466797,
0.0533447265625,
-0.00962066650390625,
-0.0005345344543457031,
0.053192138671875,
-0.0592041015625,
0.02734375,
0.008697509765625,
0.004852294921875,
-0.035858154296875,
-0.057159423828125,
-0.034454345703125,
-0.021697998046875,
-0.09429931640625,
-0.0247039794921875,
0.0173492431640625,
-0.06805419921875,
0.0221710205078125,
0.0033550262451171875,
-0.031951904296875,
-0.0303192138671875,
0.039031982421875,
0.020233154296875,
-0.0160675048828125,
-0.033843994140625,
-0.050506591796875,
-0.0587158203125,
-0.0599365234375,
-0.020965576171875,
-0.0091552734375,
0.007236480712890625,
0.004085540771484375,
0.049835205078125,
-0.0003418922424316406,
-0.042938232421875,
-0.0272979736328125,
0.0168914794921875,
-0.0024280548095703125,
-0.01363372802734375,
-0.01461029052734375,
-0.00957489013671875,
0.020599365234375,
-0.0004208087921142578,
-0.06524658203125,
0.0024471282958984375,
0.01303863525390625,
-0.032867431640625,
-0.01015472412109375,
0.0009360313415527344,
0.005443572998046875,
0.0012598037719726562,
0.015899658203125,
0.0176849365234375,
0.0021610260009765625,
-0.028778076171875,
0.0200958251953125,
-0.044647216796875,
-0.0465087890625,
-0.037628173828125,
0.043121337890625,
0.0078887939453125,
-0.0250396728515625,
-0.028961181640625,
0.036407470703125,
0.033233642578125,
0.0234832763671875,
-0.00928497314453125,
0.0007309913635253906,
0.01439666748046875,
0.0267791748046875,
-0.029022216796875,
0.003017425537109375,
-0.015838623046875,
0.0594482421875,
0.01462554931640625,
0.02020263671875,
-0.045318603515625,
0.05218505859375,
-0.080322265625,
0.017425537109375,
0.03228759765625,
-0.06427001953125,
-0.0207061767578125,
-0.0203857421875,
0.0004394054412841797,
-0.018402099609375,
0.048065185546875,
-0.060302734375,
-0.0101318359375,
0.00794219970703125,
0.043792724609375,
-0.039215087890625,
-0.073974609375,
-0.00215911865234375,
-0.024078369140625,
-0.0309906005859375,
-0.007358551025390625,
-0.033233642578125,
-0.0016965866088867188,
-0.005161285400390625,
-0.0665283203125,
-0.00861358642578125,
-0.05572509765625,
0.0115966796875,
-0.0269317626953125,
-0.00635528564453125,
0.006023406982421875,
-0.0012578964233398438,
-0.0380859375,
0.0121002197265625,
-0.0433349609375,
-0.044677734375,
-0.01270294189453125,
0.0259857177734375,
0.01068878173828125,
0.01238250732421875,
-0.06182861328125,
0.004608154296875,
0.026519775390625,
0.00103759765625,
-0.035736083984375,
0.029510498046875,
0.0108795166015625,
-0.0019407272338867188,
0.0258026123046875,
0.001483917236328125,
-0.0154876708984375,
-0.006717681884765625,
0.0362548828125,
-0.030548095703125,
0.054168701171875,
0.0119781494140625,
-0.01503753662109375,
0.060333251953125,
-0.05072021484375,
-0.0357666015625,
-0.060699462890625,
-0.021514892578125,
0.038543701171875,
-0.0240020751953125,
0.00432586669921875,
-0.0728759765625,
-0.049072265625,
-0.0240325927734375,
-0.01751708984375,
-0.0159454345703125,
0.024627685546875,
-0.007190704345703125,
0.0258026123046875,
-0.0034999847412109375,
0.014404296875,
0.045684814453125,
0.001743316650390625,
0.017120361328125,
0.047271728515625,
-0.005855560302734375,
0.01236724853515625,
0.077392578125,
-0.03216552734375,
0.0135345458984375,
-0.0152587890625,
-0.004261016845703125,
-0.0002956390380859375,
-0.0258331298828125,
0.025390625,
-0.0074920654296875,
0.01922607421875,
0.0423583984375,
0.017425537109375,
-0.050079345703125,
0.006649017333984375,
0.035186767578125,
-0.036346435546875,
0.0273895263671875,
-0.0133209228515625,
-0.0266265869140625,
0.028472900390625,
-0.0926513671875,
0.021392822265625,
0.02581787109375,
-0.004669189453125,
0.002033233642578125,
-0.033416748046875,
0.0000317692756652832,
-0.008697509765625,
-0.01415252685546875,
-0.022430419921875,
0.0298614501953125,
-0.00791168212890625,
-0.021697998046875,
0.0096282958984375,
0.0016536712646484375,
0.0179290771484375,
0.005214691162109375,
-0.037689208984375,
-0.020599365234375,
0.009368896484375,
-0.00841522216796875,
0.020263671875,
-0.017578125,
0.03350830078125,
0.0214385986328125,
-0.009979248046875,
0.0003368854522705078,
-0.036224365234375,
0.031341552734375,
-0.048858642578125,
0.0249481201171875,
0.005069732666015625,
-0.004344940185546875,
-0.0210113525390625,
0.0546875,
-0.0081939697265625,
0.011016845703125,
-0.01047515869140625,
0.00183868408203125,
0.0243072509765625,
0.01474761962890625,
0.031402587890625,
-0.0238037109375,
-0.004791259765625,
-0.00335693359375,
-0.00021791458129882812,
-0.059417724609375,
-0.0091094970703125,
0.0214385986328125,
0.05780029296875,
0.0145416259765625,
-0.0178680419921875,
-0.0008182525634765625,
-0.0120849609375,
-0.035980224609375,
0.03564453125,
0.03717041015625,
-0.0193939208984375,
-0.021820068359375,
-0.032623291015625,
-0.0001016855239868164,
0.0187835693359375,
0.007781982421875,
-0.059967041015625,
-0.01207733154296875,
-0.0229949951171875,
-0.006893157958984375,
-0.0231170654296875,
0.0038585662841796875,
-0.00839996337890625,
-0.013336181640625,
-0.061126708984375,
-0.005306243896484375,
-0.0204010009765625,
0.032989501953125,
-0.0268096923828125,
0.00995635986328125,
0.0004642009735107422,
-0.032562255859375,
0.01776123046875,
-0.0087738037109375,
0.016021728515625,
-0.08709716796875,
0.035614013671875,
-0.0095062255859375,
0.01058197021484375,
-0.06982421875,
0.026092529296875,
-0.05889892578125,
-0.01953125,
-0.019866943359375,
-0.03607177734375,
-0.0494384765625,
-0.0290985107421875,
0.028076171875,
0.00865936279296875,
-0.0124359130859375,
-0.05487060546875,
-0.0259246826171875,
0.0068511962890625,
0.04583740234375,
0.0318603515625,
-0.02044677734375,
0.020721435546875,
-0.0024852752685546875,
0.040771484375,
0.000885009765625,
0.0225067138671875,
0.0107269287109375,
-0.0300445556640625,
0.02874755859375,
-0.062347412109375,
-0.0281982421875,
-0.0204315185546875,
0.0038356781005859375,
0.02655029296875,
0.011199951171875,
-0.00395965576171875,
-0.015716552734375,
-0.0182342529296875,
0.0195465087890625,
-0.024993896484375,
0.004634857177734375,
-0.02593994140625,
-0.050018310546875,
0.012420654296875,
-0.0155487060546875,
0.0168914794921875,
-0.031341552734375,
-0.0269317626953125,
0.035491943359375,
-0.00823211669921875,
0.0241241455078125,
-0.0073089599609375,
0.040771484375,
-0.00983428955078125,
0.0357666015625,
-0.0166015625,
0.040283203125,
0.01139068603515625,
0.0163421630859375,
0.0193634033203125,
-0.00018322467803955078,
-0.019805908203125,
-0.0031337738037109375,
0.01202392578125,
0.0009369850158691406,
-0.00748443603515625,
0.0215606689453125,
-0.016754150390625,
0.01195526123046875,
0.0008878707885742188,
0.046875,
-0.007663726806640625,
0.0090179443359375,
0.035400390625,
-0.024658203125,
0.0205841064453125,
0.0191497802734375,
-0.034210205078125,
-0.07000732421875,
0.01123809814453125,
0.0086517333984375,
-0.0107269287109375,
-0.00827789306640625,
0.0160980224609375,
0.01439666748046875,
0.032867431640625,
0.054107666015625,
-0.003910064697265625,
-0.033660888671875,
-0.034515380859375,
-0.0180511474609375,
0.021881103515625,
-0.0229644775390625,
-0.0242156982421875,
0.002288818359375,
-0.03857421875,
-0.062744140625,
-0.01500701904296875,
-0.0244598388671875,
0.0006785392761230469,
0.0242919921875,
0.0015535354614257812,
0.00878143310546875,
0.0285186767578125,
-0.00759124755859375,
0.0003542900085449219,
0.00995635986328125,
-0.04656982421875,
0.0179595947265625,
-0.0133514404296875,
0.03778076171875,
0.0184326171875,
0.0298309326171875,
0.01244354248046875,
0.016693115234375,
-0.06256103515625,
-0.00516510009765625,
0.0261077880859375,
0.0416259765625,
0.0328369140625,
-0.04302978515625,
0.024749755859375,
0.0202178955078125,
-0.00908660888671875,
-0.04376220703125,
0.0227813720703125,
-0.06365966796875,
-0.006908416748046875,
-0.03076171875,
-0.01259613037109375,
-0.0074920654296875,
-0.053497314453125,
-0.0543212890625,
0.1044921875,
-0.0263824462890625,
0.04486083984375,
0.03466796875,
0.0241546630859375,
-0.01904296875,
0.01064300537109375,
-0.051177978515625,
0.04852294921875,
0.01690673828125,
0.052337646484375,
-0.053924560546875,
-0.013092041015625,
-0.0010862350463867188,
0.045684814453125,
0.10546875,
0.01216888427734375,
0.01050567626953125,
0.0135955810546875,
0.067626953125,
-0.010711669921875,
-0.06475830078125,
0.0338134765625,
-0.0214080810546875,
0.0181121826171875,
0.0033321380615234375,
-0.05938720703125,
0.0191802978515625,
-0.022216796875,
-0.0297393798828125,
-0.0167236328125,
-0.003253936767578125,
-0.00787353515625,
0.0259857177734375,
0.0202484130859375,
0.0236053466796875,
0.0091400146484375,
-0.01529693603515625,
-0.0213623046875,
0.013427734375,
0.0145263671875,
0.017852783203125,
0.00470733642578125,
0.0156707763671875,
-0.0224151611328125,
0.036895751953125,
0.0124053955078125,
0.00884246826171875,
0.006320953369140625,
0.0200042724609375,
0.022308349609375,
-0.0243377685546875,
-0.0008649826049804688,
0.0311737060546875,
-0.035186767578125,
0.014739990234375,
-0.015655517578125,
0.04327392578125,
-0.043060302734375,
-0.050872802734375,
0.001239776611328125,
0.021240234375,
-0.00420379638671875,
-0.021484375,
0.0175628662109375,
0.001068115234375,
0.0158538818359375,
-0.01045989990234375,
0.04119873046875,
0.006076812744140625,
0.01096343994140625,
-0.0203094482421875,
-0.01366424560546875,
0.0157012939453125,
0.0113372802734375,
0.0140533447265625,
0.0791015625,
-0.0240631103515625,
-0.038482666015625,
0.0189361572265625,
-0.0421142578125,
0.00029468536376953125,
-0.001178741455078125,
0.0014171600341796875,
0.020843505859375,
-0.0156707763671875,
0.00588226318359375,
0.034332275390625,
-0.0026645660400390625,
0.020233154296875,
-0.040252685546875,
0.007381439208984375,
-0.023529052734375,
0.0200042724609375,
0.0045318603515625,
-0.0167083740234375,
0.005260467529296875,
0.0278167724609375,
0.0011272430419921875,
-0.05755615234375,
-0.00408935546875,
0.0128326416015625,
-0.037017822265625,
-0.025360107421875,
-0.03277587890625,
-0.0269927978515625,
0.0238037109375,
-0.003963470458984375,
0.038543701171875,
-0.044219970703125,
0.061859130859375,
-0.004558563232421875,
0.0198974609375,
0.018951416015625,
0.012725830078125,
-0.043853759765625,
0.01763916015625,
-0.0732421875,
0.0240325927734375,
-0.0806884765625,
-0.01438140869140625,
-0.00830841064453125,
-0.047607421875,
0.0216522216796875,
0.0433349609375,
-0.0430908203125,
0.034332275390625,
-0.00572967529296875,
0.0254058837890625,
-0.0097503662109375,
-0.019683837890625,
0.008026123046875,
-0.0009984970092773438,
0.01983642578125,
0.00576019287109375,
-0.0244293212890625,
-0.0169830322265625,
0.036834716796875,
0.01263427734375,
-0.024688720703125,
0.06915283203125,
-0.007114410400390625,
-0.017852783203125,
-0.002452850341796875,
-0.033599853515625,
0.0322265625,
0.01284027099609375,
-0.0262298583984375,
0.0205078125,
0.007213592529296875,
-0.00879669189453125,
-0.09075927734375,
0.01885986328125,
0.048583984375,
0.0196685791015625,
0.08740234375,
-0.025177001953125,
0.00872802734375,
-0.06085205078125,
-0.0154266357421875,
-0.039215087890625,
-0.0323486328125,
-0.0279693603515625,
-0.030487060546875,
0.0130462646484375,
-0.00038552284240722656,
0.00626373291015625,
0.07025146484375,
0.04791259765625,
0.039886474609375,
-0.015655517578125,
-0.016693115234375,
0.01153564453125,
0.03302001953125,
-0.01267242431640625,
0.0312042236328125,
0.01026153564453125,
-0.0174713134765625,
0.0176849365234375,
-0.00691986083984375,
0.02496337890625,
-0.00992584228515625,
-0.0269927978515625,
-0.01398468017578125,
0.003391265869140625,
0.002017974853515625,
-0.03314208984375,
-0.0166778564453125,
0.0303955078125,
-0.028594970703125,
-0.011260986328125,
0.01556396484375,
0.004741668701171875,
0.011871337890625,
-0.029510498046875,
0.0014505386352539062,
0.0010957717895507812,
-0.018463134765625,
0.0257720947265625,
0.0019283294677734375,
0.031280517578125,
-0.0123443603515625,
-0.0014982223510742188,
-0.0048980712890625,
-0.05523681640625,
0.01218414306640625,
-0.0025634765625,
0.04010009765625,
-0.025970458984375,
-0.0151214599609375,
-0.00018465518951416016,
-0.06658935546875,
-0.032501220703125,
0.0946044921875,
-0.035400390625,
-0.0297088623046875,
0.00754547119140625,
0.0201263427734375,
-0.005710601806640625,
-0.050201416015625,
-0.03515625,
0.00922393798828125,
-0.051055908203125,
-0.029266357421875,
0.0225372314453125,
-0.0210418701171875,
0.0152587890625,
-0.0120849609375,
-0.0130767822265625,
-0.02398681640625,
-0.0160675048828125,
-0.0255584716796875,
0.0189666748046875,
0.0172576904296875,
-0.02972412109375,
-0.0274505615234375,
-0.0308837890625,
0.0120086669921875,
-0.03656005859375,
-0.042327880859375,
-0.005802154541015625,
0.016754150390625,
-0.0192108154296875,
-0.021697998046875,
-0.023773193359375,
-0.05126953125,
0.01505279541015625,
0.033905029296875,
0.018402099609375,
0.037567138671875,
0.006649017333984375,
0.03076171875,
0.03955078125,
0.03369140625,
0.0086517333984375,
-0.058837890625,
0.00843048095703125,
0.029632568359375,
0.01186370849609375,
-0.033721923828125,
0.068115234375,
0.051513671875,
0.04150390625,
-0.01025390625,
0.004291534423828125,
-0.0181732177734375,
0.0191802978515625,
0.049896240234375,
0.0638427734375,
0.006198883056640625,
-0.043487548828125,
-0.034515380859375,
-0.035675048828125,
-0.02093505859375,
0.0034351348876953125,
0.0113067626953125,
-0.05322265625,
0.0226898193359375,
0.007110595703125,
0.03936767578125,
-0.03265380859375,
-0.0192108154296875,
0.01016998291015625,
-0.037445068359375,
-0.00733184814453125,
-0.026092529296875,
0.03936767578125,
-0.020599365234375,
-0.0165557861328125,
-0.005550384521484375,
0.009979248046875,
-0.036407470703125,
0.024200439453125,
-0.015045166015625,
-0.00685882568359375,
-0.020538330078125,
0.053466796875,
-0.07666015625,
0.0033626556396484375,
-0.0004723072052001953,
0.033355712890625,
-0.062255859375,
0.0195465087890625,
0.0265045166015625,
-0.003997802734375,
-0.021820068359375,
-0.0026721954345703125,
0.0416259765625,
-0.01898193359375,
-0.027374267578125,
0.022064208984375,
0.017852783203125,
-0.002750396728515625,
-0.0032253265380859375,
0.029571533203125,
-0.0100250244140625,
-0.02679443359375,
0.0243988037109375,
-0.046783447265625,
0.00843048095703125,
-0.01214599609375,
0.01149749755859375,
-0.058837890625,
0.0496826171875,
0.0118408203125,
-0.01117706298828125,
0.036834716796875
] |
829012cfc4d9dd31be65a734cee64d8ad966d6e3
|
Wordpress Stackexchange
Q: How to use "TRUNCATE TABLE" MySQL statement? I have tried dbDelta and $wpdb->query, they does not work. Does anyone has any ideas?
A: As try today, truncate is WAY BETTER that DELETE, because DELETE broke the site, and trucate just empty the table, here is the working code :
global $wpdb;
$wpdb->query('TRUNCATE TABLE wp_posts');
|
Q: How to use "TRUNCATE TABLE" MySQL statement? I have tried dbDelta and $wpdb->query, they does not work. Does anyone has any ideas?
A: As try today, truncate is WAY BETTER that DELETE, because DELETE broke the site, and trucate just empty the table, here is the working code :
global $wpdb;
$wpdb->query('TRUNCATE TABLE wp_posts');
A: According to this forum entry, truncate does not work. I would guess that since it's such a destructive query, that it's filtered by the class. There is also this Trac Post, which if I am reading it right, disallows DDL statements.
A: I know there are similar answers above but in the above answers, the table wp_post used if by mistake someone uses that code will lose his all posts.
So sharing a correct way to truncate.
global $wpdb;
$table_name = $wpdb->base_prefix.'name_of_table_without_prefix';
$wpdb->query("TRUNCATE TABLE $table_name");
|
wordpress
|
{
"language": "en",
"length": 141,
"provenance": "stackexchange_00019.jsonl.gz:419427",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50275"
}
|
[
-0.0001735687255859375,
0.01373291015625,
-0.0237274169921875,
0.0275115966796875,
0.015869140625,
-0.036468505859375,
0.03411865234375,
-0.036529541015625,
0.07525634765625,
0.01806640625,
-0.0513916015625,
-0.0190277099609375,
0.024993896484375,
-0.011016845703125,
-0.055328369140625,
-0.024932861328125,
0.050750732421875,
-0.0501708984375,
0.027008056640625,
-0.007114410400390625,
0.0117340087890625,
0.0257568359375,
0.0355224609375,
0.009429931640625,
-0.0279388427734375,
0.00765228271484375,
0.0726318359375,
-0.0119781494140625,
-0.0171966552734375,
-0.03460693359375,
0.001552581787109375,
0.0221710205078125,
-0.0298004150390625,
0.05218505859375,
0.020965576171875,
0.039703369140625,
0.0218353271484375,
0.0355224609375,
0.0557861328125,
0.017852783203125,
0.006561279296875,
0.0125579833984375,
0.0335693359375,
0.006938934326171875,
-0.00940704345703125,
-0.033050537109375,
0.01183319091796875,
-0.017059326171875,
0.01032257080078125,
-0.014739990234375,
-0.0005807876586914062,
0.059967041015625,
0.028106689453125,
-0.054534912109375,
0.0080413818359375,
0.019073486328125,
0.00847625732421875,
-0.0113983154296875,
0.017547607421875,
0.0172882080078125,
-0.011688232421875,
0.0184326171875,
0.009979248046875,
-0.01297760009765625,
0.024078369140625,
0.0197906494140625,
0.028045654296875,
0.036376953125,
-0.00247955322265625,
0.00797271728515625,
-0.0234222412109375,
-0.018310546875,
-0.0175628662109375,
-0.00234222412109375,
-0.045867919921875,
-0.0077056884765625,
0.055145263671875,
-0.0189666748046875,
-0.0110015869140625,
0.01922607421875,
0.0005521774291992188,
-0.0023593902587890625,
-0.0643310546875,
-0.010986328125,
-0.0038700103759765625,
-0.0011548995971679688,
-0.0140228271484375,
-0.00909423828125,
-0.0294189453125,
-0.036956787109375,
-0.01537322998046875,
-0.02618408203125,
-0.048492431640625,
0.0009441375732421875,
0.0012836456298828125,
-0.0301666259765625,
0.0247650146484375,
0.021575927734375,
-0.0169525146484375,
-0.01507568359375,
-0.016326904296875,
-0.0180511474609375,
-0.032623291015625,
0.0047149658203125,
0.0290679931640625,
0.004878997802734375,
-0.0340576171875,
-0.039398193359375,
0.038787841796875,
0.031341552734375,
-0.0161285400390625,
0.0156707763671875,
-0.0164794921875,
-0.025360107421875,
-0.023223876953125,
-0.0014247894287109375,
-0.0369873046875,
0.02978515625,
0.0163421630859375,
0.0157012939453125,
-0.024993896484375,
-0.0116729736328125,
-0.03790283203125,
0.0297698974609375,
-0.0136260986328125,
-0.044921875,
-0.003910064697265625,
0.0396728515625,
0.006000518798828125,
0.021728515625,
-0.027618408203125,
0.0053558349609375,
0.06402587890625,
0.00399017333984375,
-0.01397705078125,
-0.0148162841796875,
0.016143798828125,
-0.01407623291015625,
0.00847625732421875,
-0.00200653076171875,
0.0445556640625,
-0.0245819091796875,
-0.0138702392578125,
0.02874755859375,
-0.0307464599609375,
0.0206298828125,
0.01383209228515625,
0.003498077392578125,
0.00023472309112548828,
-0.060760498046875,
-0.024566650390625,
0.005283355712890625,
-0.006969451904296875,
0.02825927734375,
0.02923583984375,
-0.039886474609375,
0.039337158203125,
-0.051544189453125,
0.0347900390625,
-0.039794921875,
0.00600433349609375,
-0.0067291259765625,
0.050018310546875,
-0.0211944580078125,
-0.04742431640625,
0.01739501953125,
-0.06793212890625,
-0.027984619140625,
0.033111572265625,
-0.015838623046875,
0.02838134765625,
-0.023895263671875,
0.037872314453125,
0.0187530517578125,
0.00809478759765625,
0.0543212890625,
-0.0113067626953125,
-0.07684326171875,
0.045989990234375,
0.0152130126953125,
-0.011474609375,
0.0081634521484375,
-0.0011072158813476562,
0.01251983642578125,
-0.0253753662109375,
0.009552001953125,
0.0244140625,
0.054595947265625,
-0.01375579833984375,
0.03167724609375,
0.027984619140625,
0.0174560546875,
-0.04302978515625,
0.051849365234375,
0.01242828369140625,
-0.057403564453125,
-0.061920166015625,
-0.0355224609375,
-0.0229339599609375,
-0.006031036376953125,
0.01279449462890625,
0.0215911865234375,
-0.0271148681640625,
-0.00682830810546875,
-0.111328125,
0.0243988037109375,
-0.04290771484375,
0.04840087890625,
-0.00801849365234375,
-0.0001308917999267578,
0.0266571044921875,
-0.01435089111328125,
-0.01554107666015625,
-0.0036163330078125,
-0.0450439453125,
-0.0206298828125,
-0.0161590576171875,
0.018798828125,
-0.00923919677734375,
0.0223541259765625,
-0.00759124755859375,
-0.0271759033203125,
-0.020843505859375,
0.0163421630859375,
0.02459716796875,
-0.04925537109375,
-0.00023305416107177734,
-0.039794921875,
0.01450347900390625,
-0.034454345703125,
0.00002676248550415039,
0.06353759765625,
0.0146942138671875,
0.04052734375,
0.00799560546875,
-0.01207733154296875,
0.037750244140625,
-0.07623291015625,
0.01971435546875,
0.037261962890625,
0.03521728515625,
0.0180511474609375,
-0.035491943359375,
-0.04736328125,
0.0297698974609375,
-0.0301971435546875,
0.0098724365234375,
-0.0221099853515625,
0.0212860107421875,
0.036224365234375,
0.0067138671875,
-0.016357421875,
0.0169677734375,
-0.010498046875,
0.0063629150390625,
0.0288238525390625,
-0.030853271484375,
0.031097412109375,
-0.0003075599670410156,
0.0050048828125,
-0.0171661376953125,
0.003387451171875,
0.032440185546875,
-0.022186279296875,
0.056793212890625,
-0.017333984375,
0.047088623046875,
0.020263671875,
-0.0036773681640625,
-0.00392913818359375,
0.006336212158203125,
-0.05206298828125,
0.0156402587890625,
0.0355224609375,
-0.07257080078125,
0.0211334228515625,
-0.034576416015625,
0.0156707763671875,
0.0160064697265625,
0.016326904296875,
0.0074615478515625,
0.0276947021484375,
-0.02032470703125,
-0.01080322265625,
0.02154541015625,
-0.0243988037109375,
-0.02294921875,
-0.006610870361328125,
-0.03753662109375,
-0.0271759033203125,
-0.0029659271240234375,
0.0565185546875,
-0.00421142578125,
0.0176544189453125,
0.010345458984375,
-0.0022525787353515625,
0.033050537109375,
-0.003520965576171875,
0.0106201171875,
-0.00640869140625,
-0.00897216796875,
0.04034423828125,
-0.00231170654296875,
-0.0026912689208984375,
0.01236724853515625,
0.0382080078125,
0.0684814453125,
-0.036895751953125,
-0.012115478515625,
0.0230712890625,
-0.05218505859375,
-0.0034923553466796875,
0.0297393798828125,
0.06829833984375,
0.01476287841796875,
-0.04229736328125,
0.01111602783203125,
0.048126220703125,
-0.05328369140625,
-0.0853271484375,
-0.02496337890625,
-0.035552978515625,
0.0007276535034179688,
-0.034912109375,
-0.01450347900390625,
0.01033782958984375,
-0.0187225341796875,
0.00106048583984375,
0.00519561767578125,
0.0106353759765625,
0.007549285888671875,
0.0025005340576171875,
-0.044219970703125,
-0.033538818359375,
0.0099945068359375,
0.02752685546875,
-0.0146026611328125,
0.052398681640625,
-0.0246124267578125,
-0.05767822265625,
-0.066162109375,
-0.0264892578125,
-0.01369476318359375,
-0.0311279296875,
0.05328369140625,
0.03546142578125,
-0.03741455078125,
0.025848388671875,
0.0236053466796875,
0.0426025390625,
-0.08868408203125,
-0.030487060546875,
0.03912353515625,
0.0181732177734375,
0.05279541015625,
-0.0419921875,
-0.055633544921875,
0.038055419921875,
-0.0186767578125,
-0.04473876953125,
-0.005161285400390625,
-0.01520538330078125,
-0.029327392578125,
-0.0164642333984375,
-0.0007162094116210938,
0.01398468017578125,
-0.0292816162109375,
0.024505615234375,
0.06549072265625,
0.044158935546875,
0.0162200927734375,
0.0305023193359375,
-0.0005068778991699219,
0.01073455810546875,
0.039825439453125,
-0.036163330078125,
0.0106658935546875,
-0.035552978515625,
-0.0379638671875,
-0.007534027099609375,
-0.01174163818359375,
0.0060882568359375,
-0.04107666015625,
-0.0208587646484375,
-0.0198974609375,
0.0390625,
0.0210418701171875,
0.0467529296875,
-0.01275634765625,
-0.036163330078125,
-0.005809783935546875,
0.066162109375,
0.012237548828125,
-0.040740966796875,
0.0021038055419921875,
0.01087188720703125,
-0.0208282470703125,
-0.00402069091796875,
-0.00579833984375,
-0.0097198486328125,
-0.02850341796875,
-0.019805908203125,
-0.015167236328125,
-0.0190887451171875,
-0.0216522216796875,
-0.006755828857421875,
-0.0268707275390625,
-0.0299530029296875,
0.019073486328125,
-0.038665771484375,
-0.0016489028930664062,
0.006580352783203125,
-0.0288238525390625,
-0.0054931640625,
0.005584716796875,
-0.061859130859375,
-0.054412841796875,
-0.0186614990234375,
-0.01617431640625,
0.02362060546875,
0.02587890625,
-0.0005102157592773438,
-0.01617431640625,
0.0203094482421875,
0.0153961181640625,
0.0232086181640625,
-0.0374755859375,
-0.0159912109375,
-0.053192138671875,
-0.00010186433792114258,
-0.01055145263671875,
-0.0223388671875,
-0.01947021484375,
-0.0650634765625,
0.013427734375,
0.017974853515625,
-0.0113677978515625,
0.0550537109375,
-0.046844482421875,
0.0294036865234375,
-0.02069091796875,
-0.0150604248046875,
-0.050994873046875,
0.0036869049072265625,
-0.044769287109375,
0.0005159378051757812,
-0.0036029815673828125,
-0.05230712890625,
0.07025146484375,
0.05242919921875,
0.0088348388671875,
-0.0090789794921875,
0.051513671875,
-0.004535675048828125,
-0.058807373046875,
-0.08587646484375,
0.0003654956817626953,
0.024993896484375,
-0.00775146484375,
0.039031982421875,
0.00140380859375,
-0.01548004150390625,
0.0784912109375,
0.005847930908203125,
-0.0286407470703125,
-0.04364013671875,
0.035308837890625,
-0.0008974075317382812,
-0.0098114013671875,
-0.005901336669921875,
-0.043914794921875,
0.060699462890625,
0.0272674560546875,
-0.00414276123046875,
0.0154571533203125,
-0.004131317138671875,
0.033843994140625,
0.01910400390625,
-0.04486083984375,
-0.0545654296875,
-0.031646728515625,
0.01279449462890625,
-0.00226593017578125,
-0.0021495819091796875,
0.0207672119140625,
-0.006160736083984375,
0.0036334991455078125,
0.00641632080078125,
0.0283203125,
-0.0240020751953125,
0.044769287109375,
-0.042816162109375,
0.0418701171875,
-0.0012722015380859375,
0.005645751953125,
-0.041290283203125,
-0.018096923828125,
0.07330322265625,
0.0234527587890625,
-0.033111572265625,
-0.01197052001953125,
-0.0254974365234375,
0.0286865234375,
-0.01085662841796875,
0.0245208740234375,
0.0213623046875,
0.004367828369140625,
-0.028411865234375,
-0.0036411285400390625,
0.01544952392578125,
-0.0091094970703125,
-0.0289459228515625,
0.01568603515625,
0.017425537109375,
-0.005397796630859375,
0.00914764404296875,
0.06854248046875,
0.0009813308715820312,
0.037200927734375,
-0.01337432861328125,
0.04034423828125,
0.01456451416015625,
0.038818359375,
-0.00991058349609375,
0.003753662109375,
0.0137939453125,
0.02508544921875,
-0.00022470951080322266,
-0.043212890625,
-0.035736083984375,
0.0215606689453125,
0.04486083984375,
-0.0285186767578125,
-0.021331787109375,
0.03094482421875,
-0.0255126953125,
-0.01617431640625,
0.03564453125,
0.01561737060546875,
-0.05328369140625,
-0.007598876953125,
0.024261474609375,
0.0290069580078125,
-0.017852783203125,
0.00891876220703125,
-0.00988006591796875,
-0.04974365234375,
0.013092041015625,
-0.01421356201171875,
0.023223876953125,
-0.03179931640625,
-0.040924072265625,
-0.005687713623046875,
-0.058990478515625,
-0.032501220703125,
0.049041748046875,
0.027252197265625,
-0.0091094970703125,
-0.0218963623046875,
-0.0164337158203125,
-0.001560211181640625,
0.02117919921875,
-0.03631591796875,
-0.0004973411560058594,
-0.003326416015625,
-0.023895263671875,
0.10040283203125,
0.05194091796875,
-0.00007581710815429688,
-0.0222625732421875,
-0.06451416015625,
-0.0313720703125,
-0.0323486328125,
-0.0269775390625,
-0.036773681640625,
0.0034236907958984375,
0.01242828369140625,
-0.0033512115478515625,
0.006488800048828125,
-0.01690673828125,
-0.029510498046875,
0.0338134765625,
0.033905029296875,
0.005077362060546875,
0.01064300537109375,
0.03033447265625,
-0.018951416015625,
0.0271759033203125,
0.03289794921875,
0.0491943359375,
0.0178680419921875,
-0.053192138671875,
0.0513916015625,
-0.0166168212890625,
-0.048431396484375,
-0.03387451171875,
-0.03173828125,
-0.059600830078125,
-0.0106658935546875,
-0.025848388671875,
0.0166473388671875,
-0.032440185546875,
-0.005924224853515625,
-0.0200042724609375,
0.04217529296875,
-0.0535888671875,
0.0311126708984375,
-0.0135040283203125,
-0.0034236907958984375,
0.0031261444091796875,
-0.0304718017578125,
-0.0283966064453125,
0.006511688232421875,
-0.010223388671875,
-0.020599365234375,
0.0190887451171875,
-0.0220947265625,
0.038665771484375,
0.06500244140625,
0.01186370849609375,
0.0257568359375,
0.00800323486328125,
-0.0030364990234375,
0.0016469955444335938,
-0.015106201171875,
-0.042388916015625,
0.0138397216796875,
0.0400390625,
0.005023956298828125,
-0.03326416015625,
0.0225067138671875,
-0.02764892578125,
0.03350830078125,
0.0655517578125,
0.0960693359375,
-0.09576416015625,
0.017120361328125,
0.036285400390625,
-0.0165863037109375,
-0.016693115234375,
-0.0157012939453125,
-0.01172637939453125,
0.01483917236328125,
-0.023223876953125,
0.043365478515625,
-0.049041748046875,
-0.031463623046875,
0.04473876953125,
0.004119873046875,
0.006866455078125,
0.03118896484375,
0.025970458984375,
-0.058135986328125,
0.038818359375,
0.056243896484375,
0.024017333984375,
-0.042572021484375,
0.02178955078125,
-0.012237548828125,
0.01464080810546875,
-0.03240966796875,
0.055938720703125,
0.0024013519287109375,
0.01291656494140625,
0.0152740478515625,
-0.0032806396484375,
-0.016510009765625,
0.0341796875,
-0.03057861328125,
0.01087188720703125,
0.004817962646484375,
-0.007106781005859375,
-0.076416015625,
-0.036163330078125,
0.043121337890625,
0.0250244140625,
-0.0504150390625,
0.041656494140625,
-0.0435791015625,
-0.034271240234375,
-0.00616455078125,
-0.01580810546875,
0.06353759765625,
-0.0653076171875,
0.00785064697265625,
0.01535797119140625,
0.02130126953125,
0.0141448974609375,
-0.005001068115234375,
-0.018951416015625,
-0.03863525390625,
0.01373291015625,
-0.0141143798828125,
0.0026454925537109375,
0.04254150390625,
0.0207061767578125,
-0.04852294921875,
0.08746337890625,
-0.004360198974609375,
-0.00514984130859375,
-0.00455474853515625,
0.046966552734375,
-0.017547607421875,
0.0230865478515625,
-0.033233642578125,
0.03717041015625,
-0.038116455078125,
0.0307464599609375,
-0.02679443359375,
0.0307769775390625,
0.01493072509765625,
-0.01444244384765625,
0.0103912353515625,
-0.0130157470703125,
0.00958251953125,
-0.0026683807373046875,
0.06170654296875,
0.03204345703125,
0.0179901123046875,
0.0019159317016601562,
-0.016693115234375,
0.01690673828125,
0.050506591796875,
-0.023101806640625,
0.040008544921875,
-0.0081024169921875,
-0.015960693359375,
-0.004299163818359375,
-0.0019855499267578125,
-0.0005784034729003906,
0.01247406005859375,
-0.01812744140625,
0.018096923828125,
-0.003688812255859375,
-0.0161895751953125,
-0.0229644775390625,
-0.00942230224609375,
0.0467529296875,
0.05322265625,
-0.0843505859375,
-0.0673828125,
-0.029815673828125,
0.042724609375,
0.00754547119140625,
0.0355224609375,
0.05950927734375,
0.0155792236328125,
0.047027587890625,
-0.023040771484375,
-0.0012912750244140625,
-0.02630615234375,
0.00429534912109375,
0.047027587890625,
0.0291900634765625,
0.0281982421875,
-0.03851318359375,
-0.0236663818359375,
0.0304718017578125,
0.06787109375,
-0.040863037109375,
-0.03131103515625,
-0.004161834716796875,
-0.01861572265625,
-0.003910064697265625,
-0.004550933837890625,
-0.0038852691650390625,
0.0257415771484375,
0.0300750732421875,
0.0168914794921875,
-0.00872802734375,
0.01535797119140625,
-0.009857177734375,
0.0191192626953125,
0.036163330078125,
-0.0016279220581054688,
0.006496429443359375,
-0.0012693405151367188,
-0.008087158203125,
0.0114593505859375,
0.02386474609375,
0.007106781005859375,
0.008392333984375,
-0.0186920166015625,
-0.0027637481689453125,
0.0096282958984375,
-0.0023250579833984375,
-0.006412506103515625,
-0.00003331899642944336,
-0.0538330078125,
-0.057403564453125,
0.0221405029296875,
0.052520751953125,
-0.017547607421875,
-0.00827789306640625,
0.044647216796875,
0.053314208984375,
-0.03265380859375,
-0.02288818359375,
0.0261993408203125,
-0.0283050537109375,
-0.01250457763671875,
-0.01149749755859375,
0.0200042724609375,
0.004199981689453125,
0.0201568603515625,
-0.0280914306640625,
0.089599609375,
-0.026763916015625,
-0.021484375,
0.01401519775390625,
0.0022144317626953125,
0.0093231201171875,
0.050079345703125,
0.0022640228271484375,
0.0003731250762939453,
0.004047393798828125,
-0.03936767578125,
-0.0081634521484375,
-0.0198516845703125,
0.0160980224609375,
0.00099945068359375,
0.0233001708984375,
-0.0033855438232421875,
0.0201873779296875,
-0.001613616943359375,
0.0036602020263671875,
-0.0034236907958984375,
0.03961181640625,
-0.049957275390625,
-0.006977081298828125,
0.06524658203125,
-0.005077362060546875,
-0.032623291015625,
-0.03656005859375,
-0.00951385498046875,
0.050506591796875,
-0.022857666015625,
0.031341552734375,
-0.0242919921875,
0.0243988037109375,
-0.03302001953125,
0.032470703125,
-0.03704833984375,
-0.002689361572265625,
-0.003765106201171875,
0.0283966064453125,
0.0209808349609375,
-0.0240325927734375,
-0.034912109375,
0.0279998779296875,
0.02618408203125,
-0.0276947021484375,
0.006805419921875,
-0.0012445449829101562,
0.020751953125,
-0.0115966796875,
0.003490447998046875,
-0.021209716796875,
0.0167388916015625,
0.0380859375,
0.00013244152069091797,
0.023773193359375,
0.00360107421875,
0.015960693359375,
0.0255889892578125,
-0.02801513671875,
-0.032562255859375,
0.01454925537109375,
-0.04351806640625,
0.03155517578125,
0.034332275390625,
-0.015960693359375,
0.0235595703125,
0.02215576171875,
-0.01806640625,
0.02392578125,
0.0133209228515625,
-0.013824462890625,
0.0225982666015625,
-0.01491546630859375,
-0.019989013671875,
-0.01136016845703125,
0.04595947265625,
0.03790283203125,
-0.0013990402221679688,
-0.06201171875,
-0.0011205673217773438,
-0.0275115966796875,
0.0146484375,
-0.0257415771484375,
0.00347137451171875,
-0.0292510986328125,
-0.00269317626953125,
-0.0101470947265625,
-0.0614013671875,
-0.063232421875,
-0.0273590087890625,
0.0234832763671875,
0.0304107666015625,
-0.0906982421875,
0.050537109375,
-0.0020313262939453125,
-0.0250396728515625,
-0.004550933837890625,
-0.05194091796875,
-0.00792694091796875,
0.02203369140625,
0.0025005340576171875,
-0.04815673828125,
-0.048919677734375,
0.0276336669921875,
-0.0584716796875,
0.04864501953125,
0.040283203125,
-0.054443359375,
0.0117340087890625,
0.03497314453125,
0.052703857421875,
0.0826416015625,
0.062744140625,
-0.016021728515625,
0.0489501953125,
0.0007381439208984375,
-0.0233001708984375,
-0.04571533203125,
-0.00785064697265625,
-0.0391845703125,
0.0146942138671875,
-0.044281005859375,
-0.0052337646484375,
0.005939483642578125,
-0.0408935546875,
-0.0899658203125,
0.05450439453125,
-0.02679443359375,
-0.028411865234375,
0.01418304443359375,
-0.022247314453125,
-0.007343292236328125,
0.004032135009765625,
0.01995849609375,
-0.04754638671875,
-0.058349609375,
-0.0159912109375,
0.0167236328125,
0.048675537109375,
-0.0088348388671875,
0.01261138916015625,
-0.0162353515625,
0.0302276611328125,
0.0161895751953125,
0.025360107421875,
-0.005035400390625,
-0.000027000904083251953,
0.0173797607421875,
0.0528564453125,
-0.003963470458984375,
-0.003223419189453125,
-0.00856781005859375,
-0.031707763671875,
0.0004215240478515625,
-0.0086212158203125,
-0.01502227783203125,
0.0108489990234375,
0.034637451171875,
0.05950927734375,
0.010284423828125,
-0.06475830078125,
-0.0213470458984375,
-0.0088348388671875,
-0.006412506103515625,
-0.0177001953125,
0.03399658203125,
-0.07672119140625,
-0.0263824462890625,
0.015838623046875,
-0.004016876220703125,
0.00225067138671875,
-0.0294647216796875,
-0.0110015869140625,
-0.00534820556640625,
0.0208587646484375,
0.004352569580078125,
0.004352569580078125,
0.03228759765625,
0.036376953125,
-0.0404052734375,
-0.034942626953125,
-0.0047607421875,
0.00001990795135498047,
-0.0119476318359375,
-0.0290069580078125,
-0.0048980712890625,
0.0033779144287109375,
-0.0259552001953125,
0.0027561187744140625,
-0.004150390625,
0.005680084228515625,
-0.01465606689453125,
-0.011077880859375,
-0.0015125274658203125,
0.0318603515625,
0.0036373138427734375,
0.055389404296875,
-0.00402069091796875,
0.04937744140625,
0.015716552734375,
0.00789642333984375,
0.0018415451049804688,
0.013641357421875,
-0.012969970703125,
0.054901123046875,
0.0122833251953125,
-0.036285400390625,
0.041412353515625,
-0.0245819091796875,
0.004360198974609375,
0.005779266357421875,
0.04388427734375,
-0.0625,
0.043304443359375,
0.002017974853515625,
0.02935791015625,
0.0355224609375
] |
ef79d0acf8635c8ebbac8914526c02f20583fbfa
|
Wordpress Stackexchange
Q: Override user authentication with external credentials I'm working on a site running WordPress along with a vBulletin forum. The user base is registered on vBulletin. I need to allow users to appear logged in on WordPress as well for the sole purpose of posting comments with their forum user.
The user must not be replicated on WordPress, so every solution involving the creation of users in the WordPress database is not applicable.
Users recognized in this way need not have any admin or publishing privileges, only the ability to comment so that their comment appears under their forum username.
I had written a simple plugin which was working on an older version, but it's not working anymore with the most recent version of WordPress (3.3.2 at the moment). That solution relied on overriding the pluggable functions wp_validate_auth_cookie and get_userdata.
What are the correct steps to take in order to implement this functionality?
A: There should be no problem with any normal WordPress-vBulletin bridge which syncs user data between the two platforms. Just make sure that synced users have the default role of "Subscriber". This allows them to only post comments, and not to create or edit posts.
|
Q: Override user authentication with external credentials I'm working on a site running WordPress along with a vBulletin forum. The user base is registered on vBulletin. I need to allow users to appear logged in on WordPress as well for the sole purpose of posting comments with their forum user.
The user must not be replicated on WordPress, so every solution involving the creation of users in the WordPress database is not applicable.
Users recognized in this way need not have any admin or publishing privileges, only the ability to comment so that their comment appears under their forum username.
I had written a simple plugin which was working on an older version, but it's not working anymore with the most recent version of WordPress (3.3.2 at the moment). That solution relied on overriding the pluggable functions wp_validate_auth_cookie and get_userdata.
What are the correct steps to take in order to implement this functionality?
A: There should be no problem with any normal WordPress-vBulletin bridge which syncs user data between the two platforms. Just make sure that synced users have the default role of "Subscriber". This allows them to only post comments, and not to create or edit posts.
A: Have you tried Disqus?
They have a plugin that essentially "hijacks" the WP comments function and allows anonymous posting I am fairly certain that it will sync with the user database if they want to post as their WP username.
I have not used it yet but it's on my todo list to implement so unfortunately I can't run you through an install.
|
wordpress
|
{
"language": "en",
"length": 262,
"provenance": "stackexchange_00019.jsonl.gz:419430",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50281"
}
|
[
0.09490966796875,
0.0289154052734375,
-0.00931549072265625,
-0.0228271484375,
0.043426513671875,
-0.0474853515625,
0.0682373046875,
-0.037750244140625,
-0.0239410400390625,
0.02996826171875,
-0.0146484375,
-0.0158538818359375,
-0.0025691986083984375,
-0.01385498046875,
-0.0145111083984375,
-0.045166015625,
0.0028533935546875,
0.040985107421875,
0.0380859375,
-0.021697998046875,
0.022216796875,
-0.01027679443359375,
-0.00453948974609375,
0.0057373046875,
0.01255035400390625,
-0.040863037109375,
0.08770751953125,
-0.038177490234375,
0.048736572265625,
0.0263824462890625,
0.032196044921875,
-0.08392333984375,
-0.002643585205078125,
0.056396484375,
-0.050048828125,
-0.03009033203125,
0.0219268798828125,
0.0232086181640625,
0.0138092041015625,
0.0296173095703125,
0.048583984375,
-0.01363372802734375,
0.0024700164794921875,
0.038543701171875,
-0.0266265869140625,
-0.049072265625,
0.051910400390625,
-0.0257720947265625,
0.04736328125,
0.0455322265625,
-0.0105438232421875,
0.046661376953125,
-0.01531982421875,
0.020233154296875,
-0.0098876953125,
-0.0081787109375,
-0.0635986328125,
0.0280303955078125,
0.031951904296875,
0.0010900497436523438,
-0.008575439453125,
-0.0391845703125,
0.0077972412109375,
-0.0134124755859375,
0.04119873046875,
-0.0189056396484375,
-0.01062774658203125,
0.04486083984375,
-0.01197052001953125,
0.040313720703125,
0.0221405029296875,
-0.032073974609375,
0.01052093505859375,
-0.01055145263671875,
-0.042938232421875,
-0.00972747802734375,
0.0224761962890625,
0.014892578125,
0.00876617431640625,
-0.0128936767578125,
-0.03369140625,
0.018890380859375,
-0.029296875,
-0.03411865234375,
-0.017669677734375,
-0.022125244140625,
-0.0244903564453125,
0.005672454833984375,
-0.0079498291015625,
-0.0024471282958984375,
-0.01175689697265625,
-0.054229736328125,
0.0170135498046875,
0.03082275390625,
-0.019683837890625,
0.0010976791381835938,
0.022125244140625,
0.03375244140625,
-0.0108489990234375,
0.011566162109375,
-0.00714111328125,
-0.031646728515625,
-0.000047147274017333984,
-0.0249176025390625,
-0.00698089599609375,
0.0435791015625,
-0.023681640625,
0.0086669921875,
0.0010395050048828125,
0.0316162109375,
0.00246429443359375,
-0.0748291015625,
-0.0159454345703125,
-0.04962158203125,
-0.0015287399291992188,
0.0295562744140625,
-0.0262298583984375,
-0.0006470680236816406,
0.017333984375,
-0.0171051025390625,
-0.0196685791015625,
0.0097198486328125,
-0.033660888671875,
-0.006458282470703125,
-0.0017938613891601562,
-0.030029296875,
-0.00383758544921875,
0.032440185546875,
-0.0158843994140625,
0.04296875,
-0.0229339599609375,
-0.00160980224609375,
0.044891357421875,
0.0265350341796875,
-0.000042319297790527344,
-0.0227203369140625,
0.06414794921875,
-0.033935546875,
-0.023040771484375,
0.030792236328125,
-0.0019102096557617188,
-0.0217437744140625,
-0.01239776611328125,
-0.020050048828125,
-0.033966064453125,
0.03228759765625,
0.0251922607421875,
-0.00809478759765625,
-0.0167694091796875,
-0.040191650390625,
-0.058746337890625,
0.00138092041015625,
-0.0189666748046875,
-0.01140594482421875,
0.083740234375,
-0.04632568359375,
0.015869140625,
-0.03887939453125,
0.07489013671875,
0.02569580078125,
0.00496673583984375,
-0.0172882080078125,
-0.0011892318725585938,
-0.0379638671875,
-0.059539794921875,
0.0071868896484375,
-0.0140838623046875,
-0.007717132568359375,
0.034881591796875,
0.017486572265625,
0.0069580078125,
-0.0018329620361328125,
0.06207275390625,
0.037841796875,
0.00446319580078125,
0.02117919921875,
-0.024139404296875,
0.07940673828125,
0.016082763671875,
-0.01232147216796875,
0.004924774169921875,
-0.033935546875,
0.09283447265625,
-0.01561737060546875,
-0.039154052734375,
0.0016050338745117188,
0.02362060546875,
0.043243408203125,
0.0038585662841796875,
0.02777099609375,
0.0262451171875,
0.005706787109375,
-0.0400390625,
0.029022216796875,
-0.02783203125,
-0.0250701904296875,
0.0299835205078125,
0.01224517822265625,
-0.018798828125,
0.013702392578125,
0.06494140625,
0.01261138916015625,
-0.0102386474609375,
-0.04608154296875,
-0.06939697265625,
-0.004741668701171875,
-0.01377105712890625,
0.0321044921875,
0.0264739990234375,
0.0261688232421875,
-0.0065155029296875,
-0.005710601806640625,
-0.01080322265625,
0.0154876708984375,
-0.017181396484375,
-0.0009045600891113281,
-0.00405120849609375,
0.057342529296875,
-0.002490997314453125,
0.06353759765625,
-0.02398681640625,
-0.04986572265625,
-0.019195556640625,
-0.0191192626953125,
0.0472412109375,
-0.0260467529296875,
0.0084686279296875,
-0.034210205078125,
0.061126708984375,
-0.00335693359375,
0.0103912353515625,
0.00014507770538330078,
-0.02496337890625,
-0.0015621185302734375,
-0.051544189453125,
-0.002811431884765625,
-0.031768798828125,
0.01119232177734375,
0.003688812255859375,
0.045074462890625,
0.035919189453125,
-0.0269927978515625,
0.0028667449951171875,
0.00994110107421875,
0.003265380859375,
-0.0199127197265625,
0.0264739990234375,
-0.0176239013671875,
0.04052734375,
0.05072021484375,
-0.00548553466796875,
-0.005443572998046875,
0.037139892578125,
-0.039703369140625,
0.0037994384765625,
0.051025390625,
-0.00946044921875,
-0.003993988037109375,
0.00830078125,
-0.006153106689453125,
0.00644683837890625,
-0.04034423828125,
-0.00887298583984375,
-0.0165252685546875,
-0.026153564453125,
-0.049530029296875,
-0.006740570068359375,
-0.023834228515625,
0.02349853515625,
-0.07391357421875,
0.0204925537109375,
-0.00514984130859375,
0.0010395050048828125,
0.03863525390625,
0.0343017578125,
0.0036830902099609375,
-0.0240325927734375,
-0.01108551025390625,
0.0018024444580078125,
0.015869140625,
-0.013671875,
-0.01146697998046875,
-0.006465911865234375,
-0.0017910003662109375,
-0.000044465065002441406,
-0.0350341796875,
0.021026611328125,
0.0205078125,
-0.0261688232421875,
-0.043670654296875,
-0.01184844970703125,
0.02178955078125,
-0.023345947265625,
0.047271728515625,
-0.0217132568359375,
-0.0185546875,
-0.0012617111206054688,
-0.097900390625,
0.0789794921875,
-0.064697265625,
-0.00423431396484375,
0.07659912109375,
0.0158233642578125,
-0.007232666015625,
-0.0161895751953125,
-0.007625579833984375,
-0.016204833984375,
0.01282501220703125,
-0.005367279052734375,
-0.07470703125,
0.033660888671875,
0.029571533203125,
0.01059722900390625,
0.0139007568359375,
-0.00789642333984375,
-0.033111572265625,
-0.00614166259765625,
0.0233917236328125,
-0.0159759521484375,
0.0029506683349609375,
-0.027069091796875,
-0.046966552734375,
0.00800323486328125,
0.0008463859558105469,
-0.007373809814453125,
0.00368499755859375,
0.0298614501953125,
0.007419586181640625,
-0.017425537109375,
0.00273895263671875,
-0.0023288726806640625,
-0.0275726318359375,
-0.041351318359375,
-0.02276611328125,
-0.008575439453125,
-0.002597808837890625,
0.005558013916015625,
-0.0138092041015625,
-0.0038242340087890625,
-0.01171875,
0.00722503662109375,
0.0163726806640625,
-0.004638671875,
-0.05242919921875,
-0.01192474365234375,
-0.0175018310546875,
-0.0131072998046875,
0.004405975341796875,
-0.032684326171875,
-0.0236968994140625,
0.0166473388671875,
-0.01922607421875,
0.016815185546875,
-0.00518035888671875,
-0.0024356842041015625,
-0.0023021697998046875,
0.000005066394805908203,
0.017822265625,
-0.00685882568359375,
-0.0247955322265625,
0.0171356201171875,
0.0138092041015625,
-0.020416259765625,
-0.040679931640625,
-0.0002765655517578125,
-0.023223876953125,
-0.0027008056640625,
-0.0212249755859375,
0.0215606689453125,
0.02166748046875,
0.013580322265625,
-0.0299072265625,
0.0233612060546875,
0.013702392578125,
0.010528564453125,
-0.018035888671875,
0.01145172119140625,
-0.022308349609375,
-0.01251220703125,
-0.018585205078125,
0.019927978515625,
-0.0032520294189453125,
0.022705078125,
-0.0182342529296875,
-0.036651611328125,
0.03399658203125,
-0.024658203125,
0.031280517578125,
-0.048553466796875,
-0.0150909423828125,
-0.01335906982421875,
0.0849609375,
-0.0202484130859375,
0.002079010009765625,
0.0195465087890625,
0.0006394386291503906,
-0.031646728515625,
0.0157623291015625,
-0.08843994140625,
-0.00714874267578125,
0.0391845703125,
-0.0167083740234375,
0.0011730194091796875,
-0.01364898681640625,
0.0236358642578125,
-0.037689208984375,
0.0244598388671875,
-0.0172119140625,
0.004016876220703125,
-0.0160369873046875,
0.017791748046875,
0.00019979476928710938,
0.008209228515625,
-0.0191497802734375,
0.02056884765625,
-0.05194091796875,
-0.08258056640625,
-0.021575927734375,
-0.032470703125,
0.08197021484375,
0.01203155517578125,
-0.010650634765625,
-0.01503753662109375,
0.036529541015625,
-0.01313018798828125,
-0.006671905517578125,
-0.01043701171875,
0.01100921630859375,
-0.0285186767578125,
0.00827789306640625,
-0.03485107421875,
-0.01105499267578125,
0.025482177734375,
-0.01398468017578125,
-0.033843994140625,
-0.0277099609375,
-0.053985595703125,
-0.0236358642578125,
-0.01482391357421875,
-0.029510498046875,
-0.031768798828125,
-0.047393798828125,
-0.01462554931640625,
-0.0021190643310546875,
-0.003948211669921875,
-0.01690673828125,
-0.045654296875,
-0.00778961181640625,
0.0263671875,
-0.00516510009765625,
0.00328826904296875,
0.00243377685546875,
0.041351318359375,
0.0141448974609375,
-0.01241302490234375,
0.02880859375,
-0.006717681884765625,
0.0361328125,
0.011260986328125,
0.0205535888671875,
0.0009002685546875,
-0.030059814453125,
0.0264434814453125,
0.0237884521484375,
0.007778167724609375,
-0.005283355712890625,
0.032073974609375,
-0.01157379150390625,
-0.0294189453125,
0.031036376953125,
-0.0084075927734375,
-0.007160186767578125,
-0.01340484619140625,
0.021087646484375,
0.01309967041015625,
0.01873779296875,
-0.0018644332885742188,
0.043365478515625,
-0.048431396484375,
-0.0043182373046875,
-0.0296630859375,
0.0140533447265625,
-0.06561279296875,
-0.00838470458984375,
0.002315521240234375,
0.002685546875,
-0.01390838623046875,
0.01442718505859375,
-0.0266876220703125,
-0.003086090087890625,
-0.007781982421875,
-0.0249786376953125,
0.007587432861328125,
-0.0037860870361328125,
-0.032257080078125,
-0.006496429443359375,
-0.019317626953125,
0.10150146484375,
-0.0131378173828125,
-0.08966064453125,
0.0271759033203125,
-0.0038051605224609375,
0.0770263671875,
0.07177734375,
0.0182647705078125,
0.038177490234375,
-0.04876708984375,
-0.01708984375,
-0.003635406494140625,
-0.02166748046875,
-0.03570556640625,
-0.03350830078125,
-0.0001971721649169922,
-0.01110076904296875,
0.0028476715087890625,
0.02862548828125,
0.032684326171875,
-0.020477294921875,
0.032135009765625,
-0.01505279541015625,
0.059661865234375,
0.037689208984375,
0.032806396484375,
0.00585174560546875,
0.01052093505859375,
-0.0016918182373046875,
0.01311492919921875,
-0.018402099609375,
-0.019012451171875,
-0.03558349609375,
0.032867431640625,
0.00836181640625,
0.040924072265625,
0.04229736328125,
-0.035919189453125,
0.00849151611328125,
0.0130157470703125,
0.0283050537109375,
0.013275146484375,
-0.01039886474609375,
-0.01104736328125,
-0.041259765625,
0.0277252197265625,
-0.03875732421875,
0.0125732421875,
-0.028533935546875,
0.0008459091186523438,
-0.01447296142578125,
0.0545654296875,
-0.03973388671875,
-0.0092315673828125,
-0.0178070068359375,
-0.02056884765625,
-0.0283203125,
-0.01183319091796875,
-0.0186767578125,
-0.00872039794921875,
-0.00862884521484375,
-0.011322021484375,
0.01332855224609375,
-0.032989501953125,
0.0017976760864257812,
-0.038238525390625,
0.0233612060546875,
-0.00777435302734375,
0.00041866302490234375,
0.08038330078125,
0.049896240234375,
-0.0455322265625,
-0.0189361572265625,
-0.0386962890625,
-0.0136566162109375,
0.0014286041259765625,
-0.0364990234375,
-0.0304107666015625,
-0.0015802383422851562,
0.01355743408203125,
0.0132293701171875,
-0.0043182373046875,
-0.012786865234375,
-0.044677734375,
0.0303802490234375,
0.045257568359375,
0.058868408203125,
-0.0241851806640625,
0.06494140625,
0.01654052734375,
0.0058135986328125,
0.0023651123046875,
0.04754638671875,
-0.0242462158203125,
0.0024318695068359375,
0.00675201416015625,
-0.01549530029296875,
-0.02569580078125,
-0.023345947265625,
-0.02557373046875,
0.0256805419921875,
0.080078125,
-0.007251739501953125,
0.023345947265625,
-0.033721923828125,
0.0009751319885253906,
-0.012725830078125,
0.0523681640625,
-0.0238800048828125,
0.01383209228515625,
-0.0011701583862304688,
-0.002246856689453125,
0.03350830078125,
-0.0281219482421875,
-0.019989013671875,
0.0030422210693359375,
0.00279998779296875,
0.0213775634765625,
0.007038116455078125,
-0.062286376953125,
0.0347900390625,
0.04180908203125,
-0.003604888916015625,
0.036346435546875,
-0.0046844482421875,
0.00885009765625,
0.051025390625,
0.022857666015625,
-0.0384521484375,
-0.00036144256591796875,
0.027923583984375,
0.004940032958984375,
-0.0276031494140625,
-0.003154754638671875,
-0.0183563232421875,
0.038238525390625,
0.06201171875,
0.0853271484375,
-0.10443115234375,
0.01690673828125,
0.00958251953125,
-0.0036716461181640625,
0.051177978515625,
0.007099151611328125,
-0.015167236328125,
0.0026950836181640625,
0.0606689453125,
-0.00421905517578125,
0.004604339599609375,
0.038116455078125,
0.01702880859375,
-0.01129150390625,
-0.01207733154296875,
0.02734375,
0.0248870849609375,
0.044952392578125,
-0.00690460205078125,
-0.01540374755859375,
0.041473388671875,
-0.0153656005859375,
-0.038055419921875,
0.0202789306640625,
-0.058319091796875,
-0.09649658203125,
-0.029693603515625,
-0.03887939453125,
-0.008636474609375,
0.035247802734375,
-0.01629638671875,
0.0648193359375,
0.0233001708984375,
0.004055023193359375,
0.0046234130859375,
-0.0180206298828125,
0.03436279296875,
0.0242767333984375,
-0.04071044921875,
-0.013916015625,
0.0182952880859375,
-0.0108489990234375,
0.0024738311767578125,
0.017852783203125,
-0.0304718017578125,
-0.0206451416015625,
-0.020477294921875,
0.051239013671875,
-0.038848876953125,
-0.0012969970703125,
0.029754638671875,
0.0176239013671875,
-0.0108642578125,
-0.0006299018859863281,
0.01177215576171875,
-0.0657958984375,
-0.035430908203125,
0.0008635520935058594,
-0.0560302734375,
-0.0157928466796875,
-0.01013946533203125,
-0.08984375,
0.1173095703125,
-0.005100250244140625,
0.051025390625,
-0.0138397216796875,
0.022796630859375,
-0.0167083740234375,
0.0107421875,
-0.04693603515625,
0.0386962890625,
0.0058441162109375,
0.06622314453125,
-0.03277587890625,
-0.021881103515625,
0.0224456787109375,
0.0186920166015625,
0.0792236328125,
0.0223541259765625,
-0.053558349609375,
-0.0276031494140625,
0.00769805908203125,
0.03564453125,
-0.020111083984375,
0.033599853515625,
-0.0053253173828125,
0.00804901123046875,
-0.00039196014404296875,
-0.043487548828125,
0.013702392578125,
-0.050018310546875,
0.002300262451171875,
0.015167236328125,
-0.006183624267578125,
-0.0269775390625,
0.005153656005859375,
0.048248291015625,
-0.0718994140625,
0.0028324127197265625,
0.043670654296875,
-0.0023059844970703125,
0.005367279052734375,
0.0047760009765625,
0.024688720703125,
-0.01369476318359375,
-0.007656097412109375,
-0.0165863037109375,
0.0394287109375,
0.010833740234375,
-0.01361083984375,
0.0703125,
0.036163330078125,
-0.030029296875,
-0.034454345703125,
-0.0032806396484375,
-0.0236968994140625,
-0.022796630859375,
-0.0003752708435058594,
0.032928466796875,
0.03363037109375,
-0.01238250732421875,
-0.004352569580078125,
0.037384033203125,
0.0258636474609375,
-0.02130126953125,
-0.02252197265625,
0.003871917724609375,
-0.0027790069580078125,
0.0261077880859375,
0.02386474609375,
0.05328369140625,
-0.0133819580078125,
-0.0023822784423828125,
-0.035186767578125,
0.010894775390625,
0.01654052734375,
-0.0032329559326171875,
0.003749847412109375,
0.0163421630859375,
-0.01180267333984375,
0.013214111328125,
-0.0021648406982421875,
-0.018402099609375,
0.019287109375,
-0.0133819580078125,
-0.0157318115234375,
0.0184478759765625,
0.039764404296875,
0.0309906005859375,
0.01416778564453125,
0.0194854736328125,
0.0034313201904296875,
-0.017333984375,
-0.0216522216796875,
-0.042144775390625,
0.0118865966796875,
0.03558349609375,
-0.004444122314453125,
-0.0246734619140625,
0.036712646484375,
0.010498046875,
-0.0511474609375,
-0.0302276611328125,
-0.01690673828125,
-0.0355224609375,
0.01373291015625,
-0.0227813720703125,
-0.029022216796875,
-0.02081298828125,
-0.039031982421875,
-0.006839752197265625,
0.0181732177734375,
-0.0006756782531738281,
-0.004795074462890625,
0.06964111328125,
-0.00498199462890625,
0.010711669921875,
0.0256500244140625,
-0.0125732421875,
0.03558349609375,
0.018402099609375,
-0.04388427734375,
-0.01293182373046875,
-0.00821685791015625,
-0.087646484375,
0.03643798828125,
0.05072021484375,
-0.0285186767578125,
0.0084381103515625,
0.01428985595703125,
-0.03228759765625,
0.034393310546875,
0.0146026611328125,
0.0021610260009765625,
0.003505706787109375,
0.0012149810791015625,
-0.01023101806640625,
-0.052947998046875,
-0.0279388427734375,
-0.025665283203125,
0.036590576171875,
0.01067352294921875,
0.0953369140625,
-0.020538330078125,
0.0279388427734375,
-0.039154052734375,
0.0223846435546875,
-0.043914794921875,
-0.0204925537109375,
-0.0053558349609375,
0.0243377685546875,
0.0062713623046875,
0.0091400146484375,
-0.0196533203125,
0.05438232421875,
-0.01226806640625,
0.027130126953125,
0.040252685546875,
-0.049774169921875,
0.0100250244140625,
0.019683837890625,
-0.020294189453125,
-0.0283355712890625,
-0.02716064453125,
-0.01558685302734375,
0.0239410400390625,
0.002902984619140625,
0.0020351409912109375,
-0.01739501953125,
0.061676025390625,
-0.053680419921875,
0.0115966796875,
-0.0269622802734375,
-0.050567626953125,
-0.053802490234375,
0.006961822509765625,
-0.037017822265625,
0.00397491455078125,
-0.00844573974609375,
-0.022369384765625,
0.01303863525390625,
0.00855255126953125,
-0.021209716796875,
0.016937255859375,
-0.0567626953125,
-0.031341552734375,
0.037689208984375,
0.034027099609375,
-0.0009236335754394531,
0.0252227783203125,
-0.008209228515625,
-0.0178375244140625,
-0.007190704345703125,
-0.0305023193359375,
-0.0439453125,
-0.02716064453125,
-0.007129669189453125,
0.0220947265625,
-0.03240966796875,
-0.064453125,
-0.1163330078125,
0.01139068603515625,
0.0249481201171875,
0.005504608154296875,
-0.06134033203125,
0.020965576171875,
-0.0173187255859375,
0.0523681640625,
-0.0072784423828125,
-0.037261962890625,
0.0272674560546875,
0.04437255859375,
-0.0195465087890625,
0.00968170166015625,
-0.0220794677734375,
-0.021240234375,
-0.018524169921875,
0.035614013671875,
0.0587158203125,
-0.0102081298828125,
-0.0205841064453125,
0.024383544921875,
-0.012603759765625,
0.08148193359375,
-0.084716796875,
0.02508544921875,
0.0206756591796875,
-0.01019287109375,
-0.04766845703125,
-0.059112548828125,
0.0254058837890625,
-0.05859375,
-0.0352783203125,
0.046905517578125,
-0.025146484375,
0.0128021240234375,
-0.028564453125,
-0.036865234375,
0.03631591796875,
0.0207977294921875,
-0.031890869140625,
-0.0599365234375,
0.01678466796875,
-0.006519317626953125,
0.028778076171875,
-0.0193023681640625,
-0.01239776611328125,
-0.02117919921875,
0.02337646484375,
0.034698486328125,
-0.039215087890625,
0.049896240234375,
0.039703369140625,
-0.04266357421875,
0.02716064453125,
0.0187530517578125,
0.0022945404052734375,
-0.012054443359375,
0.01561737060546875,
0.0169525146484375,
0.036041259765625,
-0.0270538330078125,
0.035552978515625,
0.003131866455078125,
0.0192108154296875,
0.006229400634765625,
-0.043304443359375,
0.0177001953125,
0.0012445449829101562,
-0.00689697265625,
0.027679443359375,
-0.0089569091796875,
-0.03326416015625,
-0.032318115234375,
-0.05291748046875,
0.004486083984375,
-0.0018768310546875,
0.00959014892578125,
-0.059783935546875,
0.017578125,
0.022552490234375,
0.005405426025390625,
-0.03997802734375,
-0.01512908935546875,
-0.035186767578125,
-0.016571044921875,
-0.0038089752197265625,
-0.0160675048828125,
0.037841796875,
-0.00431060791015625,
0.0484619140625,
-0.038360595703125,
-0.0343017578125,
0.01708984375,
0.006008148193359375,
-0.0013303756713867188,
-0.013214111328125,
0.005977630615234375,
-0.0087738037109375,
-0.01384735107421875,
0.037384033203125,
0.004787445068359375,
0.07757568359375,
-0.0282440185546875,
-0.038238525390625,
0.009429931640625,
0.01202392578125,
-0.0233306884765625,
0.0169219970703125,
0.019012451171875,
0.0364990234375,
-0.01000213623046875,
0.06756591796875,
-0.0159912109375,
-0.06304931640625,
-0.03253173828125,
0.0151519775390625,
-0.0000603795051574707,
-0.01143646240234375,
0.02191162109375,
-0.01038360595703125,
-0.0003955364227294922,
0.0270843505859375,
0.00374603271484375,
-0.049774169921875,
0.047882080078125,
0.01380157470703125,
0.0275726318359375,
0.0204010009765625
] |
48979aae01de2643c3d56f5911a910fe06bcda5a
|
Wordpress Stackexchange
Q: show image in mail contact form 7 I am using contact form 7.
I have a file field to upload images.
Code of file field in contact form 7
[file* image filetypes:jpg|png|gif]
I need to display the uploaded image in mail using contact form 7. How can i do that?
A: As per my comments, it seems you are trying to attach images to emails rather than 'show' them.
Since you have [file* image filetypes:jpg|png|gif] what you need to do is put [image] in the 'File Attachments' box in the Contact Form 7 settings.
This is from the Contact Form 7 File Uploading and Attachment doc.
|
Q: show image in mail contact form 7 I am using contact form 7.
I have a file field to upload images.
Code of file field in contact form 7
[file* image filetypes:jpg|png|gif]
I need to display the uploaded image in mail using contact form 7. How can i do that?
A: As per my comments, it seems you are trying to attach images to emails rather than 'show' them.
Since you have [file* image filetypes:jpg|png|gif] what you need to do is put [image] in the 'File Attachments' box in the Contact Form 7 settings.
This is from the Contact Form 7 File Uploading and Attachment doc.
|
wordpress
|
{
"language": "en",
"length": 107,
"provenance": "stackexchange_00019.jsonl.gz:419436",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50296"
}
|
[
0.0435791015625,
-0.0031909942626953125,
-0.009918212890625,
-0.044036865234375,
-0.001773834228515625,
-0.0291748046875,
0.018402099609375,
-0.00920867919921875,
0.044158935546875,
0.001834869384765625,
-0.0628662109375,
-0.01468658447265625,
0.016845703125,
-0.0160980224609375,
-0.0008931159973144531,
-0.024871826171875,
0.0025730133056640625,
0.0246429443359375,
0.035400390625,
-0.004119873046875,
0.0158233642578125,
0.0182952880859375,
0.014434814453125,
-0.037200927734375,
-0.0330810546875,
0.0430908203125,
0.01197052001953125,
-0.00762939453125,
-0.056671142578125,
-0.028167724609375,
-0.010894775390625,
0.059661865234375,
0.048126220703125,
0.022216796875,
-0.0552978515625,
0.037322998046875,
-0.00311279296875,
-0.0017156600952148438,
-0.0214691162109375,
0.031768798828125,
-0.002361297607421875,
-0.00853729248046875,
0.06011962890625,
-0.024169921875,
0.0168914794921875,
-0.000029087066650390625,
-0.01192474365234375,
-0.053009033203125,
0.0040130615234375,
0.0175628662109375,
0.0186614990234375,
0.03741455078125,
0.027587890625,
0.01047515869140625,
0.00015234947204589844,
-0.0049285888671875,
-0.037078857421875,
0.0307464599609375,
0.015045166015625,
0.01317596435546875,
-0.00513458251953125,
-0.0005698204040527344,
0.01549530029296875,
0.005550384521484375,
0.0015935897827148438,
0.0020694732666015625,
-0.0290374755859375,
-0.017425537109375,
-0.0210113525390625,
0.0000026226043701171875,
0.03204345703125,
-0.037109375,
0.01200103759765625,
-0.06805419921875,
0.0288238525390625,
0.051239013671875,
-0.0180511474609375,
0.01541900634765625,
0.0069580078125,
-0.0208587646484375,
-0.0154876708984375,
-0.058013916015625,
-0.0202484130859375,
0.022796630859375,
-0.0162200927734375,
0.035919189453125,
-0.002742767333984375,
-0.0006585121154785156,
0.00042247772216796875,
-0.00547027587890625,
-0.0084381103515625,
0.0158233642578125,
-0.0013055801391601562,
0.01404571533203125,
-0.008331298828125,
-0.05157470703125,
0.0001876354217529297,
-0.0265045166015625,
0.0188446044921875,
0.00450897216796875,
-0.01380157470703125,
-0.02667236328125,
-0.0011005401611328125,
-0.01280975341796875,
0.01074981689453125,
0.05267333984375,
-0.01259613037109375,
-0.00402069091796875,
0.0183868408203125,
0.01035308837890625,
0.0184783935546875,
0.0169677734375,
-0.01377105712890625,
-0.01904296875,
-0.0184478759765625,
0.0259246826171875,
-0.0309600830078125,
0.022491455078125,
0.0003764629364013672,
0.039398193359375,
-0.0164642333984375,
0.018341064453125,
0.027923583984375,
-0.048248291015625,
0.00278472900390625,
-0.008453369140625,
-0.0152587890625,
-0.0220184326171875,
0.035614013671875,
-0.01220703125,
-0.01238250732421875,
0.0272369384765625,
0.00843048095703125,
0.013458251953125,
0.01548004150390625,
0.004764556884765625,
-0.0203857421875,
-0.0174713134765625,
-0.00420379638671875,
0.0300445556640625,
-0.01132965087890625,
-0.033721923828125,
0.03387451171875,
0.016754150390625,
-0.032073974609375,
0.0390625,
-0.003490447998046875,
-0.010833740234375,
-0.004238128662109375,
-0.0631103515625,
-0.022216796875,
-0.029388427734375,
0.01200103759765625,
0.0242462158203125,
-0.0143585205078125,
0.043365478515625,
0.02197265625,
0.0112152099609375,
-0.023162841796875,
-0.0187835693359375,
0.0194549560546875,
0.00951385498046875,
0.051300048828125,
0.00925445556640625,
0.01195526123046875,
-0.017059326171875,
-0.09307861328125,
-0.004177093505859375,
0.0135955810546875,
-0.041046142578125,
0.0108795166015625,
-0.00588226318359375,
-0.00327301025390625,
0.01287841796875,
0.019195556640625,
0.02105712890625,
0.048797607421875,
0.0077362060546875,
0.01111602783203125,
0.05438232421875,
0.00339508056640625,
-0.0190277099609375,
0.0589599609375,
-0.038177490234375,
-0.041015625,
0.038604736328125,
-0.0200347900390625,
-0.0212860107421875,
0.02520751953125,
-0.0259552001953125,
0.0214691162109375,
0.05767822265625,
-0.02838134765625,
0.0178070068359375,
-0.0299530029296875,
-0.0158233642578125,
-0.0406494140625,
0.01404571533203125,
-0.04022216796875,
0.0205841064453125,
-0.00012922286987304688,
-0.01346588134765625,
0.0252838134765625,
-0.0018835067749023438,
0.0291595458984375,
-0.0060577392578125,
0.0009784698486328125,
0.004909515380859375,
-0.02838134765625,
0.0225372314453125,
0.0271453857421875,
0.007427215576171875,
-0.0308074951171875,
-0.01392364501953125,
0.03076171875,
0.0159759521484375,
-0.01473236083984375,
0.0188751220703125,
-0.0104217529296875,
0.05242919921875,
-0.04876708984375,
-0.017822265625,
-0.0345458984375,
-0.0193634033203125,
-0.03662109375,
0.03948974609375,
-0.0491943359375,
0.029541015625,
-0.04229736328125,
0.01496124267578125,
0.022247314453125,
0.034088134765625,
-0.04522705078125,
-0.01003265380859375,
-0.030426025390625,
-0.005420684814453125,
0.0025806427001953125,
-0.01001739501953125,
0.02105712890625,
0.026947021484375,
0.032501220703125,
-0.0056304931640625,
0.006092071533203125,
0.0202789306640625,
0.0943603515625,
0.0750732421875,
0.0419921875,
-0.024017333984375,
-0.006744384765625,
-0.02288818359375,
-0.019317626953125,
-0.015167236328125,
0.05218505859375,
-0.0687255859375,
0.0183563232421875,
0.0418701171875,
-0.0081634521484375,
-0.04949951171875,
-0.0008969306945800781,
0.0081634521484375,
0.034393310546875,
0.017486572265625,
-0.060028076171875,
0.0233001708984375,
-0.0244140625,
0.035980224609375,
0.0228271484375,
0.0072784423828125,
-0.04180908203125,
0.02789306640625,
0.0220794677734375,
-0.017791748046875,
0.00774383544921875,
0.041900634765625,
0.0098724365234375,
0.0548095703125,
-0.00890350341796875,
-0.02734375,
0.0272216796875,
0.037384033203125,
-0.0166015625,
-0.0236663818359375,
0.00548553466796875,
0.0006232261657714844,
0.00812530517578125,
-0.03778076171875,
0.0421142578125,
0.006778717041015625,
0.023712158203125,
0.02667236328125,
0.035186767578125,
0.024139404296875,
0.0097808837890625,
0.024810791015625,
0.0040740966796875,
-0.00435638427734375,
-0.03594970703125,
-0.013946533203125,
0.053741455078125,
-0.05419921875,
-0.0108489990234375,
0.048431396484375,
-0.0587158203125,
0.061065673828125,
0.005126953125,
-0.0438232421875,
-0.006519317626953125,
0.045379638671875,
0.02264404296875,
-0.054656982421875,
0.025634765625,
0.05682373046875,
0.01027679443359375,
-0.057830810546875,
-0.00677490234375,
-0.017608642578125,
-0.0386962890625,
-0.039825439453125,
-0.09979248046875,
-0.0687255859375,
-0.0291748046875,
-0.0697021484375,
-0.05279541015625,
0.005832672119140625,
-0.050994873046875,
0.041900634765625,
0.03485107421875,
-0.004749298095703125,
-0.050445556640625,
0.0153045654296875,
-0.0318603515625,
-0.048828125,
-0.039215087890625,
0.0066680908203125,
-0.0157470703125,
0.0209808349609375,
-0.00939178466796875,
0.053436279296875,
-0.00867462158203125,
-0.04498291015625,
-0.0018491744995117188,
0.037139892578125,
0.01544952392578125,
0.01477813720703125,
-0.06494140625,
0.0194854736328125,
0.0116424560546875,
-0.002651214599609375,
-0.00029659271240234375,
0.01158905029296875,
-0.00634765625,
-0.00695037841796875,
-0.05035400390625,
-0.0457763671875,
-0.034149169921875,
0.01019287109375,
0.04833984375,
-0.07550048828125,
-0.01232147216796875,
-0.06683349609375,
0.01175689697265625,
0.00583648681640625,
0.0006742477416992188,
-0.0870361328125,
-0.0247039794921875,
-0.0100555419921875,
-0.051910400390625,
0.0213165283203125,
-0.0171966552734375,
0.00780487060546875,
-0.0031375885009765625,
-0.058563232421875,
0.0882568359375,
-0.00860595703125,
-0.01080322265625,
-0.015838623046875,
0.037139892578125,
-0.0113525390625,
0.056549072265625,
0.027191162109375,
0.0169677734375,
-0.01806640625,
0.05902099609375,
-0.01708984375,
-0.0765380859375,
0.0576171875,
-0.060577392578125,
-0.0269317626953125,
-0.04193115234375,
-0.01438140869140625,
-0.01776123046875,
0.07635498046875,
0.013671875,
-0.0279388427734375,
-0.006298065185546875,
0.015655517578125,
-0.035980224609375,
-0.019439697265625,
-0.006130218505859375,
0.01097869873046875,
-0.043670654296875,
0.01221466064453125,
-0.003765106201171875,
-0.0216827392578125,
0.0205535888671875,
-0.0599365234375,
-0.01064300537109375,
-0.045989990234375,
-0.003570556640625,
0.02691650390625,
-0.034576416015625,
0.0287322998046875,
-0.043975830078125,
0.01230621337890625,
0.01202392578125,
-0.0171966552734375,
-0.11077880859375,
-0.0251007080078125,
0.0259246826171875,
0.0699462890625,
-0.037628173828125,
0.0296783447265625,
-0.04736328125,
0.05413818359375,
0.0200347900390625,
-0.03094482421875,
0.00514984130859375,
-0.01325225830078125,
-0.038970947265625,
0.007663726806640625,
0.00020372867584228516,
-0.03753662109375,
0.005207061767578125,
-0.063720703125,
-0.0711669921875,
-0.06964111328125,
-0.01953125,
0.0170135498046875,
-0.0057830810546875,
-0.0200958251953125,
-0.001430511474609375,
-0.016632080078125,
-0.01311492919921875,
0.01197052001953125,
0.00457763671875,
-0.0289764404296875,
-0.0160064697265625,
-0.002490997314453125,
-0.0186614990234375,
-0.011260986328125,
-0.016387939453125,
0.0233917236328125,
0.0338134765625,
0.00763702392578125,
0.00970458984375,
-0.07965087890625,
0.005168914794921875,
0.06494140625,
0.034942626953125,
-0.00028204917907714844,
0.009735107421875,
-0.0521240234375,
0.040618896484375,
0.0634765625,
0.047149658203125,
-0.0321044921875,
0.0555419921875,
-0.0022792816162109375,
-0.00789642333984375,
0.036773681640625,
0.0078582763671875,
-0.035797119140625,
-0.032073974609375,
-0.011444091796875,
-0.02557373046875,
-0.0005359649658203125,
0.046478271484375,
-0.022491455078125,
0.0716552734375,
-0.0153045654296875,
-0.06512451171875,
0.01360321044921875,
-0.005588531494140625,
0.0200653076171875,
-0.004360198974609375,
0.0116424560546875,
0.0259246826171875,
0.0323486328125,
-0.003734588623046875,
0.0313720703125,
-0.01023101806640625,
-0.0023136138916015625,
0.00022614002227783203,
0.05535888671875,
-0.01195526123046875,
0.0263671875,
-0.00244140625,
-0.0215301513671875,
0.02685546875,
-0.01544189453125,
-0.0248260498046875,
0.00946044921875,
-0.02154541015625,
-0.031524658203125,
0.01253509521484375,
-0.03533935546875,
0.027557373046875,
0.056182861328125,
0.02911376953125,
0.0364990234375,
0.066650390625,
0.031524658203125,
0.0022106170654296875,
0.0220794677734375,
-0.026580810546875,
0.01314544677734375,
0.032501220703125,
-0.0203094482421875,
0.00897216796875,
0.0089569091796875,
0.025299072265625,
0.0546875,
-0.00489044189453125,
0.0300750732421875,
0.0242919921875,
-0.0291595458984375,
-0.01207733154296875,
0.007205963134765625,
-0.05499267578125,
0.01023101806640625,
0.003047943115234375,
0.03680419921875,
-0.004688262939453125,
-0.03826904296875,
0.0203094482421875,
-0.01293182373046875,
-0.0057220458984375,
0.0176239013671875,
0.03131103515625,
0.00006014108657836914,
-0.01180267333984375,
-0.01055145263671875,
0.01116180419921875,
0.01348876953125,
-0.0159454345703125,
0.01165008544921875,
0.0035762786865234375,
0.024871826171875,
0.0117034912109375,
-0.0171966552734375,
-0.001750946044921875,
-0.0016803741455078125,
0.032867431640625,
-0.01032257080078125,
-0.03790283203125,
-0.047576904296875,
-0.0242767333984375,
-0.006519317626953125,
0.0129852294921875,
0.051116943359375,
-0.0239410400390625,
-0.0188140869140625,
-0.013397216796875,
0.01520538330078125,
-0.00846099853515625,
0.016357421875,
0.0191802978515625,
-0.01288604736328125,
-0.0291290283203125,
0.007518768310546875,
-0.0372314453125,
-0.01059722900390625,
0.004428863525390625,
-0.01003265380859375,
-0.0106048583984375,
-0.033935546875,
-0.0236358642578125,
0.028778076171875,
-0.01788330078125,
-0.00447845458984375,
0.006397247314453125,
0.0176544189453125,
-0.00455474853515625,
0.041961669921875,
0.03125,
-0.0142059326171875,
-0.0284423828125,
0.01064300537109375,
0.0008931159973144531,
-0.05047607421875,
-0.0633544921875,
-0.00830078125,
-0.039337158203125,
-0.0599365234375,
0.03594970703125,
0.028717041015625,
0.034210205078125,
0.01320648193359375,
-0.01238250732421875,
0.04083251953125,
-0.00386810302734375,
-0.033477783203125,
-0.00646209716796875,
-0.027618408203125,
0.07086181640625,
-0.040740966796875,
-0.00807952880859375,
-0.0027790069580078125,
-0.01427459716796875,
0.0665283203125,
-0.017242431640625,
-0.0258331298828125,
0.0226287841796875,
-0.0205535888671875,
0.033599853515625,
0.0164337158203125,
0.01032257080078125,
0.01812744140625,
0.051666259765625,
-0.023162841796875,
0.0220489501953125,
0.03826904296875,
0.00852203369140625,
0.0146331787109375,
0.058990478515625,
-0.00949859619140625,
-0.06854248046875,
0.00347900390625,
0.01107025146484375,
-0.01708984375,
-0.00832366943359375,
-0.0070343017578125,
0.022705078125,
0.041900634765625,
0.08929443359375,
-0.06640625,
0.023834228515625,
0.0281982421875,
0.002841949462890625,
0.0254669189453125,
-0.005458831787109375,
-0.0084991455078125,
-0.01374053955078125,
0.0157318115234375,
0.000598907470703125,
-0.0144195556640625,
0.005817413330078125,
0.021484375,
0.01258087158203125,
0.034027099609375,
0.0311126708984375,
0.004726409912109375,
-0.0265960693359375,
-0.07489013671875,
0.0286712646484375,
-0.044036865234375,
0.0082550048828125,
0.058197021484375,
-0.05224609375,
-0.0034008026123046875,
-0.0171661376953125,
-0.017181396484375,
-0.0012836456298828125,
-0.0251617431640625,
-0.038909912109375,
-0.0018682479858398438,
0.03643798828125,
0.0209197998046875,
0.01016998291015625,
-0.06317138671875,
0.0089874267578125,
-0.0026454925537109375,
0.03118896484375,
-0.01824951171875,
-0.0018644332885742188,
0.061187744140625,
-0.062164306640625,
0.007595062255859375,
-0.01313018798828125,
0.051971435546875,
-0.00443267822265625,
0.0188751220703125,
0.08160400390625,
-0.0300750732421875,
-0.037628173828125,
0.0341796875,
0.01274871826171875,
-0.029876708984375,
-0.014190673828125,
-0.001178741455078125,
-0.05072021484375,
-0.01849365234375,
-0.00580596923828125,
-0.051849365234375,
0.0033779144287109375,
-0.030242919921875,
-0.052886962890625,
-0.0084686279296875,
-0.01026153564453125,
0.014984130859375,
-0.00034332275390625,
-0.01056671142578125,
0.032440185546875,
-0.0159454345703125,
0.01486968994140625,
-0.002628326416015625,
-0.0290679931640625,
-0.0016241073608398438,
-0.036346435546875,
0.0025310516357421875,
-0.0098724365234375,
0.05078125,
0.0723876953125,
0.00453948974609375,
-0.039276123046875,
-0.0019683837890625,
0.083251953125,
0.0689697265625,
0.0247039794921875,
0.0211639404296875,
-0.0150604248046875,
-0.042572021484375,
0.00861358642578125,
0.048431396484375,
0.015960693359375,
0.0168304443359375,
-0.043914794921875,
0.03387451171875,
0.00853729248046875,
0.03399658203125,
0.021514892578125,
0.002605438232421875,
0.0135955810546875,
-0.00049591064453125,
0.020355224609375,
-0.035369873046875,
-0.019378662109375,
0.024200439453125,
-0.0220184326171875,
-0.04010009765625,
-0.0052642822265625,
-0.0282135009765625,
0.02520751953125,
-0.0132904052734375,
0.03887939453125,
0.044708251953125,
0.036407470703125,
0.050201416015625,
-0.011566162109375,
0.040191650390625,
0.0208282470703125,
-0.03863525390625,
0.01082611083984375,
-0.024993896484375,
0.0199737548828125,
-0.045989990234375,
0.006473541259765625,
-0.0025959014892578125,
0.004535675048828125,
-0.0219268798828125,
-0.025909423828125,
0.01561737060546875,
0.0197296142578125,
0.01384735107421875,
-0.0169219970703125,
0.0004286766052246094,
-0.0660400390625,
-0.01369476318359375,
-0.0300445556640625,
0.0191497802734375,
0.0242462158203125,
0.034393310546875,
-0.0093536376953125,
0.00525665283203125,
-0.05279541015625,
0.01094818115234375,
-0.043792724609375,
0.037811279296875,
-0.0122833251953125,
0.002071380615234375,
-0.0008058547973632812,
0.0523681640625,
0.0274810791015625,
0.0006957054138183594,
-0.0188446044921875,
0.012420654296875,
0.011688232421875,
0.034210205078125,
0.01105499267578125,
0.015899658203125,
0.0005283355712890625,
0.0160980224609375,
0.024749755859375,
0.0010099411010742188,
0.01299285888671875,
0.03155517578125,
0.01351165771484375,
-0.00983428955078125,
0.00710296630859375,
-0.0044708251953125,
0.04705810546875,
-0.0212860107421875,
0.024383544921875,
0.0295867919921875,
-0.0259246826171875,
-0.019256591796875,
-0.032867431640625,
0.08795166015625,
-0.04888916015625,
0.040802001953125,
-0.0186767578125,
-0.0281219482421875,
0.01296234130859375,
-0.040435791015625,
0.05731201171875,
-0.039581298828125,
-0.08642578125,
-0.04254150390625,
0.0282745361328125,
-0.007965087890625,
0.034393310546875,
0.0380859375,
-0.006656646728515625,
0.0058746337890625,
0.0012359619140625,
0.0091400146484375,
0.01513671875,
-0.0085906982421875,
-0.027374267578125,
-0.031585693359375,
0.04425048828125,
-0.01702880859375,
-0.057098388671875,
-0.03961181640625,
0.00470733642578125,
0.028717041015625,
-0.015899658203125,
0.027008056640625,
0.001979827880859375,
-0.001819610595703125,
-0.040802001953125,
0.040130615234375,
-0.06884765625,
-0.035064697265625,
0.0223236083984375,
-0.007061004638671875,
-0.0196533203125,
0.0002199411392211914,
0.03582763671875,
0.02239990234375,
0.00878143310546875,
-0.02435302734375,
-0.02532958984375,
-0.012115478515625,
0.0207061767578125,
0.03619384765625,
-0.0125732421875,
-0.0200958251953125,
-0.0030841827392578125,
-0.002506256103515625,
-0.0008668899536132812,
0.0218658447265625,
0.00521087646484375,
-0.005977630615234375,
0.0171661376953125,
0.041656494140625,
0.0095367431640625,
0.03076171875,
-0.0294952392578125,
0.091552734375,
0.03924560546875,
-0.011993408203125,
-0.0269775390625,
-0.045135498046875,
-0.0309600830078125,
0.02667236328125,
-0.03961181640625,
0.051025390625,
-0.035186767578125,
0.0015344619750976562,
0.052581787109375,
-0.032806396484375,
0.0057373046875,
-0.042877197265625,
-0.03955078125,
0.0149993896484375,
0.01520538330078125,
-0.00011026859283447266,
0.01079559326171875,
-0.004756927490234375,
-0.037841796875,
0.00785064697265625,
0.01513671875,
0.01129150390625,
0.031707763671875,
0.0400390625,
-0.004886627197265625,
0.024505615234375,
0.0237884521484375,
-0.052154541015625,
0.0217742919921875,
0.0122833251953125,
0.0157623291015625,
0.0231781005859375,
-0.029083251953125,
-0.0041351318359375,
0.00861358642578125,
-0.0053558349609375,
-0.06182861328125,
-0.02593994140625,
0.06414794921875,
0.0038166046142578125,
0.0180816650390625,
0.0187530517578125,
-0.021636962890625,
-0.01073455810546875,
0.042388916015625,
0.029388427734375,
0.0758056640625,
-0.0107879638671875,
-0.037261962890625,
-0.0167694091796875,
0.02020263671875,
-0.01464080810546875,
0.01522064208984375,
0.0227813720703125,
0.019500732421875,
-0.020843505859375,
-0.0533447265625,
0.026641845703125,
0.003940582275390625,
-0.038177490234375,
-0.077880859375,
0.0223541259765625,
-0.0139312744140625,
-0.0362548828125,
-0.0179290771484375,
0.0270538330078125,
-0.01119232177734375,
0.044891357421875,
0.00397491455078125,
-0.0024547576904296875,
0.01474761962890625,
-0.00128173828125,
-0.03509521484375,
0.0217132568359375,
0.033416748046875,
-0.03472900390625,
0.01000213623046875,
-0.0128631591796875,
0.003269195556640625,
-0.041595458984375,
0.0401611328125,
-0.0343017578125,
0.039581298828125,
0.05078125,
-0.03521728515625,
-0.051025390625,
-0.034454345703125,
-0.061920166015625,
-0.0166168212890625,
-0.052490234375,
-0.0279541015625,
-0.0176544189453125,
0.05224609375,
0.0428466796875,
0.007781982421875,
-0.01171112060546875,
0.04754638671875,
0.021087646484375,
-0.0002448558807373047,
0.003810882568359375,
-0.0037841796875,
-0.00376129150390625,
-0.0062103271484375,
-0.013885498046875,
-0.01326751708984375,
-0.01103973388671875,
-0.00890350341796875,
-0.045166015625,
-0.002838134765625,
-0.0145416259765625,
-0.0106353759765625,
-0.038055419921875,
0.01436614990234375,
0.065185546875,
-0.01605224609375,
0.04840087890625,
-0.005023956298828125,
-0.002590179443359375,
0.054473876953125,
0.035675048828125,
-0.0204620361328125,
-0.027801513671875,
0.0117645263671875,
0.0194244384765625,
0.0020465850830078125,
-0.01145172119140625,
0.005615234375,
-0.004154205322265625,
-0.0032863616943359375,
0.020965576171875,
-0.01186370849609375,
0.0082244873046875,
-0.04315185546875,
0.08868408203125,
0.00514984130859375,
0.0635986328125,
-0.037933349609375,
-0.0662841796875,
-0.022705078125,
-0.0038471221923828125,
-0.01044464111328125,
0.0206298828125,
0.0540771484375,
-0.035736083984375,
0.015472412109375,
0.00728607177734375,
-0.00429534912109375,
-0.0210723876953125,
0.004322052001953125,
0.0034503936767578125,
0.00258636474609375,
0.017486572265625
] |
c16f4c5a564a2efdae59149f5180285759982ff2
|
Wordpress Stackexchange
Q: Wordpress category loop offset possible? I have been on this for a while now and haven't really come across a solution to filter the posts on a category page using a sort of offset in php.
There are plugin for posts and pages but I am trying to achieve this with pure php and specifically for a category page.
Scenario example:
A blog with 7 posts, setting the offset to say 3 would begin the loop on the category page to only show (Post4, Post5, Post6, Post7) and NOT (Post1, Post2, Post3).
I am wondering if this would be possible at all and be dynamic enough to apply to all categories without the need to specifically identify which posts to exclude via id numbers.
A: The 'offset' parameter does what you want. I've written this hack, it should help you...
<?php
//The third parameter corresponds to action priority,
//set it to change the order of execution in case of a conflict
add_action('pre_get_posts', 'the_modified_loop', 10);
function the_modified_loop($query){
//Remove 'is_admin' if you want the code to run for the backend category archive page
if(!is_admin() && $query->is_category()){
$query->set('offset', 3);
}
}
?>
Let me know if it worked!
|
Q: Wordpress category loop offset possible? I have been on this for a while now and haven't really come across a solution to filter the posts on a category page using a sort of offset in php.
There are plugin for posts and pages but I am trying to achieve this with pure php and specifically for a category page.
Scenario example:
A blog with 7 posts, setting the offset to say 3 would begin the loop on the category page to only show (Post4, Post5, Post6, Post7) and NOT (Post1, Post2, Post3).
I am wondering if this would be possible at all and be dynamic enough to apply to all categories without the need to specifically identify which posts to exclude via id numbers.
A: The 'offset' parameter does what you want. I've written this hack, it should help you...
<?php
//The third parameter corresponds to action priority,
//set it to change the order of execution in case of a conflict
add_action('pre_get_posts', 'the_modified_loop', 10);
function the_modified_loop($query){
//Remove 'is_admin' if you want the code to run for the backend category archive page
if(!is_admin() && $query->is_category()){
$query->set('offset', 3);
}
}
?>
Let me know if it worked!
A: Don't forget to check $query->is_main_query()Codex:
<?php
//The third parameter corresponds to action priority,
//set it to change the order of execution in case of a conflict
add_action('pre_get_posts', 'the_modified_loop', 10);
function the_modified_loop($query){
//Remove 'is_admin' if you want the code to run for the backend category archive page
if( $query->is_main_query() && !is_admin() && $query->is_category() ) {
$query->set( 'offset', 3 );
}
}
?>
|
wordpress
|
{
"language": "en",
"length": 258,
"provenance": "stackexchange_00019.jsonl.gz:419496",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50494"
}
|
[
0.058990478515625,
0.0183868408203125,
-0.0060577392578125,
-0.01522064208984375,
0.0439453125,
-0.04718017578125,
0.0640869140625,
-0.0341796875,
0.04974365234375,
0.0021533966064453125,
-0.0266265869140625,
-0.050811767578125,
0.0175323486328125,
-0.043701171875,
-0.01531982421875,
-0.0286407470703125,
0.029571533203125,
-0.0175323486328125,
0.0309295654296875,
-0.0091552734375,
0.0233612060546875,
-0.00357818603515625,
0.028228759765625,
0.035736083984375,
0.016143798828125,
-0.0222015380859375,
0.0687255859375,
-0.0231170654296875,
0.004405975341796875,
-0.032196044921875,
0.007114410400390625,
-0.00533294677734375,
0.017669677734375,
0.006381988525390625,
-0.01149749755859375,
0.02899169921875,
0.0080718994140625,
-0.004093170166015625,
-0.01447296142578125,
0.039886474609375,
0.0225830078125,
-0.0076904296875,
-0.00801849365234375,
0.0222320556640625,
-0.01702880859375,
-0.01222991943359375,
-0.0046234130859375,
-0.0428466796875,
0.04766845703125,
-0.040557861328125,
-0.00039315223693847656,
0.044647216796875,
0.01474761962890625,
-0.014434814453125,
-0.0109710693359375,
0.052459716796875,
-0.0222320556640625,
0.0306396484375,
0.020355224609375,
-0.01509857177734375,
-0.0274658203125,
0.006439208984375,
0.0103759765625,
-0.0142822265625,
0.0115966796875,
-0.0106201171875,
0.061370849609375,
0.0265350341796875,
-0.0328369140625,
0.0006866455078125,
0.04742431640625,
-0.00832366943359375,
-0.0024871826171875,
-0.0029506683349609375,
-0.035675048828125,
-0.0274505615234375,
0.0281219482421875,
-0.0421142578125,
0.0017948150634765625,
0.0037479400634765625,
-0.0548095703125,
-0.0034046173095703125,
-0.070556640625,
-0.0146636962890625,
-0.00443267822265625,
0.00934600830078125,
-0.0244140625,
0.00005453824996948242,
-0.012786865234375,
-0.0303497314453125,
-0.0176239013671875,
0.004238128662109375,
-0.03521728515625,
0.007587432861328125,
-0.01812744140625,
-0.0213775634765625,
0.02777099609375,
0.00902557373046875,
-0.0133514404296875,
-0.008636474609375,
-0.0243377685546875,
-0.0168609619140625,
-0.003376007080078125,
-0.006107330322265625,
0.0186309814453125,
-0.005146026611328125,
-0.03076171875,
0.05694580078125,
0.0794677734375,
0.05145263671875,
0.00728607177734375,
0.054046630859375,
-0.03240966796875,
0.0144195556640625,
-0.0592041015625,
0.00829315185546875,
-0.0496826171875,
-0.02880859375,
-0.038299560546875,
0.006191253662109375,
0.00629425048828125,
0.0443115234375,
-0.007404327392578125,
-0.04461669921875,
0.006229400634765625,
-0.001209259033203125,
-0.01971435546875,
-0.0355224609375,
0.06591796875,
-0.0013227462768554688,
-0.02716064453125,
0.003696441650390625,
0.035858154296875,
0.0024662017822265625,
0.00797271728515625,
-0.004779815673828125,
0.021453857421875,
-0.01149749755859375,
-0.01090240478515625,
0.01155853271484375,
-0.01155853271484375,
-0.00514984130859375,
0.0086212158203125,
-0.0180206298828125,
0.023284912109375,
0.0238494873046875,
0.00791168212890625,
-0.006626129150390625,
0.0199737548828125,
-0.022216796875,
0.018157958984375,
-0.050628662109375,
0.0250701904296875,
0.00815582275390625,
-0.028350830078125,
-0.004974365234375,
0.00873565673828125,
-0.004215240478515625,
-0.023712158203125,
-0.036407470703125,
0.00861358642578125,
-0.00225067138671875,
0.00936126708984375,
-0.03216552734375,
-0.05340576171875,
0.014434814453125,
-0.0244140625,
-0.01409149169921875,
0.0110321044921875,
0.031402587890625,
0.011749267578125,
0.02325439453125,
-0.04949951171875,
-0.0136871337890625,
-0.00774383544921875,
-0.028594970703125,
-0.003986358642578125,
0.0139617919921875,
0.02142333984375,
0.0162811279296875,
-0.0225372314453125,
-0.048583984375,
-0.0044708251953125,
0.0087127685546875,
-0.031707763671875,
0.0186614990234375,
0.02984619140625,
0.03497314453125,
-0.0271759033203125,
0.0229949951171875,
0.0374755859375,
0.04364013671875,
-0.02203369140625,
0.02252197265625,
-0.02886962890625,
-0.0361328125,
0.00913238525390625,
0.0036678314208984375,
-0.00960540771484375,
0.01271820068359375,
0.030731201171875,
0.0198516845703125,
-0.0037059783935546875,
0.01256561279296875,
-0.034698486328125,
0.014892578125,
-0.010528564453125,
0.023590087890625,
0.021392822265625,
0.028533935546875,
-0.0009641647338867188,
0.011932373046875,
-0.0235443115234375,
-0.006702423095703125,
-0.01039886474609375,
0.006786346435546875,
0.00724029541015625,
-0.0025424957275390625,
-0.0201416015625,
0.0189666748046875,
-0.01432037353515625,
-0.006580352783203125,
-0.029876708984375,
0.042236328125,
0.10638427734375,
-0.0288848876953125,
-0.004375457763671875,
-0.0587158203125,
0.055267333984375,
-0.0026836395263671875,
-0.0853271484375,
0.06317138671875,
0.040313720703125,
0.028106689453125,
-0.05523681640625,
0.00028324127197265625,
-0.02362060546875,
-0.007518768310546875,
-0.0189971923828125,
0.04071044921875,
0.03680419921875,
0.00681304931640625,
-0.01406097412109375,
-0.021759033203125,
0.0361328125,
-0.0714111328125,
0.00020420551300048828,
-0.0207366943359375,
0.0039520263671875,
0.0316162109375,
-0.004634857177734375,
0.0036754608154296875,
0.0260009765625,
-0.048614501953125,
0.0287322998046875,
0.037200927734375,
0.032867431640625,
-0.0137939453125,
-0.004512786865234375,
-0.004772186279296875,
0.0294342041015625,
-0.01148223876953125,
-0.08447265625,
0.025054931640625,
0.058746337890625,
0.007293701171875,
0.051666259765625,
0.037109375,
-0.0284271240234375,
0.0017480850219726562,
0.0004973411560058594,
0.0145721435546875,
0.007091522216796875,
-0.00830841064453125,
-0.06903076171875,
0.015625,
-0.03363037109375,
0.03558349609375,
0.0012712478637695312,
-0.0291290283203125,
-0.011260986328125,
0.064208984375,
0.004352569580078125,
-0.019561767578125,
-0.051300048828125,
-0.04290771484375,
0.007152557373046875,
-0.01409149169921875,
-0.0421142578125,
-0.04705810546875,
-0.006832122802734375,
0.01465606689453125,
-0.03167724609375,
0.0211639404296875,
-0.0241241455078125,
-0.0183868408203125,
0.016357421875,
-0.053436279296875,
0.055206298828125,
-0.053070068359375,
0.035003662109375,
0.059326171875,
-0.00733184814453125,
0.0052337646484375,
0.002773284912109375,
0.003391265869140625,
-0.006298065185546875,
0.04150390625,
0.00797271728515625,
-0.03839111328125,
0.00543212890625,
0.0135498046875,
0.021331787109375,
0.0175323486328125,
0.01959228515625,
-0.0239105224609375,
0.0291595458984375,
0.01284027099609375,
-0.04058837890625,
-0.054931640625,
0.05523681640625,
-0.047210693359375,
0.007244110107421875,
0.010955810546875,
-0.033721923828125,
-0.042205810546875,
0.042510986328125,
-0.016448974609375,
0.06854248046875,
-0.01224517822265625,
-0.051116943359375,
-0.01617431640625,
-0.061767578125,
-0.04644775390625,
0.0015621185302734375,
-0.0285491943359375,
0.005741119384765625,
0.0872802734375,
0.0088348388671875,
-0.10009765625,
-0.02947998046875,
0.02740478515625,
-0.022674560546875,
0.01776123046875,
-0.0172119140625,
-0.0060577392578125,
-0.0009665489196777344,
0.00909423828125,
-0.01537322998046875,
-0.01081085205078125,
0.0034465789794921875,
-0.0130615234375,
-0.034759521484375,
0.0288238525390625,
0.0066680908203125,
-0.02203369140625,
0.045867919921875,
0.04656982421875,
-0.007511138916015625,
-0.006984710693359375,
-0.007244110107421875,
-0.015289306640625,
-0.0242156982421875,
-0.0213470458984375,
0.031524658203125,
-0.005916595458984375,
-0.0226287841796875,
-0.006229400634765625,
-0.00843048095703125,
-0.0191802978515625,
-0.034820556640625,
-0.0498046875,
0.057891845703125,
0.024627685546875,
0.038787841796875,
0.025146484375,
-0.038055419921875,
-0.0496826171875,
0.0450439453125,
-0.0264434814453125,
-0.01084136962890625,
-0.0204010009765625,
0.01214599609375,
0.0017185211181640625,
-0.05499267578125,
0.03460693359375,
0.0245361328125,
-0.0023326873779296875,
-0.01073455810546875,
-0.0250091552734375,
0.00948333740234375,
0.07635498046875,
-0.053497314453125,
-0.019775390625,
-0.0016641616821289062,
-0.0008630752563476562,
0.0306854248046875,
0.0169525146484375,
-0.0204925537109375,
-0.02880859375,
-0.09088134765625,
0.0174560546875,
0.0021209716796875,
-0.0190887451171875,
-0.0288848876953125,
0.029754638671875,
-0.06878662109375,
-0.02587890625,
0.034820556640625,
-0.032257080078125,
0.005039215087890625,
-0.022735595703125,
0.01383209228515625,
-0.06353759765625,
-0.00957489013671875,
-0.013641357421875,
-0.048675537109375,
0.0021839141845703125,
-0.0185546875,
0.02117919921875,
0.008026123046875,
0.0156402587890625,
-0.0187225341796875,
0.00390625,
0.0190887451171875,
0.0142364501953125,
-0.0030517578125,
-0.01025390625,
-0.01456451416015625,
-0.0155181884765625,
-0.0056610107421875,
-0.0252227783203125,
-0.040618896484375,
-0.054168701171875,
-0.013885498046875,
-0.00634002685546875,
-0.024444580078125,
0.00010150671005249023,
-0.0268707275390625,
0.005771636962890625,
-0.10345458984375,
-0.060089111328125,
0.00501251220703125,
-0.01459503173828125,
-0.021270751953125,
0.0028133392333984375,
-0.04864501953125,
-0.075439453125,
0.052581787109375,
0.012115478515625,
-0.01308441162109375,
-0.0018758773803710938,
0.07733154296875,
0.008880615234375,
-0.03363037109375,
-0.04681396484375,
0.00982666015625,
0.042572021484375,
-0.0291595458984375,
0.053985595703125,
0.0194244384765625,
-0.03759765625,
0.09228515625,
0.01525115966796875,
-0.01038360595703125,
-0.034149169921875,
0.0408935546875,
0.0107269287109375,
-0.0110626220703125,
0.003978729248046875,
-0.00696563720703125,
0.06036376953125,
0.006511688232421875,
-0.01143646240234375,
-0.028289794921875,
-0.02166748046875,
0.04656982421875,
0.00479888916015625,
0.019805908203125,
-0.0426025390625,
-0.00023996829986572266,
-0.00461578369140625,
0.015228271484375,
0.0767822265625,
0.035308837890625,
0.0031528472900390625,
0.03704833984375,
0.063232421875,
0.00684356689453125,
-0.00732421875,
0.007965087890625,
-0.00928497314453125,
0.03900146484375,
-0.0078125,
0.00511932373046875,
-0.013671875,
0.006381988525390625,
-0.0217742919921875,
-0.0234375,
-0.025604248046875,
-0.036041259765625,
-0.00035190582275390625,
0.0201416015625,
0.017303466796875,
-0.06329345703125,
0.0053253173828125,
0.0321044921875,
0.004581451416015625,
0.0124053955078125,
-0.062255859375,
-0.0006718635559082031,
-0.0227203369140625,
0.019927978515625,
0.0142059326171875,
0.0021190643310546875,
0.01360321044921875,
0.058685302734375,
0.0217742919921875,
0.040496826171875,
-0.0234832763671875,
0.04656982421875,
0.045135498046875,
0.0003457069396972656,
0.009429931640625,
-0.00042319297790527344,
-0.01418304443359375,
0.00502777099609375,
0.0023059844970703125,
-0.0382080078125,
0.00579833984375,
0.00988006591796875,
0.025543212890625,
-0.01119232177734375,
-0.019378662109375,
0.033477783203125,
-0.00211334228515625,
-0.0242919921875,
0.026702880859375,
0.005340576171875,
0.0011844635009765625,
-0.052215576171875,
-0.04913330078125,
0.0311431884765625,
0.0165252685546875,
-0.0121612548828125,
-0.0171661376953125,
-0.06549072265625,
-0.00719451904296875,
0.0028285980224609375,
0.0118560791015625,
-0.02349853515625,
-0.0401611328125,
-0.0304718017578125,
-0.01418304443359375,
-0.010406494140625,
-0.016693115234375,
-0.0162811279296875,
0.007427215576171875,
-0.0181884765625,
0.0126953125,
0.0019235610961914062,
0.047821044921875,
-0.01360321044921875,
-0.0565185546875,
-0.02081298828125,
-0.005794525146484375,
0.0845947265625,
0.05181884765625,
-0.0638427734375,
0.0195465087890625,
-0.064697265625,
-0.0152435302734375,
-0.052764892578125,
-0.05615234375,
-0.06280517578125,
0.007373809814453125,
0.0309600830078125,
0.0207061767578125,
0.0140533447265625,
-0.06597900390625,
-0.048736572265625,
-0.003284454345703125,
0.061187744140625,
0.033660888671875,
-0.03558349609375,
0.0244140625,
0.0235137939453125,
0.01529693603515625,
-0.004154205322265625,
-0.01561737060546875,
-0.00811004638671875,
0.003490447998046875,
-0.02099609375,
-0.076416015625,
0.003749847412109375,
0.0533447265625,
-0.059112548828125,
0.0268096923828125,
0.020111083984375,
0.01297760009765625,
-0.01287078857421875,
-0.03076171875,
-0.0019283294677734375,
-0.0290679931640625,
0.010345458984375,
-0.031402587890625,
-0.049530029296875,
0.0062103271484375,
0.0261383056640625,
0.017578125,
-0.0221405029296875,
-0.01045989990234375,
0.0030651092529296875,
0.023345947265625,
0.00487518310546875,
-0.0341796875,
-0.0352783203125,
0.0257568359375,
0.0714111328125,
0.0297698974609375,
0.049285888671875,
0.008209228515625,
0.0323486328125,
0.01416778564453125,
-0.009918212890625,
0.045928955078125,
0.0010013580322265625,
0.043212890625,
-0.011322021484375,
-0.005374908447265625,
0.020751953125,
-0.033782958984375,
-0.04034423828125,
0.02276611328125,
0.00606536865234375,
-0.034881591796875,
-0.0108795166015625,
-0.0012416839599609375,
0.005565643310546875,
-0.027984619140625,
0.00844573974609375,
-0.0019931793212890625,
0.01464080810546875,
0.01363372802734375,
-0.0238494873046875,
-0.0288238525390625,
0.00708770751953125,
0.002231597900390625,
-0.007373809814453125,
-0.008087158203125,
0.005077362060546875,
0.0156097412109375,
-0.01018524169921875,
0.002208709716796875,
0.005451202392578125,
0.00893402099609375,
-0.031890869140625,
-0.0094451904296875,
0.02008056640625,
-0.0291900634765625,
-0.05877685546875,
0.0259857177734375,
-0.006732940673828125,
0.01161956787109375,
0.011932373046875,
0.00464630126953125,
0.0006394386291503906,
0.038421630859375,
-0.005352020263671875,
0.01213836669921875,
0.01299285888671875,
-0.0498046875,
-0.0179595947265625,
-0.011199951171875,
0.0254058837890625,
0.0297088623046875,
-0.03521728515625,
0.014678955078125,
-0.006084442138671875,
-0.0163421630859375,
-0.00928497314453125,
-0.046844482421875,
0.04107666015625,
0.005794525146484375,
-0.035736083984375,
0.0224609375,
-0.01568603515625,
-0.01788330078125,
0.040130615234375,
0.034088134765625,
-0.004230499267578125,
-0.009979248046875,
0.04571533203125,
-0.0201263427734375,
-0.01476287841796875,
0.037994384765625,
-0.0248260498046875,
0.031890869140625,
-0.04974365234375,
0.030670166015625,
0.04534912109375,
0.0043487548828125,
0.0015954971313476562,
0.00299072265625,
-0.01947021484375,
0.0229339599609375,
0.024505615234375,
0.041717529296875,
-0.0164337158203125,
-0.01971435546875,
0.0237884521484375,
0.058013916015625,
0.050323486328125,
0.01357269287109375,
-0.06365966796875,
-0.01302337646484375,
0.025238037109375,
0.065185546875,
0.031494140625,
0.04302978515625,
0.00455474853515625,
0.0170135498046875,
0.016082763671875,
-0.01413726806640625,
0.034393310546875,
-0.0212554931640625,
-0.018280029296875,
0.0283966064453125,
0.015716552734375,
0.03558349609375,
-0.0299072265625,
0.056488037109375,
-0.038818359375,
-0.01265716552734375,
0.051116943359375,
-0.034423828125,
-0.0211029052734375,
0.061248779296875,
0.02239990234375,
-0.056549072265625,
-0.0183258056640625,
-0.04022216796875,
0.037872314453125,
0.001850128173828125,
0.034759521484375,
0.0203704833984375,
0.0245819091796875,
0.053924560546875,
-0.0195465087890625,
0.0151214599609375,
0.00849151611328125,
-0.035552978515625,
0.041778564453125,
0.049285888671875,
0.054534912109375,
0.0274810791015625,
0.01485443115234375,
-0.00937652587890625,
0.02215576171875,
-0.0236968994140625,
-0.049560546875,
0.01027679443359375,
0.0144195556640625,
0.0167236328125,
0.028564453125,
0.02490234375,
-0.019012451171875,
0.0325927734375,
-0.06524658203125,
-0.0292510986328125,
0.002086639404296875,
0.04718017578125,
-0.006778717041015625,
-0.02154541015625,
0.00047135353088378906,
-0.055908203125,
-0.01291656494140625,
-0.00940704345703125,
0.0164642333984375,
0.0438232421875,
0.00798797607421875,
0.0206146240234375,
-0.05938720703125,
-0.0138092041015625,
0.00940704345703125,
0.0149078369140625,
-0.02410888671875,
-0.0227813720703125,
-0.012359619140625,
-0.05413818359375,
-0.0014095306396484375,
0.0275421142578125,
0.01230621337890625,
-0.0160980224609375,
0.035797119140625,
0.04248046875,
-0.031524658203125,
-0.0192718505859375,
0.025726318359375,
-0.01479339599609375,
-0.0298309326171875,
-0.0281829833984375,
-0.005199432373046875,
0.0300140380859375,
0.0034122467041015625,
0.0133819580078125,
0.0258026123046875,
0.037200927734375,
-0.0023365020751953125,
-0.041900634765625,
0.01384735107421875,
-0.0406494140625,
0.040130615234375,
0.0164947509765625,
0.0294647216796875,
0.0191192626953125,
-0.0865478515625,
-0.035736083984375,
-0.00811004638671875,
-0.03887939453125,
0.03216552734375,
0.039947509765625,
-0.019500732421875,
0.00862884521484375,
0.02825927734375,
-0.056060791015625,
0.01488494873046875,
0.0380859375,
0.0024776458740234375,
-0.00991058349609375,
0.0133056640625,
-0.0202178955078125,
-0.007259368896484375,
-0.01065826416015625,
-0.01389312744140625,
0.03863525390625,
0.046417236328125,
0.02197265625,
0.0162200927734375,
0.031280517578125,
0.0116119384765625,
0.0211639404296875,
-0.0271759033203125,
0.00455474853515625,
0.00682830810546875,
-0.02923583984375,
0.01166534423828125,
-0.00881195068359375,
0.045196533203125,
-0.01387786865234375,
0.062286376953125,
-0.08551025390625,
-0.03399658203125,
0.0070343017578125,
0.0104522705078125,
-0.03436279296875,
0.040130615234375,
-0.0220489501953125,
-0.01534271240234375,
-0.044891357421875,
-0.033203125,
0.0369873046875,
0.048614501953125,
0.033416748046875,
0.0223541259765625,
-0.01096343994140625,
-0.0019474029541015625,
0.00043463706970214844,
0.00824737548828125,
0.0087127685546875,
0.03399658203125,
-0.055938720703125,
0.046234130859375,
0.009857177734375,
-0.01457977294921875,
0.0257415771484375,
0.0240478515625,
-0.0222930908203125,
0.002460479736328125,
0.019805908203125,
0.005306243896484375,
0.0295257568359375,
0.0509033203125,
-0.00896453857421875,
0.016387939453125,
-0.0011320114135742188,
-0.0154571533203125,
0.0054473876953125,
0.0262451171875,
-0.0355224609375,
-0.0182037353515625,
-0.0167694091796875,
-0.010589599609375,
-0.02142333984375,
-0.08294677734375,
-0.08563232421875,
-0.030975341796875,
-0.00955963134765625,
0.004123687744140625,
-0.033782958984375,
0.03436279296875,
-0.0153961181640625,
-0.0111541748046875,
-0.034210205078125,
0.01885986328125,
-0.026123046875,
-0.007312774658203125,
-0.057342529296875,
-0.0235137939453125,
-0.051239013671875,
0.01160430908203125,
-0.043365478515625,
-0.004940032958984375,
0.0243072509765625,
-0.0176239013671875,
-0.0440673828125,
-0.032440185546875,
-0.01262664794921875,
0.0058746337890625,
0.01067352294921875,
0.0003600120544433594,
0.033172607421875,
0.01849365234375,
-0.058074951171875,
-0.058135986328125,
0.0252838134765625,
-0.0127105712890625,
-0.0009975433349609375,
-0.004459381103515625,
-0.01123046875,
0.0106658935546875,
-0.02813720703125,
-0.0577392578125,
0.0120391845703125,
-0.006908416748046875,
-0.0304718017578125,
-0.0411376953125,
0.0128326416015625,
0.00429534912109375,
0.032928466796875,
-0.0004456043243408203,
-0.038360595703125,
-0.042266845703125,
0.01244354248046875,
0.037841796875,
0.0124969482421875,
0.0094146728515625,
0.03643798828125,
-0.054962158203125,
0.0287017822265625,
-0.00479888916015625,
0.0230865478515625,
-0.0227203369140625,
0.026702880859375,
0.0037860870361328125,
0.043365478515625,
-0.00750732421875,
0.01445770263671875,
0.0089569091796875,
-0.020294189453125,
0.01395416259765625,
-0.0034389495849609375,
-0.10687255859375,
-0.03436279296875,
0.09613037109375,
0.0928955078125,
0.05255126953125,
-0.016754150390625,
-0.050628662109375,
-0.03021240234375,
-0.0035552978515625,
-0.030731201171875,
0.034637451171875,
-0.09735107421875,
-0.0107574462890625,
0.01971435546875,
0.0027618408203125,
0.01163482666015625,
-0.022003173828125,
-0.0253143310546875,
-0.0191497802734375,
-0.0294036865234375,
-0.006061553955078125,
-0.05157470703125,
0.009674072265625,
-0.007526397705078125,
-0.02777099609375,
-0.0684814453125,
0.00530242919921875,
-0.00521087646484375,
-0.0609130859375,
-0.016082763671875,
-0.028961181640625,
-0.02777099609375,
-0.00020694732666015625,
0.0100860595703125,
0.0023479461669921875,
0.032745361328125,
0.006397247314453125,
0.00380706787109375,
0.0023193359375,
0.0242156982421875,
0.01308441162109375,
0.0139923095703125,
-0.0238494873046875,
0.01093292236328125,
-0.0012769699096679688,
0.033905029296875,
0.0234527587890625,
0.03765869140625,
0.0029888153076171875,
0.0517578125,
0.00920867919921875,
-0.044891357421875,
0.027252197265625,
-0.047332763671875,
-0.00968170166015625,
0.00722503662109375,
-0.0105133056640625,
-0.025054931640625,
-0.0138092041015625,
-0.04986572265625,
0.0027561187744140625,
0.002422332763671875
] |
bf9ea20a98a3ee1d77e9242cc9b6ba22957922c6
|
Wordpress Stackexchange
Q: Get the blog page URL set in Options I have set the blog to be a different page other than the home page.
I want to have a link from single.php to this blog page.
Is there any function that pulls out URL for the blog ?
A: To build on Sagive's answer, you'll want to wrap the ID in get_permalink() to get the actual link.
<a href="<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>">Our Blog</a>
|
Q: Get the blog page URL set in Options I have set the blog to be a different page other than the home page.
I want to have a link from single.php to this blog page.
Is there any function that pulls out URL for the blog ?
A: To build on Sagive's answer, you'll want to wrap the ID in get_permalink() to get the actual link.
<a href="<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>">Our Blog</a>
A: Best way to check the option before setting the permalink is as follows:
if ( get_option( 'page_for_posts' ) ) {
echo '<a href="'.esc_url(get_permalink( get_option( 'page_for_posts' ) )).'">'.esc_html__( 'Blog', 'textdomain' ).'</a>';
} else {
echo '<a href="'.esc_url( home_url( '/' ) ).'">'.esc_html__( 'Blog', 'textdomain' ).'</a>';
}
A: As of WordPress 4.5 you can use:
get_post_type_archive_link( 'post' );
This handles the logic of getting the correct URL regardless of whether posts show up on the homepage or in a specified page.
A: You can use get_option of page_for_posts to get the page ID to either assign it to a variable or to echo it if you wish to do so.
<?php $postsPageId = get_option('page_for_posts'); ?>
<a href="index.php?p=<?php echo $postsPageId; ?>">Our Blog</a>
For additional information of the defualt get_option visit: Option Reference
A: Agree with the Hugh Man that it is better to check the option before echoing the link, but it is possible to set the static page as a front page and leave the posts page empty. In this case, the link will just point to the home URL. A better approach is to provide a fallback to the posts archive page. Something like this:
function slug_all_posts_link() {
if ( 'page' == get_option( 'show_on_front' ) ) {
if ( get_option( 'page_for_posts' ) ) {
echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) );
} else {
echo esc_url( home_url( '/?post_type=post' ) );
}
} else {
echo esc_url( home_url( '/' ) );
}
}
|
wordpress
|
{
"language": "en",
"length": 319,
"provenance": "stackexchange_00019.jsonl.gz:419501",
"question_score": "54",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50509"
}
|
[
0.0411376953125,
-0.0226898193359375,
0.057952880859375,
0.04180908203125,
-0.0196075439453125,
-0.0155487060546875,
0.0838623046875,
-0.04840087890625,
-0.0247802734375,
-0.007175445556640625,
-0.020782470703125,
0.024871826171875,
-0.060150146484375,
-0.035491943359375,
0.046142578125,
-0.041534423828125,
0.044464111328125,
-0.0270843505859375,
0.0228424072265625,
0.0017957687377929688,
0.00637054443359375,
0.0220947265625,
0.0218505859375,
0.042327880859375,
0.052642822265625,
-0.0017948150634765625,
0.0211334228515625,
-0.00908660888671875,
0.021148681640625,
-0.01067352294921875,
0.03265380859375,
-0.0264434814453125,
0.0173492431640625,
0.012969970703125,
-0.01297760009765625,
-0.0537109375,
-0.0191192626953125,
0.012939453125,
-0.01367950439453125,
0.026275634765625,
0.01515960693359375,
-0.0060882568359375,
-0.01374053955078125,
0.045745849609375,
-0.01812744140625,
-0.045989990234375,
0.005306243896484375,
-0.04669189453125,
-0.005641937255859375,
0.01678466796875,
0.0132293701171875,
0.0198974609375,
0.0036411285400390625,
0.0129547119140625,
-0.0241851806640625,
-0.0316162109375,
0.050689697265625,
-0.033660888671875,
0.0328369140625,
-0.072509765625,
-0.0616455078125,
0.0029144287109375,
0.057525634765625,
0.02362060546875,
-0.0306396484375,
-0.01096343994140625,
-0.022979736328125,
0.0244903564453125,
-0.05670166015625,
-0.040283203125,
0.0296478271484375,
-0.024078369140625,
-0.00533294677734375,
-0.0284423828125,
-0.029754638671875,
0.017852783203125,
-0.00629425048828125,
-0.0253753662109375,
0.005496978759765625,
-0.00612640380859375,
-0.001171112060546875,
-0.0183258056640625,
-0.02423095703125,
-0.0447998046875,
0.0307464599609375,
-0.0105133056640625,
0.006809234619140625,
-0.0069580078125,
-0.051544189453125,
-0.0091094970703125,
-0.037353515625,
-0.0109710693359375,
-0.0253448486328125,
-0.01114654541015625,
-0.041259765625,
0.0090484619140625,
0.009490966796875,
0.03424072265625,
-0.0015354156494140625,
0.0158843994140625,
-0.032562255859375,
-0.02679443359375,
0.01202392578125,
-0.040740966796875,
-0.0181427001953125,
0.0001277923583984375,
0.0343017578125,
0.049530029296875,
0.0220794677734375,
0.0129241943359375,
-0.0259857177734375,
0.00597381591796875,
-0.037109375,
-0.01111602783203125,
-0.01502227783203125,
0.006519317626953125,
-0.06494140625,
-0.000012874603271484375,
-0.0173187255859375,
0.0006051063537597656,
0.0028133392333984375,
0.044708251953125,
-0.0036678314208984375,
0.0011968612670898438,
-0.03887939453125,
-0.01436614990234375,
0.01233673095703125,
-0.06121826171875,
-0.00677490234375,
0.0277862548828125,
-0.032318115234375,
0.005496978759765625,
0.04449462890625,
0.0173797607421875,
0.0103912353515625,
-0.03009033203125,
0.006717681884765625,
0.0003147125244140625,
-0.0004329681396484375,
0.001491546630859375,
0.017608642578125,
-0.0291748046875,
-0.0104217529296875,
-0.00021147727966308594,
-0.01322174072265625,
0.00786590576171875,
0.00849151611328125,
0.0223388671875,
-0.010833740234375,
-0.027191162109375,
-0.04095458984375,
0.03973388671875,
0.002643585205078125,
0.007587432861328125,
0.052886962890625,
-0.05364990234375,
0.0296783447265625,
-0.039825439453125,
0.060516357421875,
-0.02154541015625,
0.04766845703125,
0.015167236328125,
0.005924224853515625,
0.0134735107421875,
-0.0241851806640625,
-0.0281982421875,
-0.0284271240234375,
-0.0240020751953125,
0.0137939453125,
0.0087432861328125,
-0.0169525146484375,
-0.0078582763671875,
-0.003814697265625,
0.0152130126953125,
0.004184722900390625,
0.01142120361328125,
-0.01251983642578125,
0.00940704345703125,
-0.004833221435546875,
0.066162109375,
0.0276947021484375,
-0.0233917236328125,
-0.02154541015625,
0.0222625732421875,
-0.04388427734375,
0.05584716796875,
0.021087646484375,
0.06488037109375,
-0.0155792236328125,
0.0264129638671875,
0.00740814208984375,
0.0243377685546875,
-0.04132080078125,
0.0406494140625,
-0.00586700439453125,
-0.01226806640625,
-0.0248870849609375,
0.00307464599609375,
-0.035369873046875,
-0.0191802978515625,
-0.00849151611328125,
0.0021228790283203125,
0.0004494190216064453,
0.043792724609375,
0.014312744140625,
0.00893402099609375,
-0.006801605224609375,
0.008941650390625,
0.00811004638671875,
-0.0006165504455566406,
0.01248931884765625,
-0.00006347894668579102,
0.00836944580078125,
-0.052490234375,
-0.04345703125,
0.033050537109375,
-0.005809783935546875,
-0.0096435546875,
-0.0279388427734375,
-0.0062255859375,
-0.0309906005859375,
-0.0243988037109375,
-0.053314208984375,
0.047210693359375,
0.06610107421875,
-0.041595458984375,
-0.022216796875,
-0.062347412109375,
-0.031524658203125,
-0.01230621337890625,
-0.11834716796875,
0.082275390625,
0.019439697265625,
0.04583740234375,
-0.00597381591796875,
-0.007518768310546875,
0.01515960693359375,
-0.0155792236328125,
0.022308349609375,
0.0272369384765625,
0.037200927734375,
-0.004230499267578125,
0.01468658447265625,
0.01198577880859375,
0.0170440673828125,
-0.0171966552734375,
0.025115966796875,
-0.02001953125,
0.0004925727844238281,
0.045928955078125,
0.017852783203125,
0.0191650390625,
-0.0025577545166015625,
-0.0274200439453125,
-0.010589599609375,
0.03509521484375,
-0.03228759765625,
0.03167724609375,
-0.006404876708984375,
-0.0168304443359375,
-0.0096893310546875,
0.0185546875,
0.0253448486328125,
-0.0173797607421875,
0.0254669189453125,
0.035369873046875,
0.035736083984375,
0.048492431640625,
-0.0242919921875,
0.01471710205078125,
-0.00445556640625,
0.044952392578125,
-0.01184844970703125,
0.041412353515625,
0.037200927734375,
-0.03485107421875,
0.01151275634765625,
-0.02252197265625,
-0.042755126953125,
0.015350341796875,
-0.0103759765625,
0.02764892578125,
0.019256591796875,
-0.00250244140625,
-0.01454925537109375,
-0.0308685302734375,
0.0188446044921875,
0.0211944580078125,
0.006328582763671875,
0.016448974609375,
0.042510986328125,
0.001430511474609375,
-0.037750244140625,
0.0304412841796875,
0.01485443115234375,
-0.0275115966796875,
0.038299560546875,
-0.0684814453125,
0.05645751953125,
-0.039886474609375,
0.04925537109375,
0.062103271484375,
-0.0266265869140625,
0.045867919921875,
0.01258087158203125,
-0.0244293212890625,
0.00995635986328125,
-0.00897216796875,
-0.0091094970703125,
0.025238037109375,
-0.0560302734375,
0.0330810546875,
-0.007770538330078125,
0.01434326171875,
-0.0268096923828125,
-0.033782958984375,
-0.0280914306640625,
-0.00555419921875,
-0.09637451171875,
-0.0264892578125,
-0.001247406005859375,
-0.061126708984375,
0.006694793701171875,
-0.004180908203125,
-0.0276947021484375,
-0.0098419189453125,
0.0288848876953125,
0.004695892333984375,
0.044647216796875,
-0.0156707763671875,
-0.10919189453125,
-0.046234130859375,
-0.1236572265625,
0.01354217529296875,
-0.01849365234375,
0.01751708984375,
-0.0005311965942382812,
0.00833892822265625,
-0.01099395751953125,
-0.0643310546875,
-0.0055999755859375,
0.01419830322265625,
-0.0267791748046875,
-0.03717041015625,
-0.036651611328125,
-0.012115478515625,
-0.0234222412109375,
0.0003228187561035156,
0.05438232421875,
0.0030193328857421875,
-0.007030487060546875,
0.0183563232421875,
-0.040771484375,
-0.013397216796875,
0.036712646484375,
-0.027008056640625,
0.02593994140625,
0.036865234375,
0.02874755859375,
-0.01824951171875,
-0.0259246826171875,
-0.0158538818359375,
-0.062347412109375,
0.00238037109375,
0.053253173828125,
-0.0009012222290039062,
-0.0197601318359375,
-0.005462646484375,
-0.0168609619140625,
-0.01837158203125,
0.0242919921875,
-0.0208740234375,
0.03729248046875,
-0.016571044921875,
-0.01087188720703125,
-0.006977081298828125,
0.0079498291015625,
-0.025390625,
0.0034389495849609375,
0.004589080810546875,
-0.02490234375,
-0.01861572265625,
-0.00792694091796875,
-0.033172607421875,
-0.038116455078125,
0.048828125,
-0.035308837890625,
-0.004486083984375,
-0.0238189697265625,
-0.0235595703125,
0.01318359375,
0.08551025390625,
-0.01113128662109375,
-0.01332855224609375,
0.001270294189453125,
-0.002048492431640625,
-0.031005859375,
-0.02703857421875,
-0.05169677734375,
0.0010318756103515625,
-0.06597900390625,
-0.00759124755859375,
-0.004131317138671875,
-0.02947998046875,
0.00528717041015625,
0.033294677734375,
-0.0215911865234375,
-0.0165252685546875,
0.024200439453125,
0.017852783203125,
-0.016326904296875,
0.03533935546875,
-0.01580810546875,
0.0228424072265625,
-0.01238250732421875,
0.00807952880859375,
-0.040283203125,
-0.0261077880859375,
0.0538330078125,
-0.000965118408203125,
-0.0151519775390625,
-0.0396728515625,
0.004543304443359375,
0.0545654296875,
0.000762939453125,
-0.011810302734375,
0.0199127197265625,
-0.004230499267578125,
0.0159759521484375,
0.00881195068359375,
-0.0111236572265625,
-0.022674560546875,
-0.0002205371856689453,
-0.0148773193359375,
-0.04791259765625,
0.00262451171875,
-0.01117706298828125,
0.0183563232421875,
0.01111602783203125,
-0.028717041015625,
-0.053985595703125,
-0.018218994140625,
0.0170135498046875,
0.03076171875,
0.01238250732421875,
0.0086517333984375,
-0.0205841064453125,
-0.073974609375,
0.045654296875,
0.006404876708984375,
-0.0137176513671875,
-0.00598907470703125,
0.051788330078125,
0.016387939453125,
-0.028778076171875,
-0.00688934326171875,
0.0308990478515625,
0.03253173828125,
0.0011644363403320312,
0.07757568359375,
0.024078369140625,
-0.0015354156494140625,
0.049224853515625,
-0.00429534912109375,
0.00673675537109375,
-0.027130126953125,
0.025146484375,
-0.0024127960205078125,
-0.00019502639770507812,
0.01480865478515625,
-0.0175933837890625,
0.0325927734375,
0.057830810546875,
-0.02386474609375,
-0.014923095703125,
-0.006015777587890625,
0.0273284912109375,
-0.0440673828125,
0.035400390625,
-0.021484375,
-0.0293731689453125,
0.0044403076171875,
-0.0182952880859375,
0.0452880859375,
0.01605224609375,
0.0037212371826171875,
0.0294342041015625,
0.0430908203125,
0.00983428955078125,
0.0182342529296875,
0.02764892578125,
0.01023101806640625,
0.048492431640625,
-0.03564453125,
-0.01092529296875,
-0.00582122802734375,
-0.00716400146484375,
0.031585693359375,
0.00839996337890625,
-0.0251007080078125,
0.035400390625,
-0.01213836669921875,
-0.007678985595703125,
0.019012451171875,
-0.016326904296875,
0.0184478759765625,
0.006458282470703125,
-0.032196044921875,
-0.02203369140625,
-0.035858154296875,
-0.04779052734375,
-0.04205322265625,
0.023162841796875,
-0.004673004150390625,
0.025054931640625,
0.051422119140625,
0.07073974609375,
0.00620269775390625,
0.0736083984375,
-0.0447998046875,
-0.01253509521484375,
0.01149749755859375,
0.0108642578125,
0.020172119140625,
0.00464630126953125,
-0.003910064697265625,
-0.0164031982421875,
0.029571533203125,
-0.04730224609375,
-0.0191650390625,
0.0176239013671875,
0.05645751953125,
0.0263671875,
-0.00742340087890625,
-0.00859832763671875,
-0.006092071533203125,
-0.036102294921875,
0.0667724609375,
0.019805908203125,
-0.06768798828125,
-0.03497314453125,
0.0145721435546875,
0.02923583984375,
0.013275146484375,
-0.0159759521484375,
0.0260772705078125,
-0.00341796875,
0.027191162109375,
-0.0247344970703125,
-0.0163726806640625,
0.0126190185546875,
0.0214385986328125,
-0.027740478515625,
-0.036224365234375,
0.0178070068359375,
-0.0295257568359375,
0.0019779205322265625,
-0.03216552734375,
-0.0258636474609375,
0.0533447265625,
-0.0007643699645996094,
0.07598876953125,
-0.034942626953125,
-0.054229736328125,
-0.00934600830078125,
-0.01355743408203125,
0.06549072265625,
0.05230712890625,
-0.05926513671875,
0.019073486328125,
-0.05487060546875,
0.00531768798828125,
0.00795745849609375,
-0.0166015625,
-0.0443115234375,
-0.0301513671875,
0.017974853515625,
0.0301971435546875,
-0.0050506591796875,
-0.00963592529296875,
0.01050567626953125,
-0.002933502197265625,
-0.008636474609375,
0.033447265625,
0.00466156005859375,
0.051422119140625,
0.0241546630859375,
0.039154052734375,
0.0408935546875,
0.04205322265625,
-0.0289306640625,
-0.04461669921875,
-0.0013856887817382812,
0.0033702850341796875,
-0.0176239013671875,
0.00785064697265625,
0.004703521728515625,
-0.016265869140625,
0.02947998046875,
0.0033359527587890625,
-0.035064697265625,
-0.01560211181640625,
0.0012083053588867188,
-0.029296875,
0.0029048919677734375,
-0.0106658935546875,
-0.061370849609375,
-0.004253387451171875,
-0.00603485107421875,
-0.01230621337890625,
-0.0050201416015625,
0.0196990966796875,
-0.027130126953125,
0.0108489990234375,
-0.031707763671875,
0.0004703998565673828,
-0.02911376953125,
0.0411376953125,
0.124755859375,
0.0191192626953125,
0.059600830078125,
0.051605224609375,
0.0030117034912109375,
0.028045654296875,
0.0210418701171875,
-0.045166015625,
-0.027252197265625,
0.01479339599609375,
0.0044708251953125,
-0.0011148452758789062,
0.0184478759765625,
0.000011861324310302734,
0.0304718017578125,
0.032745361328125,
0.07659912109375,
-0.062469482421875,
0.029083251953125,
0.025970458984375,
0.0072479248046875,
0.0657958984375,
0.0211181640625,
-0.0144195556640625,
-0.021759033203125,
0.0186767578125,
-0.04962158203125,
-0.0166473388671875,
-0.00974273681640625,
-0.022247314453125,
-0.00891876220703125,
-0.03668212890625,
0.03509521484375,
0.016265869140625,
-0.059295654296875,
0.0275726318359375,
0.04034423828125,
-0.00563812255859375,
-0.035797119140625,
0.004779815673828125,
0.0249786376953125,
-0.016265869140625,
-0.041046142578125,
0.036773681640625,
-0.011077880859375,
0.007045745849609375,
-0.0020885467529296875,
-0.0272369384765625,
0.003787994384765625,
0.02532958984375,
-0.0296783447265625,
0.017669677734375,
-0.0021038055419921875,
-0.0428466796875,
0.0270538330078125,
-0.007137298583984375,
0.0364990234375,
-0.0101165771484375,
-0.00988006591796875,
0.004703521728515625,
-0.0122833251953125,
-0.0511474609375,
-0.01251983642578125,
-0.021575927734375,
0.10162353515625,
-0.0228271484375,
-0.0296478271484375,
0.03076171875,
-0.003570556640625,
-0.0244903564453125,
-0.016571044921875,
-0.0014896392822265625,
-0.0166473388671875,
0.0220489501953125,
-0.0232696533203125,
0.01629638671875,
0.01543426513671875,
-0.038848876953125,
-0.04425048828125,
0.0648193359375,
-0.0355224609375,
0.020751953125,
0.035980224609375,
0.021484375,
-0.01004791259765625,
0.007335662841796875,
-0.024017333984375,
0.0616455078125,
0.01090240478515625,
0.03704833984375,
-0.0706787109375,
-0.0177764892578125,
0.005168914794921875,
0.041717529296875,
0.031524658203125,
0.00757598876953125,
-0.004108428955078125,
-0.01531219482421875,
0.0198822021484375,
0.0340576171875,
0.0038280487060546875,
0.0169830322265625,
0.0187530517578125,
0.06610107421875,
0.06658935546875,
-0.04473876953125,
0.0222625732421875,
0.0166473388671875,
0.004421234130859375,
0.0517578125,
0.01537322998046875,
-0.0015668869018554688,
0.03955078125,
-0.0257720947265625,
-0.061767578125,
0.030670166015625,
0.0419921875,
-0.046295166015625,
-0.002590179443359375,
0.052337646484375,
0.0521240234375,
-0.053558349609375,
-0.004241943359375,
-0.0323486328125,
0.04754638671875,
-0.0013446807861328125,
-0.01366424560546875,
0.01250457763671875,
0.0161285400390625,
0.028472900390625,
-0.04046630859375,
-0.0172576904296875,
0.00994873046875,
0.0017232894897460938,
0.07550048828125,
0.0491943359375,
0.018280029296875,
-0.0379638671875,
0.005252838134765625,
0.0259552001953125,
0.0736083984375,
-0.05218505859375,
0.003543853759765625,
0.006511688232421875,
-0.004802703857421875,
0.00511932373046875,
-0.048858642578125,
-0.0027027130126953125,
0.01367950439453125,
-0.004669189453125,
-0.01287841796875,
0.0014019012451171875,
0.0304412841796875,
0.0299530029296875,
0.00308990478515625,
-0.032867431640625,
-0.035125732421875,
0.01316070556640625,
-0.006755828857421875,
-0.016815185546875,
-0.021942138671875,
0.0292205810546875,
0.031158447265625,
0.024810791015625,
-0.046875,
-0.00395965576171875,
0.0138397216796875,
0.037628173828125,
-0.024871826171875,
-0.00926971435546875,
-0.039276123046875,
-0.07366943359375,
0.006488800048828125,
0.0462646484375,
0.04290771484375,
-0.025970458984375,
0.026336669921875,
0.0012865066528320312,
-0.02215576171875,
-0.004055023193359375,
0.0187530517578125,
-0.01158905029296875,
0.05743408203125,
-0.0391845703125,
0.0308990478515625,
-0.01416015625,
-0.0211639404296875,
-0.00848388671875,
-0.0128326416015625,
0.0504150390625,
-0.018402099609375,
0.0653076171875,
-0.004940032958984375,
0.0171356201171875,
0.04498291015625,
0.00006574392318725586,
0.0246429443359375,
0.0022487640380859375,
-0.038970947265625,
-0.0059661865234375,
-0.012359619140625,
-0.017242431640625,
0.011322021484375,
0.04547119140625,
0.01480865478515625,
-0.007114410400390625,
-0.03741455078125,
0.0102691650390625,
0.0095977783203125,
-0.030364990234375,
-0.00949859619140625,
0.04522705078125,
0.0234222412109375,
0.01209259033203125,
-0.09716796875,
-0.062255859375,
-0.03759765625,
0.038238525390625,
0.0186767578125,
0.051605224609375,
0.006755828857421875,
0.0252685546875,
0.003314971923828125,
0.03985595703125,
-0.048065185546875,
-0.004009246826171875,
0.00995635986328125,
-0.00621795654296875,
0.0260009765625,
-0.0058135986328125,
-0.062469482421875,
0.04254150390625,
0.0202789306640625,
0.0078887939453125,
0.049072265625,
-0.038543701171875,
0.0012540817260742188,
-0.019012451171875,
0.0234222412109375,
-0.034423828125,
-0.0335693359375,
-0.045745849609375,
-0.0267181396484375,
0.037445068359375,
0.0269927978515625,
0.01136016845703125,
0.044189453125,
-0.014923095703125,
-0.015625,
0.0213165283203125,
-0.031890869140625,
0.03326416015625,
0.025421142578125,
-0.02239990234375,
-0.02423095703125,
0.0127105712890625,
-0.0233154296875,
0.040557861328125,
-0.00946044921875,
0.039215087890625,
0.0208282470703125,
-0.0071563720703125,
0.032440185546875,
-0.0455322265625,
0.0174560546875,
-0.03338623046875,
-0.0152740478515625,
0.016754150390625,
0.0390625,
-0.01558685302734375,
0.0005102157592773438,
-0.013885498046875,
-0.03369140625,
-0.012725830078125,
0.010284423828125,
-0.0224456787109375,
-0.0379638671875,
-0.0162353515625,
-0.029510498046875,
0.00617218017578125,
-0.0244598388671875,
0.0059814453125,
-0.0213775634765625,
-0.0285186767578125,
0.03143310546875,
-0.059234619140625,
0.01885986328125,
0.0008497238159179688,
0.046783447265625,
-0.052520751953125,
-0.0090789794921875,
-0.0160369873046875,
-0.002544403076171875,
-0.01070404052734375,
0.052581787109375,
0.0711669921875,
-0.047027587890625,
-0.0258941650390625,
0.05474853515625,
0.02178955078125,
0.1060791015625,
-0.0302886962890625,
-0.00759124755859375,
0.00533294677734375,
0.016143798828125,
-0.027252197265625,
-0.0614013671875,
0.0276947021484375,
-0.039703369140625,
-0.022308349609375,
0.034210205078125,
-0.0308685302734375,
0.00921630859375,
-0.036651611328125,
-0.0531005859375,
0.0634765625,
-0.000025510787963867188,
-0.038604736328125,
-0.0181732177734375,
0.003101348876953125,
0.001735687255859375,
0.00856781005859375,
0.0088348388671875,
-0.0177001953125,
-0.026458740234375,
0.011474609375,
0.0303497314453125,
0.0626220703125,
0.0054473876953125,
0.0201416015625,
-0.0056915283203125,
0.039337158203125,
0.0171661376953125,
0.0283203125,
0.0176544189453125,
-0.02154541015625,
0.024444580078125,
0.04010009765625,
-0.043487548828125,
-0.028228759765625,
-0.0167999267578125,
0.00974273681640625,
-0.00832366943359375,
-0.0533447265625,
-0.0120697021484375,
-0.01439666748046875,
0.041717529296875,
0.0224609375,
0.009979248046875,
-0.0207061767578125,
-0.0274200439453125,
-0.02630615234375,
-0.06756591796875,
-0.01214599609375,
0.04608154296875,
-0.0576171875,
0.047119140625,
-0.01210784912109375,
-0.0135498046875,
-0.00888824462890625,
0.0089263916015625,
-0.022918701171875,
0.005603790283203125,
0.033538818359375,
0.0110931396484375,
-0.04241943359375,
0.00786590576171875,
0.057586669921875,
-0.0300140380859375,
0.02392578125,
0.000743865966796875,
0.004207611083984375,
0.03143310546875,
-0.0029506683349609375,
0.025238037109375,
0.0224151611328125,
-0.028594970703125,
-0.0028705596923828125,
0.03424072265625,
0.01715087890625,
0.0034999847412109375,
-0.03509521484375,
-0.00959014892578125,
0.039276123046875,
0.01177978515625,
0.03094482421875,
-0.0005612373352050781,
-0.004650115966796875,
-0.0009765625,
0.023040771484375,
-0.0080413818359375,
0.05157470703125,
0.0011701583862304688,
0.036895751953125,
-0.031494140625,
-0.0076446533203125,
-0.0037136077880859375,
-0.036895751953125,
-0.00942230224609375,
-0.01331329345703125,
-0.018798828125,
-0.03778076171875,
0.0161895751953125,
0.0200042724609375,
-0.01373291015625,
0.0275421142578125
] |
98d4347188c0b35dbbff2995539293b96ea8d9f7
|
Wordpress Stackexchange
Q: How to map permalinks with accented letters to sanitized slugs? To keep legacy entries on a blog hosted on TypePad on sync with a new WordPress installation...
How do I map this permalink with accented letters:
domain.com/no-es-fácil-alejarse-de-la-política
to this clean WP permalink without accented letter:
domain.com/no-es-facil-alejarse-de-la-politica
What is the best way to accomplish this?
A: The best way to accomplish this is remove the default sanitize_title filter and replace it with yours, which will encode those characters properly. Here is an implementation of using accents in permalinks.
Example:
remove_filter( 'sanitize_title', 'sanitize_title_with_dashes');
add_filter( 'sanitize_title', 'restore_raw_title', 9, 3 );
function sweURLtoCHAR($text)
{
$url=array(
"%C3%81","%C3%A1",
"%C3%8D","%C3%AD"
);
$char=array(
"Á","á",
"Í","í"
);
$str = str_replace($char,$url,$text);
$str_new = str_replace(" ", "", $str);
return strtolower($str_new);
}
function restore_raw_title( $title, $raw_title, $context ) {
if ( $context == 'save' )
return sweURLtoCHAR($raw_title);
else {
$title_new = str_replace(" ", "", $title);
return strtolower($title_new);
}
}
You can find the characters and their utf8 hex here and build an array with the accented characters you need.
|
Q: How to map permalinks with accented letters to sanitized slugs? To keep legacy entries on a blog hosted on TypePad on sync with a new WordPress installation...
How do I map this permalink with accented letters:
domain.com/no-es-fácil-alejarse-de-la-política
to this clean WP permalink without accented letter:
domain.com/no-es-facil-alejarse-de-la-politica
What is the best way to accomplish this?
A: The best way to accomplish this is remove the default sanitize_title filter and replace it with yours, which will encode those characters properly. Here is an implementation of using accents in permalinks.
Example:
remove_filter( 'sanitize_title', 'sanitize_title_with_dashes');
add_filter( 'sanitize_title', 'restore_raw_title', 9, 3 );
function sweURLtoCHAR($text)
{
$url=array(
"%C3%81","%C3%A1",
"%C3%8D","%C3%AD"
);
$char=array(
"Á","á",
"Í","í"
);
$str = str_replace($char,$url,$text);
$str_new = str_replace(" ", "", $str);
return strtolower($str_new);
}
function restore_raw_title( $title, $raw_title, $context ) {
if ( $context == 'save' )
return sweURLtoCHAR($raw_title);
else {
$title_new = str_replace(" ", "", $title);
return strtolower($title_new);
}
}
You can find the characters and their utf8 hex here and build an array with the accented characters you need.
A: You could make a redirection with .htacces or perhaps try out the wordpress plugin redirection.
|
wordpress
|
{
"language": "en",
"length": 184,
"provenance": "stackexchange_00019.jsonl.gz:419508",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50533"
}
|
[
0.0202484130859375,
-0.0015020370483398438,
0.021514892578125,
0.02154541015625,
0.0007390975952148438,
-0.01708984375,
0.042144775390625,
-0.049468994140625,
0.0190582275390625,
0.0311126708984375,
0.04962158203125,
-0.007770538330078125,
0.02935791015625,
-0.05389404296875,
0.01122283935546875,
0.03265380859375,
0.0125579833984375,
-0.022064208984375,
-0.01045989990234375,
-0.03375244140625,
0.00426483154296875,
-0.034637451171875,
0.004230499267578125,
-0.0440673828125,
0.0411376953125,
-0.06573486328125,
0.10455322265625,
-0.035369873046875,
0.018798828125,
-0.050445556640625,
0.01898193359375,
0.0117645263671875,
0.0266876220703125,
0.0054168701171875,
0.018402099609375,
0.035400390625,
-0.01091766357421875,
0.01146697998046875,
0.009185791015625,
0.010833740234375,
0.007183074951171875,
0.00861358642578125,
-0.003429412841796875,
0.04095458984375,
-0.021270751953125,
-0.0584716796875,
0.010101318359375,
-0.0428466796875,
0.0164947509765625,
0.022552490234375,
0.0159454345703125,
0.001125335693359375,
0.0171356201171875,
0.037567138671875,
-0.007015228271484375,
-0.00039649009704589844,
-0.01081085205078125,
0.008209228515625,
0.001483917236328125,
0.03338623046875,
0.00737762451171875,
0.031402587890625,
-0.00962066650390625,
-0.021209716796875,
-0.0135040283203125,
-0.01184844970703125,
0.017120361328125,
0.00547027587890625,
-0.051727294921875,
-0.003047943115234375,
0.046234130859375,
-0.0277862548828125,
0.007389068603515625,
-0.036346435546875,
-0.01044464111328125,
0.0352783203125,
-0.0438232421875,
-0.0110015869140625,
0.02801513671875,
-0.0032405853271484375,
0.00975799560546875,
-0.005939483642578125,
0.0237274169921875,
-0.0244903564453125,
0.00787353515625,
-0.0236663818359375,
-0.00868988037109375,
-0.0003256797790527344,
-0.04351806640625,
0.03363037109375,
-0.0233917236328125,
-0.02105712890625,
-0.02093505859375,
0.01206207275390625,
0.016845703125,
-0.0271148681640625,
0.026275634765625,
0.0615234375,
-0.023162841796875,
0.032989501953125,
0.033660888671875,
-0.0577392578125,
0.08428955078125,
-0.06646728515625,
0.00841522216796875,
0.00661468505859375,
-0.0031223297119140625,
-0.006290435791015625,
0.0244903564453125,
0.01531219482421875,
-0.027496337890625,
0.046875,
-0.0136566162109375,
-0.04766845703125,
-0.0207977294921875,
0.06536865234375,
-0.004222869873046875,
0.016571044921875,
0.018341064453125,
0.01474761962890625,
-0.00514984130859375,
0.0191192626953125,
0.005504608154296875,
0.004810333251953125,
-0.01465606689453125,
-0.007472991943359375,
0.01226806640625,
-0.0401611328125,
-0.0104827880859375,
0.039337158203125,
-0.023956298828125,
-0.00383758544921875,
0.028106689453125,
0.0300445556640625,
-0.0038509368896484375,
-0.034759521484375,
0.018157958984375,
0.00826263427734375,
0.0027446746826171875,
0.01934814453125,
0.0103302001953125,
-0.00791168212890625,
0.0281982421875,
0.007671356201171875,
0.045440673828125,
0.0199432373046875,
-0.0189208984375,
0.00641632080078125,
0.050445556640625,
-0.007335662841796875,
0.03375244140625,
-0.08221435546875,
0.055267333984375,
-0.00539398193359375,
-0.0869140625,
-0.047515869140625,
-0.0013875961303710938,
-0.04986572265625,
-0.0188140869140625,
-0.08746337890625,
-0.0013170242309570312,
-0.0157318115234375,
-0.0003516674041748047,
0.01126861572265625,
-0.01184844970703125,
0.0194854736328125,
0.00812530517578125,
0.00435638427734375,
0.0018167495727539062,
-0.0123443603515625,
-0.0142822265625,
0.01158905029296875,
-0.01959228515625,
-0.039215087890625,
-0.00899505615234375,
-0.022491455078125,
-0.020904541015625,
0.049560546875,
-0.000568389892578125,
0.06182861328125,
0.05810546875,
-0.019561767578125,
0.0242462158203125,
0.03173828125,
-0.041961669921875,
0.0043792724609375,
0.0088043212890625,
0.07794189453125,
0.0155029296875,
0.023529052734375,
0.0017652511596679688,
-0.00408935546875,
-0.0280609130859375,
0.007518768310546875,
-0.00894927978515625,
-0.01983642578125,
0.0240325927734375,
0.005401611328125,
-0.003780364990234375,
0.01678466796875,
0.043304443359375,
-0.0009307861328125,
-0.0167236328125,
0.0007777214050292969,
-0.056610107421875,
0.012481689453125,
-0.0264892578125,
0.016204833984375,
0.0167236328125,
0.03961181640625,
0.01129150390625,
0.016510009765625,
-0.035552978515625,
-0.0024814605712890625,
-0.0004520416259765625,
0.0228729248046875,
0.034210205078125,
-0.00778961181640625,
-0.025421142578125,
-0.025390625,
-0.004642486572265625,
-0.04974365234375,
-0.028839111328125,
0.0699462890625,
0.0200653076171875,
-0.04144287109375,
0.01027679443359375,
-0.028167724609375,
-0.00829315185546875,
-0.0167236328125,
-0.0161285400390625,
0.051422119140625,
0.060028076171875,
0.03424072265625,
-0.04351806640625,
-0.01018524169921875,
-0.04547119140625,
-0.0372314453125,
-0.00196075439453125,
0.0655517578125,
0.053741455078125,
0.0289459228515625,
0.01105499267578125,
-0.0404052734375,
0.0188446044921875,
-0.03619384765625,
0.042694091796875,
-0.049591064453125,
-0.01515960693359375,
0.019134521484375,
0.00372314453125,
-0.019500732421875,
0.0246124267578125,
-0.03271484375,
-0.018402099609375,
0.03582763671875,
-0.0247955322265625,
-0.013946533203125,
0.0131378173828125,
0.0122833251953125,
-0.0034885406494140625,
-0.0196533203125,
0.00531768798828125,
-0.0208892822265625,
0.00936126708984375,
-0.00765228271484375,
0.0013561248779296875,
-0.005664825439453125,
-0.0147247314453125,
-0.01922607421875,
0.0269775390625,
0.016693115234375,
-0.0136871337890625,
0.0212860107421875,
0.047637939453125,
-0.01190185546875,
-0.030242919921875,
0.004726409912109375,
0.0129852294921875,
0.008331298828125,
0.0238037109375,
0.0743408203125,
0.04388427734375,
-0.0065155029296875,
-0.0204315185546875,
-0.03472900390625,
0.0019207000732421875,
-0.0118408203125,
-0.003704071044921875,
-0.02337646484375,
-0.0052947998046875,
0.055023193359375,
-0.006618499755859375,
0.050537109375,
0.03521728515625,
-0.0184173583984375,
0.05426025390625,
-0.04833984375,
0.030548095703125,
-0.0153656005859375,
0.044464111328125,
0.07269287109375,
0.0384521484375,
-0.028656005859375,
0.01253509521484375,
-0.019378662109375,
0.0189208984375,
0.0260009765625,
0.01190948486328125,
-0.016082763671875,
-0.040679931640625,
-0.0012292861938476562,
-0.0006589889526367188,
0.004669189453125,
-0.041229248046875,
-0.056182861328125,
-0.01079559326171875,
-0.007293701171875,
-0.093994140625,
-0.0694580078125,
0.053466796875,
0.006954193115234375,
-0.01085662841796875,
0.042083740234375,
0.0054473876953125,
-0.0285186767578125,
0.03875732421875,
-0.02349853515625,
0.04541015625,
-0.0256195068359375,
-0.068115234375,
-0.034637451171875,
-0.06964111328125,
-0.0350341796875,
-0.010467529296875,
-0.0158538818359375,
0.01137542724609375,
-0.07708740234375,
-0.0174560546875,
0.0133209228515625,
0.031951904296875,
0.03240966796875,
0.0020809173583984375,
-0.0323486328125,
0.0204925537109375,
-0.01206207275390625,
-0.030487060546875,
-0.003650665283203125,
0.02227783203125,
0.0263824462890625,
-0.0256805419921875,
0.0242156982421875,
-0.0090179443359375,
-0.0112457275390625,
0.01009368896484375,
-0.0106201171875,
0.0036678314208984375,
0.02752685546875,
0.0189208984375,
-0.02996826171875,
-0.042633056640625,
-0.0189208984375,
-0.050689697265625,
0.044769287109375,
0.0221099853515625,
0.001987457275390625,
-0.01050567626953125,
0.042388916015625,
0.010772705078125,
0.0084686279296875,
0.037109375,
-0.007686614990234375,
-0.009735107421875,
-0.0069732666015625,
-0.00652313232421875,
-0.0271453857421875,
0.042327880859375,
-0.0014982223510742188,
0.005367279052734375,
0.0098114013671875,
0.0296478271484375,
0.009063720703125,
-0.0009241104125976562,
-0.01250457763671875,
-0.0296783447265625,
0.0308074951171875,
-0.051849365234375,
0.0175628662109375,
-0.048004150390625,
-0.01195526123046875,
-0.03173828125,
0.06689453125,
-0.048583984375,
-0.024993896484375,
0.00995635986328125,
0.02264404296875,
-0.0280914306640625,
-0.032196044921875,
-0.0469970703125,
-0.0269775390625,
-0.09564208984375,
-0.0047607421875,
-0.0030384063720703125,
-0.05230712890625,
-0.01012420654296875,
-0.0274658203125,
-0.04998779296875,
-0.029144287109375,
0.0173187255859375,
0.0186920166015625,
0.00167083740234375,
0.0292816162109375,
-0.0014696121215820312,
0.023284912109375,
-0.019744873046875,
-0.0124664306640625,
-0.0445556640625,
-0.01418304443359375,
-0.015777587890625,
0.03277587890625,
0.00974273681640625,
-0.0273895263671875,
-0.015045166015625,
0.044281005859375,
0.00797271728515625,
0.0271759033203125,
0.01155853271484375,
0.0065765380859375,
0.02215576171875,
0.0333251953125,
0.0147857666015625,
-0.00010639429092407227,
0.031402587890625,
0.0249176025390625,
-0.0780029296875,
-0.006542205810546875,
-0.010101318359375,
0.0078125,
0.04669189453125,
-0.07891845703125,
-0.06640625,
-0.01053619384765625,
0.016754150390625,
0.046478271484375,
-0.00926971435546875,
0.006732940673828125,
-0.0207977294921875,
-0.068359375,
0.01629638671875,
0.0335693359375,
-0.00482177734375,
-0.0198516845703125,
0.02191162109375,
0.0300445556640625,
-0.041656494140625,
0.06207275390625,
0.00283050537109375,
0.01299285888671875,
-0.00669097900390625,
0.049530029296875,
0.0205841064453125,
-0.003082275390625,
0.0035953521728515625,
-0.004638671875,
-0.0068206787109375,
0.027679443359375,
-0.04803466796875,
0.0202178955078125,
-0.0211334228515625,
-0.0014200210571289062,
0.023345947265625,
0.0472412109375,
0.02362060546875,
-0.005279541015625,
0.0181427001953125,
-0.051483154296875,
0.014373779296875,
0.021453857421875,
-0.0282135009765625,
-0.030242919921875,
-0.05938720703125,
0.03521728515625,
0.0028228759765625,
0.017730712890625,
0.003093719482421875,
-0.0007929801940917969,
0.00022673606872558594,
-0.03729248046875,
-0.0025730133056640625,
-0.005832672119140625,
0.01396942138671875,
-0.0027313232421875,
0.043487548828125,
-0.008270263671875,
-0.004009246826171875,
-0.0219268798828125,
-0.00606536865234375,
0.035797119140625,
-0.00644683837890625,
-0.0258026123046875,
-0.01206207275390625,
-0.015777587890625,
-0.02740478515625,
0.0101165771484375,
-0.0046234130859375,
-0.0199432373046875,
0.02142333984375,
-0.0008172988891601562,
0.023712158203125,
0.01003265380859375,
0.00844573974609375,
-0.003971099853515625,
-0.00946807861328125,
0.006778717041015625,
-0.0159454345703125,
-0.0276336669921875,
0.041015625,
0.005504608154296875,
-0.003200531005859375,
0.0011072158813476562,
-0.0192413330078125,
0.0183258056640625,
0.05242919921875,
0.01465606689453125,
-0.04638671875,
-0.015472412109375,
0.0557861328125,
0.027740478515625,
-0.0552978515625,
-0.01824951171875,
0.057464599609375,
0.063720703125,
-0.0259552001953125,
-0.032379150390625,
-0.0003228187561035156,
-0.0298004150390625,
-0.017303466796875,
0.046295166015625,
-0.0001277923583984375,
-0.05120849609375,
-0.03228759765625,
0.003215789794921875,
0.022674560546875,
-0.018341064453125,
0.00234222412109375,
-0.0006208419799804688,
-0.01181793212890625,
0.0186004638671875,
-0.002166748046875,
0.0194244384765625,
-0.01235198974609375,
-0.01345062255859375,
0.0238037109375,
-0.03564453125,
-0.0024814605712890625,
0.020904541015625,
0.01325225830078125,
-0.0201568603515625,
-0.003696441650390625,
0.0272674560546875,
0.0019006729125976562,
0.07696533203125,
-0.038818359375,
-0.0140380859375,
0.03729248046875,
-0.0020751953125,
0.0135498046875,
-0.028900146484375,
-0.032958984375,
-0.0253448486328125,
-0.03411865234375,
0.00970458984375,
0.039947509765625,
-0.0165252685546875,
-0.00775909423828125,
-0.0191497802734375,
0.00875091552734375,
0.00997161865234375,
0.0282745361328125,
0.039093017578125,
0.022369384765625,
0.01415252685546875,
-0.007038116455078125,
0.057098388671875,
-0.048126220703125,
0.060211181640625,
-0.00905609130859375,
0.0100250244140625,
-0.029296875,
0.041168212890625,
0.041412353515625,
-0.006687164306640625,
-0.0162200927734375,
-0.036773681640625,
0.00031685829162597656,
0.00786590576171875,
0.0377197265625,
0.0305328369140625,
0.04339599609375,
0.00711822509765625,
0.041412353515625,
-0.020294189453125,
0.0202178955078125,
-0.0183258056640625,
0.0217437744140625,
-0.06768798828125,
0.00505828857421875,
-0.006038665771484375,
-0.004764556884765625,
0.048828125,
-0.0030879974365234375,
0.0022735595703125,
-0.00644683837890625,
-0.0218658447265625,
-0.0072479248046875,
0.0271453857421875,
-0.026519775390625,
0.002788543701171875,
-0.00677490234375,
0.0287933349609375,
0.0181884765625,
-0.0278472900390625,
0.029815673828125,
-0.0033054351806640625,
-0.06243896484375,
0.04205322265625,
0.079833984375,
0.0169677734375,
-0.04522705078125,
0.046295166015625,
-0.006000518798828125,
-0.00022161006927490234,
-0.032867431640625,
0.06768798828125,
0.0399169921875,
-0.08404541015625,
-0.025238037109375,
-0.0026874542236328125,
0.0006785392761230469,
-0.022064208984375,
0.025665283203125,
-0.028350830078125,
-0.03411865234375,
0.02044677734375,
-0.07379150390625,
-0.0244293212890625,
-0.016632080078125,
-0.0077362060546875,
0.00015866756439208984,
-0.0160369873046875,
0.032257080078125,
0.0006728172302246094,
-0.0165252685546875,
-0.021881103515625,
0.0147705078125,
-0.007366180419921875,
-0.0246429443359375,
-0.013397216796875,
0.037200927734375,
-0.0199432373046875,
-0.033721923828125,
0.049407958984375,
-0.0176849365234375,
0.0118255615234375,
-0.0013322830200195312,
0.025604248046875,
0.0408935546875,
0.03253173828125,
0.01334381103515625,
-0.039276123046875,
0.0159149169921875,
-0.020751953125,
0.0272979736328125,
-0.03509521484375,
-0.011566162109375,
0.016632080078125,
-0.0025005340576171875,
0.006000518798828125,
0.014556884765625,
-0.0167388916015625,
0.0025310516357421875,
0.027069091796875,
0.08380126953125,
-0.0221710205078125,
-0.032470703125,
0.0248260498046875,
-0.0294189453125,
-0.0006265640258789062,
-0.0162200927734375,
0.0128631591796875,
-0.0767822265625,
-0.05670166015625,
-0.017486572265625,
-0.072998046875,
0.0033321380615234375,
-0.0278472900390625,
-0.08355712890625,
0.125732421875,
0.006755828857421875,
0.0821533203125,
0.0291900634765625,
0.0242462158203125,
-0.029876708984375,
0.00875091552734375,
-0.00677490234375,
0.03759765625,
-0.046844482421875,
-0.00527191162109375,
-0.043060302734375,
-0.004024505615234375,
-0.00962066650390625,
0.0291290283203125,
0.04315185546875,
0.00630950927734375,
-0.021820068359375,
-0.021392822265625,
0.0214691162109375,
0.00955963134765625,
-0.0127410888671875,
0.04364013671875,
-0.0010290145874023438,
0.04022216796875,
0.015655517578125,
-0.044097900390625,
0.01381683349609375,
-0.02398681640625,
-0.0308685302734375,
0.0124969482421875,
0.00201416015625,
0.0059356689453125,
0.049652099609375,
-0.0236968994140625,
-0.0450439453125,
0.0283203125,
0.033416748046875,
-0.040618896484375,
0.0311737060546875,
-0.0162353515625,
0.007312774658203125,
-0.07666015625,
-0.0401611328125,
-0.01568603515625,
0.02545166015625,
-0.00853729248046875,
0.0011358261108398438,
0.040283203125,
0.0236968994140625,
-0.00022923946380615234,
-0.0338134765625,
0.00020992755889892578,
-0.01474761962890625,
-0.006183624267578125,
0.038818359375,
0.064208984375,
0.0302276611328125,
0.045135498046875,
0.0406494140625,
0.05419921875,
0.060302734375,
-0.051727294921875,
-0.01158905029296875,
0.0078582763671875,
0.0018100738525390625,
-0.0062408447265625,
-0.011138916015625,
0.0270843505859375,
-0.0169830322265625,
-0.0174560546875,
-0.0044097900390625,
0.00576019287109375,
0.0283050537109375,
-0.007106781005859375,
0.0018787384033203125,
-0.019439697265625,
0.002346038818359375,
0.033233642578125,
-0.046630859375,
0.01308441162109375,
-0.01134490966796875,
0.05303955078125,
0.038604736328125,
0.036865234375,
-0.01126861572265625,
-0.043853759765625,
-0.01428985595703125,
0.03643798828125,
0.0333251953125,
-0.020477294921875,
-0.007747650146484375,
-0.0146942138671875,
0.0276641845703125,
0.00726318359375,
0.0146942138671875,
0.0087890625,
0.062347412109375,
0.04901123046875,
-0.013427734375,
-0.0177154541015625,
0.006694793701171875,
-0.0017108917236328125,
0.044281005859375,
-0.0100860595703125,
0.007259368896484375,
-0.00917816162109375,
-0.0226287841796875,
-0.0279541015625,
0.025970458984375,
0.00702667236328125,
-0.0244598388671875,
0.04241943359375,
-0.0008707046508789062,
0.0207366943359375,
0.0193328857421875,
0.00778961181640625,
-0.00464630126953125,
0.0212860107421875,
-0.05072021484375,
-0.003993988037109375,
0.01345062255859375,
-0.067626953125,
0.0272064208984375,
0.050750732421875,
-0.0092620849609375,
0.00400543212890625,
0.032440185546875,
-0.007457733154296875,
-0.00441741943359375,
0.0271453857421875,
0.0006403923034667969,
0.0008559226989746094,
0.023529052734375,
0.004314422607421875,
-0.0005335807800292969,
0.0056304931640625,
0.0201873779296875,
0.032958984375,
-0.0157623291015625,
0.056365966796875,
-0.0256195068359375,
-0.004840850830078125,
-0.00841522216796875,
-0.01554107666015625,
-0.021942138671875,
-0.003261566162109375,
0.0111083984375,
-0.01215362548828125,
0.0009484291076660156,
0.0033092498779296875,
-0.0031833648681640625,
0.0138702392578125,
0.016632080078125,
-0.031707763671875,
0.0236663818359375,
-0.04803466796875,
0.0207977294921875,
-0.01531982421875,
0.057342529296875,
-0.029510498046875,
-0.03668212890625,
-0.0848388671875,
-0.03875732421875,
0.051544189453125,
0.01361083984375,
-0.0479736328125,
0.04510498046875,
-0.002582550048828125,
0.00838470458984375,
0.02294921875,
-0.0290069580078125,
0.01416015625,
0.0316162109375,
-0.01383209228515625,
0.04315185546875,
0.0247802734375,
-0.0184173583984375,
0.00926971435546875,
0.022064208984375,
-0.03363037109375,
0.0015668869018554688,
-0.032562255859375,
-0.03826904296875,
-0.020263671875,
0.011962890625,
0.0024929046630859375,
0.01088714599609375,
-0.06591796875,
0.0019626617431640625,
0.025177001953125,
0.01523590087890625,
-0.0185546875,
-0.0042266845703125,
-0.007137298583984375,
0.0026340484619140625,
0.0062255859375,
-0.03216552734375,
-0.03485107421875,
-0.011260986328125,
-0.0289764404296875,
-0.0193023681640625,
0.0057830810546875,
-0.002086639404296875,
-0.0092926025390625,
0.0104522705078125,
-0.07244873046875,
-0.0213470458984375,
-0.0311431884765625,
-0.00843048095703125,
-0.03192138671875,
-0.05560302734375,
-0.060211181640625,
0.043914794921875,
-0.054443359375,
-0.0202178955078125,
0.02508544921875,
-0.0010633468627929688,
-0.052825927734375,
-0.0635986328125,
-0.01500701904296875,
-0.01424407958984375,
0.0161895751953125,
-0.00420379638671875,
0.0347900390625,
0.0015077590942382812,
-0.0543212890625,
-0.0955810546875,
0.0186767578125,
-0.090087890625,
0.004062652587890625,
-0.0016078948974609375,
-0.0280303955078125,
-0.0291900634765625,
-0.0439453125,
-0.03363037109375,
0.05523681640625,
0.020477294921875,
-0.0120849609375,
-0.0027828216552734375,
-0.01528167724609375,
0.0165863037109375,
0.0013141632080078125,
-0.01088714599609375,
-0.005481719970703125,
-0.0609130859375,
-0.0148468017578125,
0.00632476806640625,
0.053466796875,
-0.006931304931640625,
0.030120849609375,
0.037322998046875,
0.06402587890625,
0.0479736328125,
-0.005329132080078125,
0.0023555755615234375,
-0.0256500244140625,
0.040771484375,
0.034576416015625,
-0.033203125,
-0.03265380859375,
0.00406646728515625,
-0.0032634735107421875,
-0.03582763671875,
-0.0609130859375,
-0.027862548828125,
-0.03802490234375,
0.1119384765625,
0.026824951171875,
0.016204833984375,
-0.01537322998046875,
-0.00867462158203125,
0.01149749755859375,
0.0031452178955078125,
0.0035877227783203125,
0.013427734375,
-0.05621337890625,
-0.0167694091796875,
0.00566864013671875,
0.0213775634765625,
0.0308685302734375,
-0.0560302734375,
0.0143585205078125,
-0.01187896728515625,
0.0198974609375,
-0.00910186767578125,
0.0120391845703125,
0.019500732421875,
0.10003662109375,
-0.048065185546875,
0.0270233154296875,
-0.0026416778564453125,
0.005687713623046875,
0.06671142578125,
-0.0150604248046875,
-0.03729248046875,
-0.0225830078125,
0.0653076171875,
0.00754547119140625,
0.0374755859375,
0.0286712646484375,
0.0557861328125,
-0.0012493133544921875,
-0.0180511474609375,
-0.00240325927734375,
0.0195159912109375,
-0.00460052490234375,
-0.0121612548828125,
-0.0360107421875,
-0.00494384765625,
0.039947509765625,
-0.03131103515625,
-0.0065155029296875,
-0.0115966796875,
0.020782470703125,
-0.0244598388671875,
-0.00007051229476928711,
0.044189453125,
-0.041259765625,
0.004596710205078125,
-0.01541900634765625,
-0.01727294921875,
-0.030975341796875,
0.0015649795532226562,
-0.066650390625,
-0.0106964111328125,
0.0106201171875
] |
3cf0740797b822692871da37166aad42a2f5ecad
|
Wordpress Stackexchange
Q: Redirect to post after submission with Gravity Forms? How do I redirect to a post after submission with gravity forms. It gives you the option to put in query string values but when I add {post_id}/{Video Title:1} I get mysite.com/?123/name+of+post and it just goes back to the homepage. My permalink structure is post_id/postname and {Video Title:1} equals the post name but it uses plus sings instead of dashes. What am I doing wrong?
A: Set the query string to p={post_id}. WordPress will redirect it to the proper URI then automatically.
|
Q: Redirect to post after submission with Gravity Forms? How do I redirect to a post after submission with gravity forms. It gives you the option to put in query string values but when I add {post_id}/{Video Title:1} I get mysite.com/?123/name+of+post and it just goes back to the homepage. My permalink structure is post_id/postname and {Video Title:1} equals the post name but it uses plus sings instead of dashes. What am I doing wrong?
A: Set the query string to p={post_id}. WordPress will redirect it to the proper URI then automatically.
|
wordpress
|
{
"language": "en",
"length": 91,
"provenance": "stackexchange_00019.jsonl.gz:419509",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50535"
}
|
[
0.048858642578125,
0.0139007568359375,
0.0036182403564453125,
0.0114288330078125,
0.01187896728515625,
-0.005901336669921875,
0.05810546875,
-0.0517578125,
0.038330078125,
0.0299530029296875,
0.004718780517578125,
-0.0140533447265625,
0.0192718505859375,
-0.04742431640625,
-0.0274658203125,
0.004337310791015625,
0.03607177734375,
-0.02239990234375,
0.005199432373046875,
-0.0310821533203125,
0.0032520294189453125,
-0.0029735565185546875,
0.0350341796875,
0.0284576416015625,
-0.0164642333984375,
0.00579833984375,
0.060882568359375,
-0.023590087890625,
-0.0364990234375,
-0.0499267578125,
-0.0096893310546875,
0.03277587890625,
0.030975341796875,
-0.0003762245178222656,
0.0035266876220703125,
0.0295257568359375,
0.049774169921875,
-0.0119476318359375,
0.0188751220703125,
0.0164947509765625,
0.0343017578125,
-0.0202789306640625,
0.00881195068359375,
0.024749755859375,
-0.0015926361083984375,
-0.0247802734375,
0.0137481689453125,
-0.048065185546875,
0.004062652587890625,
0.027130126953125,
-0.0103912353515625,
0.0182342529296875,
0.0053863525390625,
0.0176544189453125,
-0.0142669677734375,
-0.0244903564453125,
-0.0176239013671875,
0.0006279945373535156,
0.03387451171875,
0.00872039794921875,
-0.0030269622802734375,
-0.01152801513671875,
0.005237579345703125,
-0.01076507568359375,
-0.0233612060546875,
0.0253143310546875,
-0.0102691650390625,
-0.00199127197265625,
-0.03546142578125,
-0.04266357421875,
0.004730224609375,
-0.03363037109375,
-0.00510406494140625,
-0.0272979736328125,
0.009490966796875,
-0.0224151611328125,
0.0187530517578125,
-0.0078277587890625,
-0.0081634521484375,
0.039794921875,
-0.0170440673828125,
0.0150299072265625,
0.03607177734375,
-0.051910400390625,
0.001964569091796875,
-0.0275115966796875,
-0.03228759765625,
0.002941131591796875,
-0.04132080078125,
-0.050262451171875,
-0.015289306640625,
-0.0338134765625,
-0.061553955078125,
-0.004730224609375,
-0.0056915283203125,
-0.031982421875,
-0.00524139404296875,
-0.024658203125,
0.055908203125,
0.043548583984375,
0.0128173828125,
-0.05523681640625,
0.055419921875,
-0.035552978515625,
-0.004123687744140625,
0.0071258544921875,
0.0156707763671875,
-0.0237274169921875,
0.0100860595703125,
0.004085540771484375,
-0.03826904296875,
0.041656494140625,
-0.0355224609375,
-0.00754547119140625,
-0.035308837890625,
0.050567626953125,
-0.0298614501953125,
-0.0299530029296875,
-0.0138092041015625,
0.0178985595703125,
-0.0146331787109375,
-0.0003066062927246094,
0.042816162109375,
-0.0305023193359375,
-0.0024280548095703125,
-0.01016998291015625,
-0.01438140869140625,
-0.03643798828125,
0.026153564453125,
0.033905029296875,
-0.016357421875,
-0.0026950836181640625,
0.03485107421875,
0.0221710205078125,
-0.0014867782592773438,
-0.0220947265625,
0.006946563720703125,
-0.033294677734375,
-0.038909912109375,
0.0350341796875,
-0.03125,
-0.04888916015625,
-0.0038013458251953125,
-0.01459503173828125,
0.0112152099609375,
0.06378173828125,
0.0158233642578125,
-0.037109375,
-0.0250244140625,
-0.0823974609375,
0.00635528564453125,
-0.0684814453125,
0.050048828125,
-0.00855255126953125,
0.00496673583984375,
-0.03167724609375,
0.033203125,
-0.0271759033203125,
-0.01076507568359375,
-0.031280517578125,
0.01465606689453125,
0.0047149658203125,
0.046417236328125,
-0.053466796875,
-0.0631103515625,
-0.0294342041015625,
-0.0836181640625,
-0.01654052734375,
0.0009984970092773438,
0.036773681640625,
-0.0025386810302734375,
0.0302581787109375,
-0.037078857421875,
-0.028350830078125,
-0.0134124755859375,
-0.0460205078125,
-0.00835418701171875,
-0.0278472900390625,
0.0213165283203125,
0.04412841796875,
0.0283966064453125,
0.00617218017578125,
0.035369873046875,
0.01276397705078125,
-0.0027313232421875,
0.0682373046875,
0.028594970703125,
0.0478515625,
-0.05950927734375,
0.018402099609375,
0.036346435546875,
0.10040283203125,
-0.038330078125,
-0.0007119178771972656,
-0.0152587890625,
-0.0121307373046875,
0.01459503173828125,
-0.0013828277587890625,
-0.007720947265625,
0.021270751953125,
0.01074981689453125,
0.0082550048828125,
0.0185546875,
0.03900146484375,
0.0185699462890625,
0.020416259765625,
-0.005245208740234375,
0.004573822021484375,
0.01611328125,
0.04315185546875,
0.0084686279296875,
0.015289306640625,
-0.020355224609375,
-0.032012939453125,
0.0019197463989257812,
0.039093017578125,
-0.039398193359375,
0.0228118896484375,
-0.019744873046875,
0.054931640625,
-0.052978515625,
-0.0262603759765625,
-0.050048828125,
-0.045806884765625,
0.0506591796875,
-0.0209197998046875,
-0.00907135009765625,
-0.025146484375,
0.0180511474609375,
-0.01117706298828125,
-0.03875732421875,
0.0367431640625,
0.00799560546875,
-0.00733184814453125,
-0.06060791015625,
0.01482391357421875,
-0.054351806640625,
-0.006237030029296875,
-0.01483917236328125,
0.056976318359375,
0.00615692138671875,
0.027069091796875,
-0.0227203369140625,
0.0347900390625,
-0.0244293212890625,
-0.021697998046875,
0.0184173583984375,
0.01296234130859375,
0.0528564453125,
0.07763671875,
-0.0592041015625,
-0.01230621337890625,
0.0291595458984375,
-0.056396484375,
0.021759033203125,
0.0455322265625,
-0.018768310546875,
0.0025310516357421875,
-0.029998779296875,
-0.002044677734375,
0.006153106689453125,
-0.0347900390625,
-0.0190582275390625,
-0.01485443115234375,
0.01241302490234375,
0.01617431640625,
-0.0008335113525390625,
-0.004974365234375,
-0.041412353515625,
0.03448486328125,
0.035369873046875,
-0.0297393798828125,
0.005611419677734375,
0.0090484619140625,
0.05767822265625,
-0.08721923828125,
0.01151275634765625,
-0.00632476806640625,
0.005157470703125,
-0.032928466796875,
-0.0203704833984375,
-0.003108978271484375,
-0.0182037353515625,
-0.0265045166015625,
0.02337646484375,
-0.02935791015625,
-0.00559234619140625,
-0.038360595703125,
0.05816650390625,
0.013214111328125,
0.044647216796875,
-0.003757476806640625,
-0.0244598388671875,
0.061279296875,
-0.0006837844848632812,
-0.05914306640625,
0.0294189453125,
-0.00742340087890625,
-0.006809234619140625,
0.00653076171875,
0.061676025390625,
0.0338134765625,
-0.01544952392578125,
0.021087646484375,
0.001983642578125,
0.0151824951171875,
0.017059326171875,
-0.0035419464111328125,
-0.0258331298828125,
-0.01091766357421875,
-0.08154296875,
-0.042724609375,
0.0170440673828125,
0.03533935546875,
-0.0010023117065429688,
-0.053466796875,
0.0022792816162109375,
0.019012451171875,
-0.09576416015625,
-0.08074951171875,
-0.03607177734375,
-0.060333251953125,
0.022613525390625,
-0.0014085769653320312,
-0.011444091796875,
-0.007045745849609375,
0.023193359375,
0.0286102294921875,
0.00026416778564453125,
0.01318359375,
-0.06219482421875,
-0.01404571533203125,
-0.0645751953125,
0.005443572998046875,
-0.01654052734375,
0.01287841796875,
0.0231781005859375,
-0.0190582275390625,
0.0128936767578125,
-0.0194549560546875,
0.03271484375,
0.01922607421875,
-0.030181884765625,
-0.01331329345703125,
-0.041412353515625,
0.01137542724609375,
-0.010223388671875,
0.01502227783203125,
-0.042327880859375,
-0.0128326416015625,
0.032806396484375,
-0.0033283233642578125,
-0.006084442138671875,
-0.042999267578125,
-0.0008416175842285156,
-0.040130615234375,
-0.003948211669921875,
-0.01312255859375,
-0.0068359375,
-0.0545654296875,
-0.03802490234375,
-0.0191650390625,
-0.0731201171875,
-0.0625,
0.040618896484375,
0.01227569580078125,
-0.038421630859375,
-0.0260162353515625,
0.006473541259765625,
0.0122528076171875,
0.01629638671875,
-0.01357269287109375,
-0.042633056640625,
-0.004730224609375,
0.0036602020263671875,
-0.00946044921875,
-0.01334381103515625,
-0.021209716796875,
0.01593017578125,
-0.01142120361328125,
0.0185394287109375,
0.00809478759765625,
0.044097900390625,
-0.00666046142578125,
-0.0221710205078125,
0.01410675048828125,
-0.051605224609375,
-0.0140228271484375,
-0.016815185546875,
-0.00833892822265625,
0.00897979736328125,
0.051849365234375,
0.01203155517578125,
-0.0108489990234375,
0.013763427734375,
-0.0018129348754882812,
-0.01407623291015625,
-0.0204010009765625,
-0.041839599609375,
-0.024810791015625,
-0.060699462890625,
-0.0289459228515625,
-0.0257720947265625,
-0.0232391357421875,
-0.00921630859375,
-0.0034618377685546875,
-0.038604736328125,
-0.04248046875,
0.03656005859375,
-0.00914764404296875,
0.021697998046875,
-0.0012979507446289062,
0.0239715576171875,
-0.01258087158203125,
-0.02105712890625,
-0.004467010498046875,
-0.0213623046875,
-0.0188751220703125,
0.03997802734375,
0.020172119140625,
-0.002498626708984375,
-0.0367431640625,
-0.0099945068359375,
0.042236328125,
0.0194091796875,
0.038604736328125,
0.0025539398193359375,
-0.0198974609375,
0.021636962890625,
-0.01497650146484375,
-0.005825042724609375,
-0.022979736328125,
-0.00026488304138183594,
0.0175628662109375,
-0.004871368408203125,
0.0196075439453125,
-0.036285400390625,
-0.05780029296875,
0.0110321044921875,
-0.03704833984375,
-0.0703125,
-0.01459503173828125,
-0.0157012939453125,
0.0248260498046875,
-0.027679443359375,
0.00843048095703125,
-0.0257110595703125,
-0.080810546875,
0.016021728515625,
-0.01380157470703125,
-0.005313873291015625,
0.0130767822265625,
0.0223236083984375,
0.0130767822265625,
-0.0174713134765625,
-0.037841796875,
0.006198883056640625,
0.0246429443359375,
-0.02056884765625,
0.037933349609375,
-0.00426483154296875,
-0.021942138671875,
0.07025146484375,
-0.03106689453125,
-0.0166168212890625,
-0.007781982421875,
0.028076171875,
-0.0103607177734375,
-0.0416259765625,
0.035858154296875,
-0.03509521484375,
0.02734375,
0.003833770751953125,
-0.0258331298828125,
0.0255889892578125,
-0.031951904296875,
-0.0017004013061523438,
-0.0106658935546875,
0.0296478271484375,
0.0007386207580566406,
-0.07183837890625,
0.0213470458984375,
0.043792724609375,
-0.00206756591796875,
0.016632080078125,
0.0163421630859375,
0.032318115234375,
0.01540374755859375,
-0.003910064697265625,
-0.018157958984375,
-0.03314208984375,
-0.004974365234375,
0.01190948486328125,
-0.017303466796875,
-0.0070343017578125,
0.003192901611328125,
-0.004425048828125,
0.052154541015625,
0.0186004638671875,
-0.015533447265625,
-0.0163421630859375,
-0.029876708984375,
-0.052520751953125,
-0.01558685302734375,
0.0159912109375,
0.0132904052734375,
0.034423828125,
-0.01093292236328125,
0.0030956268310546875,
0.04315185546875,
0.00975799560546875,
-0.022003173828125,
0.0413818359375,
0.00916290283203125,
0.006412506103515625,
0.018951416015625,
0.06683349609375,
0.032806396484375,
0.0266265869140625,
-0.04010009765625,
0.046112060546875,
0.002277374267578125,
-0.005290985107421875,
0.002132415771484375,
0.033599853515625,
0.0284881591796875,
-0.043975830078125,
0.005352020263671875,
-0.0267181396484375,
0.0014801025390625,
0.0070037841796875,
0.047454833984375,
-0.006473541259765625,
-0.01271820068359375,
0.037933349609375,
-0.00970458984375,
-0.0138397216796875,
0.032745361328125,
0.037841796875,
-0.0238037109375,
-0.00160980224609375,
0.02484130859375,
0.01190185546875,
0.0201568603515625,
-0.0289306640625,
-0.0281982421875,
-0.054168701171875,
0.0169677734375,
-0.004329681396484375,
-0.033203125,
0.0247955322265625,
0.0106353759765625,
0.02520751953125,
-0.006805419921875,
-0.0267486572265625,
-0.026153564453125,
-0.00954437255859375,
-0.0077056884765625,
-0.0101318359375,
0.06292724609375,
-0.0141448974609375,
0.0009026527404785156,
-0.0268402099609375,
0.00911712646484375,
-0.0012102127075195312,
-0.003955841064453125,
0.040252685546875,
-0.00029969215393066406,
-0.0234527587890625,
-0.013397216796875,
-0.0130462646484375,
-0.0092926025390625,
0.040771484375,
0.0085601806640625,
0.0091094970703125,
-0.0250091552734375,
0.021484375,
0.02685546875,
-0.001544952392578125,
-0.03619384765625,
0.03076171875,
-0.0016355514526367188,
-0.00576019287109375,
0.01129913330078125,
-0.005115509033203125,
0.0158233642578125,
-0.0018815994262695312,
0.033233642578125,
-0.005702972412109375,
-0.0087127685546875,
-0.0064849853515625,
-0.015625,
-0.0244903564453125,
-0.05609130859375,
0.0034809112548828125,
0.0183868408203125,
0.00809478759765625,
0.05328369140625,
0.04364013671875,
0.0252838134765625,
0.037139892578125,
0.004711151123046875,
0.006572723388671875,
-0.0178680419921875,
-0.01514434814453125,
-0.0167236328125,
0.01416015625,
0.01406097412109375,
0.0186920166015625,
0.003993988037109375,
0.0024471282958984375,
-0.00908660888671875,
-0.047088623046875,
0.0264892578125,
-0.037933349609375,
-0.037445068359375,
-0.012451171875,
-0.00940704345703125,
0.0491943359375,
0.02227783203125,
0.034027099609375,
0.001644134521484375,
0.014434814453125,
0.006137847900390625,
0.004627227783203125,
-0.007694244384765625,
-0.00921630859375,
0.0450439453125,
0.0031795501708984375,
0.01020050048828125,
0.040313720703125,
0.0013217926025390625,
-0.0248565673828125,
0.033599853515625,
0.002410888671875,
-0.07318115234375,
0.0132598876953125,
-0.02557373046875,
0.018310546875,
-0.0008139610290527344,
-0.01219940185546875,
0.0228118896484375,
0.01319122314453125,
-0.0186614990234375,
0.03033447265625,
-0.017669677734375,
-0.0141448974609375,
0.00623321533203125,
0.0026073455810546875,
-0.004154205322265625,
0.06536865234375,
-0.01273345947265625,
-0.06939697265625,
-0.042572021484375,
0.03192138671875,
-0.05096435546875,
-0.0250701904296875,
-0.027496337890625,
0.0159912109375,
-0.03118896484375,
-0.050872802734375,
-0.0012197494506835938,
-0.0628662109375,
0.016510009765625,
-0.0017986297607421875,
0.040008544921875,
0.0484619140625,
0.038116455078125,
0.0204315185546875,
-0.0322265625,
0.01479339599609375,
-0.0120849609375,
0.00885772705078125,
-0.006671905517578125,
0.0174102783203125,
-0.005023956298828125,
-0.02178955078125,
0.0211639404296875,
-0.0251312255859375,
-0.0239105224609375,
-0.0259246826171875,
0.0033092498779296875,
0.0784912109375,
-0.00821685791015625,
-0.03125,
-0.0012111663818359375,
0.0609130859375,
0.018096923828125,
-0.01708984375,
0.01019287109375,
-0.0704345703125,
-0.017486572265625,
-0.006580352783203125,
-0.01076507568359375,
0.0011949539184570312,
-0.032867431640625,
-0.05908203125,
0.08306884765625,
0.036163330078125,
0.0225982666015625,
-0.020294189453125,
0.043609619140625,
-0.01090240478515625,
0.03045654296875,
-0.03363037109375,
0.033477783203125,
-0.00556182861328125,
0.0261077880859375,
-0.06103515625,
-0.018463134765625,
-0.01213836669921875,
0.0364990234375,
0.06988525390625,
0.002254486083984375,
-0.04852294921875,
0.00971221923828125,
0.105712890625,
0.055450439453125,
0.0247039794921875,
0.032318115234375,
-0.0016078948974609375,
0.0168304443359375,
0.050079345703125,
-0.0279083251953125,
0.031707763671875,
-0.03363037109375,
-0.0017108917236328125,
-0.0037670135498046875,
-0.0141754150390625,
-0.026458740234375,
-0.00391387939453125,
-0.045013427734375,
0.01079559326171875,
-0.01207733154296875,
-0.0247344970703125,
-0.004367828369140625,
-0.002628326416015625,
0.0104522705078125,
0.01552581787109375,
-0.07720947265625,
0.0260772705078125,
-0.046051025390625,
0.045318603515625,
0.00011271238327026367,
0.0046234130859375,
0.062103271484375,
0.0221099853515625,
0.025421142578125,
0.00719451904296875,
0.0157318115234375,
0.0022869110107421875,
0.0203094482421875,
0.085693359375,
0.040130615234375,
0.0229339599609375,
-0.040496826171875,
-0.033935546875,
0.06768798828125,
0.1102294921875,
-0.06317138671875,
0.0224456787109375,
0.0052337646484375,
-0.0005965232849121094,
0.011138916015625,
-0.0750732421875,
-0.0141143798828125,
-0.039825439453125,
-0.055938720703125,
-0.042999267578125,
0.0115814208984375,
0.023284912109375,
0.02850341796875,
-0.0244293212890625,
-0.03350830078125,
-0.015899658203125,
0.01044464111328125,
-0.057220458984375,
0.0271148681640625,
0.02685546875,
0.072998046875,
0.0188751220703125,
0.042999267578125,
-0.00994873046875,
-0.0235137939453125,
-0.01303863525390625,
0.02569580078125,
0.06024169921875,
0.004573822021484375,
-0.05108642578125,
-0.02239990234375,
0.06072998046875,
0.033203125,
0.04486083984375,
0.056732177734375,
0.04718017578125,
-0.008453369140625,
0.0006871223449707031,
0.0149688720703125,
0.005695343017578125,
-0.0345458984375,
0.037506103515625,
-0.01654052734375,
-0.006725311279296875,
-0.031341552734375,
-0.04827880859375,
-0.01470947265625,
-0.007205963134765625,
0.006931304931640625,
-0.030914306640625,
0.0474853515625,
-0.0133209228515625,
-0.045989990234375,
0.01381683349609375,
-0.033050537109375,
0.10076904296875,
-0.006175994873046875,
-0.04498291015625,
-0.032623291015625,
0.047027587890625,
-0.03204345703125,
-0.0076904296875,
0.0307159423828125,
-0.00543212890625,
-0.0038547515869140625,
-0.0147247314453125,
-0.01166534423828125,
0.034698486328125,
-0.0050048828125,
0.01094818115234375,
0.0498046875,
0.0133514404296875,
0.002349853515625,
-0.064208984375,
-0.01168060302734375,
0.009674072265625,
-0.021759033203125,
-0.007061004638671875,
0.022796630859375,
0.0193939208984375,
-0.0014982223510742188,
-0.04833984375,
0.007648468017578125,
-0.0206146240234375,
-0.037994384765625,
0.04522705078125,
0.032073974609375,
-0.00266265869140625,
-0.01496124267578125,
-0.0287322998046875,
0.034454345703125,
0.00998687744140625,
0.01032257080078125,
0.0151824951171875,
-0.030303955078125,
0.01543426513671875,
0.01030731201171875,
-0.005199432373046875,
-0.03704833984375,
-0.047271728515625,
-0.011199951171875,
0.004390716552734375,
-0.007022857666015625,
-0.013763427734375,
-0.0282440185546875,
0.103759765625,
-0.03656005859375,
0.037567138671875,
0.00679779052734375,
-0.107421875,
-0.0026569366455078125,
0.0223846435546875,
-0.0458984375,
0.016448974609375,
0.050201416015625,
-0.00394439697265625,
0.035736083984375,
0.0236663818359375,
0.0031261444091796875,
0.05157470703125,
-0.00008469820022583008,
-0.0423583984375,
-0.06182861328125,
-0.021453857421875,
0.0011501312255859375,
-0.0170135498046875,
-0.049560546875,
-0.01175689697265625,
-0.056793212890625,
-0.01251983642578125,
-0.0252685546875,
-0.041656494140625,
0.006885528564453125,
0.02349853515625,
-0.019683837890625,
0.004230499267578125,
-0.052093505859375,
-0.0178070068359375,
0.034149169921875,
-0.0003018379211425781,
-0.015899658203125,
-0.0185699462890625,
-0.01189422607421875,
0.045196533203125,
-0.006793975830078125,
0.048370361328125,
-0.024383544921875,
-0.0003943443298339844,
-0.06280517578125,
0.01910400390625,
-0.034393310546875,
-0.00933837890625,
-0.01128387451171875,
-0.037200927734375,
-0.0016031265258789062,
0.0099945068359375,
-0.0182952880859375,
-0.050811767578125,
-0.0246429443359375,
-0.005496978759765625,
-0.005397796630859375,
-0.03424072265625,
0.0184783935546875,
-0.0111846923828125,
0.0023040771484375,
-0.033721923828125,
-0.003406524658203125,
-0.0511474609375,
-0.0018606185913085938,
0.000926971435546875,
-0.03619384765625,
-0.043731689453125,
-0.06353759765625,
-0.019744873046875,
0.043609619140625,
0.0281219482421875,
-0.0187225341796875,
-0.0007085800170898438,
0.026458740234375,
0.00958251953125,
-0.011505126953125,
0.0150604248046875,
-0.0097198486328125,
-0.0098724365234375,
-0.02117919921875,
0.01042938232421875,
0.048248291015625,
0.0262298583984375,
0.00945281982421875,
-0.035003662109375,
-0.00609588623046875,
-0.03326416015625,
0.0029144287109375,
0.0260467529296875,
-0.000035643577575683594,
-0.0056304931640625,
0.00839996337890625,
-0.07208251953125,
-0.0163726806640625,
-0.042938232421875,
-0.002285003662109375,
0.0012273788452148438,
-0.044586181640625,
-0.0250091552734375,
-0.045257568359375,
0.018524169921875,
-0.0012531280517578125,
0.0001575946807861328,
0.0097198486328125,
-0.056365966796875,
-0.034027099609375,
-0.0309295654296875,
-0.0234375,
0.036224365234375,
-0.0867919921875,
0.0020236968994140625,
-0.0003426074981689453,
-0.0033931732177734375,
-0.0142364501953125,
0.016143798828125,
-0.030731201171875,
-0.0208892822265625,
0.0010166168212890625,
-0.0006632804870605469,
-0.0419921875,
-0.037750244140625,
0.0303497314453125,
-0.0102996826171875,
0.0002313852310180664,
-0.01065826416015625,
0.044586181640625,
0.00012564659118652344,
-0.00933074951171875,
0.05853271484375,
0.0391845703125,
-0.032806396484375,
-0.01467132568359375,
0.03851318359375,
0.02667236328125,
-0.014434814453125,
-0.056976318359375,
-0.0189361572265625,
0.034332275390625,
-0.0097198486328125,
0.0294647216796875,
-0.01265716552734375,
0.0479736328125,
0.0036163330078125,
0.109375,
-0.025360107421875,
0.0154876708984375,
-0.011871337890625,
0.037689208984375,
-0.0225067138671875,
0.00765228271484375,
0.027069091796875,
-0.0357666015625,
0.0149688720703125,
0.007381439208984375,
0.0362548828125,
-0.00032901763916015625,
0.0123291015625,
-0.0027942657470703125,
0.0167999267578125,
-0.0023136138916015625
] |
34a9b8ad59bde14b99cf9fbbd21a31fd4de22e46
|
Wordpress Stackexchange
Q: wp_editor adds HTML entities to the content I'm building my theme options page and I want to use Wordpress TinyMCE editor here, so I'm calling wp_editor. But when I'm saving data some entities are added to the content for example, lets say I want to add image:
<img class="" title="" src="path_to_image" alt="" />
Thats what I've got after clicking save:
<img title="\"\"" src="\"path_to_image\"" alt="\"\"" />
Why is this changing quotes into entities (and leaves actual - correctly displayed quotes?)??
@edit:
This is how I display my editor:
$class = (isset($value['class'])) ? $value['class']:'';
$content = (get_option($value['id']) ? get_option($value['id']) : '');
$settings = array(
'textarea_name' => $value['id'],
'editor_class' => $class
);
wp_editor($content, strtolower($value['id']), $settings );
And that's how I save data for this field:
update_option($value['id'],
$_POST[ $value['id'] ]);
A: I too had same problem.
Then I used :
<? wp_editor(html_entity_decode(stripcslashes(get_option('wid1_cont'))), "editor1",$settings = array('textarea_name'=>'wid1_cont','textarea_rows'=>'5') ); ?>
It worked..
|
Q: wp_editor adds HTML entities to the content I'm building my theme options page and I want to use Wordpress TinyMCE editor here, so I'm calling wp_editor. But when I'm saving data some entities are added to the content for example, lets say I want to add image:
<img class="" title="" src="path_to_image" alt="" />
Thats what I've got after clicking save:
<img title="\"\"" src="\"path_to_image\"" alt="\"\"" />
Why is this changing quotes into entities (and leaves actual - correctly displayed quotes?)??
@edit:
This is how I display my editor:
$class = (isset($value['class'])) ? $value['class']:'';
$content = (get_option($value['id']) ? get_option($value['id']) : '');
$settings = array(
'textarea_name' => $value['id'],
'editor_class' => $class
);
wp_editor($content, strtolower($value['id']), $settings );
And that's how I save data for this field:
update_option($value['id'],
$_POST[ $value['id'] ]);
A: I too had same problem.
Then I used :
<? wp_editor(html_entity_decode(stripcslashes(get_option('wid1_cont'))), "editor1",$settings = array('textarea_name'=>'wid1_cont','textarea_rows'=>'5') ); ?>
It worked..
A: WordPress is running addslashes on POST input. The value you get from the data base looks probably like:
<img title=\"\" …
… and the editor tries to enforce valid markup from that.
So … call the editor with …
wp_editor( stripslashes( $content ), strtolower($value['id']), $settings );
A: sometimes, the problem not is in save: is just on view stage.
Try:
wp_editor( html_entity_decode($content), strtolower($value['id']), $settings );
|
wordpress
|
{
"language": "en",
"length": 212,
"provenance": "stackexchange_00019.jsonl.gz:419544",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50674"
}
|
[
0.016510009765625,
-0.01235198974609375,
-0.020050048828125,
0.01922607421875,
0.0197601318359375,
-0.050628662109375,
0.06585693359375,
-0.0262908935546875,
0.03155517578125,
0.03741455078125,
0.0194244384765625,
-0.0239105224609375,
0.0273590087890625,
-0.043426513671875,
-0.020538330078125,
0.01399993896484375,
-0.00279998779296875,
0.020172119140625,
0.0131378173828125,
-0.00034165382385253906,
-0.002857208251953125,
0.012969970703125,
-0.04583740234375,
-0.07635498046875,
0.01508331298828125,
-0.006092071533203125,
0.06317138671875,
-0.02972412109375,
0.01216888427734375,
-0.01898193359375,
0.00494384765625,
-0.00818634033203125,
0.049835205078125,
0.029205322265625,
-0.05218505859375,
0.07281494140625,
0.0216827392578125,
0.004520416259765625,
-0.01409912109375,
0.048614501953125,
0.00724029541015625,
0.014617919921875,
0.05126953125,
0.00347137451171875,
-0.0082550048828125,
-0.033355712890625,
0.038848876953125,
-0.016937255859375,
-0.0157012939453125,
-0.0247955322265625,
0.01275634765625,
0.0143890380859375,
0.040069580078125,
-0.00968170166015625,
-0.0159454345703125,
-0.0133209228515625,
-0.0194091796875,
0.01369476318359375,
0.012237548828125,
0.0301513671875,
-0.00044465065002441406,
0.018707275390625,
-0.017852783203125,
-0.0092620849609375,
0.0263671875,
-0.00661468505859375,
0.03314208984375,
0.039703369140625,
-0.0199432373046875,
0.00392913818359375,
0.01317596435546875,
-0.011077880859375,
0.00737762451171875,
-0.05865478515625,
0.0218963623046875,
0.05133056640625,
-0.04022216796875,
-0.01288604736328125,
0.0209808349609375,
-0.0015201568603515625,
0.0219268798828125,
-0.011016845703125,
0.003284454345703125,
-0.003551483154296875,
0.045623779296875,
0.038482666015625,
-0.0008168220520019531,
-0.0296783447265625,
-0.002864837646484375,
0.0100555419921875,
-0.006954193115234375,
-0.07196044921875,
0.047210693359375,
0.037384033203125,
-0.00531768798828125,
-0.004817962646484375,
-0.01351165771484375,
-0.037322998046875,
0.002880096435546875,
0.041961669921875,
0.0295867919921875,
-0.0638427734375,
0.10467529296875,
-0.021148681640625,
0.01113128662109375,
0.004116058349609375,
0.004550933837890625,
-0.01508331298828125,
0.033416748046875,
0.0192108154296875,
-0.02655029296875,
0.071533203125,
-0.0183563232421875,
-0.034820556640625,
0.004909515380859375,
0.03643798828125,
-0.0265045166015625,
0.0201263427734375,
0.0007729530334472656,
0.02069091796875,
-0.0157470703125,
0.00809478759765625,
-0.0041961669921875,
-0.0087432861328125,
-0.01776123046875,
-0.03265380859375,
-0.00011175870895385742,
-0.013885498046875,
-0.01495361328125,
0.0048980712890625,
-0.04437255859375,
0.03656005859375,
0.10833740234375,
0.02618408203125,
0.01495361328125,
-0.01438140869140625,
-0.01090240478515625,
-0.0254974365234375,
-0.021697998046875,
0.043731689453125,
-0.0167999267578125,
-0.034515380859375,
0.0169525146484375,
-0.021209716796875,
-0.0059967041015625,
0.007427215576171875,
0.0274200439453125,
0.0145111083984375,
-0.00180816650390625,
-0.0750732421875,
0.024993896484375,
-0.026123046875,
0.04998779296875,
0.01116180419921875,
-0.0269927978515625,
-0.049591064453125,
0.04583740234375,
-0.062469482421875,
0.007801055908203125,
-0.07568359375,
-0.01416015625,
-0.0138702392578125,
0.048370361328125,
-0.034088134765625,
-0.02520751953125,
0.005924224853515625,
-0.06658935546875,
-0.01413726806640625,
0.0288848876953125,
0.050445556640625,
-0.010223388671875,
0.00592041015625,
0.039215087890625,
0.024078369140625,
-0.01776123046875,
0.01435089111328125,
-0.0082855224609375,
-0.022430419921875,
0.03070068359375,
0.00858306884765625,
-0.01708984375,
-0.0276947021484375,
0.0248565673828125,
-0.003040313720703125,
-0.05657958984375,
0.01554107666015625,
0.0036449432373046875,
0.08740234375,
0.03277587890625,
0.030120849609375,
0.00115966796875,
-0.03936767578125,
-0.0214691162109375,
-0.0002865791320800781,
0.01345062255859375,
-0.015838623046875,
-0.03070068359375,
0.0003695487976074219,
-0.01447296142578125,
-0.01568603515625,
0.042266845703125,
-0.013031005859375,
0.0241546630859375,
-0.0272064208984375,
-0.06280517578125,
0.010162353515625,
-0.0242767333984375,
0.0251312255859375,
-0.031280517578125,
0.00864410400390625,
0.02545166015625,
-0.005252838134765625,
-0.024322509765625,
0.00978851318359375,
0.0201263427734375,
0.027313232421875,
-0.0242767333984375,
0.03167724609375,
-0.022857666015625,
0.044219970703125,
-0.00652313232421875,
-0.0465087890625,
0.0096435546875,
0.035888671875,
0.018341064453125,
-0.01183319091796875,
-0.01019287109375,
-0.01313018798828125,
0.02703857421875,
-0.010498046875,
0.034210205078125,
0.0233154296875,
0.0200347900390625,
0.0202484130859375,
-0.05670166015625,
-0.036590576171875,
-0.0975341796875,
-0.09649658203125,
0.00978851318359375,
0.08349609375,
0.0251922607421875,
0.0203704833984375,
-0.0294952392578125,
-0.0243072509765625,
0.021575927734375,
-0.01433563232421875,
0.02545166015625,
-0.0299224853515625,
0.00732421875,
0.0286712646484375,
0.022125244140625,
-0.05010986328125,
-0.006290435791015625,
-0.0543212890625,
0.02166748046875,
-0.004993438720703125,
-0.0310821533203125,
-0.00554656982421875,
0.03228759765625,
-0.023651123046875,
-0.004108428955078125,
-0.0223846435546875,
0.003040313720703125,
-0.0236663818359375,
0.026214599609375,
0.0487060546875,
0.033935546875,
0.025360107421875,
-0.052734375,
0.0460205078125,
0.007274627685546875,
-0.0018377304077148438,
0.0095062255859375,
0.01111602783203125,
-0.01898193359375,
0.01425933837890625,
-0.021728515625,
0.01418304443359375,
0.0196380615234375,
0.0028781890869140625,
-0.00728607177734375,
0.042572021484375,
0.0382080078125,
-0.01114654541015625,
-0.006641387939453125,
-0.0328369140625,
0.01788330078125,
-0.022857666015625,
-0.0138397216796875,
-0.018646240234375,
0.01316070556640625,
0.011871337890625,
-0.037841796875,
0.0266571044921875,
0.018096923828125,
-0.021484375,
0.0511474609375,
0.017059326171875,
0.003192901611328125,
0.0140838623046875,
0.07305908203125,
0.041656494140625,
-0.01611328125,
-0.00653839111328125,
0.0138702392578125,
-0.01184844970703125,
0.008880615234375,
0.0265045166015625,
0.0059661865234375,
-0.007511138916015625,
-0.0543212890625,
0.00092315673828125,
0.0274505615234375,
0.01221466064453125,
0.0011529922485351562,
-0.035614013671875,
-0.031494140625,
0.01053619384765625,
-0.0810546875,
-0.055267333984375,
0.00937652587890625,
-0.06573486328125,
-0.02850341796875,
0.00034928321838378906,
-0.04779052734375,
0.0158538818359375,
0.02899169921875,
-0.0009045600891113281,
-0.01512908935546875,
-0.0042724609375,
-0.039154052734375,
-0.0243988037109375,
-0.052581787109375,
-0.008270263671875,
-0.00951385498046875,
0.0251007080078125,
0.01334381103515625,
0.01708984375,
0.020782470703125,
-0.02825927734375,
0.04248046875,
-0.0076446533203125,
-0.0140228271484375,
0.036407470703125,
0.01129913330078125,
-0.0119171142578125,
0.0059051513671875,
0.0023326873779296875,
0.01348114013671875,
0.02667236328125,
-0.02032470703125,
-0.0050048828125,
-0.0037784576416015625,
0.01371002197265625,
0.041748046875,
-0.020111083984375,
-0.0100860595703125,
0.054473876953125,
0.05047607421875,
-0.00789642333984375,
-0.0262603759765625,
-0.019134521484375,
-0.027587890625,
0.0229339599609375,
0.00116729736328125,
0.00732421875,
-0.005168914794921875,
0.038360595703125,
-0.02569580078125,
0.0198822021484375,
0.07049560546875,
-0.0149688720703125,
-0.0067291259765625,
-0.042236328125,
-0.06353759765625,
-0.0176544189453125,
0.0172882080078125,
-0.0114288330078125,
-0.0252227783203125,
-0.00872802734375,
0.007282257080078125,
-0.005474090576171875,
-0.01190948486328125,
-0.02862548828125,
-0.0182952880859375,
0.02349853515625,
-0.043731689453125,
0.0487060546875,
-0.051422119140625,
-0.005786895751953125,
-0.03363037109375,
0.0716552734375,
-0.0007777214050292969,
-0.0036487579345703125,
0.015228271484375,
0.0191497802734375,
-0.054931640625,
-0.004932403564453125,
-0.054840087890625,
0.00838470458984375,
-0.03338623046875,
0.02020263671875,
-0.00308990478515625,
-0.0099639892578125,
-0.0239410400390625,
0.0131988525390625,
-0.0239715576171875,
-0.032318115234375,
0.0259246826171875,
-0.0286407470703125,
0.013458251953125,
0.03790283203125,
-0.01099395751953125,
0.01861572265625,
-0.0269775390625,
-0.020599365234375,
-0.113037109375,
-0.030242919921875,
0.017578125,
0.079345703125,
-0.015899658203125,
-0.004360198974609375,
-0.04681396484375,
0.0721435546875,
-0.0025234222412109375,
0.01004791259765625,
0.027587890625,
0.053070068359375,
-0.0269775390625,
-0.051055908203125,
0.02264404296875,
-0.0704345703125,
0.003322601318359375,
0.011993408203125,
-0.01343536376953125,
0.00653076171875,
-0.040008544921875,
-0.031494140625,
0.0110321044921875,
-0.0338134765625,
-0.03778076171875,
-0.0153045654296875,
-0.03436279296875,
0.021148681640625,
-0.0102691650390625,
-0.02362060546875,
-0.0206756591796875,
-0.062255859375,
0.06878662109375,
-0.010284423828125,
0.0126953125,
-0.0013360977172851562,
0.1053466796875,
0.00110626220703125,
-0.0161590576171875,
-0.021270751953125,
-0.0046539306640625,
0.0290374755859375,
0.00634002685546875,
0.03607177734375,
0.0311126708984375,
-0.0160980224609375,
0.0209197998046875,
0.00650787353515625,
0.0322265625,
-0.1068115234375,
0.1212158203125,
-0.00449371337890625,
0.016693115234375,
0.0161590576171875,
-0.016265869140625,
0.027252197265625,
0.0291900634765625,
-0.01009368896484375,
0.0215911865234375,
0.0013666152954101562,
-0.00811004638671875,
-0.0306243896484375,
0.01116943359375,
0.00812530517578125,
-0.024658203125,
-0.008087158203125,
0.0273284912109375,
0.057220458984375,
0.044891357421875,
0.00045037269592285156,
0.0281219482421875,
0.04461669921875,
-0.007656097412109375,
0.0361328125,
-0.0146331787109375,
0.015380859375,
0.02496337890625,
0.01068878173828125,
-0.0175018310546875,
0.02166748046875,
-0.0119476318359375,
0.01010894775390625,
0.00379180908203125,
-0.0266876220703125,
-0.01715087890625,
0.00782012939453125,
0.039764404296875,
0.00020956993103027344,
0.02154541015625,
-0.004024505615234375,
0.024658203125,
-0.032623291015625,
0.004119873046875,
0.040130615234375,
0.039642333984375,
-0.0115814208984375,
-0.0162811279296875,
0.01245880126953125,
-0.007747650146484375,
0.012176513671875,
0.0238037109375,
0.017486572265625,
-0.00035858154296875,
-0.02227783203125,
0.04010009765625,
0.03533935546875,
0.0201416015625,
0.0240631103515625,
0.0100860595703125,
-0.02752685546875,
0.030426025390625,
-0.029449462890625,
-0.028961181640625,
-0.00710296630859375,
0.00971221923828125,
0.01338958740234375,
-0.01953125,
-0.02239990234375,
0.0235748291015625,
-0.0123443603515625,
-0.0209197998046875,
0.0160675048828125,
-0.023406982421875,
-0.0609130859375,
-0.004764556884765625,
0.034210205078125,
0.0027713775634765625,
-0.0262908935546875,
-0.0096893310546875,
-0.0003514289855957031,
-0.0325927734375,
0.010101318359375,
0.051910400390625,
-0.017791748046875,
-0.0199737548828125,
-0.030609130859375,
-0.0180206298828125,
-0.0194244384765625,
-0.0248870849609375,
-0.0382080078125,
-0.0255584716796875,
-0.0017633438110351562,
-0.0005965232849121094,
0.05029296875,
-0.03436279296875,
0.01110076904296875,
-0.008544921875,
-0.0038776397705078125,
-0.0227203369140625,
0.0125579833984375,
0.011505126953125,
-0.0012464523315429688,
-0.017608642578125,
-0.029632568359375,
-0.0280609130859375,
-0.00586700439453125,
-0.004611968994140625,
-0.039825439453125,
-0.0086517333984375,
-0.0184478759765625,
0.015869140625,
0.041656494140625,
-0.0023479461669921875,
-0.016571044921875,
0.0250396728515625,
-0.0108184814453125,
-0.016021728515625,
0.06817626953125,
-0.005062103271484375,
0.04461669921875,
-0.044921875,
0.0572509765625,
-0.019805908203125,
-0.01258087158203125,
-0.01708984375,
-0.00792694091796875,
0.0063018798828125,
-0.0006451606750488281,
0.00548553466796875,
-0.039154052734375,
0.031524658203125,
-0.0173187255859375,
0.01296234130859375,
-0.005710601806640625,
0.04669189453125,
-0.0006194114685058594,
0.006969451904296875,
-0.013916015625,
-0.029693603515625,
-0.046661376953125,
-0.00202178955078125,
0.0552978515625,
-0.0518798828125,
-0.027618408203125,
-0.01000213623046875,
0.0328369140625,
0.032257080078125,
-0.040496826171875,
-0.002178192138671875,
0.03173828125,
-0.0206451416015625,
0.01384735107421875,
0.048553466796875,
0.0097198486328125,
0.0266265869140625,
0.0153656005859375,
0.005588531494140625,
0.0016374588012695312,
0.00537109375,
-0.033111572265625,
0.03839111328125,
0.045318603515625,
0.0003647804260253906,
-0.003612518310546875,
0.0290374755859375,
-0.020477294921875,
0.04693603515625,
0.0626220703125,
0.109375,
-0.0675048828125,
0.013580322265625,
0.038299560546875,
-0.038909912109375,
0.04998779296875,
0.03497314453125,
-0.037689208984375,
-0.04937744140625,
0.0107574462890625,
-0.0272216796875,
-0.012298583984375,
-0.0020656585693359375,
0.0248260498046875,
-0.0206451416015625,
-0.0219573974609375,
0.01226806640625,
0.007049560546875,
-0.0098419189453125,
0.0008502006530761719,
0.0223388671875,
-0.01064300537109375,
-0.005718231201171875,
0.0313720703125,
-0.003925323486328125,
-0.01490020751953125,
-0.06683349609375,
-0.00811004638671875,
0.006439208984375,
-0.042022705078125,
-0.00847625732421875,
0.01418304443359375,
-0.0004093647003173828,
0.04296875,
-0.01702880859375,
0.0033397674560546875,
0.01904296875,
-0.0019683837890625,
0.0133819580078125,
-0.007587432861328125,
0.0008721351623535156,
0.0531005859375,
-0.04779052734375,
0.01184844970703125,
-0.01210784912109375,
0.0255126953125,
0.0019054412841796875,
0.0228729248046875,
0.0141754150390625,
-0.003437042236328125,
-0.0286865234375,
0.047821044921875,
-0.0166473388671875,
-0.01392364501953125,
-0.03057861328125,
-0.0305633544921875,
-0.054107666015625,
-0.050262451171875,
-0.049835205078125,
-0.069580078125,
0.01837158203125,
-0.0677490234375,
-0.085205078125,
0.12548828125,
0.046234130859375,
0.02508544921875,
-0.001262664794921875,
0.0579833984375,
-0.08056640625,
-0.0006732940673828125,
-0.0220947265625,
0.033447265625,
-0.00897216796875,
-0.00513458251953125,
-0.05377197265625,
0.005855560302734375,
-0.021881103515625,
0.045867919921875,
0.038177490234375,
0.01055145263671875,
-0.0224761962890625,
0.00457000732421875,
0.032196044921875,
-0.013580322265625,
-0.035003662109375,
0.05084228515625,
0.0152740478515625,
-0.051910400390625,
0.0275726318359375,
0.00560760498046875,
0.03265380859375,
-0.021484375,
0.02337646484375,
0.024261474609375,
-0.004230499267578125,
0.0003705024719238281,
0.0111236572265625,
0.022552490234375,
0.006908416748046875,
-0.004810333251953125,
-0.00624847412109375,
-0.06317138671875,
-0.01271820068359375,
0.032928466796875,
0.0416259765625,
-0.054962158203125,
-0.0736083984375,
-0.0135650634765625,
0.0264434814453125,
0.020843505859375,
0.00580596923828125,
0.01345062255859375,
0.0034084320068359375,
0.032623291015625,
-0.00046443939208984375,
-0.023712158203125,
0.007965087890625,
0.041015625,
0.0230560302734375,
0.006481170654296875,
0.01763916015625,
-0.0135650634765625,
0.043487548828125,
0.03961181640625,
0.03277587890625,
-0.03271484375,
-0.020172119140625,
0.00034618377685546875,
0.0233306884765625,
-0.00013363361358642578,
-0.004375457763671875,
0.021209716796875,
-0.021728515625,
0.045135498046875,
0.01910400390625,
-0.0061492919921875,
0.0223846435546875,
-0.02227783203125,
0.0162506103515625,
0.027252197265625,
-0.00106048583984375,
0.010589599609375,
-0.053375244140625,
0.0035686492919921875,
0.0016183853149414062,
0.061309814453125,
0.034454345703125,
0.062286376953125,
0.01177215576171875,
-0.03778076171875,
-0.034271240234375,
0.0186614990234375,
0.003131866455078125,
0.03387451171875,
-0.0236663818359375,
0.00982666015625,
-0.01326751708984375,
0.0239105224609375,
0.004795074462890625,
0.0479736328125,
0.050140380859375,
0.0426025390625,
0.00001919269561767578,
0.00606536865234375,
0.020751953125,
-0.02886962890625,
0.0172576904296875,
-0.0279693603515625,
0.0137939453125,
0.0215911865234375,
-0.00841522216796875,
-0.005889892578125,
-0.0005083084106445312,
0.0572509765625,
-0.016448974609375,
0.048797607421875,
-0.008819580078125,
0.02105712890625,
0.038177490234375,
-0.0294189453125,
0.0138092041015625,
0.0236663818359375,
-0.048736572265625,
-0.00928497314453125,
0.0016956329345703125,
-0.0657958984375,
0.007022857666015625,
0.0330810546875,
-0.034637451171875,
0.0266571044921875,
-0.0151214599609375,
-0.01325225830078125,
-0.0018444061279296875,
0.0014753341674804688,
-0.004093170166015625,
0.00928497314453125,
0.01221466064453125,
-0.01174163818359375,
0.0227813720703125,
0.0162811279296875,
0.0249786376953125,
0.033050537109375,
0.006206512451171875,
0.01031494140625,
-0.0013017654418945312,
0.02825927734375,
-0.03564453125,
0.02587890625,
-0.030364990234375,
-0.04290771484375,
0.057403564453125,
0.0277099609375,
-0.0084228515625,
-0.0255889892578125,
-0.006916046142578125,
0.043792724609375,
0.0028076171875,
-0.029388427734375,
0.005237579345703125,
-0.0023174285888671875,
0.01399993896484375,
0.021697998046875,
0.04241943359375,
-0.019012451171875,
-0.01416778564453125,
-0.041778564453125,
-0.0238494873046875,
0.0292510986328125,
0.015869140625,
0.042022705078125,
0.0262908935546875,
0.0247039794921875,
0.0011816024780273438,
0.0307159423828125,
-0.025634765625,
0.041534423828125,
0.0290985107421875,
0.0006775856018066406,
-0.0190277099609375,
0.004871368408203125,
-0.0177001953125,
-0.0158843994140625,
0.0222015380859375,
0.00676727294921875,
0.0026187896728515625,
-0.0418701171875,
0.0188140869140625,
0.04400634765625,
0.0626220703125,
0.005489349365234375,
0.028900146484375,
0.0137939453125,
0.01161956787109375,
0.0018949508666992188,
-0.0117034912109375,
-0.0285491943359375,
-0.046966552734375,
0.007083892822265625,
0.029205322265625,
-0.034088134765625,
-0.0178375244140625,
-0.09063720703125,
-0.03143310546875,
0.0295562744140625,
0.019561767578125,
-0.05047607421875,
-0.0086212158203125,
0.031890869140625,
0.038330078125,
-0.0035037994384765625,
0.004474639892578125,
-0.00719451904296875,
0.00249481201171875,
-0.0266265869140625,
-0.0389404296875,
-0.04681396484375,
0.04034423828125,
-0.05645751953125,
0.016143798828125,
0.046356201171875,
-0.0222015380859375,
-0.0208892822265625,
0.0219879150390625,
-0.011474609375,
0.052093505859375,
-0.061798095703125,
-0.0248260498046875,
0.0457763671875,
-0.01123046875,
-0.009307861328125,
-0.038330078125,
-0.039306640625,
-0.0016603469848632812,
0.0335693359375,
0.0015697479248046875,
-0.0174102783203125,
-0.0019931793212890625,
-0.058074951171875,
-0.111572265625,
0.0443115234375,
-0.012939453125,
-0.0369873046875,
0.044342041015625,
-0.0231781005859375,
-0.0247344970703125,
0.029266357421875,
0.0133209228515625,
-0.007472991943359375,
0.01546478271484375,
0.0222930908203125,
-0.004405975341796875,
0.03887939453125,
0.025787353515625,
-0.037017822265625,
-0.044158935546875,
-0.055755615234375,
-0.058868408203125,
0.01495361328125,
0.0227813720703125,
-0.01517486572265625,
0.0269317626953125,
0.0499267578125,
-0.0242767333984375,
-0.06744384765625,
-0.0137176513671875,
-0.04644775390625,
-0.0117340087890625,
-0.0272979736328125,
-0.0338134765625,
-0.000050902366638183594,
0.08380126953125,
0.04266357421875,
0.01611328125,
-0.0307159423828125,
0.01702880859375,
-0.017425537109375,
-0.0572509765625,
-0.01001739501953125,
0.028717041015625,
-0.044097900390625,
-0.0236663818359375,
0.00470733642578125,
-0.01116180419921875,
0.0186004638671875,
-0.002735137939453125,
-0.0186004638671875,
0.0028629302978515625,
0.02020263671875,
-0.006500244140625,
-0.0273590087890625,
-0.002593994140625,
0.0271759033203125,
-0.024322509765625,
-0.0042572021484375,
0.01032257080078125,
-0.001140594482421875,
0.0059967041015625,
0.05133056640625,
-0.061798095703125,
-0.039031982421875,
-0.00836944580078125,
0.0276641845703125,
-0.0285491943359375,
0.045684814453125,
-0.037933349609375,
0.0195159912109375,
-0.006763458251953125,
-0.00399017333984375,
0.00786590576171875,
-0.0178070068359375,
-0.01097869873046875,
0.0031185150146484375,
-0.0095367431640625,
0.0251312255859375,
-0.043182373046875,
-0.0018568038940429688,
-0.01293182373046875,
-0.004993438720703125,
-0.0080413818359375,
0.0350341796875,
0.0264739990234375,
0.003528594970703125,
0.020172119140625,
-0.0291290283203125,
0.00354766845703125,
-0.0171051025390625,
-0.00344085693359375,
-0.0063018798828125,
-0.023101806640625,
0.01425933837890625
] |
77150ad2d6e0d9c0d42ac4254c189fdfe9d1ea02
|
Wordpress Stackexchange
Q: How to remove help tabs? Is there any way to remove the help tabs?
I'm looking to remove these tabs not to hide them with CSS.
On the wp-admin/includes/screen.php there are a couple of lines that mention this but no idea how to create something to remove the help tab.
Is there any way to create something similar to: add_filter('screen_options_show_screen', '__return_false'); but to remove the Help tab ?
From the screen.php file:
647 /**
648 * Removes a help tab from the contextual help for the screen.
649 *
650 * @since 3.3.0
651 *
652 * @param string $id The help tab ID.
653 */
654 public function remove_help_tab( $id ) {
655 unset( $this->_help_tabs[ $id ] );
656 }
657
658 /**
659 * Removes all help tabs from the contextual help for the screen.
660 *
661 * @since 3.3.0
662 */
663 public function remove_help_tabs() {
664 $this->_help_tabs = array();
665 }
A: Add this you your functions.php file:
add_action('admin_head', 'mytheme_remove_help_tabs');
function mytheme_remove_help_tabs() {
$screen = get_current_screen();
$screen->remove_help_tabs();
}
This will remove tabs ant the 'Help' button from all admin pages.
|
Q: How to remove help tabs? Is there any way to remove the help tabs?
I'm looking to remove these tabs not to hide them with CSS.
On the wp-admin/includes/screen.php there are a couple of lines that mention this but no idea how to create something to remove the help tab.
Is there any way to create something similar to: add_filter('screen_options_show_screen', '__return_false'); but to remove the Help tab ?
From the screen.php file:
647 /**
648 * Removes a help tab from the contextual help for the screen.
649 *
650 * @since 3.3.0
651 *
652 * @param string $id The help tab ID.
653 */
654 public function remove_help_tab( $id ) {
655 unset( $this->_help_tabs[ $id ] );
656 }
657
658 /**
659 * Removes all help tabs from the contextual help for the screen.
660 *
661 * @since 3.3.0
662 */
663 public function remove_help_tabs() {
664 $this->_help_tabs = array();
665 }
A: Add this you your functions.php file:
add_action('admin_head', 'mytheme_remove_help_tabs');
function mytheme_remove_help_tabs() {
$screen = get_current_screen();
$screen->remove_help_tabs();
}
This will remove tabs ant the 'Help' button from all admin pages.
A: You need to use the contextual_help help filter.
add_filter( 'contextual_help', 'wpse50723_remove_help', 999, 3 );
function wpse50723_remove_help($old_help, $screen_id, $screen){
$screen->remove_help_tabs();
return $old_help;
}
The filter is for the old context help (pre 3.3). (I'm not sure it matters what is returned...?).
In any case the filter should be called late (hence 999) because plug-ins could add their own help tabs to pages. This is partly why admin_head is not an ideal hook.
|
wordpress
|
{
"language": "en",
"length": 258,
"provenance": "stackexchange_00019.jsonl.gz:419557",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50723"
}
|
[
0.061492919921875,
0.0089569091796875,
0.003620147705078125,
-0.0101470947265625,
0.038970947265625,
-0.032806396484375,
0.0714111328125,
-0.0166778564453125,
-0.0037994384765625,
0.0302886962890625,
0.0234832763671875,
-0.0274505615234375,
0.01373291015625,
-0.048187255859375,
-0.0148162841796875,
-0.0020694732666015625,
0.039154052734375,
-0.01412200927734375,
0.0302734375,
-0.003719329833984375,
-0.01016998291015625,
0.013641357421875,
0.04656982421875,
0.068603515625,
-0.006870269775390625,
-0.04791259765625,
0.03753662109375,
0.00197601318359375,
-0.0161285400390625,
-0.0296173095703125,
-0.016845703125,
0.05902099609375,
0.00408172607421875,
0.051605224609375,
-0.0249176025390625,
-0.017425537109375,
0.0016927719116210938,
0.0171051025390625,
0.03814697265625,
-0.0222930908203125,
0.04541015625,
-0.0357666015625,
-0.0282440185546875,
-0.0133819580078125,
-0.035980224609375,
0.0201263427734375,
-0.0114898681640625,
-0.00492095947265625,
0.0177459716796875,
0.00209808349609375,
0.0046539306640625,
0.01486968994140625,
0.010650634765625,
-0.045654296875,
-0.007320404052734375,
-0.0046234130859375,
0.0185546875,
-0.052154541015625,
0.0149688720703125,
0.03271484375,
0.007068634033203125,
-0.003276824951171875,
0.0081634521484375,
-0.0257415771484375,
-0.03558349609375,
0.0292510986328125,
0.01491546630859375,
-0.008544921875,
-0.037139892578125,
-0.0283203125,
0.0129547119140625,
-0.024932861328125,
0.016815185546875,
0.0200958251953125,
-0.036041259765625,
-0.0198516845703125,
0.01065826416015625,
0.00490570068359375,
0.03521728515625,
-0.0116424560546875,
0.0179595947265625,
-0.0035076141357421875,
-0.0198516845703125,
0.02667236328125,
-0.04083251953125,
0.034698486328125,
-0.008209228515625,
-0.0142669677734375,
0.0052032470703125,
-0.01154327392578125,
-0.016265869140625,
-0.048065185546875,
-0.0186614990234375,
0.062225341796875,
0.00860595703125,
-0.01291656494140625,
0.07080078125,
0.03326416015625,
0.0131988525390625,
-0.057891845703125,
0.0290985107421875,
-0.04119873046875,
-0.047332763671875,
0.00885772705078125,
-0.0012292861938476562,
0.03131103515625,
-0.015472412109375,
-0.02032470703125,
0.002033233642578125,
0.025421142578125,
-0.01178741455078125,
-0.07720947265625,
-0.00878143310546875,
-0.02880859375,
-0.0027923583984375,
0.0214385986328125,
-0.0262908935546875,
0.00530242919921875,
0.01171112060546875,
-0.014678955078125,
-0.0117340087890625,
-0.005977630615234375,
-0.0271148681640625,
0.0036296844482421875,
-0.00020182132720947266,
-0.01273345947265625,
-0.026397705078125,
0.0222015380859375,
-0.0131378173828125,
-0.01202392578125,
-0.0240325927734375,
0.0232391357421875,
0.061431884765625,
0.050140380859375,
0.031402587890625,
-0.01407623291015625,
0.0242156982421875,
0.0167388916015625,
0.01654052734375,
-0.003665924072265625,
0.019134521484375,
-0.0171661376953125,
-0.0101165771484375,
-0.00487518310546875,
0.0170135498046875,
0.0009436607360839844,
0.0026226043701171875,
0.032470703125,
0.01053619384765625,
-0.02130126953125,
0.0484619140625,
-0.0479736328125,
0.0201568603515625,
0.0210113525390625,
0.01151275634765625,
0.01410675048828125,
0.036834716796875,
-0.0209808349609375,
-0.0281829833984375,
-0.00612640380859375,
0.02490234375,
0.00977325439453125,
0.0305938720703125,
-0.02960205078125,
-0.03326416015625,
-0.0189056396484375,
-0.0516357421875,
-0.01070404052734375,
0.0232086181640625,
-0.0116424560546875,
-0.03765869140625,
-0.0638427734375,
0.057891845703125,
0.032745361328125,
-0.006763458251953125,
0.09185791015625,
0.04193115234375,
0.017120361328125,
0.0188751220703125,
0.00986480712890625,
-0.032318115234375,
-0.036895751953125,
0.056793212890625,
-0.05078125,
-0.0853271484375,
0.0204315185546875,
-0.0178680419921875,
0.025299072265625,
0.064697265625,
-0.01284027099609375,
0.060302734375,
-0.01074981689453125,
0.0118408203125,
-0.0233612060546875,
-0.0030117034912109375,
-0.0478515625,
0.00424957275390625,
-0.00872039794921875,
-0.01434326171875,
0.0345458984375,
0.04058837890625,
0.0218353271484375,
0.0013608932495117188,
0.004055023193359375,
-0.0621337890625,
0.01537322998046875,
-0.019195556640625,
0.0200042724609375,
-0.041656494140625,
0.006557464599609375,
0.0374755859375,
-0.0159759521484375,
-0.030853271484375,
0.0191192626953125,
0.00475311279296875,
-0.0005421638488769531,
0.01416778564453125,
0.047882080078125,
0.0084686279296875,
0.03826904296875,
0.0296173095703125,
-0.06146240234375,
0.03167724609375,
0.0028018951416015625,
0.004352569580078125,
-0.0232696533203125,
-0.0239105224609375,
-0.026275634765625,
0.0011224746704101562,
-0.049346923828125,
0.0380859375,
0.08447265625,
0.045745849609375,
0.067138671875,
0.00377655029296875,
-0.0015468597412109375,
0.033416748046875,
-0.075439453125,
-0.0080413818359375,
0.031890869140625,
0.060455322265625,
0.00238037109375,
-0.00010031461715698242,
-0.05316162109375,
0.0101165771484375,
-0.0418701171875,
0.032196044921875,
-0.04296875,
-0.020782470703125,
-0.016082763671875,
0.01413726806640625,
0.0165557861328125,
0.037811279296875,
0.026275634765625,
0.039215087890625,
0.02197265625,
-0.047088623046875,
-0.039154052734375,
0.008270263671875,
-0.0178680419921875,
0.0205230712890625,
-0.068603515625,
-0.0225067138671875,
-0.018768310546875,
0.035491943359375,
-0.044525146484375,
-0.0009222030639648438,
-0.01052093505859375,
-0.036041259765625,
-0.0303802490234375,
0.052215576171875,
0.0253448486328125,
-0.0292205810546875,
0.004123687744140625,
0.0654296875,
-0.06817626953125,
-0.06744384765625,
0.018951416015625,
-0.003353118896484375,
-0.01556396484375,
-0.00969696044921875,
0.01313018798828125,
0.0186004638671875,
-0.006404876708984375,
0.0028171539306640625,
0.0109100341796875,
0.017303466796875,
-0.004913330078125,
-0.018402099609375,
-0.0145263671875,
-0.0015163421630859375,
0.032135009765625,
-0.018402099609375,
0.01409912109375,
0.00908660888671875,
-0.0010118484497070312,
0.0217742919921875,
-0.0107879638671875,
0.01372528076171875,
-0.002696990966796875,
0.059814453125,
0.060760498046875,
0.016998291015625,
-0.0004837512969970703,
0.0186004638671875,
-0.040740966796875,
-0.00853729248046875,
0.01399993896484375,
0.01360321044921875,
0.0031566619873046875,
-0.02008056640625,
0.07354736328125,
0.0195159912109375,
0.0653076171875,
-0.0275421142578125,
-0.06646728515625,
-0.007343292236328125,
0.0194854736328125,
-0.0887451171875,
-0.06048583984375,
0.0162353515625,
-0.039764404296875,
-0.060150146484375,
0.01181793212890625,
-0.043792724609375,
0.0200347900390625,
0.026092529296875,
-0.007755279541015625,
0.0164642333984375,
-0.0189361572265625,
-0.0104827880859375,
0.02099609375,
-0.0182342529296875,
-0.0299530029296875,
-0.0010814666748046875,
-0.01399993896484375,
0.0070037841796875,
0.059814453125,
0.021209716796875,
0.003917694091796875,
0.035552978515625,
-0.031646728515625,
-0.017913818359375,
-0.019073486328125,
0.00988006591796875,
-0.03668212890625,
0.03851318359375,
-0.0024013519287109375,
-0.04608154296875,
0.0213470458984375,
0.031951904296875,
-0.034942626953125,
-0.0179595947265625,
0.005786895751953125,
-0.001983642578125,
0.00800323486328125,
0.0097503662109375,
-0.00791168212890625,
-0.0167694091796875,
-0.04559326171875,
-0.0171661376953125,
0.01100921630859375,
-0.0246734619140625,
0.028076171875,
0.0052032470703125,
-0.024261474609375,
0.0230560302734375,
-0.00142669677734375,
0.069580078125,
0.03271484375,
0.007785797119140625,
0.03924560546875,
-0.007007598876953125,
0.00859832763671875,
0.042755126953125,
-0.041168212890625,
0.051300048828125,
0.001468658447265625,
-0.0103607177734375,
0.0247802734375,
0.006103515625,
0.003986358642578125,
-0.016693115234375,
-0.006404876708984375,
0.00974273681640625,
0.05670166015625,
0.0173492431640625,
0.013702392578125,
-0.0008425712585449219,
-0.019775390625,
-0.013702392578125,
0.041534423828125,
-0.06964111328125,
-0.035400390625,
-0.035369873046875,
0.020843505859375,
0.0307769775390625,
-0.073486328125,
0.02752685546875,
-0.0382080078125,
-0.11248779296875,
0.028045654296875,
0.0033397674560546875,
-0.035919189453125,
-0.058807373046875,
0.06719970703125,
-0.08038330078125,
-0.0222320556640625,
0.03411865234375,
-0.01305389404296875,
-0.0208282470703125,
0.034576416015625,
-0.0075225830078125,
-0.026947021484375,
-0.01473236083984375,
-0.0184478759765625,
-0.0928955078125,
-0.0164947509765625,
-0.0312042236328125,
0.0880126953125,
0.01459503173828125,
-0.01090240478515625,
-0.01445770263671875,
0.052825927734375,
0.038299560546875,
0.042510986328125,
0.0005865097045898438,
-0.0280609130859375,
0.007061004638671875,
0.006587982177734375,
0.036163330078125,
-0.0152130126953125,
-0.0189208984375,
0.00121307373046875,
-0.0193939208984375,
0.0562744140625,
-0.0065460205078125,
0.026275634765625,
0.024169921875,
-0.01171875,
-0.041534423828125,
-0.019561767578125,
-0.0159759521484375,
-0.02960205078125,
-0.007785797119140625,
-0.0291595458984375,
0.0218658447265625,
-0.0333251953125,
-0.000675201416015625,
0.05816650390625,
-0.03448486328125,
0.01122283935546875,
-0.017547607421875,
0.0240325927734375,
-0.049346923828125,
-0.0361328125,
0.034698486328125,
0.0169525146484375,
-0.0289306640625,
0.043243408203125,
-0.02294921875,
-0.02008056640625,
0.082275390625,
-0.040191650390625,
0.01229095458984375,
-0.006534576416015625,
0.04034423828125,
-0.0137786865234375,
-0.0258941650390625,
0.0256805419921875,
-0.023223876953125,
0.0198211669921875,
-0.0511474609375,
-0.0009670257568359375,
-0.002105712890625,
-0.0079193115234375,
0.0035533905029296875,
0.052886962890625,
-0.013946533203125,
-0.0158538818359375,
-0.017303466796875,
0.00102996826171875,
0.03277587890625,
0.0186767578125,
-0.002880096435546875,
0.0134429931640625,
-0.00574493408203125,
0.005939483642578125,
0.001461029052734375,
-0.051300048828125,
-0.0049285888671875,
-0.056793212890625,
0.0196380615234375,
-0.032562255859375,
-0.03656005859375,
-0.0195159912109375,
-0.0006909370422363281,
0.01177215576171875,
-0.02081298828125,
-0.04931640625,
-0.01505279541015625,
-0.020050048828125,
0.02392578125,
0.027984619140625,
0.005218505859375,
0.037078857421875,
0.01641845703125,
-0.00933074951171875,
-0.010101318359375,
0.02484130859375,
-0.040069580078125,
-0.0360107421875,
0.0033588409423828125,
-0.00199127197265625,
-0.008331298828125,
0.031524658203125,
0.03656005859375,
-0.02410888671875,
0.0419921875,
-0.01207733154296875,
-0.0167083740234375,
0.01049041748046875,
0.0056610107421875,
0.0039005279541015625,
0.010162353515625,
0.0153656005859375,
-0.0182342529296875,
0.072021484375,
-0.0266571044921875,
-0.045013427734375,
0.051513671875,
0.029205322265625,
0.00579833984375,
0.01275634765625,
-0.0218658447265625,
0.0006389617919921875,
-0.005435943603515625,
0.061767578125,
-0.01183319091796875,
-0.075439453125,
-0.0213775634765625,
0.0021457672119140625,
0.007091522216796875,
-0.067138671875,
-0.00963592529296875,
0.03375244140625,
-0.036224365234375,
0.02764892578125,
0.05279541015625,
-0.022308349609375,
-0.014068603515625,
-0.01202392578125,
-0.007640838623046875,
-0.022705078125,
0.01336669921875,
-0.0919189453125,
-0.014617919921875,
-0.0060272216796875,
0.01806640625,
0.01436614990234375,
0.01171875,
0.05657958984375,
-0.0203704833984375,
-0.034881591796875,
0.01105499267578125,
-0.0003955364227294922,
0.022735595703125,
-0.005889892578125,
-0.08209228515625,
0.02105712890625,
-0.054229736328125,
0.01483154296875,
-0.058135986328125,
-0.08416748046875,
-0.029510498046875,
-0.016021728515625,
-0.007656097412109375,
-0.01122283935546875,
0.014404296875,
0.0185699462890625,
0.0122222900390625,
0.053436279296875,
0.006893157958984375,
0.0243072509765625,
0.0021533966064453125,
0.055877685546875,
-0.0114898681640625,
0.0250091552734375,
0.032135009765625,
0.045440673828125,
0.01541900634765625,
-0.03216552734375,
0.0165863037109375,
-0.047943115234375,
-0.0015249252319335938,
-0.032501220703125,
0.0101165771484375,
-0.011566162109375,
-0.0012664794921875,
-0.00205230712890625,
-0.01904296875,
0.02825927734375,
0.00545501708984375,
-0.045989990234375,
0.0072021484375,
0.036407470703125,
0.02935791015625,
-0.045196533203125,
-0.041168212890625,
0.0391845703125,
-0.0004401206970214844,
0.042816162109375,
-0.0030002593994140625,
-0.06768798828125,
0.018035888671875,
0.03948974609375,
-0.04864501953125,
0.06005859375,
0.0928955078125,
0.0147705078125,
0.05535888671875,
0.00848388671875,
0.0168914794921875,
0.0279998779296875,
-0.0015249252319335938,
0.04541015625,
-0.005031585693359375,
0.048431396484375,
0.01383209228515625,
0.053802490234375,
0.07073974609375,
-0.01113128662109375,
0.0067138671875,
0.03936767578125,
0.0305633544921875,
-0.08282470703125,
0.0148773193359375,
0.0219573974609375,
0.03350830078125,
0.06707763671875,
0.0200653076171875,
0.0011892318725585938,
-0.040802001953125,
0.00557708740234375,
-0.00360107421875,
-0.005767822265625,
0.0011806488037109375,
-0.00771331787109375,
-0.0029582977294921875,
-0.0004558563232421875,
0.046142578125,
-0.00849151611328125,
-0.004047393798828125,
-0.042266845703125,
0.01094818115234375,
-0.0132598876953125,
-0.005664825439453125,
0.0438232421875,
-0.00019049644470214844,
-0.031768798828125,
-0.0845947265625,
0.002498626708984375,
0.015899658203125,
-0.058685302734375,
0.066650390625,
0.0054473876953125,
-0.029541015625,
0.0225372314453125,
-0.0202789306640625,
0.032623291015625,
-0.0243988037109375,
-0.017669677734375,
-0.00756072998046875,
-0.0242767333984375,
0.019317626953125,
-0.0293426513671875,
-0.04595947265625,
0.01541900634765625,
-0.05145263671875,
-0.0274810791015625,
-0.0092620849609375,
-0.01424407958984375,
0.06494140625,
-0.0235137939453125,
-0.03912353515625,
-0.0033817291259765625,
0.002025604248046875,
0.018890380859375,
-0.033172607421875,
0.01531219482421875,
-0.01873779296875,
-0.0031890869140625,
-0.0258331298828125,
-0.042388916015625,
-0.0080718994140625,
-0.061737060546875,
-0.04705810546875,
0.07574462890625,
0.014984130859375,
0.0183258056640625,
0.009796142578125,
0.0296630859375,
-0.02947998046875,
0.00521087646484375,
-0.01271820068359375,
0.03900146484375,
0.060150146484375,
0.01837158203125,
0.006084442138671875,
-0.0022983551025390625,
0.01465606689453125,
0.0143585205078125,
-0.0001220703125,
-0.00823974609375,
0.030914306640625,
0.01259613037109375,
0.028778076171875,
0.0170440673828125,
-0.00553131103515625,
-0.0105133056640625,
0.017791748046875,
-0.0275726318359375,
0.026031494140625,
-0.020782470703125,
0.039154052734375,
-0.069091796875,
0.01290130615234375,
0.01617431640625,
0.0145111083984375,
0.00894927978515625,
-0.02288818359375,
0.006557464599609375,
-0.01934814453125,
-0.0166168212890625,
0.0161285400390625,
-0.05035400390625,
-0.0177764892578125,
0.021759033203125,
-0.01030731201171875,
-0.033477783203125,
-0.00011241436004638672,
-0.033477783203125,
0.0400390625,
0.01160430908203125,
0.030914306640625,
0.0216064453125,
0.03448486328125,
-0.01593017578125,
-0.03863525390625,
0.0199127197265625,
0.01131439208984375,
-0.06719970703125,
0.008453369140625,
0.020660400390625,
0.022491455078125,
-0.0193634033203125,
0.0066070556640625,
0.0283355712890625,
0.01239776611328125,
-0.016021728515625,
-0.04766845703125,
0.0076751708984375,
0.00727081298828125,
0.0196380615234375,
0.0374755859375,
0.043365478515625,
-0.006656646728515625,
0.05224609375,
-0.0160675048828125,
-0.0142669677734375,
0.00887298583984375,
0.0014019012451171875,
0.0004096031188964844,
0.02471923828125,
0.005828857421875,
-0.013580322265625,
-0.031829833984375,
-0.024932861328125,
0.02960205078125,
0.018798828125,
0.02398681640625,
0.0282440185546875,
0.0595703125,
-0.0164337158203125,
-0.0433349609375,
0.035919189453125,
-0.01560211181640625,
0.039825439453125,
-0.045166015625,
-0.0068206787109375,
-0.02459716796875,
0.0291290283203125,
0.0210418701171875,
0.029541015625,
0.0036945343017578125,
0.00637054443359375,
0.060760498046875,
0.006000518798828125,
-0.006107330322265625,
-0.01531982421875,
0.01001739501953125,
-0.0311431884765625,
0.01995849609375,
0.006107330322265625,
-0.0007796287536621094,
0.01018524169921875,
-0.011962890625,
0.0286712646484375,
-0.0101776123046875,
0.0229949951171875,
0.0007786750793457031,
-0.01551055908203125,
0.039093017578125,
-0.01522064208984375,
0.043121337890625,
0.017059326171875,
-0.0192413330078125,
-0.00335693359375,
-0.0467529296875,
0.0305023193359375,
0.002079010009765625,
0.0197601318359375,
0.034912109375,
0.0262451171875,
-0.019256591796875,
-0.01117706298828125,
-0.0248565673828125,
0.005214691162109375,
-0.0081939697265625,
-0.0248565673828125,
0.01189422607421875,
-0.0091705322265625,
-0.0152435302734375,
-0.0223541259765625,
0.01053619384765625,
0.038482666015625,
0.014739990234375,
-0.01251983642578125,
0.0012426376342773438,
0.015472412109375,
-0.01447296142578125,
0.06982421875,
-0.05908203125,
-0.018707275390625,
0.03961181640625,
0.00983428955078125,
-0.002727508544921875,
-0.0064849853515625,
-0.059722900390625,
0.0226898193359375,
0.0289764404296875,
-0.0101165771484375,
0.00437164306640625,
0.0146026611328125,
0.0152740478515625,
-0.00887298583984375,
-0.021697998046875,
-0.01381683349609375,
-0.024200439453125,
-0.0211944580078125,
0.0128173828125,
0.0137939453125,
0.0020771026611328125,
-0.0408935546875,
0.024993896484375,
0.013916015625,
0.0014324188232421875,
0.023773193359375,
0.0130157470703125,
0.0309295654296875,
0.04119873046875,
-0.0192108154296875,
-0.0145263671875,
0.01535797119140625,
-0.00746917724609375,
0.03106689453125,
0.014007568359375,
0.0313720703125,
0.034759521484375,
0.00684356689453125,
0.030181884765625,
0.00974273681640625,
0.0103912353515625,
-0.040496826171875,
-0.0374755859375,
0.05462646484375,
-0.0185546875,
-0.027557373046875,
0.0153961181640625,
-0.0322265625,
-0.05047607421875,
-0.0181121826171875,
0.0174102783203125,
-0.046051025390625,
-0.046295166015625,
-0.08349609375,
0.033477783203125,
0.00403594970703125,
0.004955291748046875,
-0.0872802734375,
0.05145263671875,
-0.00653076171875,
0.064697265625,
-0.0294952392578125,
0.02899169921875,
-0.0213775634765625,
-0.038055419921875,
-0.04339599609375,
-0.024078369140625,
-0.03387451171875,
0.055694580078125,
-0.0051422119140625,
0.015869140625,
0.0178375244140625,
-0.023681640625,
0.052825927734375,
-0.0085906982421875,
0.036346435546875,
0.036102294921875,
-0.0017261505126953125,
-0.0218505859375,
0.013214111328125,
0.0002224445343017578,
-0.00371551513671875,
-0.003337860107421875,
-0.0271453857421875,
0.0204010009765625,
-0.005184173583984375,
0.00153350830078125,
0.001922607421875,
0.0138702392578125,
-0.034515380859375,
-0.046966552734375,
0.006488800048828125,
0.01049041748046875,
-0.03173828125,
0.00531768798828125,
0.0087890625,
-0.022003173828125,
0.0171051025390625,
0.0157928466796875,
-0.0293731689453125,
0.0167694091796875,
0.00827789306640625,
0.005840301513671875,
0.046783447265625,
0.00559234619140625,
0.00791168212890625,
0.028472900390625,
0.0207061767578125,
0.0095062255859375,
-0.01030731201171875,
0.008209228515625,
0.00914764404296875,
0.025543212890625,
0.056060791015625,
-0.0071563720703125,
-0.034912109375,
-0.00919342041015625,
-0.040985107421875,
-0.009735107421875,
-0.006931304931640625,
-0.01354217529296875,
-0.00981903076171875,
0.030914306640625,
0.046783447265625,
0.01513671875,
-0.021514892578125,
-0.01396942138671875,
-0.01027679443359375,
-0.00615692138671875,
-0.01526641845703125,
0.035858154296875,
-0.10711669921875,
-0.043121337890625,
0.05322265625,
0.0083465576171875,
0.0014028549194335938,
-0.0158538818359375,
-0.004619598388671875,
-0.0249176025390625,
0.03082275390625,
0.021209716796875,
-0.0157470703125,
0.05670166015625,
-0.0016918182373046875,
-0.0172271728515625,
0.0223388671875,
-0.030029296875,
-0.0216827392578125,
0.016265869140625,
-0.004207611083984375,
0.00963592529296875,
-0.0166168212890625,
-0.007061004638671875,
0.06011962890625,
-0.003513336181640625,
0.011383056640625,
-0.047637939453125,
-0.0303192138671875,
0.002529144287109375,
-0.003147125244140625,
-0.0021514892578125,
-0.006072998046875,
-0.0099639892578125,
0.0179290771484375,
-0.012908935546875,
0.03717041015625,
-0.0171966552734375,
0.0386962890625,
-0.0297088623046875,
0.04132080078125,
0.044036865234375,
-0.0263824462890625,
0.0928955078125,
-0.0166473388671875,
-0.005786895751953125,
0.02301025390625,
0.0242156982421875,
-0.0533447265625,
0.0225067138671875,
0.034881591796875,
0.04168701171875,
0.03662109375
] |
6a49df12a0f92dacb1ee8dbeaa5954e842ef1a22
|
Wordpress Stackexchange
Q: How do you make the email field on the profile page read only for subscribers? I would like to make the email field on the profile page for subscribers read only. They can see their email but not change it. I want only admins to to be able to change users email address.
A: Although the readonly attribute can be removed using Chrome/Firebug inspector (making the field editable again), much probably the average user will not know this.
<?php
function wpse50730_script_enqueuer(){
if(current_user_can('subscriber')) {
echo '<script type="text/javascript">
jQuery(document).ready( function($) {
$(".form-table #email").attr("readonly", true);
});
</script>';
}
}
add_action('admin_head-profile.php', 'wpse50730_script_enqueuer');
|
Q: How do you make the email field on the profile page read only for subscribers? I would like to make the email field on the profile page for subscribers read only. They can see their email but not change it. I want only admins to to be able to change users email address.
A: Although the readonly attribute can be removed using Chrome/Firebug inspector (making the field editable again), much probably the average user will not know this.
<?php
function wpse50730_script_enqueuer(){
if(current_user_can('subscriber')) {
echo '<script type="text/javascript">
jQuery(document).ready( function($) {
$(".form-table #email").attr("readonly", true);
});
</script>';
}
}
add_action('admin_head-profile.php', 'wpse50730_script_enqueuer');
A: @brasofilo's answer is good, but better use .prop and the .user-email-wrap class to prevent impact on #email fields on other pages.
<script type="text/javascript">
jQuery(document).ready( function($) {
$(".user-email-wrap #email").prop('disabled', true);
});
</script>
|
wordpress
|
{
"language": "en",
"length": 131,
"provenance": "stackexchange_00019.jsonl.gz:419560",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50730"
}
|
[
0.027618408203125,
-0.006702423095703125,
0.015869140625,
-0.028411865234375,
-0.0121917724609375,
-0.0165863037109375,
-0.006160736083984375,
-0.05633544921875,
0.01490020751953125,
0.0296783447265625,
-0.00942230224609375,
-0.0116729736328125,
-0.0018739700317382812,
-0.0169830322265625,
-0.020477294921875,
-0.035186767578125,
0.0016422271728515625,
0.0271453857421875,
0.0101776123046875,
-0.01055145263671875,
0.020751953125,
-0.0030918121337890625,
-0.0496826171875,
-0.0270233154296875,
-0.03363037109375,
0.03082275390625,
0.0911865234375,
-0.01271820068359375,
-0.021697998046875,
-0.0294952392578125,
0.00023496150970458984,
-0.006519317626953125,
-0.0014429092407226562,
0.0245513916015625,
-0.029998779296875,
-0.0214996337890625,
0.03887939453125,
0.0012502670288085938,
0.0186614990234375,
0.0114898681640625,
0.0233001708984375,
-0.0107574462890625,
-0.05340576171875,
0.029388427734375,
-0.0404052734375,
-0.057708740234375,
0.0401611328125,
-0.01305389404296875,
0.043701171875,
0.05609130859375,
-0.0323486328125,
0.037567138671875,
-0.035186767578125,
-0.0269317626953125,
0.002132415771484375,
-0.0131683349609375,
-0.031280517578125,
-0.008331298828125,
0.017059326171875,
0.025238037109375,
0.0064697265625,
0.01015472412109375,
-0.004932403564453125,
-0.01006317138671875,
-0.0205535888671875,
-0.0269317626953125,
-0.0267791748046875,
0.0194091796875,
-0.023345947265625,
-0.02996826171875,
0.03106689453125,
-0.017242431640625,
0.03460693359375,
-0.055908203125,
-0.0248870849609375,
0.030975341796875,
-0.006855010986328125,
-0.0003116130828857422,
0.022003173828125,
-0.056243896484375,
-0.02734375,
-0.0311737060546875,
-0.07171630859375,
0.04583740234375,
-0.01285552978515625,
0.059844970703125,
-0.0244598388671875,
-0.0229949951171875,
0.021087646484375,
0.008453369140625,
-0.0016279220581054688,
0.026031494140625,
0.00566864013671875,
0.0154571533203125,
-0.0252227783203125,
-0.0159759521484375,
0.007770538330078125,
0.03192138671875,
-0.0087738037109375,
-0.0291595458984375,
-0.007778167724609375,
-0.006618499755859375,
-0.059356689453125,
0.00711822509765625,
-0.006084442138671875,
0.0499267578125,
-0.040985107421875,
-0.0253753662109375,
0.01374053955078125,
0.035369873046875,
0.01136016845703125,
-0.06854248046875,
0.004497528076171875,
-0.0025424957275390625,
-0.02099609375,
0.0096893310546875,
-0.01517486572265625,
0.0168304443359375,
-0.00452423095703125,
0.016937255859375,
-0.0175628662109375,
0.002483367919921875,
-0.0101470947265625,
-0.050811767578125,
0.0240020751953125,
-0.02142333984375,
-0.0386962890625,
0.0201873779296875,
0.0037136077880859375,
0.005641937255859375,
-0.060302734375,
-0.0011768341064453125,
0.07843017578125,
0.06524658203125,
0.06060791015625,
-0.0243988037109375,
-0.01312255859375,
-0.0030574798583984375,
-0.0172271728515625,
0.02752685546875,
-0.0235748291015625,
-0.01079559326171875,
0.047943115234375,
-0.032470703125,
-0.027618408203125,
0.0499267578125,
0.0258636474609375,
-0.005481719970703125,
-0.01410675048828125,
-0.058380126953125,
-0.03778076171875,
-0.003971099853515625,
0.00225830078125,
0.03802490234375,
0.0242919921875,
0.00628662109375,
0.04718017578125,
-0.0152587890625,
-0.01248931884765625,
-0.0297393798828125,
0.05908203125,
-0.00791168212890625,
-0.0108489990234375,
-0.03436279296875,
-0.05462646484375,
-0.00015556812286376953,
-0.08270263671875,
-0.01409149169921875,
0.0137939453125,
-0.043243408203125,
0.03936767578125,
0.0149688720703125,
0.0073089599609375,
0.024993896484375,
0.0262603759765625,
0.018646240234375,
-0.01390838623046875,
0.0179443359375,
0.028533935546875,
-0.034027099609375,
-0.03912353515625,
-0.042694091796875,
0.058990478515625,
-0.03472900390625,
-0.037322998046875,
0.0225067138671875,
-0.0284423828125,
-0.005329132080078125,
0.046417236328125,
-0.009613037109375,
-0.004978179931640625,
0.023834228515625,
0.014068603515625,
-0.02716064453125,
0.00579071044921875,
-0.046112060546875,
-0.0097808837890625,
-0.017181396484375,
-0.0150604248046875,
0.029937744140625,
0.024200439453125,
-0.025970458984375,
0.029998779296875,
-0.01294708251953125,
-0.005626678466796875,
-0.0150909423828125,
0.0008234977722167969,
0.0106658935546875,
-0.029022216796875,
0.01276397705078125,
0.034088134765625,
-0.006744384765625,
-0.0237884521484375,
-0.015655517578125,
-0.0291595458984375,
-0.049896240234375,
-0.0153656005859375,
0.05242919921875,
-0.003917694091796875,
0.061187744140625,
0.0094757080078125,
-0.0543212890625,
0.01629638671875,
0.0017404556274414062,
0.02099609375,
-0.0037097930908203125,
-0.011474609375,
-0.0166168212890625,
0.035675048828125,
-0.00910186767578125,
0.020782470703125,
0.0205841064453125,
0.005199432373046875,
0.0215606689453125,
-0.028167724609375,
0.018524169921875,
0.0241241455078125,
0.01143646240234375,
-0.01158905029296875,
0.0156097412109375,
0.02545166015625,
-0.0029582977294921875,
0.002742767333984375,
0.0179901123046875,
0.03509521484375,
0.005512237548828125,
0.036224365234375,
-0.0034732818603515625,
-0.01404571533203125,
0.03253173828125,
-0.0296630859375,
0.024139404296875,
0.025238037109375,
-0.01398468017578125,
-0.018707275390625,
0.051666259765625,
-0.00514984130859375,
0.0266876220703125,
0.0032558441162109375,
-0.0087738037109375,
0.00917816162109375,
0.045623779296875,
-0.00292205810546875,
0.0145263671875,
0.006290435791015625,
0.0010280609130859375,
0.0157928466796875,
0.018341064453125,
-0.021575927734375,
0.01210784912109375,
0.021881103515625,
-0.004451751708984375,
0.00726318359375,
0.0284881591796875,
0.0033245086669921875,
0.0177459716796875,
-0.0272369384765625,
-0.01087188720703125,
0.006481170654296875,
0.0124664306640625,
-0.0272216796875,
0.00011289119720458984,
-0.014251708984375,
-0.012969970703125,
0.0293121337890625,
-0.0026702880859375,
0.006320953369140625,
-0.043792724609375,
0.01343536376953125,
-0.01541900634765625,
0.01116180419921875,
0.0106353759765625,
-0.01470947265625,
0.0131683349609375,
-0.0030651092529296875,
-0.0333251953125,
-0.06622314453125,
-0.051971435546875,
0.047882080078125,
-0.036895751953125,
0.0264129638671875,
0.0863037109375,
0.00921630859375,
0.0233306884765625,
-0.012237548828125,
-0.058349609375,
-0.06787109375,
0.038421630859375,
0.004787445068359375,
-0.03472900390625,
-0.03582763671875,
0.06927490234375,
0.0306243896484375,
-0.013519287109375,
0.025909423828125,
0.014373779296875,
-0.023681640625,
0.0233154296875,
-0.0006823539733886719,
0.01296234130859375,
-0.040496826171875,
-0.0650634765625,
-0.0063629150390625,
0.00848388671875,
-0.03106689453125,
0.01342010498046875,
0.02960205078125,
0.0166168212890625,
-0.019989013671875,
-0.022796630859375,
-0.0706787109375,
-0.05279541015625,
-0.062225341796875,
-0.0195770263671875,
-0.0232086181640625,
0.01044464111328125,
0.01444244384765625,
0.018951416015625,
0.008056640625,
-0.032958984375,
0.018157958984375,
-0.00858306884765625,
0.0021915435791015625,
0.014007568359375,
-0.04669189453125,
-0.00809478759765625,
-0.021514892578125,
0.01373291015625,
-0.005237579345703125,
-0.033477783203125,
0.04217529296875,
-0.0250701904296875,
-0.0021419525146484375,
0.007801055908203125,
0.040557861328125,
0.0168609619140625,
-0.023468017578125,
0.02801513671875,
0.04608154296875,
-0.0262451171875,
0.01015472412109375,
-0.0170135498046875,
-0.0232696533203125,
0.0044403076171875,
0.003143310546875,
-0.0089263916015625,
0.0005197525024414062,
0.01004791259765625,
0.036865234375,
0.030670166015625,
0.03131103515625,
0.0035610198974609375,
0.00420379638671875,
-0.0005664825439453125,
-0.009857177734375,
-0.036773681640625,
0.046844482421875,
0.001232147216796875,
-0.006008148193359375,
0.0005855560302734375,
0.0278472900390625,
-0.021697998046875,
0.0301666259765625,
-0.060272216796875,
-0.1085205078125,
0.05029296875,
-0.0457763671875,
-0.004840850830078125,
-0.059906005859375,
-0.0211181640625,
-0.0034694671630859375,
0.11114501953125,
0.038360595703125,
-0.0002682209014892578,
-0.0299224853515625,
-0.0084686279296875,
-0.050140380859375,
-0.0229034423828125,
-0.030303955078125,
0.019805908203125,
-0.0070953369140625,
0.005138397216796875,
-0.03125,
0.0075531005859375,
-0.049041748046875,
-0.03570556640625,
-0.005466461181640625,
-0.041595458984375,
0.0132598876953125,
0.007251739501953125,
-0.031768798828125,
0.0264739990234375,
-0.0178070068359375,
-0.020111083984375,
-0.004547119140625,
-0.0129547119140625,
-0.0498046875,
-0.019500732421875,
0.046356201171875,
0.0277099609375,
-0.03948974609375,
0.0251312255859375,
-0.0192108154296875,
0.04949951171875,
0.00908660888671875,
0.00923919677734375,
0.0164794921875,
0.005771636962890625,
-0.0217132568359375,
-0.0055999755859375,
0.0159149169921875,
-0.027984619140625,
-0.0192718505859375,
0.0028820037841796875,
-0.0008230209350585938,
0.048126220703125,
-0.0012617111206054688,
0.0223388671875,
0.024322509765625,
-0.0177001953125,
-0.06207275390625,
-0.045257568359375,
-0.035552978515625,
-0.030303955078125,
-0.0249481201171875,
-0.00992584228515625,
-0.017578125,
-0.048248291015625,
0.03179931640625,
-0.048004150390625,
-0.007503509521484375,
0.00974273681640625,
0.06390380859375,
0.016632080078125,
0.007656097412109375,
0.0081787109375,
0.005878448486328125,
0.044921875,
-0.0038433074951171875,
0.0181884765625,
0.0031280517578125,
-0.03863525390625,
0.0771484375,
0.00733184814453125,
-0.001506805419921875,
-0.0177154541015625,
0.032867431640625,
0.0280609130859375,
0.0012617111206054688,
-0.01104736328125,
0.0198974609375,
0.0217132568359375,
0.0001385211944580078,
0.0255889892578125,
-0.04656982421875,
0.0321044921875,
0.0185546875,
-0.0029773712158203125,
0.036865234375,
0.0277252197265625,
-0.035369873046875,
0.001995086669921875,
-0.0296478271484375,
0.015289306640625,
0.03265380859375,
-0.0228271484375,
0.0240631103515625,
0.03466796875,
-0.018829345703125,
-0.0223236083984375,
-0.0184478759765625,
0.006755828857421875,
0.00815582275390625,
-0.009979248046875,
0.0030689239501953125,
-0.03485107421875,
-0.020355224609375,
0.049072265625,
0.006977081298828125,
-0.062286376953125,
0.02423095703125,
-0.0164337158203125,
0.0167083740234375,
0.005443572998046875,
-0.0228424072265625,
0.057586669921875,
0.06787109375,
0.01238250732421875,
0.01258087158203125,
-0.018035888671875,
0.0316162109375,
-0.043304443359375,
0.0205841064453125,
0.0311279296875,
-0.024505615234375,
0.0212554931640625,
0.045166015625,
-0.0012416839599609375,
0.024169921875,
-0.0026607513427734375,
0.08001708984375,
0.1070556640625,
-0.0204315185546875,
-0.0018606185913085938,
0.04248046875,
-0.01242828369140625,
-0.0494384765625,
0.01329803466796875,
0.00875091552734375,
0.0278167724609375,
0.027069091796875,
-0.037322998046875,
0.028289794921875,
0.003131866455078125,
-0.0026683807373046875,
-0.006809234619140625,
-0.004413604736328125,
0.009521484375,
-0.0019550323486328125,
-0.04400634765625,
0.00982666015625,
0.0230560302734375,
-0.01221466064453125,
-0.020721435546875,
0.0216522216796875,
-0.028076171875,
-0.0163116455078125,
-0.050140380859375,
0.07476806640625,
-0.05322265625,
-0.0298004150390625,
-0.0207672119140625,
-0.008453369140625,
-0.028106689453125,
-0.000038743019104003906,
-0.0496826171875,
-0.0105133056640625,
-0.0068206787109375,
0.0081634521484375,
0.019378662109375,
0.01318359375,
0.031768798828125,
-0.0501708984375,
0.0012998580932617188,
-0.041351318359375,
-0.013763427734375,
0.061553955078125,
0.039337158203125,
-0.0743408203125,
-0.0126495361328125,
-0.0477294921875,
-0.0014801025390625,
-0.0635986328125,
-0.05560302734375,
-0.02276611328125,
0.022064208984375,
0.052764892578125,
0.0277099609375,
-0.0096893310546875,
-0.0771484375,
0.01812744140625,
0.0118865966796875,
0.0210723876953125,
0.042510986328125,
-0.04669189453125,
0.061553955078125,
0.0201568603515625,
0.0288848876953125,
-0.02203369140625,
0.01336669921875,
-0.0128326416015625,
0.000789642333984375,
-0.007709503173828125,
-0.004955291748046875,
0.0023345947265625,
-0.0230560302734375,
-0.0126190185546875,
-0.023101806640625,
0.044647216796875,
0.0003666877746582031,
0.00081634521484375,
-0.03887939453125,
-0.0006918907165527344,
-0.03338623046875,
0.0447998046875,
-0.0548095703125,
0.0098876953125,
-0.05316162109375,
0.0014390945434570312,
0.031890869140625,
0.004375457763671875,
-0.0139312744140625,
0.0089874267578125,
0.0122528076171875,
0.034637451171875,
-0.02117919921875,
-0.006275177001953125,
0.0270843505859375,
0.0330810546875,
0.0032138824462890625,
0.045623779296875,
-0.01323699951171875,
0.01383209228515625,
0.0228118896484375,
0.00780487060546875,
-0.01824951171875,
-0.0343017578125,
0.040496826171875,
0.016510009765625,
-0.01253509521484375,
0.040863037109375,
-0.0228729248046875,
0.0230560302734375,
0.08184814453125,
0.1055908203125,
-0.09613037109375,
0.0223846435546875,
0.0216827392578125,
-0.0003619194030761719,
0.04278564453125,
-0.0019550323486328125,
-0.0032863616943359375,
-0.0162811279296875,
0.024810791015625,
-0.00855255126953125,
-0.026397705078125,
-0.0035495758056640625,
-0.012054443359375,
-0.0106201171875,
0.01543426513671875,
0.0304412841796875,
0.0250091552734375,
0.039306640625,
-0.05169677734375,
-0.01165008544921875,
0.0032711029052734375,
-0.00957489013671875,
-0.0125885009765625,
0.0491943359375,
-0.060546875,
-0.08099365234375,
0.003448486328125,
0.0236053466796875,
-0.0217132568359375,
0.0255889892578125,
0.02960205078125,
0.0003237724304199219,
0.03350830078125,
0.00614166259765625,
0.01006317138671875,
-0.00801849365234375,
0.01209259033203125,
-0.025726318359375,
-0.062744140625,
-0.01551055908203125,
0.0159149169921875,
-0.033172607421875,
0.0279083251953125,
0.0183563232421875,
-0.042694091796875,
0.00324249267578125,
0.01253509521484375,
0.050567626953125,
0.02093505859375,
-0.050048828125,
0.019561767578125,
-0.0169830322265625,
-0.00284576416015625,
-0.003978729248046875,
-0.01508331298828125,
0.0017538070678710938,
0.00875091552734375,
-0.0232696533203125,
-0.04443359375,
0.0142822265625,
-0.0216522216796875,
-0.0806884765625,
0.08837890625,
-0.005706787109375,
0.05157470703125,
0.016998291015625,
0.0211029052734375,
-0.0177154541015625,
-0.003597259521484375,
-0.0194091796875,
0.01134490966796875,
-0.00629425048828125,
0.048828125,
-0.0018339157104492188,
-0.008453369140625,
0.0372314453125,
0.033233642578125,
0.07440185546875,
0.0298614501953125,
-0.020782470703125,
-0.0609130859375,
-0.01108551025390625,
0.05230712890625,
-0.016845703125,
0.0292205810546875,
-0.00893402099609375,
0.00841522216796875,
0.032867431640625,
-0.07366943359375,
0.0114288330078125,
-0.0244293212890625,
0.00305938720703125,
-0.0016145706176757812,
0.0108489990234375,
0.01364898681640625,
-0.02099609375,
0.0251617431640625,
-0.045379638671875,
-0.016326904296875,
0.036163330078125,
-0.042633056640625,
-0.0290985107421875,
0.045654296875,
0.01824951171875,
-0.02520751953125,
0.045562744140625,
-0.045989990234375,
0.05548095703125,
0.014312744140625,
0.0105438232421875,
0.046539306640625,
0.0222320556640625,
0.0311431884765625,
0.0005865097045898438,
-0.0009984970092773438,
-0.0198822021484375,
0.0288543701171875,
0.01152801513671875,
-0.02874755859375,
0.0032444000244140625,
-0.06683349609375,
-0.0203857421875,
0.02777099609375,
0.01189422607421875,
-0.0091094970703125,
-0.040679931640625,
0.0108795166015625,
0.00567626953125,
-0.0007143020629882812,
0.0014753341674804688,
0.0032405853271484375,
-0.0268402099609375,
0.0268096923828125,
-0.0335693359375,
0.013916015625,
0.036956787109375,
0.0269775390625,
0.01026153564453125,
0.027435302734375,
-0.055145263671875,
-0.00774383544921875,
-0.0276336669921875,
-0.02105712890625,
0.00737762451171875,
-0.00989532470703125,
0.043243408203125,
-0.01412200927734375,
0.0675048828125,
-0.0007767677307128906,
-0.025054931640625,
-0.00833892822265625,
0.04278564453125,
-0.0032024383544921875,
-0.02069091796875,
0.01971435546875,
0.01355743408203125,
0.03887939453125,
0.0102081298828125,
-0.0242767333984375,
0.0011358261108398438,
-0.0187225341796875,
-0.03924560546875,
-0.01325225830078125,
-0.0281829833984375,
-0.030364990234375,
0.03045654296875,
-0.029449462890625,
0.035736083984375,
-0.005321502685546875,
-0.00441741943359375,
-0.027069091796875,
0.058624267578125,
0.028533935546875,
0.0026092529296875,
0.022705078125,
-0.00315093994140625,
0.0019216537475585938,
0.055450439453125,
0.002483367919921875,
0.00925445556640625,
0.0262603759765625,
-0.08624267578125,
-0.0019359588623046875,
-0.0216064453125,
-0.06341552734375,
0.034027099609375,
0.040771484375,
-0.054351806640625,
0.06072998046875,
-0.006122589111328125,
0.01800537109375,
-0.01959228515625,
-0.024383544921875,
0.003978729248046875,
0.00988006591796875,
0.0218353271484375,
0.00043320655822753906,
0.0196533203125,
-0.0005550384521484375,
0.01142120361328125,
0.050201416015625,
0.00690460205078125,
0.060791015625,
-0.036346435546875,
0.01284027099609375,
-0.035919189453125,
0.033477783203125,
-0.05841064453125,
-0.06939697265625,
0.08441162109375,
0.0028896331787109375,
-0.016693115234375,
0.004322052001953125,
-0.00923919677734375,
0.055267333984375,
-0.00826263427734375,
-0.0277862548828125,
0.0390625,
-0.010955810546875,
-0.0137176513671875,
-0.0124969482421875,
-0.00867462158203125,
-0.0450439453125,
-0.0438232421875,
-0.0176544189453125,
-0.0016336441040039062,
-0.0173797607421875,
-0.00037169456481933594,
0.025909423828125,
0.0291290283203125,
-0.037078857421875,
-0.010406494140625,
0.0225982666015625,
-0.01666259765625,
-0.00066375732421875,
0.01316070556640625,
-0.045806884765625,
0.0173797607421875,
0.0180816650390625,
-0.017181396484375,
0.021331787109375,
0.0046234130859375,
0.00728607177734375,
0.0078277587890625,
0.00206756591796875,
-0.03460693359375,
0.019256591796875,
0.0225067138671875,
-0.0214080810546875,
0.02227783203125,
-0.002971649169921875,
-0.01192474365234375,
0.0030345916748046875,
-0.01837158203125,
-0.025115966796875,
-0.0384521484375,
-0.01910400390625,
0.00395965576171875,
-0.0421142578125,
-0.07537841796875,
-0.04534912109375,
0.040863037109375,
0.0277252197265625,
-0.0086822509765625,
-0.055145263671875,
0.025177001953125,
-0.01776123046875,
0.0927734375,
-0.035125732421875,
0.025421142578125,
-0.002544403076171875,
0.0238189697265625,
-0.06561279296875,
-0.0199432373046875,
-0.049652099609375,
0.0006413459777832031,
-0.058013916015625,
0.0021686553955078125,
0.06298828125,
0.01183319091796875,
-0.038116455078125,
-0.01486968994140625,
-0.040008544921875,
0.0283355712890625,
-0.0841064453125,
-0.037017822265625,
0.01268768310546875,
0.02001953125,
-0.027191162109375,
-0.043121337890625,
-0.009368896484375,
-0.02667236328125,
0.033203125,
-0.042572021484375,
0.017547607421875,
0.0265655517578125,
-0.0222015380859375,
-0.045166015625,
0.046600341796875,
-0.01739501953125,
-0.0133056640625,
-0.0309295654296875,
-0.04052734375,
-0.00897979736328125,
0.031707763671875,
-0.018707275390625,
-0.0090789794921875,
-0.04498291015625,
0.0438232421875,
0.0303497314453125,
0.00007742643356323242,
0.005260467529296875,
0.03668212890625,
-0.06201171875,
0.052642822265625,
0.026214599609375,
0.01221466064453125,
0.010406494140625,
0.003421783447265625,
0.0115814208984375,
0.0345458984375,
-0.035430908203125,
-0.03961181640625,
-0.01445770263671875,
-0.01465606689453125,
-0.01446533203125,
0.01430511474609375,
-0.021026611328125,
0.02716064453125,
0.07574462890625,
0.08514404296875,
0.0227508544921875,
-0.0667724609375,
-0.02825927734375,
-0.0301361083984375,
-0.025787353515625,
-0.021697998046875,
0.0193023681640625,
-0.070556640625,
0.00960540771484375,
0.0161895751953125,
-0.0199127197265625,
-0.02264404296875,
-0.0217742919921875,
-0.052978515625,
-0.0031833648681640625,
-0.012420654296875,
0.016326904296875,
-0.01464080810546875,
0.00617218017578125,
0.005615234375,
-0.033203125,
-0.053558349609375,
0.0237274169921875,
-0.0015554428100585938,
-0.042266845703125,
0.017608642578125,
0.007808685302734375,
-0.04351806640625,
-0.0261077880859375,
0.0277252197265625,
-0.004329681396484375,
0.04144287109375,
-0.040283203125,
-0.0352783203125,
-0.01503753662109375,
0.033843994140625,
0.007904052734375,
0.02899169921875,
-0.02294921875,
0.027496337890625,
0.0006680488586425781,
0.036346435546875,
-0.0019083023071289062,
-0.0328369140625,
-0.029022216796875,
0.029022216796875,
0.004550933837890625,
-0.003475189208984375,
0.03363037109375,
-0.021209716796875,
0.020599365234375,
0.0279388427734375,
0.029205322265625,
0.01392364501953125,
0.0027313232421875,
-0.0093536376953125,
0.01528167724609375,
-0.00865936279296875
] |
b036d427a44dd33bba03c8a357bfd56894a7bdd9
|
Wordpress Stackexchange
Q: add_rewrite_rule() not playing nice with child pages function my_add_rewrite_rules() {
add_rewrite_rule('testing/([^/]+)?$', 'index.php?pagename=testing&event_slug=$matches[1]', 'top' );
}
add_action( 'init', 'my_add_rewrite_rules' );
function add_query_vars( $query_vars ) {
$query_vars[] = 'event_slug';
return $query_vars;
}
add_filter( 'query_vars', 'add_query_vars' );
/testing/foo - Works, shows foo
If I have testing set to no parent, the rewrite works and everything is good to go.
If I set testing to a child of, lets say about, and update the add_rewrite_rule to..
add_rewrite_rule('about/testing/([^/]+)?$', 'index.php?pagename=testing&event_slug=$matches[1]', 'top' );
... it loads about/testing but strips out my custom query_var and displays the page normally.
/about/testing/foo - Loads page, doesn't show foo
A: if it's a child page, you have to update pagename to reflect the parent/child path:
add_rewrite_rule('about/testing/([^/]+)?$', 'index.php?pagename=about/testing&event_slug=$matches[1]', 'top' );
|
Q: add_rewrite_rule() not playing nice with child pages function my_add_rewrite_rules() {
add_rewrite_rule('testing/([^/]+)?$', 'index.php?pagename=testing&event_slug=$matches[1]', 'top' );
}
add_action( 'init', 'my_add_rewrite_rules' );
function add_query_vars( $query_vars ) {
$query_vars[] = 'event_slug';
return $query_vars;
}
add_filter( 'query_vars', 'add_query_vars' );
/testing/foo - Works, shows foo
If I have testing set to no parent, the rewrite works and everything is good to go.
If I set testing to a child of, lets say about, and update the add_rewrite_rule to..
add_rewrite_rule('about/testing/([^/]+)?$', 'index.php?pagename=testing&event_slug=$matches[1]', 'top' );
... it loads about/testing but strips out my custom query_var and displays the page normally.
/about/testing/foo - Loads page, doesn't show foo
A: if it's a child page, you have to update pagename to reflect the parent/child path:
add_rewrite_rule('about/testing/([^/]+)?$', 'index.php?pagename=about/testing&event_slug=$matches[1]', 'top' );
|
wordpress
|
{
"language": "en",
"length": 119,
"provenance": "stackexchange_00019.jsonl.gz:419573",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50773"
}
|
[
0.026031494140625,
-0.01328277587890625,
-0.043975830078125,
-0.06982421875,
0.007549285888671875,
-0.012542724609375,
-0.0203399658203125,
0.0325927734375,
-0.05657958984375,
0.019622802734375,
-0.0263671875,
0.02264404296875,
0.0020351409912109375,
-0.031402587890625,
0.0340576171875,
-0.0194549560546875,
0.0220489501953125,
-0.045928955078125,
-0.00824737548828125,
-0.0284881591796875,
-0.0020751953125,
-0.006256103515625,
0.047119140625,
0.052947998046875,
0.03924560546875,
-0.0689697265625,
0.051483154296875,
-0.02099609375,
0.01776123046875,
-0.035888671875,
0.01535797119140625,
0.00982666015625,
0.034912109375,
0.00641632080078125,
0.0126190185546875,
-0.00637054443359375,
0.030487060546875,
-0.0187530517578125,
-0.0029544830322265625,
0.045806884765625,
0.0197601318359375,
-0.0252685546875,
0.038726806640625,
-0.008270263671875,
0.018280029296875,
-0.045501708984375,
0.03887939453125,
-0.04412841796875,
0.009765625,
0.0146636962890625,
0.0258331298828125,
0.0582275390625,
0.008514404296875,
0.0347900390625,
0.0039215087890625,
0.03466796875,
-0.003467559814453125,
-0.0007710456848144531,
-0.007518768310546875,
-0.024261474609375,
0.007137298583984375,
0.05010986328125,
0.0248565673828125,
0.056549072265625,
-0.00890350341796875,
-0.0025997161865234375,
-0.0014142990112304688,
0.003520965576171875,
-0.0472412109375,
-0.004833221435546875,
0.0428466796875,
-0.0443115234375,
-0.0009627342224121094,
-0.030364990234375,
-0.01177978515625,
-0.041351318359375,
0.0166168212890625,
-0.03900146484375,
-0.02191162109375,
0.014129638671875,
0.02313232421875,
-0.0240478515625,
-0.0377197265625,
0.01485443115234375,
0.001956939697265625,
0.027313232421875,
-0.0023899078369140625,
-0.019195556640625,
-0.04461669921875,
-0.0207061767578125,
-0.0223388671875,
-0.027435302734375,
-0.035919189453125,
-0.0007491111755371094,
0.01194000244140625,
-0.00577545166015625,
0.036956787109375,
0.037078857421875,
0.013275146484375,
-0.0140533447265625,
0.02557373046875,
-0.0428466796875,
0.0019989013671875,
-0.036773681640625,
0.023406982421875,
0.0506591796875,
0.010040283203125,
0.025299072265625,
0.06854248046875,
0.004150390625,
0.0269775390625,
0.076416015625,
-0.004150390625,
0.0343017578125,
-0.045623779296875,
-0.0098724365234375,
-0.0609130859375,
-0.024810791015625,
-0.0232086181640625,
0.0135650634765625,
-0.0011138916015625,
-0.0023345947265625,
0.006443023681640625,
-0.01100921630859375,
0.040924072265625,
0.01274871826171875,
-0.02215576171875,
-0.004650115966796875,
0.0213165283203125,
0.037994384765625,
-0.007251739501953125,
-0.004058837890625,
0.00302886962890625,
0.002796173095703125,
-0.009429931640625,
-0.004547119140625,
0.023651123046875,
-0.015472412109375,
-0.0171356201171875,
0.0234222412109375,
-0.00084686279296875,
-0.05633544921875,
-0.0117034912109375,
0.005096435546875,
-0.0016269683837890625,
0.031097412109375,
0.0157623291015625,
0.0044708251953125,
-0.0017442703247070312,
-0.041656494140625,
0.00711822509765625,
-0.03668212890625,
0.0731201171875,
-0.022369384765625,
-0.057098388671875,
-0.022369384765625,
-0.03057861328125,
-0.01251983642578125,
-0.0242462158203125,
-0.01507568359375,
-0.004146575927734375,
0.0238189697265625,
0.036102294921875,
-0.0472412109375,
-0.0458984375,
-0.056488037109375,
-0.08514404296875,
-0.0171051025390625,
0.01776123046875,
-0.022979736328125,
0.064697265625,
0.00783538818359375,
-0.0396728515625,
0.008148193359375,
0.03704833984375,
-0.0037860870361328125,
-0.004119873046875,
0.0521240234375,
-0.0133056640625,
0.050811767578125,
0.028045654296875,
-0.042816162109375,
0.037322998046875,
-0.0102691650390625,
-0.05804443359375,
0.04962158203125,
0.0042266845703125,
0.0316162109375,
-0.00978851318359375,
-0.01129913330078125,
0.044891357421875,
0.04437255859375,
-0.02557373046875,
-0.03875732421875,
0.02569580078125,
0.02545166015625,
-0.0009293556213378906,
0.003498077392578125,
0.0091552734375,
-0.0197906494140625,
-0.0259552001953125,
-0.0095367431640625,
0.00351715087890625,
0.019744873046875,
-0.00972747802734375,
0.006923675537109375,
-0.02496337890625,
0.0281219482421875,
0.00983428955078125,
0.0298309326171875,
0.01305389404296875,
0.033294677734375,
-0.054931640625,
-0.01395416259765625,
-0.022125244140625,
0.027740478515625,
0.045623779296875,
0.0219879150390625,
0.003032684326171875,
0.0106964111328125,
0.0211181640625,
-0.005733489990234375,
-0.0010004043579101562,
0.00922393798828125,
0.037384033203125,
-0.00433349609375,
-0.0296173095703125,
-0.0228729248046875,
-0.00989532470703125,
-0.0042572021484375,
-0.070556640625,
0.08160400390625,
0.0145721435546875,
0.034576416015625,
-0.038238525390625,
-0.0021152496337890625,
-0.0404052734375,
-0.0187225341796875,
-0.01494598388671875,
0.038543701171875,
0.023773193359375,
0.019378662109375,
-0.009063720703125,
0.00688934326171875,
0.02703857421875,
-0.03314208984375,
-0.0032501220703125,
-0.00794219970703125,
-0.01171112060546875,
0.03668212890625,
0.0241546630859375,
0.015838623046875,
0.00933837890625,
-0.059173583984375,
-0.0020427703857421875,
0.028564453125,
-0.0178680419921875,
-0.01544189453125,
-0.0200042724609375,
0.00615692138671875,
0.021881103515625,
0.0135955810546875,
-0.00994873046875,
0.0022735595703125,
-0.0010890960693359375,
0.004093170166015625,
-0.0193328857421875,
-0.0060577392578125,
-0.003162384033203125,
-0.01132965087890625,
0.00446319580078125,
-0.04302978515625,
-0.0089263916015625,
0.03863525390625,
0.034423828125,
-0.060302734375,
-0.0171051025390625,
-0.00392913818359375,
0.0010519027709960938,
-0.0016717910766601562,
-0.00150299072265625,
0.0309600830078125,
0.0391845703125,
-0.007656097412109375,
0.001689910888671875,
-0.03509521484375,
0.01055908203125,
0.00353240966796875,
0.051300048828125,
0.02227783203125,
0.0295562744140625,
0.010467529296875,
-0.0203399658203125,
0.044830322265625,
0.027740478515625,
-0.02880859375,
0.020172119140625,
0.0181884765625,
0.0155029296875,
0.0008320808410644531,
0.01181793212890625,
0.0233917236328125,
-0.00817108154296875,
0.0002994537353515625,
0.0163726806640625,
-0.007770538330078125,
0.004039764404296875,
-0.0135498046875,
-0.0023174285888671875,
0.00971221923828125,
-0.04229736328125,
0.03326416015625,
0.039581298828125,
0.0287628173828125,
0.038299560546875,
-0.0213470458984375,
0.016693115234375,
0.04620361328125,
-0.0134124755859375,
-0.05572509765625,
-0.031951904296875,
-0.02593994140625,
-0.0654296875,
0.0302276611328125,
-0.0214385986328125,
0.022613525390625,
0.01190948486328125,
-0.00464630126953125,
-0.034881591796875,
-0.033447265625,
-0.0531005859375,
-0.0672607421875,
-0.0657958984375,
-0.005706787109375,
-0.0142974853515625,
0.01132965087890625,
-0.0020885467529296875,
0.05218505859375,
0.0128021240234375,
-0.037841796875,
0.01357269287109375,
0.00684356689453125,
-0.00534820556640625,
0.00891876220703125,
-0.0212249755859375,
-0.0036029815673828125,
-0.00031280517578125,
0.018463134765625,
0.014923095703125,
0.00007963180541992188,
0.0016803741455078125,
-0.0163421630859375,
-0.01611328125,
0.0291290283203125,
0.00664520263671875,
0.01407623291015625,
0.0295257568359375,
0.0286865234375,
0.03472900390625,
-0.0269622802734375,
-0.044036865234375,
-0.0142669677734375,
-0.06072998046875,
-0.002376556396484375,
0.05712890625,
0.01052093505859375,
-0.0126800537109375,
-0.01247406005859375,
0.0271759033203125,
0.0114898681640625,
0.06451416015625,
-0.006206512451171875,
-0.0031223297119140625,
-0.0237884521484375,
-0.01812744140625,
-0.05999755859375,
0.035125732421875,
-0.005462646484375,
0.0023441314697265625,
0.0208892822265625,
-0.0153350830078125,
-0.0169219970703125,
-0.0028934478759765625,
-0.03326416015625,
-0.02911376953125,
0.0127410888671875,
-0.07080078125,
0.0040740966796875,
-0.068115234375,
0.0007576942443847656,
-0.0606689453125,
0.04022216796875,
-0.026947021484375,
-0.0247039794921875,
-0.0209197998046875,
0.01558685302734375,
-0.025909423828125,
-0.044677734375,
0.003208160400390625,
-0.004901885986328125,
-0.041412353515625,
0.0101165771484375,
-0.01485443115234375,
-0.024566650390625,
-0.0019445419311523438,
-0.031097412109375,
-0.0218658447265625,
-0.020263671875,
0.047943115234375,
-0.00647735595703125,
-0.01071929931640625,
0.03680419921875,
-0.0236663818359375,
0.007541656494140625,
-0.0491943359375,
0.0084686279296875,
-0.08367919921875,
-0.046630859375,
0.037933349609375,
0.09466552734375,
0.0011873245239257812,
-0.037506103515625,
-0.024169921875,
0.0775146484375,
0.04052734375,
-0.038177490234375,
0.046783447265625,
-0.03997802734375,
0.00980377197265625,
0.05291748046875,
0.0291290283203125,
-0.0017137527465820312,
-0.0098419189453125,
-0.0030574798583984375,
-0.036102294921875,
-0.0220184326171875,
-0.0276031494140625,
-0.0445556640625,
0.0262451171875,
-0.027587890625,
-0.06494140625,
-0.021240234375,
-0.0214385986328125,
-0.01085662841796875,
0.01947021484375,
-0.052001953125,
-0.027984619140625,
-0.0643310546875,
0.021942138671875,
-0.031005859375,
-0.0260772705078125,
-0.0166778564453125,
0.03216552734375,
0.0302276611328125,
-0.02618408203125,
0.0823974609375,
0.0200958251953125,
0.0148468017578125,
0.005084991455078125,
0.041351318359375,
0.0025653839111328125,
0.00415802001953125,
0.021942138671875,
-0.004474639892578125,
0.0545654296875,
-0.0049285888671875,
0.0165557861328125,
-0.018951416015625,
-0.029327392578125,
0.04888916015625,
0.011993408203125,
-0.042388916015625,
0.0000022649765014648438,
-0.01983642578125,
-0.0018510818481445312,
-0.04779052734375,
0.025634765625,
0.0010995864868164062,
0.053131103515625,
-0.04144287109375,
0.01528167724609375,
-0.006237030029296875,
0.0122833251953125,
0.0340576171875,
0.0292816162109375,
-0.01131439208984375,
0.0017852783203125,
0.0014972686767578125,
-0.00569915771484375,
0.045867919921875,
0.056640625,
-0.004886627197265625,
0.023651123046875,
0.01824951171875,
-0.0299530029296875,
-0.017730712890625,
-0.0009541511535644531,
0.067138671875,
0.002849578857421875,
-0.042205810546875,
0.007781982421875,
-0.00606536865234375,
-0.006320953369140625,
-0.00185394287109375,
0.04058837890625,
-0.0254364013671875,
-0.027557373046875,
0.006397247314453125,
-0.004062652587890625,
0.02337646484375,
0.03228759765625,
-0.0029449462890625,
0.03692626953125,
0.016815185546875,
-0.0152435302734375,
0.0010929107666015625,
0.01131439208984375,
-0.024871826171875,
0.003276824951171875,
0.0164947509765625,
-0.01512908935546875,
0.02313232421875,
0.04107666015625,
0.018798828125,
-0.0294036865234375,
0.01483154296875,
0.027130126953125,
0.05401611328125,
-0.046051025390625,
-0.042327880859375,
0.055755615234375,
0.0802001953125,
-0.01444244384765625,
0.0015430450439453125,
-0.0256500244140625,
0.0015506744384765625,
-0.017425537109375,
-0.0047149658203125,
-0.016754150390625,
-0.0011529922485351562,
-0.03350830078125,
-0.008392333984375,
0.03778076171875,
0.031494140625,
-0.024749755859375,
0.0217132568359375,
-0.04656982421875,
-0.00644683837890625,
0.0251617431640625,
-0.0189971923828125,
-0.0193328857421875,
-0.0213470458984375,
0.00804901123046875,
-0.007480621337890625,
0.0061492919921875,
-0.018524169921875,
-0.007381439208984375,
-0.03656005859375,
-0.0302734375,
0.06951904296875,
-0.018768310546875,
0.032073974609375,
-0.0195465087890625,
-0.004459381103515625,
0.0116424560546875,
0.005840301513671875,
0.0347900390625,
0.0012044906616210938,
-0.035858154296875,
0.00014257431030273438,
-0.041900634765625,
0.0009088516235351562,
-0.029541015625,
-0.039764404296875,
-0.011260986328125,
-0.00669097900390625,
-0.0220489501953125,
0.027435302734375,
-0.0212860107421875,
0.0350341796875,
-0.032257080078125,
-0.0146636962890625,
-0.004547119140625,
0.03564453125,
0.004978179931640625,
0.0751953125,
-0.0601806640625,
0.044097900390625,
0.002079010009765625,
0.02398681640625,
-0.01546478271484375,
-0.0155487060546875,
0.006320953369140625,
-0.01108551025390625,
-0.003265380859375,
-0.0155792236328125,
-0.0008945465087890625,
-0.0041046142578125,
0.07122802734375,
-0.0032444000244140625,
0.036041259765625,
-0.02276611328125,
0.0012102127075195312,
-0.0240478515625,
0.00739288330078125,
-0.0791015625,
-0.00040268898010253906,
-0.004756927490234375,
0.029083251953125,
0.044708251953125,
-0.0093536376953125,
0.0133514404296875,
-0.044891357421875,
0.01534271240234375,
0.008270263671875,
-0.01392364501953125,
-0.053314208984375,
0.058837890625,
0.072509765625,
-0.0026397705078125,
0.05975341796875,
-0.010101318359375,
0.0249481201171875,
0.064453125,
0.003330230712890625,
0.00518035888671875,
-0.0172119140625,
0.055023193359375,
0.0050811767578125,
0.0007119178771972656,
0.039581298828125,
-0.0166015625,
-0.0088348388671875,
0.021759033203125,
0.0160369873046875,
-0.05328369140625,
-0.01007080078125,
-0.036224365234375,
-0.00386810302734375,
0.06243896484375,
0.011138916015625,
0.0165863037109375,
0.0721435546875,
-0.03961181640625,
-0.00771331787109375,
-0.040802001953125,
0.0011749267578125,
0.0254058837890625,
0.00882720947265625,
-0.01171875,
0.0462646484375,
0.0039215087890625,
-0.0197906494140625,
-0.0171051025390625,
0.0013179779052734375,
0.005962371826171875,
0.00977325439453125,
0.0077667236328125,
0.00847625732421875,
-0.01629638671875,
-0.01019287109375,
0.0267333984375,
-0.06134033203125,
0.00428009033203125,
0.01427459716796875,
-0.0015382766723632812,
-0.004192352294921875,
0.02288818359375,
-0.006114959716796875,
-0.00984954833984375,
-0.00125885009765625,
-0.0271453857421875,
0.0243682861328125,
-0.0029392242431640625,
-0.005054473876953125,
-0.042144775390625,
-0.01131439208984375,
-0.01020050048828125,
-0.044158935546875,
-0.012603759765625,
-0.0106353759765625,
-0.01384735107421875,
0.048919677734375,
-0.0489501953125,
-0.018218994140625,
0.0172271728515625,
-0.01506805419921875,
-0.0027217864990234375,
0.01210784912109375,
-0.038299560546875,
0.007671356201171875,
-0.0027217864990234375,
-0.0220794677734375,
-0.072998046875,
0.0011920928955078125,
-0.04864501953125,
-0.08892822265625,
0.135498046875,
0.0003638267517089844,
0.07666015625,
0.044708251953125,
0.043487548828125,
-0.0535888671875,
-0.0228424072265625,
-0.036956787109375,
0.07318115234375,
0.052978515625,
0.050628662109375,
-0.054931640625,
-0.04345703125,
0.0193328857421875,
0.06689453125,
0.04547119140625,
0.0048980712890625,
-0.054107666015625,
-0.0017118453979492188,
0.042236328125,
0.01364898681640625,
-0.006755828857421875,
0.047088623046875,
-0.006195068359375,
-0.005466461181640625,
0.04559326171875,
-0.0238800048828125,
0.01194000244140625,
-0.005764007568359375,
0.01092529296875,
0.01268768310546875,
-0.005588531494140625,
0.007740020751953125,
-0.0193939208984375,
0.02740478515625,
-0.0233001708984375,
-0.01406097412109375,
0.0257415771484375,
-0.02288818359375,
0.001636505126953125,
0.005023956298828125,
0.0239105224609375,
-0.048126220703125,
-0.059967041015625,
-0.005023956298828125,
0.04248046875,
0.033782958984375,
-0.01479339599609375,
0.0035343170166015625,
0.0160064697265625,
-0.0116119384765625,
-0.00200653076171875,
-0.00319671630859375,
0.022735595703125,
-0.0151519775390625,
0.037445068359375,
0.0423583984375,
0.049835205078125,
0.0157470703125,
0.023895263671875,
0.0167999267578125,
0.048248291015625,
-0.043365478515625,
-0.02667236328125,
-0.00519561767578125,
-0.032867431640625,
-0.00949859619140625,
-0.008453369140625,
-0.011932373046875,
0.0134429931640625,
0.01428985595703125,
-0.025665283203125,
0.0001418590545654297,
0.0072021484375,
0.01044464111328125,
-0.00815582275390625,
0.0078277587890625,
-0.0205535888671875,
0.0183563232421875,
-0.01198577880859375,
-0.02301025390625,
0.0175018310546875,
0.039825439453125,
0.01320648193359375,
0.0243988037109375,
-0.029052734375,
-0.0270538330078125,
-0.01425933837890625,
-0.0023193359375,
-0.04388427734375,
0.033660888671875,
-0.045654296875,
-0.020294189453125,
-0.01059722900390625,
0.048187255859375,
0.0428466796875,
0.03955078125,
0.0570068359375,
0.006557464599609375,
-0.038421630859375,
0.0152587890625,
0.048309326171875,
-0.034149169921875,
0.0780029296875,
-0.025177001953125,
0.059112548828125,
-0.01195526123046875,
0.006412506103515625,
-0.06475830078125,
0.0230255126953125,
0.01264190673828125,
0.0102996826171875,
0.0007882118225097656,
0.00624847412109375,
-0.0081634521484375,
0.0438232421875,
0.02618408203125,
0.04083251953125,
0.034423828125,
-0.0498046875,
-0.012786865234375,
0.00446319580078125,
-0.07086181640625,
0.032318115234375,
0.050994873046875,
0.01056671142578125,
-0.0079193115234375,
0.01427459716796875,
-0.009796142578125,
-0.0006852149963378906,
0.0156707763671875,
0.0005578994750976562,
-0.00861358642578125,
0.0032901763916015625,
0.00649261474609375,
0.033660888671875,
0.01227569580078125,
0.0216064453125,
0.0186920166015625,
0.0029697418212890625,
0.11700439453125,
-0.07916259765625,
-0.0018568038940429688,
0.00533294677734375,
0.01360321044921875,
-0.01384735107421875,
0.012451171875,
0.0075225830078125,
-0.0226287841796875,
0.00296783447265625,
-0.00922393798828125,
-0.016693115234375,
0.0406494140625,
0.004947662353515625,
-0.018890380859375,
0.033050537109375,
-0.03607177734375,
0.00327301025390625,
-0.0187835693359375,
0.007419586181640625,
-0.0085906982421875,
-0.028778076171875,
0.00476837158203125,
0.0199432373046875,
0.00568389892578125,
0.0207672119140625,
-0.032012939453125,
0.06854248046875,
0.03472900390625,
0.0258636474609375,
0.01035308837890625,
-0.027313232421875,
0.006801605224609375,
0.01708984375,
0.0045928955078125,
-0.015594482421875,
0.02972412109375,
-0.0111846923828125,
0.009307861328125,
0.02093505859375,
0.0321044921875,
0.022125244140625,
-0.02716064453125,
-0.0252685546875,
-0.0312042236328125,
-0.00864410400390625,
-0.025604248046875,
-0.009307861328125,
-0.0248260498046875,
0.0003902912139892578,
0.004833221435546875,
-0.051910400390625,
-0.0243072509765625,
-0.0302276611328125,
-0.01190185546875,
0.01544952392578125,
-0.01328277587890625,
-0.025238037109375,
-0.0054473876953125,
0.037567138671875,
0.033905029296875,
0.0222320556640625,
-0.09051513671875,
0.057708740234375,
-0.027435302734375,
0.08306884765625,
-0.00502777099609375,
-0.0121002197265625,
-0.007083892822265625,
-0.0105133056640625,
-0.05694580078125,
0.0273284912109375,
-0.057281494140625,
-0.034088134765625,
-0.04071044921875,
0.00012505054473876953,
0.025054931640625,
-0.00017726421356201172,
-0.0033893585205078125,
-0.0106048583984375,
0.0030040740966796875,
0.06036376953125,
-0.062286376953125,
-0.0235443115234375,
0.0310211181640625,
-0.00472259521484375,
-0.039764404296875,
0.0156707763671875,
0.0191192626953125,
-0.0175018310546875,
-0.035064697265625,
0.0186004638671875,
-0.01534271240234375,
0.003398895263671875,
-0.02764892578125,
-0.045166015625,
0.060546875,
0.00833892822265625,
-0.0313720703125,
-0.033447265625,
-0.01082611083984375,
-0.0218048095703125,
0.0228424072265625,
-0.0007791519165039062,
-0.0379638671875,
-0.00583648681640625,
0.04119873046875,
0.01137542724609375,
0.05194091796875,
0.00290679931640625,
0.02728271484375,
-0.0223846435546875,
0.0149688720703125,
0.0007624626159667969,
0.0078582763671875,
0.002391815185546875,
-0.00522613525390625,
0.06817626953125,
0.050323486328125,
0.00665283203125,
0.06719970703125,
0.03558349609375,
-0.042266845703125,
0.00795745849609375,
-0.0286865234375,
-0.05352783203125,
-0.0288848876953125,
0.06622314453125,
0.0188446044921875,
0.02288818359375,
-0.002635955810546875,
-0.031646728515625,
-0.0501708984375,
-0.043487548828125,
-0.0195159912109375,
0.03314208984375,
-0.067626953125,
0.01290130615234375,
0.00662994384765625,
-0.004428863525390625,
-0.0252227783203125,
0.0218505859375,
-0.0296478271484375,
-0.0166473388671875,
0.0102081298828125,
-0.01131439208984375,
-0.01812744140625,
-0.0161895751953125,
0.09295654296875,
-0.049896240234375,
-0.032562255859375,
0.0173492431640625,
0.029571533203125,
0.012969970703125,
-0.025146484375,
0.03314208984375,
0.058013916015625,
-0.038360595703125,
0.0027370452880859375,
0.0239410400390625,
-0.0099945068359375,
-0.03466796875,
-0.0067901611328125,
-0.0253143310546875,
0.00873565673828125,
0.01071929931640625,
-0.01387786865234375,
-0.03271484375,
0.048004150390625,
0.00392913818359375,
0.088623046875,
0.00710296630859375,
0.0252685546875,
0.01111602783203125,
0.0219268798828125,
0.01523590087890625,
0.006206512451171875,
0.00860595703125,
0.0125274658203125,
-0.0237274169921875,
-0.0283966064453125,
-0.042388916015625,
-0.0880126953125,
0.01425933837890625,
-0.051483154296875,
-0.00853729248046875,
0.04290771484375
] |
162b12f4ea73dafaa12cbafa8b13c78be425fa67
|
Wordpress Stackexchange
Q: How to wrap oEmbed-embedded video in DIV tags inside the_content? I am making a Wordpress Theme for a website with video tutorials. I would like to put the video that is embedded in the content (with oEmbed) in a apart div.
An example
The full content (output from the_content()) is something like this:
<p><iframe src="http://player.vimeo.com/video/0000000" width="900" height="506" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>This is an Test of a tutorial. Bla bla bla</p>
And I would like to get this to:
<div id="video">
<iframe src="http://player.vimeo.com/video/0000000" width="900" height="506" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
<div id="content">
<p>This is an Test of a tutorial. Bla bla bla</p>
</div>
A: The embed_oembed_html filter runs before an oEmbed resource's HTML is outputted, so you could hook into this and wrap the output in a div as below. I can't think of a simple way of wrapping the other content.
add_filter('embed_oembed_html', 'my_embed_oembed_html', 99, 4);
function my_embed_oembed_html($html, $url, $attr, $post_id) {
return '<div id="video">' . $html . '</div>';
}
|
Q: How to wrap oEmbed-embedded video in DIV tags inside the_content? I am making a Wordpress Theme for a website with video tutorials. I would like to put the video that is embedded in the content (with oEmbed) in a apart div.
An example
The full content (output from the_content()) is something like this:
<p><iframe src="http://player.vimeo.com/video/0000000" width="900" height="506" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>This is an Test of a tutorial. Bla bla bla</p>
And I would like to get this to:
<div id="video">
<iframe src="http://player.vimeo.com/video/0000000" width="900" height="506" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
<div id="content">
<p>This is an Test of a tutorial. Bla bla bla</p>
</div>
A: The embed_oembed_html filter runs before an oEmbed resource's HTML is outputted, so you could hook into this and wrap the output in a div as below. I can't think of a simple way of wrapping the other content.
add_filter('embed_oembed_html', 'my_embed_oembed_html', 99, 4);
function my_embed_oembed_html($html, $url, $attr, $post_id) {
return '<div id="video">' . $html . '</div>';
}
A: If you are attempting to use oEmbed in your Wordpress theme template, try this:
<aside>
<p>oEmbed video in template test</p>
<?php echo apply_filters('the_content', "http://vimeo.com/41205967"); ?>
</aside>
This snippet will display a video from Vimeo.com directly in your theme, without having to create a post manually.
|
wordpress
|
{
"language": "en",
"length": 207,
"provenance": "stackexchange_00019.jsonl.gz:419574",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50779"
}
|
[
0.048309326171875,
0.006748199462890625,
0.01004791259765625,
-0.037017822265625,
0.033935546875,
-0.01073455810546875,
0.049652099609375,
-0.027099609375,
-0.0200653076171875,
0.0021762847900390625,
-0.050018310546875,
0.0199432373046875,
-0.0238037109375,
-0.019134521484375,
0.0220184326171875,
-0.048583984375,
0.032135009765625,
0.00330352783203125,
0.0191192626953125,
-0.012725830078125,
-0.0222320556640625,
0.0094146728515625,
0.0545654296875,
-0.01425933837890625,
0.012542724609375,
-0.061309814453125,
0.09466552734375,
-0.0185394287109375,
0.006038665771484375,
-0.017822265625,
0.0208892822265625,
-0.011749267578125,
0.059814453125,
0.020751953125,
-0.10882568359375,
-0.01812744140625,
-0.02783203125,
-0.0040740966796875,
-0.0210418701171875,
0.019073486328125,
-0.001743316650390625,
0.01390838623046875,
0.07586669921875,
0.0201873779296875,
0.0031337738037109375,
-0.017578125,
-0.01366424560546875,
-0.057098388671875,
-0.00569915771484375,
-0.034820556640625,
0.0131378173828125,
0.005462646484375,
0.02142333984375,
-0.049591064453125,
-0.007221221923828125,
0.0247802734375,
-0.0261688232421875,
-0.02056884765625,
0.006061553955078125,
0.00531768798828125,
0.026947021484375,
0.014801025390625,
0.01290130615234375,
0.031585693359375,
0.01276397705078125,
-0.011260986328125,
0.0253143310546875,
0.01165008544921875,
-0.051422119140625,
0.0035724639892578125,
0.042449951171875,
-0.0185699462890625,
-0.0223846435546875,
-0.0328369140625,
-0.033905029296875,
0.037445068359375,
0.0258941650390625,
-0.00865936279296875,
-0.0078125,
-0.0140838623046875,
0.0185089111328125,
0.036834716796875,
0.01172637939453125,
-0.043060302734375,
0.006439208984375,
-0.029632568359375,
-0.01181793212890625,
-0.001918792724609375,
0.00853729248046875,
0.0196685791015625,
-0.01035308837890625,
0.05279541015625,
0.00618743896484375,
-0.007137298583984375,
-0.047393798828125,
0.01617431640625,
0.013641357421875,
0.0275115966796875,
0.007297515869140625,
0.025543212890625,
0.025604248046875,
-0.06414794921875,
0.061767578125,
-0.053436279296875,
0.02191162109375,
0.008941650390625,
0.00971221923828125,
-0.026153564453125,
0.0330810546875,
0.00888824462890625,
-0.0272369384765625,
0.10546875,
-0.0151519775390625,
-0.0528564453125,
-0.0295867919921875,
0.0169525146484375,
-0.0156097412109375,
-0.01806640625,
0.0224456787109375,
-0.011322021484375,
0.00641632080078125,
0.01389312744140625,
0.0367431640625,
-0.0012159347534179688,
0.00041413307189941406,
0.0016851425170898438,
-0.0232086181640625,
-0.04248046875,
0.0231170654296875,
0.03271484375,
-0.03778076171875,
-0.005157470703125,
0.048919677734375,
0.031402587890625,
0.0245208740234375,
-0.027435302734375,
0.057403564453125,
0.00408935546875,
0.0001308917999267578,
0.029296875,
-0.048675537109375,
-0.0236358642578125,
0.005496978759765625,
-0.045257568359375,
-0.0256805419921875,
0.00968170166015625,
0.008331298828125,
0.0192718505859375,
-0.029632568359375,
-0.0772705078125,
0.038177490234375,
-0.03192138671875,
0.026947021484375,
-0.0207672119140625,
0.04296875,
-0.05108642578125,
0.021270751953125,
-0.0294647216796875,
0.00862884521484375,
-0.01416015625,
-0.0226287841796875,
0.0162200927734375,
0.06939697265625,
-0.007091522216796875,
0.01029205322265625,
-0.03338623046875,
-0.04315185546875,
0.00025773048400878906,
0.01053619384765625,
0.09808349609375,
-0.0285186767578125,
-0.052886962890625,
-0.03936767578125,
0.01247406005859375,
-0.035400390625,
0.032958984375,
0.01297760009765625,
-0.04638671875,
0.04315185546875,
0.042205810546875,
-0.0060272216796875,
-0.0013751983642578125,
0.06890869140625,
-0.027923583984375,
-0.031646728515625,
-0.0087738037109375,
0.018829345703125,
0.0213165283203125,
-0.002349853515625,
0.02020263671875,
0.040374755859375,
-0.0018510818481445312,
-0.026641845703125,
-0.004604339599609375,
0.016387939453125,
-0.0170135498046875,
-0.00847625732421875,
-0.0240631103515625,
-0.0063629150390625,
0.004180908203125,
0.014801025390625,
0.002841949462890625,
0.0164947509765625,
0.0118408203125,
-0.006122589111328125,
-0.0194854736328125,
0.0005855560302734375,
0.01387786865234375,
-0.01340484619140625,
-0.0203399658203125,
0.01059722900390625,
-0.025238037109375,
0.0171356201171875,
-0.034637451171875,
-0.018280029296875,
0.0206298828125,
0.006587982177734375,
0.051513671875,
0.0063323974609375,
0.05706787109375,
0.01800537109375,
-0.0164642333984375,
0.00970458984375,
0.003597259521484375,
0.060272216796875,
-0.03839111328125,
0.0020961761474609375,
-0.02825927734375,
0.030670166015625,
-0.00940704345703125,
-0.048095703125,
0.043853759765625,
0.060211181640625,
-0.008209228515625,
-0.059356689453125,
0.007755279541015625,
-0.032989501953125,
-0.04833984375,
-0.032684326171875,
0.06878662109375,
0.039306640625,
0.024505615234375,
0.00530242919921875,
0.0302581787109375,
0.062225341796875,
-0.0504150390625,
-0.002933502197265625,
0.01348114013671875,
0.002490997314453125,
-0.004291534423828125,
0.01154327392578125,
-0.01122283935546875,
0.033660888671875,
-0.109130859375,
0.05755615234375,
0.031280517578125,
0.007049560546875,
0.030609130859375,
-0.06982421875,
0.039794921875,
-0.0186614990234375,
-0.0220794677734375,
-0.01617431640625,
-0.0186004638671875,
0.03570556640625,
0.0016269683837890625,
0.03515625,
0.0303955078125,
-0.007244110107421875,
-0.012451171875,
0.022186279296875,
0.04180908203125,
-0.01141357421875,
0.07025146484375,
0.0087890625,
-0.04901123046875,
-0.030609130859375,
0.0015287399291992188,
-0.032196044921875,
0.003147125244140625,
-0.0027904510498046875,
0.0261993408203125,
0.005451202392578125,
-0.01146697998046875,
-0.001556396484375,
-0.0233917236328125,
-0.00003159046173095703,
-0.0257415771484375,
0.01409912109375,
0.00113677978515625,
0.015716552734375,
0.03790283203125,
-0.0255584716796875,
0.05450439453125,
0.01474761962890625,
-0.00980377197265625,
0.005794525146484375,
-0.05950927734375,
0.0662841796875,
-0.06793212890625,
0.00896453857421875,
0.04315185546875,
-0.04644775390625,
0.0099029541015625,
-0.00382232666015625,
0.01031494140625,
0.007205963134765625,
-0.01117706298828125,
-0.0374755859375,
-0.0267486572265625,
-0.04046630859375,
-0.01177978515625,
0.029083251953125,
0.047882080078125,
-0.002716064453125,
-0.03631591796875,
-0.007080078125,
0.0259857177734375,
-0.043365478515625,
-0.0341796875,
0.045562744140625,
-0.07073974609375,
0.017059326171875,
0.036346435546875,
-0.038360595703125,
-0.042205810546875,
0.0928955078125,
-0.002254486083984375,
-0.01345062255859375,
-0.03314208984375,
-0.059906005859375,
-0.044158935546875,
-0.07196044921875,
0.051666259765625,
-0.0032749176025390625,
0.0128021240234375,
0.0242767333984375,
-0.01067352294921875,
0.0275421142578125,
-0.0119781494140625,
0.0709228515625,
0.0225982666015625,
-0.010772705078125,
0.021392822265625,
-0.0012006759643554688,
0.004425048828125,
-0.057342529296875,
0.022491455078125,
-0.08624267578125,
-0.0201416015625,
0.0197906494140625,
-0.01947021484375,
-0.0182037353515625,
-0.06005859375,
0.0030460357666015625,
0.007099151611328125,
0.01146697998046875,
-0.01363372802734375,
0.032012939453125,
-0.05487060546875,
0.023101806640625,
-0.00426483154296875,
-0.0093536376953125,
-0.0218505859375,
0.01520538330078125,
-0.031646728515625,
-0.011810302734375,
-0.031341552734375,
-0.0277099609375,
-0.02288818359375,
0.03265380859375,
-0.03265380859375,
-0.0306854248046875,
-0.028289794921875,
-0.032379150390625,
-0.00186920166015625,
0.0237274169921875,
-0.002483367919921875,
0.0214385986328125,
0.008819580078125,
0.037384033203125,
-0.0128631591796875,
0.0219268798828125,
-0.059112548828125,
-0.009918212890625,
0.057342529296875,
0.02197265625,
0.001804351806640625,
-0.00870513916015625,
-0.052947998046875,
0.0194091796875,
0.09295654296875,
-0.06243896484375,
-0.02435302734375,
0.0252838134765625,
0.01390838623046875,
0.0192108154296875,
-0.0178070068359375,
-0.043121337890625,
-0.0302581787109375,
-0.0254974365234375,
0.002788543701171875,
-0.0292205810546875,
0.0076904296875,
-0.0227813720703125,
0.0215606689453125,
-0.0245208740234375,
-0.0318603515625,
0.00298309326171875,
0.005329132080078125,
-0.0159912109375,
0.0088043212890625,
-0.07000732421875,
0.035491943359375,
-0.0103912353515625,
-0.037078857421875,
-0.0538330078125,
-0.0121612548828125,
-0.01537322998046875,
0.06634521484375,
0.0090179443359375,
0.0013589859008789062,
-0.0467529296875,
0.04058837890625,
-0.01308441162109375,
0.0205841064453125,
0.0233154296875,
0.00479888916015625,
0.042327880859375,
0.003353118896484375,
0.032012939453125,
-0.0215301513671875,
-0.024932861328125,
-0.012939453125,
0.00429534912109375,
0.044952392578125,
-0.01219940185546875,
0.0080108642578125,
0.006824493408203125,
0.0067596435546875,
-0.0692138671875,
-0.0204925537109375,
0.0311737060546875,
-0.0032825469970703125,
0.00859832763671875,
0.0083160400390625,
-0.00677490234375,
-0.046539306640625,
0.03076171875,
0.02447509765625,
-0.01009368896484375,
0.00412750244140625,
0.028350830078125,
0.0236053466796875,
-0.0340576171875,
-0.0018949508666992188,
0.038604736328125,
0.0404052734375,
-0.016387939453125,
0.0245819091796875,
0.0055389404296875,
-0.0234832763671875,
0.03826904296875,
-0.0019779205322265625,
0.034423828125,
-0.000059604644775390625,
0.051666259765625,
0.00957489013671875,
-0.00850677490234375,
0.03521728515625,
0.0257110595703125,
-0.050201416015625,
-0.0194244384765625,
-0.060791015625,
0.04815673828125,
-0.0184783935546875,
-0.01512908935546875,
0.0030460357666015625,
0.00524139404296875,
-0.024322509765625,
-0.00641632080078125,
0.004241943359375,
-0.00039458274841308594,
0.078369140625,
0.051910400390625,
0.0015382766723632812,
0.038116455078125,
0.03118896484375,
0.01172637939453125,
0.02880859375,
-0.033843994140625,
0.00727081298828125,
0.0400390625,
0.025726318359375,
0.0225067138671875,
0.039215087890625,
-0.00008815526962280273,
-0.0018367767333984375,
0.00791168212890625,
-0.0093994140625,
-0.03155517578125,
0.0038204193115234375,
-0.0013599395751953125,
-0.0002484321594238281,
0.00742340087890625,
0.013397216796875,
0.04229736328125,
-0.00403594970703125,
-0.005542755126953125,
0.0089569091796875,
0.036163330078125,
-0.0216064453125,
-0.00713348388671875,
-0.00019824504852294922,
-0.003971099853515625,
-0.010101318359375,
0.0201568603515625,
-0.02813720703125,
0.016143798828125,
0.00200653076171875,
0.04425048828125,
0.013946533203125,
0.04119873046875,
0.0264739990234375,
-0.0229339599609375,
-0.03436279296875,
0.03948974609375,
-0.0469970703125,
0.01425933837890625,
0.01131439208984375,
0.030120849609375,
0.00913238525390625,
-0.040313720703125,
-0.007526397705078125,
-0.00012552738189697266,
-0.038909912109375,
-0.02081298828125,
0.0037384033203125,
-0.005260467529296875,
-0.01506805419921875,
-0.010223388671875,
0.0257415771484375,
0.0302581787109375,
0.016448974609375,
-0.000087738037109375,
-0.0352783203125,
0.004108428955078125,
-0.00843048095703125,
0.012969970703125,
-0.04180908203125,
0.01151275634765625,
0.0217437744140625,
0.0250701904296875,
-0.009979248046875,
-0.042755126953125,
-0.0657958984375,
-0.0253143310546875,
-0.0276031494140625,
0.0166778564453125,
0.0792236328125,
-0.0426025390625,
0.01261138916015625,
-0.000392913818359375,
0.0006890296936035156,
-0.0143890380859375,
0.0197906494140625,
0.0228424072265625,
0.017730712890625,
-0.047393798828125,
-0.0022487640380859375,
-0.00916290283203125,
-0.023681640625,
-0.017791748046875,
0.004329681396484375,
-0.058868408203125,
0.001270294189453125,
-0.0274810791015625,
-0.01192474365234375,
0.0038890838623046875,
0.044769287109375,
-0.0195159912109375,
0.05255126953125,
0.00014472007751464844,
0.023162841796875,
-0.005298614501953125,
0.047637939453125,
0.0180816650390625,
0.0499267578125,
0.0170440673828125,
0.0182952880859375,
-0.031402587890625,
-0.024139404296875,
-0.0219879150390625,
-0.08197021484375,
-0.01271820068359375,
0.01433563232421875,
-0.02862548828125,
0.031707763671875,
0.01226806640625,
0.012939453125,
0.0217437744140625,
-0.004100799560546875,
-0.01485443115234375,
-0.025482177734375,
0.03924560546875,
-0.004871368408203125,
0.01849365234375,
0.042572021484375,
-0.00441741943359375,
0.006900787353515625,
-0.05169677734375,
0.01580810546875,
-0.0270233154296875,
-0.01032257080078125,
-0.02630615234375,
0.0261993408203125,
0.00405120849609375,
0.037506103515625,
0.036895751953125,
-0.0009288787841796875,
0.032501220703125,
0.000209808349609375,
0.0119171142578125,
-0.01262664794921875,
0.0301513671875,
-0.0235595703125,
-0.019805908203125,
0.0186004638671875,
0.004970550537109375,
-0.00899505615234375,
0.0254974365234375,
-0.012542724609375,
0.017852783203125,
-0.01116180419921875,
0.022857666015625,
-0.00615692138671875,
0.00867462158203125,
-0.039306640625,
-0.0430908203125,
0.0255584716796875,
-0.004779815673828125,
0.01311492919921875,
-0.00418853759765625,
0.0511474609375,
0.0203857421875,
0.00659942626953125,
0.035003662109375,
0.01128387451171875,
-0.01203155517578125,
-0.0171661376953125,
0.0078887939453125,
0.0084991455078125,
-0.06512451171875,
0.0252838134765625,
0.01258087158203125,
0.0011091232299804688,
-0.034149169921875,
0.0283203125,
-0.0357666015625,
-0.00836181640625,
-0.0190887451171875,
0.0068817138671875,
0.0032787322998046875,
0.016326904296875,
0.0195159912109375,
-0.00016629695892333984,
0.0203094482421875,
0.0494384765625,
-0.00287628173828125,
0.0116729736328125,
0.02349853515625,
-0.027130126953125,
0.016571044921875,
0.01446533203125,
0.0272979736328125,
0.00823974609375,
-0.059967041015625,
0.006031036376953125,
-0.05841064453125,
0.034149169921875,
-0.006740570068359375,
-0.0100555419921875,
0.045440673828125,
-0.01071929931640625,
-0.0183258056640625,
0.026580810546875,
0.0252532958984375,
-0.015655517578125,
-0.0072174072265625,
0.043304443359375,
-0.044769287109375,
-0.00907135009765625,
0.009521484375,
-0.0193634033203125,
-0.0104217529296875,
-0.027130126953125,
-0.0726318359375,
0.09466552734375,
0.0162200927734375,
0.0244293212890625,
-0.005340576171875,
0.047943115234375,
-0.03955078125,
0.00394439697265625,
-0.00789642333984375,
0.0570068359375,
0.0252838134765625,
0.006153106689453125,
-0.0277252197265625,
-0.012969970703125,
0.00347137451171875,
0.04345703125,
-0.0081787109375,
-0.0008678436279296875,
-0.0159759521484375,
-0.025848388671875,
0.0328369140625,
0.068359375,
0.037750244140625,
-0.01500701904296875,
-0.005153656005859375,
0.036956787109375,
0.002719879150390625,
-0.0194854736328125,
0.030792236328125,
-0.0560302734375,
-0.03778076171875,
0.0194854736328125,
0.01117706298828125,
0.01131439208984375,
0.01491546630859375,
0.0165557861328125,
-0.03466796875,
0.008331298828125,
0.0200042724609375,
-0.035125732421875,
-0.0157012939453125,
0.0352783203125,
0.02056884765625,
-0.07196044921875,
0.0313720703125,
-0.049560546875,
0.0555419921875,
-0.0018415451049804688,
0.01363372802734375,
0.0343017578125,
0.00795745849609375,
0.0097198486328125,
-0.002277374267578125,
-0.00597381591796875,
-0.0011053085327148438,
0.014007568359375,
0.01227569580078125,
0.02294921875,
0.0302276611328125,
-0.01338958740234375,
-0.025970458984375,
0.036407470703125,
0.02960205078125,
-0.01239013671875,
-0.00235748291015625,
0.0169525146484375,
0.00974273681640625,
-0.0162506103515625,
-0.0311279296875,
-0.00830841064453125,
-0.0295867919921875,
-0.020111083984375,
-0.004215240478515625,
-0.01541900634765625,
-0.007183074951171875,
0.027130126953125,
0.016357421875,
0.00567626953125,
0.01161956787109375,
-0.0172271728515625,
-0.060546875,
-0.0036296844482421875,
0.00732421875,
0.05902099609375,
0.046600341796875,
0.037322998046875,
0.0261688232421875,
-0.0276641845703125,
-0.0147857666015625,
-0.0029926300048828125,
0.025543212890625,
-0.013031005859375,
-0.0095062255859375,
-0.0253753662109375,
0.05572509765625,
0.0156097412109375,
-0.005954742431640625,
-0.0011091232299804688,
-0.028167724609375,
-0.01947021484375,
-0.014495849609375,
-0.0020294189453125,
0.024871826171875,
-0.0241241455078125,
0.034423828125,
-0.05377197265625,
0.0139007568359375,
0.0019235610961914062,
-0.00861358642578125,
0.00884246826171875,
-0.0286407470703125,
0.0533447265625,
-0.0204925537109375,
0.02569580078125,
-0.006061553955078125,
-0.0024394989013671875,
-0.01105499267578125,
-0.02728271484375,
-0.012115478515625,
-0.0228118896484375,
-0.059234619140625,
0.007350921630859375,
-0.031951904296875,
-0.0498046875,
0.0139007568359375,
0.035736083984375,
0.00399017333984375,
-0.0164642333984375,
0.05145263671875,
0.004329681396484375,
-0.0251922607421875,
0.0075836181640625,
0.01152801513671875,
-0.01910400390625,
0.035736083984375,
0.0241851806640625,
-0.02325439453125,
-0.0214996337890625,
-0.0345458984375,
0.0733642578125,
0.0123291015625,
0.033233642578125,
-0.03302001953125,
0.057403564453125,
-0.016571044921875,
-0.023895263671875,
0.01538848876953125,
-0.007541656494140625,
0.016937255859375,
0.01898193359375,
-0.027069091796875,
-0.032684326171875,
-0.03179931640625,
-0.0023784637451171875,
0.0230560302734375,
-0.0012683868408203125,
-0.00804901123046875,
-0.0265045166015625,
0.035675048828125,
0.0242919921875,
0.01532745361328125,
-0.01959228515625,
-0.034149169921875,
0.0065765380859375,
0.038055419921875,
0.002750396728515625,
0.0137786865234375,
-0.011199951171875,
0.05816650390625,
0.038848876953125,
0.023101806640625,
0.00412750244140625,
-0.006885528564453125,
0.0234832763671875,
0.0289764404296875,
-0.02508544921875,
-0.04779052734375,
-0.0005402565002441406,
-0.01105499267578125,
0.019134521484375,
-0.0239715576171875,
0.06793212890625,
0.0220794677734375,
-0.05218505859375,
-0.019195556640625,
0.053741455078125,
0.039398193359375,
-0.0189208984375,
0.03369140625,
0.0260467529296875,
-0.040924072265625,
0.037353515625,
0.01081085205078125,
-0.039825439453125,
-0.032684326171875,
0.01544952392578125,
0.006160736083984375,
-0.007904052734375,
-0.06475830078125,
-0.08367919921875,
-0.034820556640625,
0.0248870849609375,
0.01439666748046875,
-0.044921875,
-0.0232391357421875,
0.015289306640625,
0.046295166015625,
-0.02740478515625,
0.0121612548828125,
-0.0028533935546875,
0.0018749237060546875,
-0.0286712646484375,
-0.045257568359375,
-0.02117919921875,
0.053192138671875,
-0.007518768310546875,
0.0022125244140625,
0.0276641845703125,
-0.00968170166015625,
0.0168609619140625,
0.0095367431640625,
0.00011831521987915039,
0.06878662109375,
-0.062042236328125,
-0.0247344970703125,
-0.0308837890625,
0.0169525146484375,
-0.0251922607421875,
0.0281219482421875,
0.047393798828125,
-0.0167999267578125,
-0.06378173828125,
0.062255859375,
-0.045440673828125,
-0.006805419921875,
-0.0479736328125,
-0.06903076171875,
0.0141448974609375,
0.037994384765625,
-0.056549072265625,
0.01235198974609375,
-0.01012420654296875,
-0.027069091796875,
0.003040313720703125,
0.00791168212890625,
-0.00894927978515625,
0.0020904541015625,
0.0225830078125,
-0.0087890625,
-0.0108795166015625,
0.041168212890625,
-0.038543701171875,
-0.04791259765625,
-0.029449462890625,
-0.0273590087890625,
-0.02178955078125,
-0.01129913330078125,
0.01490020751953125,
0.0233612060546875,
0.04315185546875,
-0.00919342041015625,
0.005489349365234375,
0.00801849365234375,
-0.015960693359375,
-0.005962371826171875,
-0.0273284912109375,
-0.01149749755859375,
-0.0272369384765625,
0.059478759765625,
-0.0004432201385498047,
0.00099945068359375,
-0.0054779052734375,
-0.025421142578125,
0.016448974609375,
-0.03839111328125,
-0.01302337646484375,
0.036712646484375,
-0.07879638671875,
-0.0256805419921875,
-0.0049591064453125,
0.0276947021484375,
0.01055145263671875,
-0.05316162109375,
-0.0004911422729492188,
-0.039886474609375,
0.0007462501525878906,
0.044219970703125,
-0.047119140625,
-0.002246856689453125,
0.106689453125,
-0.07635498046875,
-0.03253173828125,
0.01016998291015625,
0.0109710693359375,
0.0174407958984375,
-0.07421875,
0.002071380615234375,
-0.0732421875,
0.00864410400390625,
0.030181884765625,
0.00951385498046875,
0.0665283203125,
0.01322174072265625,
-0.055023193359375,
-0.042938232421875,
-0.0207672119140625,
0.00012117624282836914,
-0.0224609375,
0.003192901611328125,
-0.0033550262451171875,
0.0200653076171875,
0.019134521484375,
-0.05810546875,
0.029083251953125,
-0.0310821533203125,
-0.017791748046875,
0.007801055908203125,
0.04058837890625,
0.07122802734375,
0.006519317626953125,
0.0214691162109375,
-0.003448486328125,
0.0002560615539550781,
-0.036285400390625,
0.024322509765625,
-0.088134765625,
-0.01360321044921875,
0.024078369140625
] |
9988d74a98dafac9df255663c0678160b7f0023b
|
Wordpress Stackexchange
Q: How do I add nested categories to drop-down menu in twenty-eleven? I know how to do it by writing a separate ul/li css for wp_list_categories, but I find menus of "twenty eleven" already well designed and flexible, so I`d like to use them.
Custom menus, when I have to add subcategories manually, are not a solution, sinse I will allow my users to create new categories. What would you do?
A: As a purely theory example, this is how I would approach the problem:
$cats = get_categories();
echo '<ul>';
foreach($cats as $cat) {
echo'<li>'.$cat->name;
if($cat->parent != 0) {
$subcats = get_category('child_of='.$cat->cat_ID;
echo '<ul>';
foreach($subcats as $subcat){
echo '<li>'.$subcat->name.'</li>';
}
}
echo '</li>';
}
echo '</ul>';
I don't expect that to work fully as I coded it there based of this codex entry but I am fairly certain that my theory is correct. I may have the $cat->parent backwards though...
|
Q: How do I add nested categories to drop-down menu in twenty-eleven? I know how to do it by writing a separate ul/li css for wp_list_categories, but I find menus of "twenty eleven" already well designed and flexible, so I`d like to use them.
Custom menus, when I have to add subcategories manually, are not a solution, sinse I will allow my users to create new categories. What would you do?
A: As a purely theory example, this is how I would approach the problem:
$cats = get_categories();
echo '<ul>';
foreach($cats as $cat) {
echo'<li>'.$cat->name;
if($cat->parent != 0) {
$subcats = get_category('child_of='.$cat->cat_ID;
echo '<ul>';
foreach($subcats as $subcat){
echo '<li>'.$subcat->name.'</li>';
}
}
echo '</li>';
}
echo '</ul>';
I don't expect that to work fully as I coded it there based of this codex entry but I am fairly certain that my theory is correct. I may have the $cat->parent backwards though...
|
wordpress
|
{
"language": "en",
"length": 150,
"provenance": "stackexchange_00019.jsonl.gz:419594",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50852"
}
|
[
0.04949951171875,
0.004779815673828125,
0.002300262451171875,
-0.01447296142578125,
0.0283660888671875,
-0.03302001953125,
0.0479736328125,
-0.03961181640625,
-0.024993896484375,
-0.0138702392578125,
-0.029388427734375,
-0.0227813720703125,
-0.038177490234375,
-0.03216552734375,
-0.008941650390625,
-0.07330322265625,
0.0240020751953125,
-0.017303466796875,
0.01311492919921875,
0.0027217864990234375,
-0.01428985595703125,
0.01312255859375,
0.0265960693359375,
0.0281982421875,
0.032501220703125,
-0.048675537109375,
0.003215789794921875,
-0.0182647705078125,
0.0156707763671875,
-0.0281524658203125,
0.0189056396484375,
0.01629638671875,
0.0227508544921875,
0.0078277587890625,
0.0233917236328125,
0.07684326171875,
-0.004032135009765625,
0.0175933837890625,
0.0157012939453125,
0.0281829833984375,
0.017059326171875,
0.0002720355987548828,
0.03680419921875,
0.02984619140625,
0.0101318359375,
-0.06268310546875,
0.051177978515625,
-0.03692626953125,
-0.006153106689453125,
-0.0501708984375,
0.048126220703125,
0.0184326171875,
0.080322265625,
-0.0799560546875,
-0.026519775390625,
-0.016082763671875,
0.025299072265625,
-0.01126861572265625,
0.0396728515625,
0.0037841796875,
-0.0546875,
-0.00582122802734375,
0.0141754150390625,
-0.047943115234375,
0.0267181396484375,
0.0024967193603515625,
0.027679443359375,
0.0228424072265625,
-0.042266845703125,
0.013214111328125,
0.0308990478515625,
-0.034454345703125,
-0.006591796875,
-0.01103973388671875,
-0.014617919921875,
-0.0136260986328125,
-0.004482269287109375,
-0.029327392578125,
0.03131103515625,
-0.00167083740234375,
0.0147247314453125,
0.0032939910888671875,
0.0014848709106445312,
0.0029449462890625,
0.00630950927734375,
0.0177154541015625,
-0.010101318359375,
-0.0217132568359375,
-0.054473876953125,
0.0215911865234375,
-0.0291900634765625,
-0.04229736328125,
-0.034332275390625,
0.0438232421875,
0.0155792236328125,
0.014373779296875,
0.03619384765625,
0.046234130859375,
-0.0003414154052734375,
0.005367279052734375,
0.006175994873046875,
-0.04388427734375,
0.03399658203125,
-0.0311279296875,
0.0277252197265625,
0.0021381378173828125,
-0.0252685546875,
-0.0084991455078125,
0.06689453125,
0.0413818359375,
-0.0016946792602539062,
0.07720947265625,
0.0237884521484375,
-0.0257720947265625,
-0.0137786865234375,
0.00090789794921875,
0.0032024383544921875,
0.022003173828125,
0.01442718505859375,
-0.0005764961242675781,
-0.0041351318359375,
0.0322265625,
-0.03887939453125,
0.0225372314453125,
0.001895904541015625,
0.002269744873046875,
0.0142974853515625,
-0.0172119140625,
-0.009521484375,
-0.031463623046875,
-0.06494140625,
0.04803466796875,
0.1165771484375,
0.035430908203125,
0.0272369384765625,
-0.0070037841796875,
0.00420379638671875,
0.023040771484375,
0.022430419921875,
-0.00661468505859375,
0.00482940673828125,
-0.027557373046875,
0.01490020751953125,
0.01102447509765625,
-0.005428314208984375,
-0.0010671615600585938,
0.0311279296875,
0.0277099609375,
-0.01287078857421875,
-0.042572021484375,
0.044921875,
-0.03961181640625,
0.05517578125,
-0.025634765625,
-0.07281494140625,
-0.02655029296875,
-0.036285400390625,
-0.0218658447265625,
-0.019378662109375,
-0.034942626953125,
-0.042327880859375,
0.006649017333984375,
0.07891845703125,
-0.07061767578125,
-0.051513671875,
0.007457733154296875,
-0.0760498046875,
-0.0225067138671875,
0.0321044921875,
0.0022945404052734375,
0.021728515625,
-0.031982421875,
-0.01053619384765625,
0.038360595703125,
0.0196380615234375,
0.04278564453125,
-0.014068603515625,
-0.0015363693237304688,
0.03204345703125,
0.0227203369140625,
0.00644683837890625,
-0.0312347412109375,
0.036224365234375,
-0.0009927749633789062,
-0.0535888671875,
0.03985595703125,
0.0012464523315429688,
0.0850830078125,
0.0223236083984375,
0.0213775634765625,
-0.00838470458984375,
-0.0010290145874023438,
-0.0401611328125,
-0.00893402099609375,
0.0002658367156982422,
-0.004390716552734375,
-0.003932952880859375,
0.0044403076171875,
-0.01363372802734375,
0.0016040802001953125,
-0.0526123046875,
0.018890380859375,
-0.001461029052734375,
0.04010009765625,
-0.0203094482421875,
0.0435791015625,
-0.0162811279296875,
0.051513671875,
0.0013484954833984375,
0.00514984130859375,
-0.00826263427734375,
-0.027984619140625,
0.019561767578125,
-0.07025146484375,
-0.01264190673828125,
0.03375244140625,
0.003009796142578125,
0.0106658935546875,
-0.0180511474609375,
-0.0166168212890625,
0.003948211669921875,
-0.01323699951171875,
0.00691986083984375,
0.05877685546875,
0.06103515625,
-0.00997161865234375,
-0.024261474609375,
-0.0206756591796875,
0.01473236083984375,
0.031982421875,
-0.0867919921875,
0.02880859375,
0.0498046875,
-0.00759124755859375,
-0.0511474609375,
0.0167236328125,
0.0102081298828125,
-0.0606689453125,
-0.0389404296875,
0.0537109375,
0.03289794921875,
0.0213623046875,
-0.01458740234375,
-0.0192718505859375,
0.0477294921875,
-0.055145263671875,
-0.0037021636962890625,
-0.0192718505859375,
-0.04803466796875,
-0.018463134765625,
0.0546875,
0.020416259765625,
0.01158905029296875,
0.0156402587890625,
0.016265869140625,
0.02301025390625,
-0.00830078125,
-0.034759521484375,
0.033294677734375,
-0.028228759765625,
0.0303192138671875,
0.0013399124145507812,
-0.049346923828125,
0.016845703125,
0.0528564453125,
-0.04119873046875,
0.038726806640625,
0.0162200927734375,
0.039642333984375,
-0.04803466796875,
-0.0036487579345703125,
-0.046142578125,
-0.001979827880859375,
-0.01715087890625,
-0.04351806640625,
-0.00827789306640625,
-0.0163421630859375,
0.02154541015625,
-0.00390625,
-0.02972412109375,
-0.004619598388671875,
0.09710693359375,
0.025177001953125,
-0.0174102783203125,
-0.06451416015625,
-0.03631591796875,
0.01367950439453125,
0.0116119384765625,
-0.007129669189453125,
0.0167388916015625,
0.04339599609375,
0.030364990234375,
0.006649017333984375,
-0.00495147705078125,
-0.035675048828125,
0.007022857666015625,
0.09820556640625,
0.045135498046875,
0.00695037841796875,
0.0253448486328125,
-0.006702423095703125,
0.02081298828125,
-0.0267791748046875,
-0.005645751953125,
0.007152557373046875,
-0.00919342041015625,
0.0150146484375,
0.035308837890625,
0.013519287109375,
-0.0233612060546875,
0.0052947998046875,
0.007640838623046875,
0.015960693359375,
0.0265655517578125,
0.0161590576171875,
-0.0170135498046875,
0.0046844482421875,
0.0188446044921875,
0.006267547607421875,
-0.024169921875,
0.0224761962890625,
-0.0396728515625,
0.009490966796875,
0.0019025802612304688,
-0.01959228515625,
-0.0292510986328125,
0.02490234375,
0.0092315673828125,
-0.0030384063720703125,
-0.04901123046875,
-0.03411865234375,
-0.0692138671875,
-0.057891845703125,
-0.00855255126953125,
0.002872467041015625,
-0.00730133056640625,
0.0012788772583007812,
0.05670166015625,
-0.0009851455688476562,
-0.06298828125,
-0.00403594970703125,
0.043701171875,
-0.002063751220703125,
0.01251220703125,
0.02642822265625,
-0.033660888671875,
0.02471923828125,
-0.0008783340454101562,
-0.00354766845703125,
0.014739990234375,
-0.00844573974609375,
-0.0281524658203125,
-0.00604248046875,
0.03851318359375,
0.02044677734375,
-0.0303802490234375,
0.01499176025390625,
0.0758056640625,
0.022613525390625,
-0.00156402587890625,
-0.00801849365234375,
-0.01105499267578125,
-0.025177001953125,
-0.0211029052734375,
0.01444244384765625,
-0.0070648193359375,
-0.032958984375,
0.01395416259765625,
-0.033966064453125,
-0.0269775390625,
0.0235443115234375,
-0.04351806640625,
-0.0171051025390625,
-0.015350341796875,
-0.020294189453125,
0.006938934326171875,
0.05816650390625,
0.0049591064453125,
-0.011566162109375,
0.0209197998046875,
0.0169677734375,
0.0047760009765625,
-0.0176849365234375,
-0.033782958984375,
-0.08172607421875,
0.025848388671875,
-0.0557861328125,
0.0205078125,
-0.05389404296875,
-0.012451171875,
-0.00580596923828125,
0.10113525390625,
-0.04522705078125,
-0.02386474609375,
0.0017147064208984375,
0.03216552734375,
-0.0216827392578125,
-0.034027099609375,
-0.022491455078125,
-0.01390838623046875,
-0.053558349609375,
0.0235443115234375,
0.010986328125,
-0.029266357421875,
-0.0210418701171875,
0.001293182373046875,
-0.05902099609375,
-0.0193328857421875,
0.03900146484375,
-0.025909423828125,
0.01346588134765625,
0.003147125244140625,
0.023193359375,
-0.032623291015625,
-0.00968170166015625,
-0.0189208984375,
-0.0682373046875,
-0.0262603759765625,
-0.0021038055419921875,
0.04931640625,
0.00731658935546875,
-0.0294342041015625,
-0.0079498291015625,
0.057373046875,
0.01287841796875,
-0.002704620361328125,
0.0430908203125,
0.02520751953125,
-0.0152435302734375,
-0.030609130859375,
0.01910400390625,
-0.05767822265625,
-0.045074462890625,
-0.039825439453125,
0.0176544189453125,
0.027191162109375,
0.003932952880859375,
-0.0010480880737304688,
0.00099945068359375,
0.0236053466796875,
-0.033477783203125,
-0.071533203125,
-0.062286376953125,
-0.0090484619140625,
-0.0306549072265625,
0.01397705078125,
-0.0562744140625,
-0.029052734375,
-0.006534576416015625,
0.013275146484375,
-0.006900787353515625,
0.013214111328125,
0.031341552734375,
0.01136016845703125,
-0.0263519287109375,
-0.018768310546875,
-0.0294036865234375,
0.03045654296875,
-0.0338134765625,
0.0335693359375,
0.0083770751953125,
-0.002838134765625,
0.03436279296875,
-0.01152801513671875,
0.059326171875,
-0.01401519775390625,
0.048248291015625,
0.01271820068359375,
0.00856781005859375,
0.01387786865234375,
0.0272369384765625,
-0.058135986328125,
0.032470703125,
-0.01580810546875,
-0.0191192626953125,
-0.0270233154296875,
0.043975830078125,
0.01534271240234375,
-0.00348663330078125,
-0.058349609375,
0.006687164306640625,
-0.0072174072265625,
-0.026641845703125,
0.042510986328125,
0.036285400390625,
-0.007747650146484375,
-0.00749969482421875,
-0.0025634765625,
-0.0074310302734375,
-0.0286865234375,
-0.0174713134765625,
-0.005130767822265625,
0.012908935546875,
-0.044769287109375,
-0.01326751708984375,
-0.0176544189453125,
-0.01209259033203125,
0.08258056640625,
0.038787841796875,
-0.0006399154663085938,
-0.014678955078125,
0.0036411285400390625,
0.0447998046875,
-0.01491546630859375,
0.0162200927734375,
-0.00751495361328125,
0.0017576217651367188,
0.03546142578125,
0.0279998779296875,
0.0007863044738769531,
0.0301666259765625,
0.0106201171875,
0.004077911376953125,
0.0125274658203125,
-0.01404571533203125,
0.0159454345703125,
0.03948974609375,
0.021759033203125,
0.0252532958984375,
-0.0168304443359375,
-0.0072479248046875,
0.0012407302856445312,
0.0183563232421875,
0.029998779296875,
0.003887176513671875,
-0.00435638427734375,
-0.007053375244140625,
0.0307769775390625,
-0.01580810546875,
-0.013885498046875,
0.0212860107421875,
0.033447265625,
0.006328582763671875,
-0.0167999267578125,
0.0022125244140625,
-0.01219940185546875,
-0.00506591796875,
0.0016088485717773438,
0.0017137527465820312,
-0.0079193115234375,
-0.0008840560913085938,
-0.004913330078125,
-0.0142974853515625,
0.00557708740234375,
-0.040679931640625,
0.0004131793975830078,
-0.04339599609375,
0.01091766357421875,
-0.0127105712890625,
-0.0166473388671875,
0.026947021484375,
0.01947021484375,
-0.04779052734375,
0.007671356201171875,
0.0227203369140625,
-0.032989501953125,
-0.0433349609375,
-0.017791748046875,
-0.03387451171875,
0.03363037109375,
-0.005016326904296875,
0.05474853515625,
-0.0213470458984375,
-0.04583740234375,
-0.007415771484375,
-0.00756072998046875,
0.06365966796875,
0.037078857421875,
-0.0204010009765625,
-0.0282440185546875,
-0.0005273818969726562,
-0.006214141845703125,
-0.00968170166015625,
-0.033843994140625,
-0.01534271240234375,
0.004390716552734375,
0.01029205322265625,
-0.00612640380859375,
0.01092529296875,
-0.01056671142578125,
-0.025146484375,
0.02337646484375,
0.0246124267578125,
-0.034088134765625,
-0.01306915283203125,
0.047515869140625,
-0.031158447265625,
-0.0058135986328125,
-0.0135955810546875,
-0.0020275115966796875,
-0.00661468505859375,
0.01561737060546875,
0.0017681121826171875,
-0.061126708984375,
-0.00986480712890625,
-0.032745361328125,
-0.01192474365234375,
0.04791259765625,
0.05322265625,
-0.002994537353515625,
0.029571533203125,
-0.00875091552734375,
0.00324249267578125,
-0.006900787353515625,
-0.0143890380859375,
-0.00452423095703125,
-0.017852783203125,
0.06146240234375,
-0.026763916015625,
0.0161895751953125,
0.0013742446899414062,
-0.039886474609375,
0.032012939453125,
-0.008209228515625,
0.03216552734375,
0.02520751953125,
-0.053558349609375,
0.0738525390625,
0.054443359375,
0.0107269287109375,
0.034515380859375,
0.00960540771484375,
0.0170745849609375,
-0.02703857421875,
0.005306243896484375,
0.0193328857421875,
0.009185791015625,
0.053131103515625,
-0.0033206939697265625,
-0.0052337646484375,
0.0258636474609375,
-0.032440185546875,
-0.040740966796875,
0.040740966796875,
0.03167724609375,
-0.0260162353515625,
-0.03363037109375,
-0.007457733154296875,
-0.0208587646484375,
-0.0142669677734375,
0.0259246826171875,
-0.0053863525390625,
0.001682281494140625,
0.0010519027709960938,
-0.03125,
-0.026458740234375,
-0.0018253326416015625,
-0.0017919540405273438,
0.00724029541015625,
-0.00844573974609375,
0.033660888671875,
0.01192474365234375,
0.0271759033203125,
-0.036102294921875,
-0.0267333984375,
0.01529693603515625,
-0.0220184326171875,
0.021575927734375,
0.00725555419921875,
-0.006610870361328125,
-0.01947021484375,
0.037811279296875,
0.02264404296875,
-0.00921630859375,
0.0225067138671875,
-0.02923583984375,
0.031341552734375,
0.0360107421875,
-0.0266571044921875,
0.03173828125,
-0.002773284912109375,
0.0023517608642578125,
0.0291290283203125,
0.0209503173828125,
-0.0114898681640625,
-0.0413818359375,
-0.021392822265625,
-0.0223388671875,
-0.06353759765625,
0.037841796875,
-0.00518035888671875,
0.004138946533203125,
0.055694580078125,
-0.0185699462890625,
-0.036163330078125,
0.007022857666015625,
0.0301055908203125,
0.0252227783203125,
-0.0175323486328125,
0.047882080078125,
-0.058074951171875,
-0.034454345703125,
0.0166168212890625,
-0.01215362548828125,
-0.006439208984375,
-0.01861572265625,
-0.02325439453125,
0.065673828125,
-0.08477783203125,
0.010986328125,
0.031280517578125,
0.028472900390625,
0.01422119140625,
0.0268096923828125,
-0.038330078125,
0.038909912109375,
0.045440673828125,
0.01471710205078125,
-0.041015625,
-0.02716064453125,
-0.008056640625,
0.056365966796875,
-0.0161590576171875,
-0.0034637451171875,
-0.0255889892578125,
0.0009398460388183594,
0.0369873046875,
0.0260772705078125,
0.01001739501953125,
0.0228729248046875,
-0.0092315673828125,
-0.022430419921875,
0.0181884765625,
0.00904083251953125,
0.036865234375,
-0.0037384033203125,
-0.0288238525390625,
0.0027065277099609375,
0.00542449951171875,
0.0232391357421875,
-0.01983642578125,
0.018768310546875,
0.0132598876953125,
-0.0212554931640625,
-0.0240325927734375,
0.002132415771484375,
0.033355712890625,
0.02691650390625,
0.024627685546875,
-0.00785064697265625,
-0.0019330978393554688,
-0.0175628662109375,
0.04119873046875,
-0.01197052001953125,
-0.0065155029296875,
0.034576416015625,
0.0182342529296875,
-0.0288238525390625,
0.00991058349609375,
0.01082611083984375,
0.01739501953125,
-0.0183563232421875,
0.031890869140625,
0.0154571533203125,
0.0084381103515625,
-0.053009033203125,
0.01132965087890625,
0.04876708984375,
0.039031982421875,
-0.0408935546875,
-0.06207275390625,
-0.0015211105346679688,
0.01410675048828125,
0.035186767578125,
0.036651611328125,
0.0751953125,
0.02508544921875,
0.05035400390625,
-0.043975830078125,
-0.0292510986328125,
0.0243377685546875,
0.019195556640625,
0.01024627685546875,
0.006988525390625,
0.004547119140625,
-0.035919189453125,
-0.0288543701171875,
-0.0038356781005859375,
-0.0008234977722167969,
0.059661865234375,
0.0181427001953125,
0.043701171875,
-0.051971435546875,
-0.0345458984375,
0.018585205078125,
-0.0277099609375,
0.0256500244140625,
-0.0513916015625,
0.03759765625,
-0.0020694732666015625,
0.0232391357421875,
-0.0026950836181640625,
-0.0196075439453125,
0.035858154296875,
0.03704833984375,
0.0307464599609375,
-0.020263671875,
-0.021942138671875,
0.0232696533203125,
-0.03851318359375,
-0.03076171875,
-0.001125335693359375,
0.00836181640625,
0.06396484375,
0.01235198974609375,
-0.0018930435180664062,
0.03631591796875,
0.06707763671875,
-0.0023632049560546875,
0.0092926025390625,
-0.0007672309875488281,
-0.03765869140625,
0.032745361328125,
-0.0221710205078125,
0.06658935546875,
0.01386260986328125,
-0.11834716796875,
-0.03106689453125,
-0.034759521484375,
-0.03021240234375,
0.06829833984375,
0.04119873046875,
-0.014129638671875,
0.009307861328125,
0.009033203125,
-0.040924072265625,
0.0248870849609375,
0.0091400146484375,
-0.0019989013671875,
0.006072998046875,
-0.00197601318359375,
-0.01387786865234375,
-0.04364013671875,
-0.01299285888671875,
-0.0184478759765625,
0.0175323486328125,
0.04473876953125,
-0.0016222000122070312,
0.0249786376953125,
0.030059814453125,
-0.0274505615234375,
0.0160369873046875,
-0.049072265625,
-0.0643310546875,
0.066162109375,
-0.02978515625,
-0.0179901123046875,
0.004047393798828125,
-0.0126800537109375,
-0.004680633544921875,
0.01528167724609375,
-0.06268310546875,
-0.021636962890625,
-0.00972747802734375,
0.0165557861328125,
-0.01422119140625,
0.028900146484375,
-0.01319122314453125,
0.005725860595703125,
-0.00814056396484375,
-0.044830322265625,
0.04876708984375,
0.0537109375,
0.0279083251953125,
-0.00408172607421875,
-0.00466156005859375,
0.0160675048828125,
-0.00936126708984375,
0.04876708984375,
-0.015167236328125,
0.020263671875,
-0.054107666015625,
0.0006375312805175781,
0.01444244384765625,
-0.01446533203125,
0.018310546875,
0.01006317138671875,
-0.00385284423828125,
0.0325927734375,
-0.037811279296875,
-0.002147674560546875,
0.07708740234375,
0.048675537109375,
-0.042938232421875,
0.0423583984375,
0.06976318359375,
-0.044586181640625,
0.018218994140625,
-0.015716552734375,
-0.034759521484375,
-0.05169677734375,
-0.0021820068359375,
0.00533294677734375,
-0.0169219970703125,
-0.02154541015625,
-0.030426025390625,
-0.00475311279296875,
0.07586669921875,
0.023284912109375,
-0.0693359375,
0.01479339599609375,
-0.0022335052490234375,
0.080078125,
0.01226806640625,
-0.0004892349243164062,
0.0016756057739257812,
-0.00911712646484375,
-0.02667236328125,
0.0118255615234375,
-0.03131103515625,
0.002056121826171875,
-0.00362396240234375,
0.007122039794921875,
0.0035915374755859375,
-0.0201263427734375,
-0.01355743408203125,
0.017425537109375,
0.024871826171875,
0.0560302734375,
0.046173095703125,
-0.0186004638671875,
-0.017913818359375,
0.004650115966796875,
-0.0240020751953125,
0.02398681640625,
0.037384033203125,
-0.0211029052734375,
-0.05535888671875,
-0.0308990478515625,
0.0145721435546875,
0.03240966796875,
-0.034637451171875,
-0.0635986328125,
0.0731201171875,
-0.03265380859375,
-0.027679443359375,
-0.03485107421875,
0.005176544189453125,
-0.042816162109375,
0.04296875,
-0.005977630615234375,
-0.016021728515625,
0.0294952392578125,
0.06109619140625,
0.032684326171875,
0.04254150390625,
-0.0021800994873046875,
0.033782958984375,
-0.0576171875,
0.00855255126953125,
-0.0173187255859375,
0.02679443359375,
-0.0167236328125,
0.006744384765625,
0.00911712646484375,
0.0293121337890625,
-0.034576416015625,
-0.0164031982421875,
0.0020046234130859375,
0.0216064453125,
0.0081634521484375,
-0.043701171875,
-0.03955078125,
-0.0521240234375,
0.021209716796875,
0.016448974609375,
0.00820159912109375,
0.0128326416015625,
-0.0445556640625,
-0.055877685546875,
-0.000637054443359375,
0.0031795501708984375,
0.0010671615600585938,
-0.042724609375,
0.0231781005859375,
0.0184783935546875,
-0.00934600830078125,
-0.0149688720703125,
0.0019683837890625,
-0.026123046875,
-0.004150390625,
0.0247955322265625,
-0.005268096923828125,
-0.018157958984375,
0.012176513671875,
0.042633056640625,
-0.055694580078125,
-0.076171875,
0.0216064453125,
-0.0040435791015625,
-0.04327392578125,
-0.00804901123046875,
-0.0426025390625,
0.0138397216796875,
-0.037078857421875,
0.01087188720703125,
-0.028533935546875,
0.033905029296875,
-0.04718017578125,
0.0202178955078125,
-0.040496826171875,
0.019622802734375,
0.017059326171875,
0.0122222900390625,
-0.024688720703125,
0.0594482421875,
0.04608154296875,
0.032196044921875,
0.004680633544921875,
0.03369140625,
-0.0251922607421875,
0.068115234375,
0.017730712890625,
-0.03497314453125,
0.03790283203125,
-0.04632568359375,
-0.01123046875,
-0.0187530517578125,
-0.0229949951171875,
-0.0557861328125,
0.0240936279296875,
0.0177764892578125,
-0.013092041015625,
0.034576416015625
] |
9f5e3ae7948ea033716fe911023ec3388ed83d20
|
Wordpress Stackexchange
Q: Highlight menu item when on a custom post type? I'm currently using this code to display a menu of pages. I'm using CSS to target the class current_page_item which works fine until you're on a page with a custom post type.
How can I target that class when the page the user is on is a custom post-type such as news or events?
<div id="menu-repeat">
<?php $args = array(
'depth' => 1,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '1908, 6282, 6380',
'include' => '',
'title_li' => __(''),
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'link_before' => '',
'link_after' => '',
'walker' => '' ); ?>
<ul><div class="menu-button"><?php wp_list_pages( $args, 'sort_column=menu_order' ); ?></div></ul>
A: I believe this has been reported as a bug. The only solutions I've seen is on the trac ticket #17590
function my_page_css_class( $css_class, $page ) {
global $post;
if ( $post->ID == $page->ID ) {
$css_class[] = 'current_page_item';
}
return $css_class;
}
add_filter( 'page_css_class', 'my_page_css_class', 10, 2 );
The alternative would be using some javascript magic to insert a class using addClass
|
Q: Highlight menu item when on a custom post type? I'm currently using this code to display a menu of pages. I'm using CSS to target the class current_page_item which works fine until you're on a page with a custom post type.
How can I target that class when the page the user is on is a custom post-type such as news or events?
<div id="menu-repeat">
<?php $args = array(
'depth' => 1,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '1908, 6282, 6380',
'include' => '',
'title_li' => __(''),
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'link_before' => '',
'link_after' => '',
'walker' => '' ); ?>
<ul><div class="menu-button"><?php wp_list_pages( $args, 'sort_column=menu_order' ); ?></div></ul>
A: I believe this has been reported as a bug. The only solutions I've seen is on the trac ticket #17590
function my_page_css_class( $css_class, $page ) {
global $post;
if ( $post->ID == $page->ID ) {
$css_class[] = 'current_page_item';
}
return $css_class;
}
add_filter( 'page_css_class', 'my_page_css_class', 10, 2 );
The alternative would be using some javascript magic to insert a class using addClass
A: If this is for a one-off site, I would suggest doing this with CSS. Philosophically, adding the current_page_item class to a menu item when that's not true feels a bit wrong too.
As long as you're using the body_class() function on your <body> element in the theme, there should be a class called single-{event} where "{event}" is the id of the post type. Hence, add the selector .single-{event} .page-item-{ID} where "{ID}" is the page ID of the events page (you'll see that as the class on the menu item as well).
|
wordpress
|
{
"language": "en",
"length": 276,
"provenance": "stackexchange_00019.jsonl.gz:419608",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50902"
}
|
[
0.078369140625,
0.00004947185516357422,
0.035919189453125,
-0.00775909423828125,
0.022216796875,
-0.035675048828125,
0.06781005859375,
-0.044708251953125,
-0.012847900390625,
-0.03692626953125,
-0.0242462158203125,
0.00714111328125,
-0.0692138671875,
-0.053619384765625,
0.032073974609375,
-0.050628662109375,
0.02288818359375,
0.0034732818603515625,
0.04461669921875,
-0.01165008544921875,
0.01134490966796875,
-0.00902557373046875,
0.04632568359375,
0.02398681640625,
0.0450439453125,
-0.05908203125,
0.025909423828125,
-0.00594329833984375,
0.043731689453125,
0.01251220703125,
0.0244140625,
-0.0362548828125,
0.0328369140625,
0.0257568359375,
-0.031982421875,
0.0144195556640625,
0.00875091552734375,
0.0016241073608398438,
-0.004642486572265625,
0.0306549072265625,
0.028656005859375,
-0.0139312744140625,
-0.0025768280029296875,
0.007274627685546875,
-0.0205230712890625,
-0.038818359375,
0.02734375,
-0.01959228515625,
-0.0033740997314453125,
-0.0290679931640625,
0.00406646728515625,
0.004322052001953125,
0.0161895751953125,
-0.0004787445068359375,
0.0030994415283203125,
0.031219482421875,
-0.0007681846618652344,
-0.01442718505859375,
0.005222320556640625,
0.01013946533203125,
0.006000518798828125,
0.01213836669921875,
0.01050567626953125,
-0.0015506744384765625,
-0.0033817291259765625,
0.0110626220703125,
0.0565185546875,
0.007232666015625,
-0.06536865234375,
-0.028350830078125,
0.028228759765625,
-0.02056884765625,
-0.0181121826171875,
0.0009489059448242188,
-0.04913330078125,
-0.00965118408203125,
0.036529541015625,
-0.0256805419921875,
-0.00673675537109375,
0.02117919921875,
-0.0003573894500732422,
0.050262451171875,
-0.0401611328125,
-0.00666046142578125,
-0.0212554931640625,
0.003520965576171875,
-0.02862548828125,
-0.009368896484375,
-0.0010919570922851562,
-0.029876708984375,
-0.006793975830078125,
0.00865936279296875,
0.01261138916015625,
-0.024688720703125,
-0.031494140625,
-0.0333251953125,
0.04437255859375,
0.0931396484375,
-0.031341552734375,
0.0199127197265625,
-0.0255126953125,
-0.0237884521484375,
0.03729248046875,
-0.06781005859375,
0.009307861328125,
0.065673828125,
0.0123138427734375,
0.0400390625,
0.052215576171875,
0.0004820823669433594,
0.019378662109375,
0.032958984375,
0.003582000732421875,
-0.00714111328125,
-0.049957275390625,
-0.016387939453125,
-0.0184173583984375,
-0.0249786376953125,
0.0036029815673828125,
-0.033538818359375,
0.019561767578125,
0.0030155181884765625,
0.04644775390625,
0.01245880126953125,
0.01324462890625,
0.01398468017578125,
-0.0303955078125,
-0.051483154296875,
0.008514404296875,
0.0224761962890625,
-0.0391845703125,
-0.020843505859375,
0.0599365234375,
0.0633544921875,
0.039764404296875,
-0.0286102294921875,
0.0389404296875,
-0.050872802734375,
0.00406646728515625,
-0.0179443359375,
0.0135650634765625,
0.0025844573974609375,
-0.006832122802734375,
-0.0113677978515625,
0.0171661376953125,
0.0245361328125,
0.0119781494140625,
-0.00012826919555664062,
-0.0033416748046875,
-0.0572509765625,
0.043609619140625,
-0.030487060546875,
0.045928955078125,
0.0162200927734375,
-0.0531005859375,
-0.0161590576171875,
0.028472900390625,
-0.029266357421875,
-0.0281829833984375,
-0.049652099609375,
0.01531982421875,
-0.00806427001953125,
-0.0002288818359375,
-0.06488037109375,
-0.058563232421875,
-0.006683349609375,
-0.05181884765625,
-0.00005990266799926758,
0.0248565673828125,
-0.037139892578125,
-0.01495361328125,
-0.0162811279296875,
0.03240966796875,
0.0286865234375,
0.0014467239379882812,
0.0538330078125,
0.04364013671875,
0.0225830078125,
0.01418304443359375,
0.01154327392578125,
-0.0379638671875,
-0.04217529296875,
0.0556640625,
-0.0572509765625,
-0.0703125,
0.0307769775390625,
0.0122833251953125,
0.056976318359375,
0.0262603759765625,
0.022216796875,
0.03973388671875,
0.0163116455078125,
-0.05078125,
-0.0162811279296875,
-0.0179443359375,
0.006145477294921875,
0.005718231201171875,
0.01129150390625,
0.004955291748046875,
0.0201568603515625,
-0.002948760986328125,
0.0258331298828125,
0.00226593017578125,
-0.0011243820190429688,
-0.04339599609375,
0.022216796875,
-0.0226593017578125,
0.057342529296875,
-0.0003256797790527344,
-0.0234832763671875,
-0.00333404541015625,
-0.005710601806640625,
0.0146026611328125,
-0.07611083984375,
-0.050750732421875,
0.03497314453125,
0.024078369140625,
0.0016841888427734375,
-0.009552001953125,
-0.0019483566284179688,
-0.003215789794921875,
-0.01416778564453125,
-0.0279998779296875,
0.0167388916015625,
0.041107177734375,
0.0113983154296875,
-0.0192718505859375,
-0.00571441650390625,
0.035125732421875,
0.0247802734375,
-0.01555633544921875,
0.01123809814453125,
0.040252685546875,
0.039215087890625,
-0.044281005859375,
-0.018585205078125,
0.010406494140625,
-0.04132080078125,
-0.0031719207763671875,
0.04510498046875,
0.0390625,
0.0181732177734375,
0.005130767822265625,
-0.00562286376953125,
0.055328369140625,
-0.005374908447265625,
0.028289794921875,
-0.027252197265625,
-0.031463623046875,
0.0009584426879882812,
0.049102783203125,
0.01351165771484375,
0.0128021240234375,
0.0135650634765625,
0.036468505859375,
0.01517486572265625,
0.02532958984375,
0.0233612060546875,
-0.0295867919921875,
0.00908660888671875,
-0.001739501953125,
0.018585205078125,
-0.037139892578125,
0.00858306884765625,
0.0301513671875,
-0.00547027587890625,
0.040740966796875,
0.01311492919921875,
0.0008001327514648438,
-0.0273895263671875,
0.0165557861328125,
-0.006134033203125,
0.0016450881958007812,
0.007450103759765625,
0.00942230224609375,
0.007480621337890625,
-0.03179931640625,
-0.00920867919921875,
0.032958984375,
-0.0019102096557617188,
-0.005672454833984375,
0.04473876953125,
-0.02386474609375,
-0.00392913818359375,
-0.000029206275939941406,
-0.08203125,
-0.0152587890625,
0.0150299072265625,
0.00870513916015625,
-0.01290130615234375,
0.0234222412109375,
-0.00179290771484375,
-0.037628173828125,
0.03961181640625,
0.006549835205078125,
-0.0297393798828125,
0.050018310546875,
-0.00002276897430419922,
0.026763916015625,
-0.0299224853515625,
0.01561737060546875,
0.0287322998046875,
-0.057586669921875,
0.033111572265625,
0.0034389495849609375,
0.005359649658203125,
0.0019168853759765625,
0.02783203125,
0.0027332305908203125,
-0.0321044921875,
0.0167694091796875,
0.046142578125,
0.032958984375,
0.0199127197265625,
-0.005130767822265625,
-0.0292510986328125,
-0.01739501953125,
-0.00110626220703125,
-0.08929443359375,
-0.0823974609375,
0.04052734375,
-0.06292724609375,
-0.0140533447265625,
-0.0011320114135742188,
-0.034027099609375,
-0.01441192626953125,
0.029876708984375,
-0.01027679443359375,
-0.037078857421875,
-0.020843505859375,
-0.0146942138671875,
-0.039642333984375,
-0.0233001708984375,
0.01169586181640625,
-0.01076507568359375,
-0.00933074951171875,
-0.0002244710922241211,
0.07568359375,
0.0224151611328125,
-0.04058837890625,
0.031402587890625,
0.05987548828125,
-0.0086212158203125,
0.0287628173828125,
0.0178070068359375,
-0.0185546875,
-0.01434326171875,
0.006000518798828125,
0.010467529296875,
0.015960693359375,
-0.0308685302734375,
0.0053558349609375,
-0.015472412109375,
0.046478271484375,
0.00891876220703125,
0.01132965087890625,
0.037567138671875,
0.0670166015625,
0.01311492919921875,
0.0008907318115234375,
-0.04766845703125,
0.0033130645751953125,
-0.051300048828125,
0.005970001220703125,
0.03009033203125,
-0.01105499267578125,
-0.02679443359375,
0.03240966796875,
0.011199951171875,
-0.0033321380615234375,
0.040924072265625,
-0.0204010009765625,
0.040435791015625,
0.003253936767578125,
0.01258087158203125,
-0.037567138671875,
0.005199432373046875,
-0.00457763671875,
0.038330078125,
0.01025390625,
0.0166473388671875,
-0.00954437255859375,
0.0168609619140625,
-0.04534912109375,
-0.0572509765625,
0.042633056640625,
-0.0149993896484375,
0.0017452239990234375,
-0.0335693359375,
-0.032989501953125,
0.006488800048828125,
0.10150146484375,
-0.07269287109375,
-0.0298919677734375,
-0.0082244873046875,
0.02142333984375,
0.041961669921875,
-0.057769775390625,
0.0035037994384765625,
-0.041473388671875,
-0.126953125,
0.0164794921875,
-0.00925445556640625,
-0.040771484375,
-0.031890869140625,
0.03082275390625,
-0.1077880859375,
-0.036956787109375,
0.03387451171875,
-0.025177001953125,
-0.01415252685546875,
0.058074951171875,
-0.035369873046875,
0.0135345458984375,
-0.02423095703125,
-0.025299072265625,
-0.115478515625,
-0.0114898681640625,
-0.0247802734375,
0.08001708984375,
0.0204925537109375,
-0.007411956787109375,
-0.0059051513671875,
0.06597900390625,
0.059906005859375,
0.03533935546875,
-0.01317596435546875,
-0.048187255859375,
0.004985809326171875,
0.002948760986328125,
0.006824493408203125,
-0.00577545166015625,
0.00249481201171875,
0.0216217041015625,
-0.0352783203125,
0.0094451904296875,
-0.01715087890625,
-0.041656494140625,
0.035003662109375,
-0.045989990234375,
-0.03948974609375,
-0.039886474609375,
0.00373077392578125,
0.0142669677734375,
-0.00907135009765625,
0.004680633544921875,
-0.041412353515625,
-0.035400390625,
-0.0032215118408203125,
-0.0374755859375,
-0.033111572265625,
0.01520538330078125,
0.0134124755859375,
0.0362548828125,
-0.0049285888671875,
0.0272369384765625,
0.01471710205078125,
0.0211181640625,
-0.0184326171875,
0.057586669921875,
0.004711151123046875,
-0.02471923828125,
0.07891845703125,
-0.0073394775390625,
-0.004543304443359375,
-0.0261993408203125,
0.072265625,
0.0034351348876953125,
-0.0006685256958007812,
0.01250457763671875,
-0.01078033447265625,
0.00853729248046875,
0.0005817413330078125,
-0.005558013916015625,
-0.048431396484375,
-0.00734710693359375,
0.06500244140625,
0.001270294189453125,
0.025054931640625,
-0.050506591796875,
-0.004535675048828125,
0.00464630126953125,
0.0091400146484375,
0.057830810546875,
0.053497314453125,
-0.00926971435546875,
0.045257568359375,
0.0149688720703125,
-0.0045623779296875,
0.026123046875,
0.06072998046875,
0.01800537109375,
0.0283966064453125,
0.0340576171875,
0.0047607421875,
-0.028289794921875,
0.0035762786865234375,
0.057525634765625,
0.023712158203125,
-0.0182952880859375,
-0.0083465576171875,
0.01015472412109375,
-0.040618896484375,
-0.01126861572265625,
0.0089874267578125,
0.041259765625,
0.01149749755859375,
-0.009124755859375,
-0.0200042724609375,
0.01004791259765625,
-0.00555419921875,
-0.038421630859375,
0.00925445556640625,
0.0086517333984375,
-0.0016031265258789062,
-0.0035400390625,
0.0261688232421875,
0.01329803466796875,
-0.006153106689453125,
-0.006134033203125,
0.0091552734375,
0.0018739700317382812,
0.02130126953125,
0.018524169921875,
-0.00865936279296875,
-0.0091705322265625,
0.00966644287109375,
0.004924774169921875,
-0.01861572265625,
-0.0277557373046875,
0.030303955078125,
0.0352783203125,
-0.004001617431640625,
0.0182647705078125,
-0.00734710693359375,
0.01512908935546875,
-0.01727294921875,
0.01059722900390625,
-0.0162811279296875,
-0.029296875,
-0.0298004150390625,
0.0210113525390625,
0.040283203125,
0.0013875961303710938,
-0.0491943359375,
0.0309906005859375,
-0.01200103759765625,
0.0340576171875,
-0.0242462158203125,
-0.035797119140625,
0.0458984375,
0.03778076171875,
-0.035430908203125,
-0.0160675048828125,
-0.01232147216796875,
-0.0574951171875,
-0.0150299072265625,
-0.00592041015625,
-0.02288818359375,
0.0112762451171875,
-0.0284423828125,
0.03955078125,
-0.0300750732421875,
-0.0175018310546875,
-0.0396728515625,
0.0191650390625,
0.0262908935546875,
0.027801513671875,
-0.03851318359375,
0.019256591796875,
-0.03790283203125,
-0.006999969482421875,
-0.0204010009765625,
-0.0548095703125,
-0.0178070068359375,
-0.0309600830078125,
0.027679443359375,
0.0218963623046875,
0.0251312255859375,
-0.02264404296875,
-0.0758056640625,
0.01439666748046875,
0.056976318359375,
0.0518798828125,
-0.0233917236328125,
0.051727294921875,
0.0062408447265625,
0.024261474609375,
-0.004779815673828125,
0.0050048828125,
-0.00008797645568847656,
0.0087738037109375,
0.003688812255859375,
-0.057861328125,
-0.0210418701171875,
-0.0088653564453125,
-0.039337158203125,
0.0616455078125,
0.07098388671875,
0.0023555755615234375,
0.037841796875,
-0.01393890380859375,
0.0138702392578125,
-0.02252197265625,
-0.03265380859375,
-0.043792724609375,
-0.012481689453125,
0.0301055908203125,
0.009918212890625,
0.0263671875,
0.006900787353515625,
-0.006053924560546875,
-0.01493072509765625,
0.0012178421020507812,
0.01812744140625,
-0.0162506103515625,
-0.005523681640625,
0.043975830078125,
0.0496826171875,
-0.017730712890625,
0.03668212890625,
0.00794219970703125,
0.00978851318359375,
0.0289306640625,
-0.006954193115234375,
0.0216522216796875,
0.0284423828125,
0.05499267578125,
-0.0204620361328125,
0.002712249755859375,
0.02545166015625,
-0.0142974853515625,
0.0112762451171875,
0.0443115234375,
0.06005859375,
-0.07769775390625,
0.006572723388671875,
0.035247802734375,
-0.0061492919921875,
0.00298309326171875,
0.015472412109375,
-0.004413604736328125,
0.01265716552734375,
0.00818634033203125,
-0.017974853515625,
-0.02728271484375,
0.0187530517578125,
0.004180908203125,
-0.007068634033203125,
0.009185791015625,
0.0275726318359375,
-0.0172576904296875,
-0.0305328369140625,
-0.0745849609375,
0.0066680908203125,
-0.035858154296875,
-0.035186767578125,
-0.007843017578125,
-0.00557708740234375,
-0.0174407958984375,
-0.04229736328125,
0.0123291015625,
-0.048187255859375,
0.0235748291015625,
0.026092529296875,
0.018707275390625,
-0.0006532669067382812,
0.049835205078125,
-0.016021728515625,
0.0288848876953125,
0.022216796875,
-0.03228759765625,
-0.007396697998046875,
-0.0114288330078125,
0.00257110595703125,
0.0229949951171875,
-0.0159759521484375,
0.006755828857421875,
-0.012176513671875,
-0.0094757080078125,
-0.01202392578125,
0.005706787109375,
0.12548828125,
-0.035430908203125,
-0.04083251953125,
-0.004695892333984375,
0.0010519027709960938,
0.006988525390625,
-0.0031223297119140625,
-0.00864410400390625,
-0.031829833984375,
-0.005855560302734375,
-0.006877899169921875,
-0.005413055419921875,
-0.0071258544921875,
-0.014892578125,
-0.0308380126953125,
0.028961181640625,
-0.016448974609375,
0.0119781494140625,
0.029052734375,
0.01824951171875,
0.0026264190673828125,
-0.00962066650390625,
-0.03375244140625,
0.051177978515625,
0.00701141357421875,
0.018768310546875,
-0.0328369140625,
0.0049285888671875,
-0.000029265880584716797,
0.0189056396484375,
-0.00972747802734375,
0.0018072128295898438,
-0.01551055908203125,
0.0261077880859375,
0.057464599609375,
0.03338623046875,
0.020050048828125,
0.022705078125,
-0.02490234375,
0.004505157470703125,
0.0036716461181640625,
-0.0223236083984375,
0.0230255126953125,
-0.0178680419921875,
-0.041656494140625,
-0.01107025146484375,
0.023956298828125,
0.0286102294921875,
0.005954742431640625,
0.00586700439453125,
-0.047271728515625,
0.017791748046875,
0.04486083984375,
-0.00859832763671875,
-0.0276641845703125,
0.060821533203125,
0.0181884765625,
-0.048095703125,
-0.056488037109375,
-0.034698486328125,
0.0292205810546875,
0.0022716522216796875,
0.024658203125,
-0.0015716552734375,
0.01995849609375,
-0.014404296875,
-0.0045928955078125,
0.00937652587890625,
0.0264739990234375,
-0.03582763671875,
0.0232696533203125,
0.01424407958984375,
0.02313232421875,
-0.0205841064453125,
-0.0171661376953125,
0.03472900390625,
0.03729248046875,
-0.030853271484375,
-0.03900146484375,
0.016845703125,
0.006092071533203125,
-0.0098876953125,
0.009429931640625,
0.01361846923828125,
-0.030975341796875,
-0.0013332366943359375,
-0.04132080078125,
-0.018035888671875,
0.0205841064453125,
0.0180816650390625,
-0.00010371208190917969,
0.0020580291748046875,
-0.006923675537109375,
-0.02398681640625,
-0.058135986328125,
0.02276611328125,
0.016357421875,
0.037933349609375,
0.00485992431640625,
0.05780029296875,
0.034912109375,
-0.012603759765625,
0.0017032623291015625,
-0.00939178466796875,
-0.000038683414459228516,
0.01076507568359375,
-0.01141357421875,
0.007366180419921875,
-0.0018548965454101562,
0.0260009765625,
-0.018890380859375,
-0.0029811859130859375,
0.006748199462890625,
-0.005352020263671875,
-0.03692626953125,
-0.0221099853515625,
0.010284423828125,
-0.036529541015625,
-0.0169830322265625,
-0.01425933837890625,
-0.00826263427734375,
0.0205535888671875,
-0.01251983642578125,
0.014556884765625,
0.005039215087890625,
0.036041259765625,
0.00321197509765625,
0.01532745361328125,
0.0162506103515625,
-0.013031005859375,
-0.0102081298828125,
0.0249176025390625,
0.010986328125,
0.033172607421875,
-0.130859375,
-0.03485107421875,
-0.03277587890625,
-0.05224609375,
0.06463623046875,
0.069580078125,
-0.0150909423828125,
-0.0212554931640625,
0.0304107666015625,
-0.000347137451171875,
-0.00499725341796875,
-0.002353668212890625,
0.0190277099609375,
0.04473876953125,
0.0194549560546875,
0.0546875,
-0.0216522216796875,
-0.0146484375,
0.002277374267578125,
0.02825927734375,
-0.000152587890625,
0.044525146484375,
-0.00331878662109375,
0.0199737548828125,
-0.050811767578125,
0.0279693603515625,
-0.0675048828125,
-0.05072021484375,
0.03594970703125,
0.005245208740234375,
0.017547607421875,
0.012908935546875,
-0.032989501953125,
0.01349639892578125,
0.06561279296875,
-0.01280975341796875,
0.0047454833984375,
-0.001979827880859375,
0.0271453857421875,
-0.03564453125,
-0.0032367706298828125,
-0.0200042724609375,
0.01983642578125,
-0.00902557373046875,
-0.0316162109375,
0.03411865234375,
0.00621795654296875,
0.025421142578125,
0.03814697265625,
0.054046630859375,
-0.0219268798828125,
0.0255279541015625,
-0.01374053955078125,
0.07293701171875,
0.0428466796875,
-0.0009417533874511719,
-0.0157012939453125,
0.0260467529296875,
-0.0004401206970214844,
-0.01194000244140625,
0.035430908203125,
-0.0019931793212890625,
0.01253509521484375,
-0.024658203125,
0.07293701171875,
0.039337158203125,
0.06085205078125,
-0.0049896240234375,
0.0020160675048828125,
0.0565185546875,
-0.017822265625,
-0.015380859375,
-0.036834716796875,
-0.036407470703125,
-0.01953125,
0.0178375244140625,
0.0246124267578125,
0.02508544921875,
-0.023529052734375,
-0.047393798828125,
-0.0142974853515625,
0.03155517578125,
0.0234527587890625,
-0.0692138671875,
0.0601806640625,
-0.0272674560546875,
0.010498046875,
-0.0197296142578125,
-0.0273284912109375,
-0.0054931640625,
0.006351470947265625,
0.00814056396484375,
0.0006923675537109375,
-0.036956787109375,
0.0185394287109375,
-0.00140380859375,
0.022491455078125,
0.0526123046875,
-0.0271759033203125,
-0.03668212890625,
-0.020477294921875,
-0.00933837890625,
0.03778076171875,
-0.030975341796875,
-0.024169921875,
0.0031490325927734375,
-0.009002685546875,
0.0012807846069335938,
-0.03350830078125,
0.0256500244140625,
-0.05792236328125,
-0.02001953125,
0.050628662109375,
-0.0168609619140625,
0.00858306884765625,
-0.0302276611328125,
-0.0706787109375,
0.042327880859375,
0.0223236083984375,
-0.046295166015625,
0.01123809814453125,
0.0206451416015625,
-0.0174102783203125,
-0.020355224609375,
0.011627197265625,
-0.07318115234375,
0.012451171875,
0.009185791015625,
-0.0002186298370361328,
0.038177490234375,
0.00811004638671875,
0.0191802978515625,
-0.0736083984375,
-0.0163726806640625,
-0.033294677734375,
0.014068603515625,
-0.014495849609375,
0.007541656494140625,
-0.00252532958984375,
0.006500244140625,
-0.051605224609375,
-0.03289794921875,
0.0008296966552734375,
0.038543701171875,
0.0115814208984375,
-0.0004963874816894531,
-0.07135009765625,
-0.049407958984375,
0.07489013671875,
0.03765869140625,
0.030364990234375,
0.01983642578125,
0.0004799365997314453,
-0.01190185546875,
-0.0413818359375,
-0.006877899169921875,
0.0219573974609375,
-0.05706787109375,
-0.0235137939453125,
0.024139404296875,
-0.01220703125,
-0.0159454345703125,
0.01203155517578125,
-0.03662109375,
-0.0063018798828125,
0.02203369140625,
0.036346435546875,
-0.07470703125,
-0.00775909423828125,
0.04595947265625,
-0.03009033203125,
0.0062103271484375,
0.0211639404296875,
0.0015707015991210938,
0.029052734375,
0.03948974609375,
-0.036376953125,
-0.0137176513671875,
-0.043426513671875,
0.01001739501953125,
-0.03631591796875,
0.038055419921875,
-0.0367431640625,
0.004680633544921875,
-0.0163116455078125,
0.009063720703125,
-0.0031719207763671875,
0.0166015625,
0.02947998046875,
0.005382537841796875,
-0.00887298583984375,
0.042510986328125,
0.00843048095703125,
0.06005859375,
0.026885986328125,
0.02392578125,
0.007213592529296875,
-0.0305023193359375,
0.0372314453125,
-0.0712890625,
-0.0110321044921875,
-0.025177001953125,
-0.029754638671875,
-0.068603515625,
0.02862548828125,
-0.0089874267578125,
-0.0200042724609375,
0.0284881591796875
] |
186948653687b9497ef127a0a5f943751955008e
|
Wordpress Stackexchange
Q: front end logo upload like happytables happytables has a cool feature where if you are logged in, on the home page && haven't uploaded a logo yet it will insert a drag + drop image box similar to image uploader on the backend.
any ideas on how to pull this off? currently digging thru the source code, but if anyone has some pointers, i'd greatly appreciate it --
A: I actually wrote this for Happy Tables so should be able to give you a couple of pointers, though I don't have time to go into too much depth at the moment.
We use this "image well" on tables tables a fair bit, it's basically the drag/drop upload from the WordPress upload. Similar to something like this: https://github.com/tobiasnygren/Drag-Drop-for-Post-Thumbnails we use Plupload for the image well, which send the file to the WordPress media-upload.php.
Anyway, this is all open source from Happy Tables which you can view here: https://github.com/themeforce/framework/blob/master/core_options/tf.options-of-uploader.php
It is pretty modular, so you might be able to use it as is pretty much. It does lean on WP Thumb, which you can download here: http://wordpress.org/extend/plugins/wp-thumb/
|
Q: front end logo upload like happytables happytables has a cool feature where if you are logged in, on the home page && haven't uploaded a logo yet it will insert a drag + drop image box similar to image uploader on the backend.
any ideas on how to pull this off? currently digging thru the source code, but if anyone has some pointers, i'd greatly appreciate it --
A: I actually wrote this for Happy Tables so should be able to give you a couple of pointers, though I don't have time to go into too much depth at the moment.
We use this "image well" on tables tables a fair bit, it's basically the drag/drop upload from the WordPress upload. Similar to something like this: https://github.com/tobiasnygren/Drag-Drop-for-Post-Thumbnails we use Plupload for the image well, which send the file to the WordPress media-upload.php.
Anyway, this is all open source from Happy Tables which you can view here: https://github.com/themeforce/framework/blob/master/core_options/tf.options-of-uploader.php
It is pretty modular, so you might be able to use it as is pretty much. It does lean on WP Thumb, which you can download here: http://wordpress.org/extend/plugins/wp-thumb/
|
wordpress
|
{
"language": "en",
"length": 186,
"provenance": "stackexchange_00019.jsonl.gz:419609",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50903"
}
|
[
0.05987548828125,
0.0439453125,
-0.013702392578125,
-0.0239105224609375,
0.056396484375,
-0.043365478515625,
0.07843017578125,
-0.0391845703125,
0.056976318359375,
0.01885986328125,
-0.04095458984375,
0.01372528076171875,
0.00832366943359375,
0.0033111572265625,
-0.0305328369140625,
-0.00019299983978271484,
0.063232421875,
-0.054168701171875,
0.047149658203125,
0.01142120361328125,
-0.01302337646484375,
0.05657958984375,
0.06390380859375,
-0.02215576171875,
0.002620697021484375,
0.0144195556640625,
0.012603759765625,
0.0069732666015625,
0.004924774169921875,
0.009857177734375,
0.01073455810546875,
-0.019012451171875,
-0.0134124755859375,
0.04022216796875,
0.00968170166015625,
0.06121826171875,
0.0264434814453125,
0.024932861328125,
0.03509521484375,
0.02349853515625,
0.0159454345703125,
0.0103759765625,
-0.048828125,
0.051361083984375,
-0.040985107421875,
-0.037628173828125,
-0.01324462890625,
-0.033843994140625,
0.0084075927734375,
0.029693603515625,
-0.00724029541015625,
0.035064697265625,
-0.0045928955078125,
-0.026397705078125,
0.0124053955078125,
-0.013580322265625,
-0.0197601318359375,
0.00470733642578125,
0.01076507568359375,
0.06817626953125,
0.014129638671875,
0.024627685546875,
-0.0147857666015625,
-0.03680419921875,
-0.0313720703125,
0.01219940185546875,
0.004093170166015625,
-0.023529052734375,
0.0182647705078125,
-0.037567138671875,
-0.01319122314453125,
0.01305389404296875,
-0.01039886474609375,
-0.04693603515625,
-0.01363372802734375,
0.01300048828125,
0.00847625732421875,
-0.039337158203125,
-0.0032482147216796875,
-0.003810882568359375,
-0.03314208984375,
-0.0526123046875,
-0.027740478515625,
-0.0265045166015625,
0.00731658935546875,
0.01678466796875,
-0.0006079673767089844,
0.01119232177734375,
0.0083465576171875,
0.039031982421875,
0.00714111328125,
-0.0204620361328125,
0.0063934326171875,
0.071044921875,
0.023345947265625,
-0.013519287109375,
0.0031719207763671875,
-0.004207611083984375,
0.029449462890625,
0.038055419921875,
0.0034084320068359375,
-0.062164306640625,
0.05072021484375,
-0.03045654296875,
0.0191497802734375,
-0.0284423828125,
-0.017791748046875,
-0.024871826171875,
0.04290771484375,
0.047637939453125,
-0.022674560546875,
0.069091796875,
0.0246429443359375,
0.006877899169921875,
-0.007114410400390625,
-0.007610321044921875,
-0.0080413818359375,
0.023162841796875,
-0.019927978515625,
0.034393310546875,
-0.0111846923828125,
0.003002166748046875,
0.0014286041259765625,
-0.00395965576171875,
0.03082275390625,
0.0224761962890625,
0.00371551513671875,
-0.0067901611328125,
0.0025920867919921875,
0.02667236328125,
-0.023193359375,
0.025604248046875,
0.08636474609375,
0.0205078125,
0.0038738250732421875,
-0.01071929931640625,
0.0341796875,
0.0143280029296875,
0.00974273681640625,
0.003978729248046875,
0.0019435882568359375,
-0.033660888671875,
-0.00574493408203125,
-0.00925445556640625,
0.04876708984375,
0.02130126953125,
0.03387451171875,
0.01558685302734375,
0.00797271728515625,
-0.0304107666015625,
0.01160430908203125,
0.044952392578125,
-0.00322723388671875,
0.0003428459167480469,
0.0299224853515625,
-0.03253173828125,
0.0250244140625,
-0.0285186767578125,
0.045928955078125,
-0.0247344970703125,
0.0166015625,
0.00821685791015625,
0.029876708984375,
-0.00556182861328125,
0.01496124267578125,
-0.047088623046875,
-0.0367431640625,
0.0179443359375,
0.037994384765625,
0.038726806640625,
0.01534271240234375,
-0.03057861328125,
0.06951904296875,
0.029998779296875,
-0.0180206298828125,
0.034210205078125,
0.01181793212890625,
0.0258636474609375,
0.03717041015625,
0.0097198486328125,
-0.0211334228515625,
-0.040374755859375,
0.0908203125,
-0.04150390625,
-0.0217437744140625,
0.0312042236328125,
-0.0048370361328125,
0.01471710205078125,
-0.001384735107421875,
0.01210784912109375,
-0.0005702972412109375,
0.04510498046875,
-0.0452880859375,
0.0274200439453125,
-0.043548583984375,
-0.01323699951171875,
-0.0213165283203125,
0.01457977294921875,
-0.031585693359375,
0.03582763671875,
-0.0032672882080078125,
0.006198883056640625,
0.026885986328125,
-0.0278472900390625,
-0.0340576171875,
0.0075836181640625,
-0.0194091796875,
0.04376220703125,
-0.022613525390625,
0.0216522216796875,
0.0389404296875,
0.032257080078125,
-0.05670166015625,
-0.0005393028259277344,
-0.019012451171875,
-0.0015964508056640625,
-0.0306854248046875,
0.060028076171875,
0.0103607177734375,
0.058502197265625,
-0.0133209228515625,
-0.03131103515625,
-0.00824737548828125,
-0.049468994140625,
0.01285552978515625,
0.01123809814453125,
-0.041107177734375,
-0.004398345947265625,
0.01451873779296875,
-0.00804901123046875,
0.0080718994140625,
0.056640625,
-0.050384521484375,
0.004486083984375,
-0.004306793212890625,
-0.017364501953125,
0.0165557861328125,
-0.07666015625,
0.044464111328125,
0.03472900390625,
0.022918701171875,
0.0278778076171875,
-0.004070281982421875,
0.0288848876953125,
0.0322265625,
-0.002147674560546875,
0.0241241455078125,
0.007659912109375,
-0.00833892822265625,
0.006000518798828125,
-0.034759521484375,
0.01396942138671875,
0.0249176025390625,
0.0031795501708984375,
0.0219879150390625,
0.02703857421875,
-0.048492431640625,
-0.00783538818359375,
-0.0203399658203125,
-0.0212860107421875,
0.0237884521484375,
-0.03961181640625,
-0.007415771484375,
-0.0228118896484375,
0.006591796875,
-0.0024433135986328125,
-0.00032401084899902344,
-0.015380859375,
-0.046722412109375,
0.0227508544921875,
0.04254150390625,
-0.007053375244140625,
-0.011688232421875,
0.021209716796875,
0.04925537109375,
0.005802154541015625,
-0.034088134765625,
-0.0260162353515625,
0.037567138671875,
0.009735107421875,
-0.04925537109375,
0.003932952880859375,
-0.0066986083984375,
-0.00963592529296875,
-0.0269775390625,
-0.0258941650390625,
0.02325439453125,
-0.033355712890625,
0.0031642913818359375,
0.03131103515625,
0.0501708984375,
0.0058746337890625,
0.014984130859375,
-0.0013446807861328125,
0.00031685829162597656,
0.004352569580078125,
0.0203704833984375,
-0.0263519287109375,
0.031951904296875,
-0.01018524169921875,
0.01110076904296875,
0.06439208984375,
0.01174163818359375,
-0.0124664306640625,
0.0130462646484375,
-0.0413818359375,
-0.0217437744140625,
0.04229736328125,
0.019927978515625,
-0.041961669921875,
0.01287841796875,
0.08123779296875,
0.0094757080078125,
-0.0173797607421875,
-0.00836944580078125,
-0.039215087890625,
-0.0165557861328125,
-0.0155792236328125,
-0.0626220703125,
-0.044464111328125,
-0.030426025390625,
-0.0340576171875,
-0.0032196044921875,
0.01158905029296875,
-0.013427734375,
-0.0027523040771484375,
0.02166748046875,
0.0089874267578125,
-0.0655517578125,
-0.011810302734375,
0.07342529296875,
-0.020233154296875,
-0.00553131103515625,
-0.036865234375,
0.0189056396484375,
0.0191650390625,
0.0035572052001953125,
0.034393310546875,
-0.0225982666015625,
-0.0323486328125,
-0.0193634033203125,
0.0394287109375,
0.0009279251098632812,
-0.0295562744140625,
-0.00690460205078125,
-0.019012451171875,
-0.025390625,
0.01039886474609375,
0.005214691162109375,
0.0178375244140625,
-0.0173492431640625,
-0.00191497802734375,
-0.057830810546875,
-0.01806640625,
-0.0517578125,
0.0228271484375,
0.07244873046875,
-0.021575927734375,
-0.0301361083984375,
-0.053070068359375,
-0.00629425048828125,
0.0015707015991210938,
-0.0291900634765625,
-0.02838134765625,
-0.0035266876220703125,
-0.0260467529296875,
-0.02105712890625,
0.0161895751953125,
0.057891845703125,
0.0469970703125,
-0.01029205322265625,
0.0279083251953125,
-0.0350341796875,
-0.00160980224609375,
0.010009765625,
-0.0186309814453125,
-0.0012540817260742188,
-0.0130462646484375,
0.0120697021484375,
-0.009765625,
0.03076171875,
-0.01088714599609375,
0.03045654296875,
-0.036712646484375,
-0.045806884765625,
0.0238037109375,
-0.01503753662109375,
0.0154266357421875,
0.004848480224609375,
-0.0129852294921875,
0.032470703125,
0.085205078125,
-0.016265869140625,
-0.0007266998291015625,
-0.026885986328125,
-0.01788330078125,
-0.0019893646240234375,
0.0215606689453125,
-0.0687255859375,
0.0200042724609375,
-0.0240936279296875,
-0.01041412353515625,
0.018310546875,
-0.03741455078125,
-0.019195556640625,
-0.006984710693359375,
-0.040069580078125,
-0.012786865234375,
0.016143798828125,
-0.039520263671875,
-0.01160430908203125,
0.04119873046875,
-0.037261962890625,
0.0122528076171875,
-0.00024127960205078125,
-0.04888916015625,
-0.048675537109375,
-0.018463134765625,
-0.036773681640625,
0.06805419921875,
0.0305938720703125,
0.00975799560546875,
-0.03662109375,
0.03131103515625,
-0.036834716796875,
0.01355743408203125,
-0.040496826171875,
0.03424072265625,
-0.00817108154296875,
-0.04547119140625,
-0.039093017578125,
-0.0249481201171875,
-0.020538330078125,
-0.0721435546875,
-0.06927490234375,
-0.0750732421875,
-0.00334930419921875,
0.039642333984375,
0.0182342529296875,
-0.01215362548828125,
-0.0098114013671875,
-0.050506591796875,
-0.0201263427734375,
0.0143890380859375,
0.02105712890625,
-0.0255889892578125,
-0.07745361328125,
-0.01117706298828125,
-0.010894775390625,
-0.0240020751953125,
0.0017156600952148438,
0.0306549072265625,
0.045135498046875,
0.0178985595703125,
0.0156707763671875,
-0.08026123046875,
0.015411376953125,
0.0285797119140625,
0.019378662109375,
0.04156494140625,
0.029510498046875,
-0.004695892333984375,
-0.00118255615234375,
0.0175628662109375,
0.01039886474609375,
-0.0614013671875,
0.0149993896484375,
0.026824951171875,
0.0249786376953125,
-0.0175323486328125,
0.01348114013671875,
0.05023193359375,
-0.00791168212890625,
-0.01739501953125,
0.005336761474609375,
-0.033050537109375,
0.033050537109375,
0.01065826416015625,
0.00893402099609375,
-0.047149658203125,
-0.024810791015625,
0.002658843994140625,
-0.00513458251953125,
0.032501220703125,
0.04913330078125,
-0.01543426513671875,
0.0164337158203125,
0.02142333984375,
-0.001560211181640625,
-0.039886474609375,
-0.0206298828125,
0.004711151123046875,
0.03704833984375,
-0.017608642578125,
0.035736083984375,
-0.0288848876953125,
-0.00794219970703125,
0.044830322265625,
0.020294189453125,
0.0088958740234375,
-0.059417724609375,
-0.01152801513671875,
0.01107025146484375,
-0.033905029296875,
-0.007465362548828125,
-0.006641387939453125,
0.0277862548828125,
0.0016460418701171875,
0.0025882720947265625,
0.04241943359375,
0.0027599334716796875,
-0.0087127685546875,
0.005443572998046875,
0.006267547607421875,
-0.0102081298828125,
0.02752685546875,
0.0032787322998046875,
0.0032482147216796875,
-0.0014181137084960938,
-0.0038051605224609375,
0.0277099609375,
0.043914794921875,
0.01236724853515625,
0.023773193359375,
0.005146026611328125,
0.0244140625,
-0.03631591796875,
0.01898193359375,
-0.053070068359375,
0.01236724853515625,
-0.005306243896484375,
0.03564453125,
-0.02154541015625,
-0.05133056640625,
0.052703857421875,
-0.0168609619140625,
-0.0224151611328125,
0.004222869873046875,
-0.02667236328125,
-0.04150390625,
-0.0182037353515625,
0.0095977783203125,
0.0236968994140625,
-0.00963592529296875,
-0.0017576217651367188,
0.0000171661376953125,
-0.00786590576171875,
0.0165863037109375,
-0.013336181640625,
-0.00461578369140625,
0.0022735595703125,
-0.0104217529296875,
-0.050140380859375,
-0.015380859375,
-0.006465911865234375,
-0.00627899169921875,
-0.01459503173828125,
-0.0008082389831542969,
-0.0272216796875,
0.01024627685546875,
-0.039337158203125,
0.00836181640625,
-0.045745849609375,
0.030029296875,
-0.05841064453125,
0.01229095458984375,
0.044952392578125,
0.03564453125,
-0.0178680419921875,
-0.0266571044921875,
-0.007312774658203125,
-0.0204315185546875,
0.047149658203125,
-0.00539398193359375,
-0.0251617431640625,
-0.0479736328125,
0.01727294921875,
0.033111572265625,
0.02008056640625,
-0.024627685546875,
0.0191192626953125,
-0.0101318359375,
-0.01032257080078125,
0.026580810546875,
-0.0028133392333984375,
0.0145263671875,
-0.0101318359375,
0.025421142578125,
-0.0024929046630859375,
-0.0017910003662109375,
-0.0077972412109375,
-0.024505615234375,
-0.034637451171875,
-0.08148193359375,
0.0159149169921875,
0.010467529296875,
0.032623291015625,
0.057281494140625,
0.00852203369140625,
0.027496337890625,
0.002735137939453125,
0.0195159912109375,
0.01507568359375,
-0.0171356201171875,
-0.005420684814453125,
0.0130157470703125,
-0.040924072265625,
0.051361083984375,
-0.05426025390625,
0.006389617919921875,
0.005702972412109375,
-0.01483917236328125,
0.05255126953125,
-0.035888671875,
0.023956298828125,
0.050994873046875,
-0.007518768310546875,
0.037322998046875,
0.11505126953125,
0.012847900390625,
0.056060791015625,
0.0408935546875,
0.01184844970703125,
0.01751708984375,
0.0260009765625,
-0.0133056640625,
-0.055206298828125,
-0.01190948486328125,
-0.007045745849609375,
0.0054931640625,
0.007381439208984375,
-0.0024318695068359375,
0.024322509765625,
-0.031982421875,
0.0428466796875,
0.03118896484375,
0.0242156982421875,
-0.00738525390625,
-0.0302276611328125,
0.055328369140625,
-0.0037746429443359375,
-0.0020847320556640625,
0.0031299591064453125,
0.007068634033203125,
-0.029327392578125,
-0.04461669921875,
-0.0221710205078125,
-0.0105438232421875,
-0.006313323974609375,
-0.0343017578125,
-0.0033054351806640625,
-0.00438690185546875,
-0.047210693359375,
0.007511138916015625,
0.0116729736328125,
-0.0223846435546875,
0.01910400390625,
0.04412841796875,
-0.0219573974609375,
-0.01187896728515625,
-0.01061248779296875,
0.004566192626953125,
0.0169525146484375,
-0.035430908203125,
0.09326171875,
-0.002513885498046875,
0.0186767578125,
0.049835205078125,
0.005603790283203125,
0.0094757080078125,
0.0096588134765625,
-0.01190185546875,
0.0391845703125,
0.014617919921875,
0.036895751953125,
-0.0306243896484375,
-0.049957275390625,
-0.0010194778442382812,
-0.055145263671875,
-0.001392364501953125,
0.009490966796875,
-0.022186279296875,
0.04656982421875,
-0.05877685546875,
0.002655029296875,
0.02301025390625,
0.015045166015625,
0.00733184814453125,
0.0015964508056640625,
0.0102996826171875,
-0.09783935546875,
-0.09979248046875,
0.02001953125,
-0.10870361328125,
0.00007319450378417969,
0.006153106689453125,
-0.04705810546875,
0.06890869140625,
-0.01544189453125,
0.02557373046875,
0.0210418701171875,
0.0191192626953125,
-0.03399658203125,
-0.012725830078125,
-0.0301513671875,
0.016143798828125,
-0.043975830078125,
0.0067291259765625,
-0.0458984375,
0.0172882080078125,
-0.0229339599609375,
-0.0022792816162109375,
0.07666015625,
0.006389617919921875,
-0.01629638671875,
-0.0103607177734375,
0.060302734375,
0.0712890625,
0.0186614990234375,
0.004878997802734375,
-0.0189971923828125,
0.0075225830078125,
0.006793975830078125,
0.0119781494140625,
0.0287933349609375,
0.006755828857421875,
-0.06060791015625,
0.0097198486328125,
-0.0006766319274902344,
-0.00799560546875,
0.005298614501953125,
0.00873565673828125,
-0.01146697998046875,
-0.01273345947265625,
0.009552001953125,
-0.047210693359375,
-0.00585174560546875,
0.03631591796875,
-0.01161956787109375,
-0.01568603515625,
-0.01922607421875,
-0.016876220703125,
0.019500732421875,
-0.006412506103515625,
0.040435791015625,
0.046478271484375,
0.0247344970703125,
0.00955963134765625,
0.01776123046875,
0.03448486328125,
0.01416778564453125,
-0.015899658203125,
0.017974853515625,
-0.0196990966796875,
0.0200958251953125,
-0.07696533203125,
-0.028411865234375,
0.03778076171875,
0.04791259765625,
-0.0233001708984375,
-0.0023040771484375,
0.007732391357421875,
0.006359100341796875,
0.007965087890625,
-0.038970947265625,
0.0011568069458007812,
-0.1070556640625,
-0.06890869140625,
0.00124359130859375,
-0.0212860107421875,
0.037506103515625,
0.0147552490234375,
0.0248870849609375,
0.03814697265625,
-0.01132965087890625,
-0.031951904296875,
0.006061553955078125,
0.0163116455078125,
-0.01873779296875,
0.010406494140625,
-0.0077362060546875,
0.0170135498046875,
-0.03631591796875,
0.017822265625,
-0.03521728515625,
0.01374053955078125,
0.01132965087890625,
0.04998779296875,
-0.029052734375,
0.00608062744140625,
-0.00856781005859375,
0.031494140625,
0.04296875,
0.0672607421875,
0.048614501953125,
0.0135040283203125,
-0.028839111328125,
0.0180206298828125,
0.057891845703125,
-0.01708984375,
-0.01910400390625,
-0.0272674560546875,
0.038421630859375,
0.037445068359375,
0.0187225341796875,
0.00846099853515625,
0.0202789306640625,
0.055450439453125,
-0.06060791015625,
0.0279388427734375,
-0.017242431640625,
-0.038787841796875,
0.01934814453125,
-0.032623291015625,
0.0526123046875,
-0.0433349609375,
-0.08172607421875,
-0.020294189453125,
-0.067626953125,
0.01145172119140625,
-0.00724029541015625,
0.0150299072265625,
0.0007333755493164062,
0.0281219482421875,
-0.005252838134765625,
0.006015777587890625,
-0.003284454345703125,
-0.002033233642578125,
-0.01168060302734375,
0.00917816162109375,
0.041748046875,
-0.006229400634765625,
-0.042694091796875,
-0.0040130615234375,
-0.0172119140625,
0.010345458984375,
0.0078277587890625,
0.0494384765625,
-0.01074981689453125,
0.0218353271484375,
0.0237579345703125,
-0.007411956787109375,
0.004459381103515625,
0.029998779296875,
-0.0264739990234375,
0.00832366943359375,
0.01044464111328125,
-0.035797119140625,
-0.0015439987182617188,
0.02313232421875,
0.036285400390625,
-0.04443359375,
-0.0189208984375,
0.042022705078125,
0.004016876220703125,
0.005916595458984375,
0.033447265625,
-0.0079345703125,
-0.01354217529296875,
0.0012063980102539062,
0.01094818115234375,
0.025543212890625,
0.0203399658203125,
-0.0079193115234375,
0.0645751953125,
-0.02593994140625,
-0.00605010986328125,
0.00739288330078125,
-0.0748291015625,
0.009307861328125,
0.030731201171875,
-0.023529052734375,
-0.00620269775390625,
0.0005273818969726562,
-0.0134429931640625,
-0.0081787109375,
0.019561767578125,
-0.0206146240234375,
0.0280914306640625,
-0.07159423828125,
0.093017578125,
0.046112060546875,
0.06353759765625,
-0.016357421875,
0.0067596435546875,
0.07232666015625,
0.007244110107421875,
0.00650787353515625,
-0.0211334228515625,
-0.00907135009765625,
-0.01268768310546875,
-0.024322509765625,
0.0167388916015625,
-0.0091400146484375,
-0.00756072998046875,
-0.0560302734375,
-0.0062103271484375,
0.0247802734375,
0.0289306640625,
-0.0828857421875,
0.05572509765625,
0.0198974609375,
0.0010433197021484375,
0.01210784912109375,
0.052825927734375,
-0.0008440017700195312,
0.025970458984375,
-0.046661376953125,
-0.042877197265625,
-0.00984954833984375,
0.057220458984375,
-0.00371551513671875,
0.0176239013671875,
0.049560546875,
-0.0347900390625,
0.001422882080078125,
-0.011474609375,
0.007183074951171875,
0.04498291015625,
-0.01190948486328125,
-0.029052734375,
0.01174163818359375,
-0.006008148193359375,
-0.004627227783203125,
-0.007740020751953125,
0.0014362335205078125,
-0.006465911865234375,
-0.001026153564453125,
-0.037109375,
-0.027801513671875,
-0.04217529296875,
-0.061920166015625,
-0.076416015625,
0.028289794921875,
-0.01300811767578125,
-0.040924072265625,
0.0019016265869140625,
0.0007467269897460938,
-0.03436279296875,
0.07080078125,
0.0172271728515625,
-0.02288818359375,
-0.0105133056640625,
-0.004238128662109375,
-0.01142120361328125,
0.054779052734375,
0.006336212158203125,
-0.0123443603515625,
-0.033050537109375,
-0.0262908935546875,
-0.0193328857421875,
0.002407073974609375,
0.046142578125,
-0.040740966796875,
0.052093505859375,
0.05023193359375,
-0.0167388916015625,
-0.0186309814453125,
-0.006534576416015625,
-0.08197021484375,
-0.013092041015625,
-0.0033416748046875,
-0.0184326171875,
-0.009735107421875,
0.059112548828125,
0.03509521484375,
0.0096893310546875,
-0.0128631591796875,
-0.01007843017578125,
-0.03289794921875,
-0.019927978515625,
-0.0364990234375,
0.0069732666015625,
-0.05511474609375,
0.0019378662109375,
-0.0126800537109375,
-0.02386474609375,
0.0028285980224609375,
0.03033447265625,
-0.0247955322265625,
-0.003299713134765625,
0.0215301513671875,
-0.00594329833984375,
-0.10137939453125,
0.0237884521484375,
0.0655517578125,
-0.040557861328125,
0.0104522705078125,
0.0004572868347167969,
-0.007762908935546875,
0.036590576171875,
-0.0018072128295898438,
0.00804901123046875,
0.004413604736328125,
-0.058807373046875,
0.021392822265625,
-0.003459930419921875,
-0.02520751953125,
-0.04638671875,
-0.0097503662109375,
-0.0205841064453125,
0.0017099380493164062,
-0.004261016845703125,
0.0195159912109375,
-0.00543212890625,
-0.00745391845703125,
0.0035877227783203125,
0.04107666015625,
-0.00913238525390625,
-0.1026611328125,
-0.037445068359375,
0.016448974609375,
-0.0180816650390625,
-0.01531219482421875,
0.0041961669921875,
-0.029083251953125,
0.005214691162109375,
0.0194091796875,
-0.0223541259765625,
-0.01153564453125,
-0.01428985595703125,
-0.0408935546875,
0.00986480712890625,
-0.001377105712890625
] |
a655175478a6d0125e456efe0edda8ef42e1423a
|
Wordpress Stackexchange
Q: Sorting by tag or category Here's the scenario:
A user clicks on a tag which takes them to a list of all those posts with that tag. There are hundreds of posts, so the user needs a way to filter these.
Here's the question:
How would you build a drop down that a user can select to filter by category while on the tag page. Filter all Yellow tags by Color category for instance.
Also the reverse would be useful. Searching the Color category and filtering by the tag Yellow.
A: The function get_posts() allows you to set parameters for both categories and tags. You could build two drop down boxes that list all categories or tags and then use JavaScript or just make a new page to sort these.
What other information do you need?
|
Q: Sorting by tag or category Here's the scenario:
A user clicks on a tag which takes them to a list of all those posts with that tag. There are hundreds of posts, so the user needs a way to filter these.
Here's the question:
How would you build a drop down that a user can select to filter by category while on the tag page. Filter all Yellow tags by Color category for instance.
Also the reverse would be useful. Searching the Color category and filtering by the tag Yellow.
A: The function get_posts() allows you to set parameters for both categories and tags. You could build two drop down boxes that list all categories or tags and then use JavaScript or just make a new page to sort these.
What other information do you need?
|
wordpress
|
{
"language": "en",
"length": 137,
"provenance": "stackexchange_00019.jsonl.gz:419619",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50929"
}
|
[
0.05767822265625,
0.011199951171875,
0.0222625732421875,
-0.01007843017578125,
0.0271759033203125,
-0.024932861328125,
0.075439453125,
-0.03350830078125,
0.0029239654541015625,
-0.0013990402221679688,
-0.063232421875,
0.002681732177734375,
-0.0295867919921875,
-0.01224517822265625,
-0.0160980224609375,
-0.07275390625,
0.031524658203125,
-0.030609130859375,
0.017730712890625,
-0.009613037109375,
0.02398681640625,
0.00838470458984375,
0.031646728515625,
0.01439666748046875,
0.031097412109375,
-0.01898193359375,
0.004566192626953125,
-0.01154327392578125,
0.02142333984375,
0.003017425537109375,
0.0216827392578125,
-0.02618408203125,
0.00946044921875,
-0.005115509033203125,
0.019561767578125,
0.0253143310546875,
-0.007381439208984375,
0.0187225341796875,
0.0262908935546875,
-0.00168609619140625,
0.0291290283203125,
-0.00865936279296875,
0.0014543533325195312,
0.055023193359375,
-0.021942138671875,
-0.042694091796875,
0.04278564453125,
-0.03240966796875,
0.0268096923828125,
-0.0782470703125,
0.004398345947265625,
0.01227569580078125,
0.04071044921875,
-0.1107177734375,
-0.0185699462890625,
0.00870513916015625,
0.00901031494140625,
0.0232086181640625,
0.05126953125,
-0.0239410400390625,
-0.0567626953125,
-0.026947021484375,
0.0162811279296875,
-0.0257568359375,
0.0016613006591796875,
-0.009429931640625,
-0.0016536712646484375,
0.0108795166015625,
-0.037689208984375,
-0.001506805419921875,
0.04461669921875,
-0.026519775390625,
-0.002567291259765625,
-0.0209503173828125,
-0.0035457611083984375,
-0.0096893310546875,
-0.002262115478515625,
-0.01800537109375,
0.019134521484375,
0.0108795166015625,
-0.0128173828125,
-0.0011749267578125,
-0.0207977294921875,
-0.0243988037109375,
-0.0008211135864257812,
-0.0072479248046875,
-0.01366424560546875,
0.003387451171875,
-0.037933349609375,
-0.0238037109375,
-0.0221710205078125,
-0.01141357421875,
-0.050079345703125,
0.0268402099609375,
-0.004360198974609375,
-0.00958251953125,
0.0126800537109375,
0.011016845703125,
0.01006317138671875,
0.0092315673828125,
0.01535797119140625,
-0.057830810546875,
0.0177459716796875,
-0.0218048095703125,
0.01390838623046875,
0.034759521484375,
-0.025543212890625,
0.041107177734375,
0.06268310546875,
0.05645751953125,
0.0162353515625,
0.01280975341796875,
-0.0027313232421875,
0.0252685546875,
-0.05877685546875,
-0.022216796875,
-0.03125,
-0.031982421875,
-0.0228729248046875,
-0.026336669921875,
0.0115203857421875,
0.02850341796875,
0.00769805908203125,
-0.0156097412109375,
0.010345458984375,
0.0099639892578125,
-0.01202392578125,
-0.042877197265625,
-0.010101318359375,
-0.0246734619140625,
-0.029144287109375,
0.0638427734375,
0.053070068359375,
-0.004001617431640625,
-0.0281982421875,
0.0085906982421875,
-0.00460052490234375,
-0.06768798828125,
0.0033512115478515625,
-0.018096923828125,
0.0491943359375,
-0.004711151123046875,
0.016571044921875,
0.0270233154296875,
0.027435302734375,
0.003459930419921875,
0.0186309814453125,
0.007495880126953125,
0.029754638671875,
-0.0010137557983398438,
0.01059722900390625,
-0.01035308837890625,
0.0239715576171875,
-0.0271759033203125,
-0.00728607177734375,
-0.048553466796875,
-0.009033203125,
-0.028167724609375,
0.0217437744140625,
-0.031402587890625,
0.032440185546875,
0.0205230712890625,
0.036956787109375,
-0.00921630859375,
-0.01351165771484375,
-0.041961669921875,
-0.035247802734375,
-0.00838470458984375,
0.0182952880859375,
-0.03118896484375,
0.004657745361328125,
0.0211181640625,
0.0295867919921875,
0.0006794929504394531,
0.0038318634033203125,
0.00481414794921875,
0.01617431640625,
-0.009552001953125,
0.0272064208984375,
0.0250701904296875,
-0.0311737060546875,
-0.023590087890625,
0.04150390625,
-0.03436279296875,
-0.06689453125,
0.0552978515625,
0.0014858245849609375,
0.06549072265625,
0.01351165771484375,
0.0170745849609375,
0.0179595947265625,
0.02069091796875,
-0.0251007080078125,
-0.004238128662109375,
-0.002140045166015625,
-0.028106689453125,
-0.00652313232421875,
-0.0074310302734375,
0.00982666015625,
0.0165557861328125,
0.00835418701171875,
0.0260009765625,
0.0032958984375,
0.00539398193359375,
-0.0193939208984375,
0.024566650390625,
-0.016876220703125,
0.039794921875,
-0.006381988525390625,
0.0203094482421875,
0.012664794921875,
-0.017120361328125,
-0.0188140869140625,
-0.0034999847412109375,
-0.0106201171875,
0.0039825439453125,
-0.01678466796875,
-0.02587890625,
-0.016143798828125,
-0.0235748291015625,
-0.0123443603515625,
-0.00028586387634277344,
-0.00815582275390625,
0.047393798828125,
0.04266357421875,
0.027435302734375,
-0.0129241943359375,
-0.0010890960693359375,
0.017913818359375,
0.05584716796875,
-0.0850830078125,
-0.004573822021484375,
0.0711669921875,
0.08392333984375,
-0.0260009765625,
-0.0021381378173828125,
0.01451873779296875,
-0.011077880859375,
-0.0038433074951171875,
0.0280609130859375,
0.01145172119140625,
0.037750244140625,
0.01039886474609375,
0.043853759765625,
0.06689453125,
-0.0372314453125,
-0.004913330078125,
0.033660888671875,
0.02490234375,
0.04608154296875,
0.03289794921875,
-0.0020275115966796875,
0.019317626953125,
0.01690673828125,
0.03253173828125,
0.0079498291015625,
0.01885986328125,
0.026763916015625,
0.0003440380096435547,
-0.0225830078125,
0.005092620849609375,
-0.01131439208984375,
-0.039459228515625,
-0.0009593963623046875,
0.07855224609375,
-0.028717041015625,
0.032867431640625,
0.0119476318359375,
-0.0190887451171875,
0.0070037841796875,
0.0025844573974609375,
-0.0474853515625,
-0.002758026123046875,
0.027191162109375,
-0.037506103515625,
0.0174102783203125,
-0.01422119140625,
0.00954437255859375,
-0.02789306640625,
0.0067138671875,
-0.002407073974609375,
0.0665283203125,
0.006343841552734375,
-0.00843048095703125,
-0.0418701171875,
-0.09332275390625,
0.01219940185546875,
0.0308380126953125,
-0.0154876708984375,
-0.01433563232421875,
0.00103759765625,
0.04608154296875,
0.006328582763671875,
0.0231781005859375,
0.0015773773193359375,
-0.0017948150634765625,
0.006557464599609375,
-0.0374755859375,
0.016815185546875,
-0.0233306884765625,
0.035125732421875,
0.06475830078125,
0.00994873046875,
0.002685546875,
0.008941650390625,
0.00383758544921875,
0.01039886474609375,
-0.0038623809814453125,
-0.006725311279296875,
0.01019287109375,
-0.047698974609375,
0.021514892578125,
0.00855255126953125,
-0.03875732421875,
0.0347900390625,
-0.00789642333984375,
-0.00878143310546875,
0.00638580322265625,
-0.0791015625,
-0.050140380859375,
0.005146026611328125,
-0.04034423828125,
-0.0009202957153320312,
0.00772857666015625,
-0.0106201171875,
-0.01483917236328125,
0.004039764404296875,
-0.0019350051879882812,
-0.04547119140625,
-0.0008344650268554688,
-0.070068359375,
-0.0474853515625,
-0.0428466796875,
0.059967041015625,
-0.01227569580078125,
0.00891876220703125,
0.00785064697265625,
0.09539794921875,
0.0030307769775390625,
-0.0887451171875,
-0.0115814208984375,
-0.0189971923828125,
-0.038818359375,
0.0271148681640625,
0.0304412841796875,
-0.0229949951171875,
0.02001953125,
0.005710601806640625,
0.04522705078125,
0.04376220703125,
-0.053680419921875,
0.00478363037109375,
-0.0268402099609375,
0.0306396484375,
0.01531982421875,
-0.0066986083984375,
0.020050048828125,
0.036773681640625,
0.006336212158203125,
-0.013336181640625,
0.04156494140625,
-0.0113067626953125,
0.0033588409423828125,
0.005558013916015625,
-0.0202789306640625,
-0.0186004638671875,
-0.0013484954833984375,
0.006069183349609375,
0.0309906005859375,
0.0216827392578125,
-0.00018656253814697266,
-0.018798828125,
0.018524169921875,
0.0166168212890625,
0.03692626953125,
-0.0123443603515625,
-0.007762908935546875,
-0.049072265625,
0.01262664794921875,
-0.0252532958984375,
-0.014312744140625,
-0.0200958251953125,
0.000020384788513183594,
-0.0211181640625,
-0.035247802734375,
0.039825439453125,
0.0221405029296875,
0.0039005279541015625,
-0.007781982421875,
-0.0280914306640625,
0.003025054931640625,
0.0694580078125,
-0.0254058837890625,
-0.0058746337890625,
0.0034999847412109375,
0.0030307769775390625,
-0.0169830322265625,
-0.005352020263671875,
-0.080078125,
-0.00608062744140625,
-0.120361328125,
0.015472412109375,
-0.01372528076171875,
-0.030792236328125,
-0.03631591796875,
0.0014772415161132812,
-0.08270263671875,
-0.04986572265625,
0.033050537109375,
-0.033111572265625,
0.020111083984375,
-0.05828857421875,
0.0198822021484375,
-0.06573486328125,
-0.0209808349609375,
-0.004993438720703125,
-0.02789306640625,
0.00577545166015625,
-0.016265869140625,
-0.00853729248046875,
0.00010603666305541992,
0.0031909942626953125,
-0.00868988037109375,
0.03424072265625,
0.014007568359375,
0.0321044921875,
0.0214385986328125,
0.011077880859375,
0.0268402099609375,
-0.053741455078125,
0.002819061279296875,
-0.042205810546875,
-0.035919189453125,
-0.047393798828125,
0.01255035400390625,
0.0322265625,
-0.01360321044921875,
0.0295257568359375,
-0.0465087890625,
0.012054443359375,
-0.0826416015625,
-0.0276947021484375,
-0.033172607421875,
-0.037261962890625,
-0.027374267578125,
-0.007160186767578125,
0.018798828125,
-0.05084228515625,
0.03125,
0.0112152099609375,
-0.0164642333984375,
0.005279541015625,
0.0270843505859375,
-0.001708984375,
-0.031494140625,
-0.039337158203125,
0.0140533447265625,
0.036895751953125,
-0.026580810546875,
0.03607177734375,
0.0028896331787109375,
-0.037017822265625,
0.07244873046875,
0.00036716461181640625,
-0.010162353515625,
-0.0291900634765625,
0.0899658203125,
-0.015716552734375,
-0.0175628662109375,
0.015838623046875,
-0.0189971923828125,
0.006381988525390625,
0.051116943359375,
-0.005817413330078125,
-0.0032558441162109375,
-0.0158538818359375,
0.0262451171875,
0.0013866424560546875,
-0.033203125,
-0.038055419921875,
-0.0298004150390625,
0.0174560546875,
-0.038787841796875,
0.0177459716796875,
0.003963470458984375,
-0.004184722900390625,
-0.0007128715515136719,
-0.0035648345947265625,
0.0113372802734375,
-0.0186614990234375,
0.0081634521484375,
-0.032073974609375,
0.061126708984375,
-0.054779052734375,
0.004795074462890625,
-0.01727294921875,
-0.0116424560546875,
0.02569580078125,
-0.0023746490478515625,
-0.03253173828125,
-0.0006060600280761719,
-0.016387939453125,
0.0160980224609375,
0.02313232421875,
-0.031646728515625,
-0.001804351806640625,
0.0199127197265625,
0.0128936767578125,
0.02313232421875,
-0.0200042724609375,
-0.0033740997314453125,
-0.01195526123046875,
-0.01206207275390625,
0.0018939971923828125,
-0.01064300537109375,
0.01016998291015625,
0.041595458984375,
-0.019012451171875,
0.0386962890625,
-0.0086212158203125,
0.0081939697265625,
0.0013170242309570312,
-0.005275726318359375,
0.0209197998046875,
-0.007110595703125,
0.0183258056640625,
-0.04473876953125,
0.0221710205078125,
-0.004306793212890625,
-0.006526947021484375,
0.0177001953125,
-0.0186004638671875,
-0.023590087890625,
0.004970550537109375,
0.0294647216796875,
0.03253173828125,
-0.01041412353515625,
0.016937255859375,
0.006439208984375,
0.0028667449951171875,
-0.0194244384765625,
-0.0167388916015625,
0.0107574462890625,
0.00769805908203125,
-0.0012454986572265625,
0.0267486572265625,
-0.0184783935546875,
0.0103302001953125,
0.0074462890625,
0.004543304443359375,
-0.015472412109375,
-0.017608642578125,
-0.02117919921875,
-0.0175628662109375,
0.0100555419921875,
-0.01224517822265625,
-0.003704071044921875,
-0.0148468017578125,
-0.019287109375,
0.01983642578125,
0.017669677734375,
0.039215087890625,
-0.01222991943359375,
-0.0426025390625,
0.01467132568359375,
-0.0232086181640625,
0.0682373046875,
0.012298583984375,
-0.053619384765625,
0.007415771484375,
-0.059112548828125,
-0.0249786376953125,
-0.0543212890625,
-0.034271240234375,
-0.0675048828125,
-0.0010118484497070312,
0.00014257431030273438,
0.0270233154296875,
0.01654052734375,
-0.00980377197265625,
-0.0275726318359375,
-0.019989013671875,
0.00015997886657714844,
-0.004444122314453125,
-0.031524658203125,
0.043975830078125,
-0.0014505386352539062,
0.0298004150390625,
-0.022735595703125,
-0.0033016204833984375,
-0.005886077880859375,
0.005794525146484375,
-0.018768310546875,
-0.08612060546875,
-0.0169525146484375,
0.0290069580078125,
-0.04937744140625,
0.0643310546875,
0.03515625,
0.0191497802734375,
0.0207977294921875,
-0.0310821533203125,
0.001617431640625,
-0.00516510009765625,
0.003448486328125,
-0.0192413330078125,
-0.0087127685546875,
0.036224365234375,
0.000046193599700927734,
0.0005316734313964844,
-0.0167694091796875,
-0.0106964111328125,
0.00774383544921875,
0.010498046875,
0.013763427734375,
-0.00542449951171875,
0.002971649169921875,
0.0055389404296875,
0.0144195556640625,
-0.002117156982421875,
0.0014677047729492188,
0.01544952392578125,
0.004367828369140625,
-0.031768798828125,
-0.0129241943359375,
0.00020515918731689453,
-0.0248565673828125,
0.042877197265625,
-0.007045745849609375,
-0.005413055419921875,
0.04595947265625,
-0.0341796875,
-0.05047607421875,
0.024627685546875,
0.0021877288818359375,
-0.043304443359375,
-0.02117919921875,
0.003734588623046875,
0.00807952880859375,
-0.037872314453125,
0.0177001953125,
-0.001804351806640625,
-0.015106201171875,
0.003154754638671875,
-0.005046844482421875,
-0.00984954833984375,
0.007465362548828125,
-0.0053253173828125,
0.00952911376953125,
0.00543212890625,
0.049224853515625,
0.00262451171875,
-0.05474853515625,
-0.0151824951171875,
0.022857666015625,
-0.0028476715087890625,
-0.00844573974609375,
0.0311126708984375,
-0.028472900390625,
-0.023895263671875,
-0.05255126953125,
-0.0169677734375,
0.0251617431640625,
-0.038238525390625,
-0.0173492431640625,
-0.049224853515625,
0.0305328369140625,
0.036773681640625,
-0.032958984375,
-0.01146697998046875,
0.0194549560546875,
-0.036895751953125,
-0.0242767333984375,
-0.01042938232421875,
-0.02197265625,
0.007381439208984375,
0.027862548828125,
0.0036754608154296875,
-0.0002541542053222656,
-0.01495361328125,
-0.01117706298828125,
-0.028106689453125,
0.0298919677734375,
0.008514404296875,
-0.0258026123046875,
0.03271484375,
0.0362548828125,
-0.016143798828125,
0.016845703125,
-0.044891357421875,
-0.00014197826385498047,
0.004932403564453125,
-0.01183319091796875,
-0.043060302734375,
0.047698974609375,
0.0164642333984375,
-0.0438232421875,
0.0648193359375,
0.006343841552734375,
0.026702880859375,
0.0031833648681640625,
0.02740478515625,
-0.0180816650390625,
0.006267547607421875,
-0.043426513671875,
0.05950927734375,
0.0081939697265625,
0.064697265625,
-0.0611572265625,
-0.0167999267578125,
0.0116119384765625,
0.047027587890625,
-0.006755828857421875,
-0.019989013671875,
-0.0221099853515625,
-0.01763916015625,
0.040069580078125,
0.08502197265625,
0.04425048828125,
-0.004436492919921875,
-0.0009851455688476562,
0.0202789306640625,
0.0223846435546875,
-0.025634765625,
0.0328369140625,
-0.0296630859375,
-0.01259613037109375,
0.023193359375,
0.00524139404296875,
-0.00508880615234375,
-0.00507354736328125,
-0.0149078369140625,
-0.038360595703125,
-0.00362396240234375,
0.024627685546875,
-0.011016845703125,
-0.005901336669921875,
0.0587158203125,
0.07257080078125,
-0.09033203125,
-0.054656982421875,
-0.034912109375,
0.051361083984375,
0.0169677734375,
0.05828857421875,
0.040771484375,
0.034515380859375,
0.062286376953125,
-0.03338623046875,
0.0323486328125,
-0.0220947265625,
-0.034698486328125,
0.08758544921875,
0.03424072265625,
0.045562744140625,
-0.03338623046875,
-0.0616455078125,
0.0269317626953125,
0.09625244140625,
-0.0274200439453125,
-0.02288818359375,
0.00400543212890625,
0.00720977783203125,
0.028350830078125,
0.00372314453125,
0.0426025390625,
0.03509521484375,
0.048858642578125,
-0.0914306640625,
-0.0082855224609375,
0.021240234375,
0.057586669921875,
-0.0114288330078125,
-0.038330078125,
-0.0189208984375,
-0.031280517578125,
-0.057525634765625,
0.018524169921875,
0.02398681640625,
0.03717041015625,
0.0167236328125,
0.01052093505859375,
0.00997161865234375,
-0.021392822265625,
-0.0017938613891601562,
0.0005350112915039062,
0.0081634521484375,
-0.00472259521484375,
-0.019775390625,
-0.0289306640625,
0.004669189453125,
0.027801513671875,
0.00844573974609375,
-0.01190185546875,
0.037811279296875,
0.04779052734375,
-0.0139312744140625,
-0.02630615234375,
0.0218505859375,
-0.00911712646484375,
0.0005536079406738281,
-0.0185089111328125,
-0.0020961761474609375,
0.0175628662109375,
-0.02581787109375,
0.01337432861328125,
-0.0043487548828125,
0.03753662109375,
-0.04034423828125,
0.047698974609375,
-0.01904296875,
-0.00592041015625,
0.03948974609375,
-0.03460693359375,
0.044647216796875,
-0.019866943359375,
-0.11279296875,
-0.0211639404296875,
-0.044830322265625,
-0.03973388671875,
0.042327880859375,
0.034576416015625,
-0.042083740234375,
0.03936767578125,
-0.002727508544921875,
-0.04559326171875,
0.056640625,
0.0153350830078125,
-0.007396697998046875,
0.043670654296875,
0.0112457275390625,
-0.0096893310546875,
-0.0274505615234375,
-0.012115478515625,
0.018524169921875,
0.032257080078125,
0.0087432861328125,
0.044891357421875,
0.0058441162109375,
0.01105499267578125,
-0.0146942138671875,
0.00897216796875,
-0.0263214111328125,
-0.026519775390625,
0.09307861328125,
-0.0082550048828125,
-0.03363037109375,
-0.0130157470703125,
0.055755615234375,
0.0103607177734375,
0.042694091796875,
-0.05419921875,
-0.0178680419921875,
-0.006404876708984375,
0.01262664794921875,
-0.0204010009765625,
0.048828125,
-0.016937255859375,
-0.00437164306640625,
-0.0251312255859375,
-0.04156494140625,
0.02947998046875,
0.04437255859375,
0.0302276611328125,
0.037872314453125,
-0.00926971435546875,
0.048828125,
-0.022247314453125,
0.0380859375,
-0.04913330078125,
0.02154541015625,
-0.061004638671875,
0.01552581787109375,
0.06500244140625,
0.0056915283203125,
0.031341552734375,
0.03607177734375,
-0.0021610260009765625,
0.0537109375,
-0.040191650390625,
-0.010589599609375,
0.0328369140625,
0.055877685546875,
0.0232086181640625,
0.03204345703125,
-0.02252197265625,
-0.0089569091796875,
-0.0205535888671875,
0.039031982421875,
-0.019561767578125,
0.0133056640625,
-0.0233001708984375,
-0.01160430908203125,
0.015899658203125,
-0.05511474609375,
-0.038238525390625,
-0.034881591796875,
0.006046295166015625,
-0.013763427734375,
-0.0106353759765625,
-0.00019800662994384766,
-0.02490234375,
-0.0169219970703125,
-0.037078857421875,
-0.0200653076171875,
0.006237030029296875,
-0.00177001953125,
-0.07427978515625,
0.000606536865234375,
-0.0290679931640625,
-0.0262451171875,
-0.017486572265625,
0.03497314453125,
0.034423828125,
-0.0482177734375,
-0.00627899169921875,
0.0523681640625,
0.05364990234375,
0.0869140625,
0.0198974609375,
0.01203155517578125,
0.04107666015625,
0.01065826416015625,
-0.054290771484375,
-0.06439208984375,
0.00960540771484375,
-0.00873565673828125,
-0.0026264190673828125,
0.022125244140625,
-0.017303466796875,
0.002185821533203125,
-0.048065185546875,
-0.1136474609375,
0.09674072265625,
-0.0206298828125,
-0.041351318359375,
-0.022674560546875,
-0.007343292236328125,
-0.0004982948303222656,
0.0106353759765625,
0.009613037109375,
-0.03753662109375,
-0.042205810546875,
0.0025081634521484375,
0.029937744140625,
0.03155517578125,
0.024322509765625,
0.0017948150634765625,
-0.05853271484375,
0.01238250732421875,
-0.01122283935546875,
0.0416259765625,
-0.01313018798828125,
-0.007053375244140625,
0.00930023193359375,
0.037078857421875,
-0.037811279296875,
-0.0576171875,
0.007282257080078125,
-0.0017786026000976562,
0.055084228515625,
-0.0144500732421875,
-0.07232666015625,
-0.06256103515625,
0.01082611083984375,
-0.004955291748046875,
0.034759521484375,
0.0255126953125,
-0.03057861328125,
-0.0499267578125,
-0.01806640625,
-0.0219573974609375,
0.0023345947265625,
-0.02490234375,
0.029571533203125,
-0.016510009765625,
0.00168609619140625,
0.031829833984375,
-0.024200439453125,
-0.0189666748046875,
-0.00850677490234375,
0.00254058837890625,
0.0311431884765625,
-0.09246826171875,
0.0268707275390625,
-0.017120361328125,
-0.0220794677734375,
-0.04986572265625,
0.013641357421875,
-0.01419830322265625,
-0.047821044921875,
0.0220184326171875,
-0.01438140869140625,
-0.0273590087890625,
0.01232147216796875,
0.0281524658203125,
0.0058135986328125,
0.01513671875,
0.01200103759765625,
-0.0029430389404296875,
-0.0280609130859375,
0.00753021240234375,
0.035888671875,
-0.0067596435546875,
-0.053955078125,
0.027252197265625,
0.0290679931640625,
0.04205322265625,
0.0104522705078125,
0.036224365234375,
-0.0010976791381835938,
0.038787841796875,
-0.0148773193359375,
-0.03631591796875,
-0.0083770751953125,
-0.045379638671875,
-0.009307861328125,
0.009033203125,
-0.004856109619140625,
-0.045196533203125,
0.03363037109375,
0.0156402587890625,
0.003582000732421875,
0.029144287109375
] |
ee9f6c01ee87228316f98b2b6620f47f5f07548b
|
Wordpress Stackexchange
Q: How Do I Load My Action Earlier Enough? With add_action, I want to intercept as early as I can in my plugin and send a 304 Not Modified header per some rules. Does anyone know what the order is of events? When I view this page, it seems to hint that the best place for this would be plugins_loaded, and that it comes before the init event. Is that correct? The page in that link doesn't describe what the event order is, but seems to imply it.
A: The page you referenced does have the correct order of events listed there. If you want to see which events were fired for a particular request you can install debug-bar and debug-bar-action-hooks.
If you are wanting to send a header either plugins_loaded or init will work. But it is recommended to use the send_headers action that is fired just after the request is parsed, also if your rules depend on data in WP_Query you will need to use send_headers.
|
Q: How Do I Load My Action Earlier Enough? With add_action, I want to intercept as early as I can in my plugin and send a 304 Not Modified header per some rules. Does anyone know what the order is of events? When I view this page, it seems to hint that the best place for this would be plugins_loaded, and that it comes before the init event. Is that correct? The page in that link doesn't describe what the event order is, but seems to imply it.
A: The page you referenced does have the correct order of events listed there. If you want to see which events were fired for a particular request you can install debug-bar and debug-bar-action-hooks.
If you are wanting to send a header either plugins_loaded or init will work. But it is recommended to use the send_headers action that is fired just after the request is parsed, also if your rules depend on data in WP_Query you will need to use send_headers.
|
wordpress
|
{
"language": "en",
"length": 168,
"provenance": "stackexchange_00019.jsonl.gz:419628",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50956"
}
|
[
0.06884765625,
0.01654052734375,
-0.02349853515625,
-0.05731201171875,
0.03094482421875,
-0.03131103515625,
0.008544921875,
-0.001522064208984375,
-0.035400390625,
0.01146697998046875,
-0.00971221923828125,
0.005886077880859375,
-0.0113983154296875,
-0.038848876953125,
0.0238800048828125,
-0.047088623046875,
0.052398681640625,
-0.04241943359375,
0.017791748046875,
-0.01336669921875,
0.0078582763671875,
0.0168304443359375,
0.036651611328125,
0.04730224609375,
0.0322265625,
-0.00001329183578491211,
0.050567626953125,
-0.0200958251953125,
0.03363037109375,
-0.001953125,
0.024658203125,
-0.044891357421875,
0.0145263671875,
0.040802001953125,
-0.039581298828125,
0.025146484375,
0.0153350830078125,
0.022674560546875,
0.0111236572265625,
0.036346435546875,
0.032928466796875,
-0.00970458984375,
0.0177459716796875,
0.0172119140625,
0.0034351348876953125,
-0.04071044921875,
0.059722900390625,
-0.0272064208984375,
0.004199981689453125,
-0.03924560546875,
-0.0015878677368164062,
0.0115966796875,
0.0141448974609375,
0.00438690185546875,
-0.0005941390991210938,
0.02801513671875,
-0.080810546875,
0.06243896484375,
0.01287078857421875,
0.06500244140625,
0.017486572265625,
0.0226287841796875,
-0.02520751953125,
-0.037750244140625,
0.00374603271484375,
0.024810791015625,
0.04913330078125,
-0.0039215087890625,
-0.034027099609375,
0.01090240478515625,
0.0231170654296875,
-0.0380859375,
-0.032928466796875,
0.00951385498046875,
-0.0386962890625,
-0.0171661376953125,
0.01103973388671875,
-0.03411865234375,
0.01971435546875,
0.006439208984375,
0.002532958984375,
0.0078125,
-0.00482177734375,
-0.01325225830078125,
0.000858306884765625,
-0.004291534423828125,
-0.0139617919921875,
-0.0064239501953125,
-0.02337646484375,
-0.04949951171875,
-0.03204345703125,
-0.020416259765625,
0.01200103759765625,
-0.041290283203125,
-0.0546875,
-0.0291290283203125,
-0.003955841064453125,
-0.0037784576416015625,
0.0043487548828125,
-0.005706787109375,
-0.02276611328125,
-0.02630615234375,
-0.00893402099609375,
0.00530242919921875,
0.00968170166015625,
0.011566162109375,
0.02032470703125,
-0.00824737548828125,
0.0263214111328125,
0.01244354248046875,
-0.024749755859375,
0.045074462890625,
0.017669677734375,
0.036224365234375,
-0.041229248046875,
-0.0211029052734375,
-0.0263519287109375,
0.018280029296875,
-0.0252227783203125,
0.04229736328125,
-0.0004801750183105469,
0.006610870361328125,
0.0150146484375,
0.0297088623046875,
-0.01067352294921875,
-0.001209259033203125,
-0.01503753662109375,
-0.03179931640625,
-0.004421234130859375,
-0.0005230903625488281,
0.0016241073608398438,
0.046173095703125,
-0.006725311279296875,
-0.03314208984375,
-0.056243896484375,
-0.004207611083984375,
0.006168365478515625,
-0.00724029541015625,
0.002033233642578125,
0.011505126953125,
-0.0175628662109375,
-0.04144287109375,
-0.01486968994140625,
0.002719879150390625,
0.0254669189453125,
-0.00577545166015625,
-0.00643157958984375,
0.0194549560546875,
0.0164947509765625,
-0.0182952880859375,
0.022735595703125,
-0.045166015625,
0.0352783203125,
0.01285552978515625,
-0.031829833984375,
0.029266357421875,
0.01424407958984375,
-0.004627227783203125,
-0.0645751953125,
-0.01357269287109375,
-0.031280517578125,
-0.0134735107421875,
-0.00507354736328125,
-0.062744140625,
-0.06060791015625,
0.01145172119140625,
0.004322052001953125,
-0.00142669677734375,
0.021514892578125,
0.01084136962890625,
0.01004791259765625,
0.034820556640625,
0.01203155517578125,
-0.00319671630859375,
-0.01064300537109375,
-0.00844573974609375,
0.00965118408203125,
0.0010614395141601562,
0.0345458984375,
0.0154266357421875,
-0.03643798828125,
-0.035003662109375,
0.07965087890625,
-0.041656494140625,
-0.04345703125,
0.051666259765625,
-0.005748748779296875,
0.0304107666015625,
0.0038433074951171875,
0.003513336181640625,
0.029144287109375,
0.0457763671875,
-0.0333251953125,
-0.01568603515625,
-0.019744873046875,
0.012481689453125,
0.039825439453125,
0.03436279296875,
0.0030689239501953125,
-0.00655364990234375,
-0.0200347900390625,
0.046661376953125,
-0.04217529296875,
0.006656646728515625,
-0.031463623046875,
0.00251007080078125,
-0.0029296875,
0.02716064453125,
0.04547119140625,
-0.0005950927734375,
-0.0184478759765625,
0.01117706298828125,
0.0020313262939453125,
-0.057891845703125,
-0.052886962890625,
0.07122802734375,
-0.038360595703125,
0.055938720703125,
-0.00211334228515625,
0.058349609375,
-0.0124664306640625,
-0.0345458984375,
-0.0022716522216796875,
-0.0271453857421875,
0.0301513671875,
-0.00923919677734375,
-0.007442474365234375,
-0.0252227783203125,
0.04168701171875,
-0.00504302978515625,
-0.0098419189453125,
0.02154541015625,
0.025146484375,
0.03912353515625,
-0.01078033447265625,
-0.0196075439453125,
-0.0141143798828125,
-0.09759521484375,
0.0238800048828125,
0.05828857421875,
0.01009368896484375,
-0.002552032470703125,
-0.0019235610961914062,
0.055145263671875,
-0.037139892578125,
-0.07867431640625,
-0.0088348388671875,
0.0399169921875,
0.005527496337890625,
0.01312255859375,
0.0023403167724609375,
-0.018280029296875,
0.0233917236328125,
-0.03509521484375,
0.04833984375,
0.005146026611328125,
-0.0162353515625,
-0.0970458984375,
-0.0186614990234375,
0.033294677734375,
0.03216552734375,
-0.040130615234375,
-0.06787109375,
0.003871917724609375,
0.046173095703125,
-0.048736572265625,
0.01096343994140625,
-0.003978729248046875,
-0.01058197021484375,
-0.00678253173828125,
0.0263671875,
-0.031646728515625,
-0.0047607421875,
0.041961669921875,
0.02252197265625,
-0.02410888671875,
-0.004680633544921875,
-0.0153656005859375,
-0.034637451171875,
0.005374908447265625,
-0.03662109375,
-0.014801025390625,
-0.020416259765625,
-0.01189422607421875,
-0.0301055908203125,
-0.022247314453125,
0.036773681640625,
-0.004199981689453125,
0.01508331298828125,
0.0183868408203125,
0.038330078125,
-0.0026378631591796875,
-0.04559326171875,
0.053558349609375,
-0.0391845703125,
-0.036468505859375,
-0.01470184326171875,
0.001407623291015625,
0.015228271484375,
-0.02593994140625,
0.040374755859375,
0.049835205078125,
-0.02520751953125,
0.020263671875,
0.0018529891967773438,
-0.01110076904296875,
-0.003673553466796875,
-0.005596160888671875,
-0.0231170654296875,
-0.0177001953125,
-0.048553466796875,
0.0190887451171875,
0.041717529296875,
0.08099365234375,
0.0030574798583984375,
-0.04132080078125,
-0.0153045654296875,
0.06793212890625,
-0.032806396484375,
-0.034332275390625,
-0.02227783203125,
-0.08013916015625,
0.03826904296875,
-0.031341552734375,
-0.02587890625,
-0.018585205078125,
0.0005259513854980469,
0.0211029052734375,
-0.0210113525390625,
-0.007205963134765625,
0.038360595703125,
-0.0174407958984375,
-0.00318145751953125,
-0.0140838623046875,
0.016448974609375,
-0.00775909423828125,
-0.00572967529296875,
0.08306884765625,
-0.0110931396484375,
-0.060028076171875,
-0.04443359375,
-0.06671142578125,
-0.0247955322265625,
-0.01303863525390625,
-0.004184722900390625,
-0.02294921875,
0.023406982421875,
-0.003021240234375,
0.0128936767578125,
0.0239715576171875,
-0.0079345703125,
-0.011505126953125,
-0.0238800048828125,
-0.033233642578125,
-0.004795074462890625,
0.0267791748046875,
0.030731201171875,
-0.0285491943359375,
0.017730712890625,
-0.0555419921875,
0.0197906494140625,
0.00771331787109375,
-0.025054931640625,
-0.0626220703125,
0.031341552734375,
-0.0158843994140625,
-0.00914764404296875,
-0.049163818359375,
-0.0018892288208007812,
0.0076904296875,
0.064453125,
-0.0174713134765625,
-0.0135498046875,
-0.0263824462890625,
-0.0296630859375,
-0.040679931640625,
0.0389404296875,
-0.015350341796875,
-0.01425933837890625,
0.007335662841796875,
-0.0036716461181640625,
-0.0219268798828125,
0.0186614990234375,
-0.045623779296875,
0.01253509521484375,
0.0194091796875,
-0.00589752197265625,
0.055755615234375,
-0.033538818359375,
-0.0267333984375,
-0.0192108154296875,
0.057098388671875,
0.01055908203125,
-0.030364990234375,
0.0145111083984375,
0.019927978515625,
-0.072509765625,
-0.0177154541015625,
-0.01235198974609375,
0.0097198486328125,
-0.059661865234375,
0.006366729736328125,
-0.0067901611328125,
-0.0166015625,
-0.034271240234375,
-0.0100860595703125,
-0.036224365234375,
-0.03094482421875,
0.040679931640625,
-0.0263824462890625,
-0.0300750732421875,
0.0347900390625,
-0.0118408203125,
-0.007320404052734375,
-0.03619384765625,
0.007617950439453125,
-0.08258056640625,
-0.0127105712890625,
-0.05877685546875,
0.075439453125,
0.046173095703125,
-0.038116455078125,
-0.000995635986328125,
0.0462646484375,
0.00036644935607910156,
0.0206298828125,
0.022979736328125,
-0.013427734375,
0.0362548828125,
0.01493072509765625,
0.01485443115234375,
-0.01494598388671875,
-0.01160430908203125,
0.0005664825439453125,
-0.00708770751953125,
0.003875732421875,
-0.0276031494140625,
-0.0286865234375,
-0.01446533203125,
-0.019256591796875,
-0.048553466796875,
-0.04388427734375,
-0.04498291015625,
0.0197601318359375,
0.0008144378662109375,
-0.0223388671875,
-0.05645751953125,
-0.0721435546875,
-0.0098114013671875,
-0.049591064453125,
0.0238800048828125,
-0.005645751953125,
0.048797607421875,
0.0273590087890625,
0.017547607421875,
0.119384765625,
-0.006717681884765625,
0.01611328125,
0.010711669921875,
0.025543212890625,
0.008026123046875,
-0.00811767578125,
0.054473876953125,
-0.008514404296875,
0.04327392578125,
-0.034332275390625,
0.056732177734375,
0.01776123046875,
0.014678955078125,
0.01461029052734375,
0.034423828125,
-0.031768798828125,
-0.00177001953125,
-0.028656005859375,
0.00395965576171875,
-0.0033168792724609375,
-0.005512237548828125,
-0.06103515625,
0.0697021484375,
0.00128936767578125,
0.0236663818359375,
0.00386810302734375,
0.04010009765625,
0.046600341796875,
0.0513916015625,
-0.0157012939453125,
-0.01419830322265625,
-0.017852783203125,
0.0018835067749023438,
0.01490020751953125,
0.005153656005859375,
-0.036041259765625,
0.0207672119140625,
-0.00463104248046875,
-0.0267486572265625,
0.01245880126953125,
-0.01039886474609375,
0.041259765625,
-0.0207061767578125,
-0.03753662109375,
-0.04443359375,
-0.018585205078125,
0.0245819091796875,
0.00992584228515625,
-0.007091522216796875,
0.0173492431640625,
0.041595458984375,
0.0034942626953125,
-0.0006394386291503906,
-0.01593017578125,
0.041717529296875,
-0.0192413330078125,
0.01346588134765625,
-0.01287841796875,
-0.0023937225341796875,
-0.0225372314453125,
0.0390625,
-0.023773193359375,
0.004138946533203125,
-0.002559661865234375,
0.038726806640625,
0.0131988525390625,
0.0247955322265625,
0.0235443115234375,
-0.0196075439453125,
0.0258026123046875,
-0.0079345703125,
0.0089569091796875,
-0.030029296875,
-0.005130767822265625,
-0.006679534912109375,
0.018951416015625,
-0.036224365234375,
-0.0241851806640625,
0.062225341796875,
0.005458831787109375,
-0.038787841796875,
0.0445556640625,
0.04931640625,
-0.01447296142578125,
-0.03851318359375,
0.015655517578125,
0.047943115234375,
0.03076171875,
0.00902557373046875,
0.08282470703125,
0.017364501953125,
0.056915283203125,
-0.0187225341796875,
0.0133819580078125,
-0.023529052734375,
-0.0036334991455078125,
0.02374267578125,
-0.0172576904296875,
-0.027252197265625,
0.0109100341796875,
0.0078887939453125,
-0.01546478271484375,
-0.0066986083984375,
0.06201171875,
-0.029083251953125,
0.003383636474609375,
-0.00917816162109375,
0.008819580078125,
-0.08843994140625,
0.036956787109375,
-0.0103607177734375,
-0.004302978515625,
-0.027618408203125,
-0.00836181640625,
-0.030426025390625,
-0.0154266357421875,
-0.07061767578125,
-0.0283660888671875,
-0.045166015625,
0.01293182373046875,
-0.007305145263671875,
0.0305023193359375,
-0.0252532958984375,
-0.0103302001953125,
0.037261962890625,
-0.0003559589385986328,
-0.033294677734375,
0.0201873779296875,
-0.0252532958984375,
0.0865478515625,
-0.01039886474609375,
0.040313720703125,
0.016815185546875,
0.045745849609375,
-0.01216888427734375,
-0.0038776397705078125,
-0.007843017578125,
-0.00905609130859375,
-0.006359100341796875,
-0.0075836181640625,
0.01320648193359375,
-0.000056803226470947266,
0.046478271484375,
-0.0023956298828125,
-0.0265350341796875,
0.00736236572265625,
0.0004634857177734375,
-0.0188140869140625,
0.0516357421875,
0.0181121826171875,
-0.0248260498046875,
0.0066680908203125,
-0.0086517333984375,
0.0016613006591796875,
-0.01470184326171875,
0.0030059814453125,
0.0179443359375,
-0.0131072998046875,
0.0140380859375,
-0.01332855224609375,
-0.03375244140625,
0.037811279296875,
0.03411865234375,
0.019073486328125,
0.066162109375,
-0.0025157928466796875,
0.045074462890625,
0.03863525390625,
0.0308990478515625,
0.0127105712890625,
-0.049468994140625,
0.05926513671875,
0.021240234375,
-0.022735595703125,
0.035247802734375,
-0.041473388671875,
0.04046630859375,
0.0239715576171875,
0.05548095703125,
-0.07403564453125,
0.0295562744140625,
-0.0198974609375,
-0.0153350830078125,
0.08367919921875,
-0.023651123046875,
0.0037174224853515625,
-0.028839111328125,
0.08148193359375,
0.0263671875,
-0.002086639404296875,
0.0435791015625,
-0.006572723388671875,
-0.01261138916015625,
-0.0087432861328125,
-0.00757598876953125,
-0.00081634521484375,
0.0018892288208007812,
0.0135498046875,
-0.0186920166015625,
0.02630615234375,
-0.0235137939453125,
0.01242828369140625,
0.028961181640625,
-0.0283966064453125,
-0.030242919921875,
0.043121337890625,
-0.005413055419921875,
-0.020904541015625,
-0.005619049072265625,
-0.052093505859375,
0.032562255859375,
0.0241851806640625,
-0.02667236328125,
0.00618743896484375,
-0.00418853759765625,
-0.0025577545166015625,
-0.045623779296875,
-0.0285491943359375,
0.0208587646484375,
0.040252685546875,
-0.042816162109375,
0.038421630859375,
-0.010833740234375,
-0.03271484375,
-0.014373779296875,
-0.033233642578125,
0.076416015625,
-0.05279541015625,
-0.01041412353515625,
-0.0005908012390136719,
0.037841796875,
0.0061798095703125,
-0.02252197265625,
0.0064697265625,
-0.0232391357421875,
0.035858154296875,
-0.0277557373046875,
0.020965576171875,
0.0135345458984375,
-0.0169677734375,
-0.03857421875,
0.0877685546875,
0.0231170654296875,
-0.01384735107421875,
-0.007137298583984375,
0.03961181640625,
-0.042327880859375,
0.01432037353515625,
-0.0340576171875,
0.0498046875,
-0.06396484375,
0.0650634765625,
-0.0794677734375,
0.0023746490478515625,
0.0136871337890625,
0.0255279541015625,
0.0526123046875,
0.0165863037109375,
-0.049652099609375,
0.006988525390625,
0.0455322265625,
0.02667236328125,
-0.0009775161743164062,
0.041015625,
0.01403045654296875,
-0.048492431640625,
0.003711700439453125,
0.036956787109375,
0.03851318359375,
-0.0254669189453125,
-0.018829345703125,
0.025390625,
-0.00417327880859375,
-0.0122222900390625,
-0.01457977294921875,
0.0224456787109375,
0.0015354156494140625,
-0.0222930908203125,
-0.0030612945556640625,
0.003204345703125,
-0.00047779083251953125,
0.0090789794921875,
0.004673004150390625,
0.0092315673828125,
-0.043426513671875,
0.00415802001953125,
0.02435302734375,
0.0229949951171875,
0.0124969482421875,
0.049530029296875,
0.0289154052734375,
-0.0195159912109375,
-0.007411956787109375,
0.00894927978515625,
0.00004416704177856445,
-0.045379638671875,
0.045867919921875,
0.013275146484375,
0.03955078125,
-0.0252227783203125,
-0.036529541015625,
0.016632080078125,
0.056671142578125,
-0.0156707763671875,
-0.04876708984375,
0.010040283203125,
0.00011938810348510742,
0.034149169921875,
-0.00969696044921875,
0.0197906494140625,
-0.0662841796875,
-0.006916046142578125,
-0.032135009765625,
-0.0287322998046875,
0.0008935928344726562,
0.02630615234375,
0.0011949539184570312,
0.0196075439453125,
-0.0121612548828125,
-0.048065185546875,
-0.00485992431640625,
0.03607177734375,
-0.01161956787109375,
-0.01068878173828125,
-0.031463623046875,
0.037506103515625,
-0.01129150390625,
0.00984954833984375,
-0.028106689453125,
0.00797271728515625,
-0.027008056640625,
0.038726806640625,
-0.043365478515625,
-0.0063629150390625,
-0.031219482421875,
0.05279541015625,
0.051239013671875,
-0.005779266357421875,
0.03466796875,
0.0283050537109375,
-0.017486572265625,
0.01096343994140625,
0.03509521484375,
-0.00757598876953125,
0.0212554931640625,
-0.047943115234375,
0.01617431640625,
-0.01580810546875,
-0.018035888671875,
-0.0019664764404296875,
-0.02447509765625,
0.03399658203125,
-0.039459228515625,
-0.03350830078125,
0.00199127197265625,
-0.039215087890625,
0.056732177734375,
-0.0240936279296875,
0.0191192626953125,
-0.0279998779296875,
-0.0208740234375,
-0.0028285980224609375,
-0.044921875,
-0.01175689697265625,
0.042205810546875,
0.044677734375,
-0.0005340576171875,
0.019195556640625,
0.0477294921875,
-0.005008697509765625,
-0.00579071044921875,
-0.0090484619140625,
0.015960693359375,
0.01654052734375,
0.017120361328125,
0.032562255859375,
-0.00041294097900390625,
0.0013437271118164062,
0.007091522216796875,
0.006710052490234375,
0.047943115234375,
-0.00772857666015625,
0.035064697265625,
0.043365478515625,
0.0428466796875,
-0.029754638671875,
0.041900634765625,
0.035614013671875,
0.0014972686767578125,
-0.01104736328125,
-0.0026874542236328125,
-0.0235595703125,
-0.04901123046875,
0.010101318359375,
0.0264129638671875,
-0.0008215904235839844,
0.0266876220703125,
-0.02227783203125,
0.0252685546875,
-0.00637054443359375,
0.043853759765625,
-0.0256500244140625,
-0.04718017578125,
-0.06732177734375,
-0.0168304443359375,
0.03277587890625,
0.02032470703125,
-0.034912109375,
-0.003787994384765625,
-0.00026416778564453125,
0.0012111663818359375,
-0.017425537109375,
0.0330810546875,
-0.0285797119140625,
0.0164642333984375,
-0.00598907470703125,
0.00739288330078125,
0.033905029296875,
-0.0120086669921875,
0.04046630859375,
0.01442718505859375,
0.02191162109375,
0.0236053466796875,
-0.028839111328125,
-0.0216522216796875,
0.01788330078125,
0.0738525390625,
0.0008559226989746094,
0.02117919921875,
-0.0201568603515625,
0.0172271728515625,
-0.017669677734375,
-0.0643310546875,
-0.022979736328125,
-0.026397705078125,
-0.000457763671875,
0.02410888671875,
0.0011758804321289062,
-0.018707275390625,
-0.0243072509765625,
0.009490966796875,
0.019866943359375,
-0.01171112060546875,
-0.047271728515625,
-0.0012378692626953125,
-0.01200103759765625,
0.046722412109375,
-0.029510498046875,
0.030975341796875,
-0.00795745849609375,
0.0157623291015625,
-0.0276031494140625,
-0.0389404296875,
-0.02215576171875,
0.041778564453125,
-0.042327880859375,
-0.020477294921875,
0.010223388671875,
0.006038665771484375,
-0.02691650390625,
-0.023895263671875,
-0.031768798828125,
0.03424072265625,
-0.03643798828125,
-0.006755828857421875,
0.0257110595703125,
0.0182342529296875,
-0.0430908203125,
-0.059295654296875,
0.0142669677734375,
-0.04266357421875,
-0.00743865966796875,
-0.058563232421875,
-0.008209228515625,
-0.01331329345703125,
-0.050994873046875,
-0.0253448486328125,
0.08441162109375,
-0.0096893310546875,
-0.00197601318359375,
-0.05682373046875,
0.065185546875,
0.030364990234375,
-0.052459716796875,
-0.0127105712890625,
-0.0210113525390625,
-0.01023101806640625,
-0.01507568359375,
-0.0048980712890625,
0.002506256103515625,
0.0259857177734375,
-0.02227783203125,
-0.01812744140625,
-0.00170135498046875,
0.01499176025390625,
-0.005970001220703125,
-0.035552978515625,
-0.006687164306640625,
0.05767822265625,
0.0416259765625,
-0.0029735565185546875,
0.1011962890625,
0.05755615234375,
0.022369384765625,
-0.04278564453125,
-0.04205322265625,
0.00899505615234375,
0.020111083984375,
0.07159423828125,
0.05352783203125,
0.0106964111328125,
-0.0538330078125,
0.027587890625,
0.01629638671875,
-0.0032978057861328125,
-0.01122283935546875,
-0.006168365478515625,
-0.020233154296875,
-0.03460693359375,
-0.0244293212890625,
-0.00543212890625,
0.01499176025390625,
0.0292205810546875,
-0.0030879974365234375,
-0.0117340087890625,
0.0152130126953125,
-0.03118896484375,
-0.06549072265625,
-0.025390625,
0.06048583984375,
-0.049346923828125,
-0.04473876953125,
0.0276947021484375,
0.01320648193359375,
-0.0222320556640625,
0.007190704345703125,
0.0361328125,
0.037872314453125,
-0.0755615234375,
-0.002689361572265625,
0.005161285400390625,
0.033538818359375,
-0.044891357421875,
-0.042755126953125,
0.008697509765625,
0.0172119140625,
-0.0279388427734375,
0.019622802734375,
0.0301361083984375,
0.0008816719055175781,
-0.0286407470703125,
0.053558349609375,
0.007537841796875,
0.005298614501953125,
-0.0178375244140625,
0.0330810546875,
0.0203399658203125,
-0.01361083984375,
0.051666259765625,
-0.01436614990234375,
0.0033512115478515625,
0.00717926025390625,
-0.004856109619140625,
-0.02349853515625,
0.032623291015625,
-0.0216522216796875,
0.0014019012451171875,
0.01090240478515625
] |
0c999b9ace9075f6266267c90db3bf16214a13ac
|
Wordpress Stackexchange
Q: Internal Links to Pages in PHP? What is the best way of linking to WordPress pages with PHP? Considering that I move the page from a local server to a live server to another URL?
<a href="/wordpress/services" title="Read More" class="yellowButton">Read more</a>
How could you replace this code with PHP linking to the WordPress page.
/wordpress/services
A: Page Permalink from $id
If you know the Page $id, use get_permalink():
<?php $permalink = get_permalink( $id ); ?>
Page Permalink from $slug
If you know the Page $slug, such as /about (including hierarchy, such as /about/work), use get_page_by_path() to determine the Page $id, then use get_permalink().
<?php
$page_object = get_page_by_path( $slug );
$page_id = $page_object->ID;
$permalink = get_permalink( $page_id );
?>
Page Permalink from $title
If you know the Page $title, such as "Some Random Page Name", use get_page_by_title(), then use get_permalink():
<?php
$page_object = get_page_by_title( $title );
$page_id = $page_object->ID;
$permalink = get_permalink( $page_id );
?>
|
Q: Internal Links to Pages in PHP? What is the best way of linking to WordPress pages with PHP? Considering that I move the page from a local server to a live server to another URL?
<a href="/wordpress/services" title="Read More" class="yellowButton">Read more</a>
How could you replace this code with PHP linking to the WordPress page.
/wordpress/services
A: Page Permalink from $id
If you know the Page $id, use get_permalink():
<?php $permalink = get_permalink( $id ); ?>
Page Permalink from $slug
If you know the Page $slug, such as /about (including hierarchy, such as /about/work), use get_page_by_path() to determine the Page $id, then use get_permalink().
<?php
$page_object = get_page_by_path( $slug );
$page_id = $page_object->ID;
$permalink = get_permalink( $page_id );
?>
Page Permalink from $title
If you know the Page $title, such as "Some Random Page Name", use get_page_by_title(), then use get_permalink():
<?php
$page_object = get_page_by_title( $title );
$page_id = $page_object->ID;
$permalink = get_permalink( $page_id );
?>
A: Do you want to find them by name? If yes then you can
<a href="<?php echo site_url('/services'); ?>"> Services </a>
A: If you want to hardcode '/page-names' you can use home_url('/wordpress/services') function with esc_url() for sanitizing URLs - it will always get you full url of home page ( local or live )
<a href="<?php echo esc_url( home_url( '/wordpress/services' ) ); ?>"
title="Read More" class="yellowButton">
Read more
</a>
A: You can use a shortcode to insert the domain name into the internal link and then just add the page url on the end e.g [domain_name]/page-name.
Add this code into your child themes function.php and it's ready to go!
//add shortcode that displays current site name
function domain_name(){
$currentDomain = "yoursite.com";
return $currentDomain;
}
add_shortcode('domain_name', 'domain_name');
I've tested this on multiple live sites and it appears to be working perfectly.
Hope this is what you're looking for!
|
wordpress
|
{
"language": "en",
"length": 302,
"provenance": "stackexchange_00019.jsonl.gz:419640",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/50995"
}
|
[
0.0528564453125,
0.0004107952117919922,
0.040191650390625,
0.0010747909545898438,
-0.003986358642578125,
-0.0177764892578125,
0.060394287109375,
-0.035369873046875,
0.0027370452880859375,
-0.0009455680847167969,
-0.038543701171875,
0.02001953125,
-0.0285491943359375,
-0.0283966064453125,
0.04150390625,
-0.0200042724609375,
0.02874755859375,
-0.0091705322265625,
0.0419921875,
0.00836944580078125,
-0.0136566162109375,
0.03192138671875,
0.07452392578125,
-0.00914764404296875,
0.041900634765625,
-0.09912109375,
0.055877685546875,
-0.0198974609375,
0.0287933349609375,
-0.041717529296875,
0.01201629638671875,
0.0221099853515625,
0.01163482666015625,
-0.0011081695556640625,
0.0264892578125,
-0.019683837890625,
-0.0005292892456054688,
0.0033931732177734375,
0.0300750732421875,
0.028594970703125,
0.0261077880859375,
-0.0022449493408203125,
0.032196044921875,
0.0245361328125,
-0.004199981689453125,
-0.027130126953125,
0.012481689453125,
-0.032623291015625,
-0.02093505859375,
0.0036296844482421875,
0.02899169921875,
0.034698486328125,
0.0267486572265625,
0.057373046875,
0.00627899169921875,
0.028472900390625,
0.0489501953125,
-0.0577392578125,
0.0268707275390625,
-0.04071044921875,
-0.05157470703125,
-0.028045654296875,
0.045196533203125,
-0.01387786865234375,
-0.0157928466796875,
-0.0036640167236328125,
-0.0175933837890625,
0.026611328125,
-0.00799560546875,
-0.0240936279296875,
0.00994110107421875,
-0.007030487060546875,
-0.03680419921875,
-0.045013427734375,
-0.00917816162109375,
0.0302581787109375,
-0.004932403564453125,
-0.0518798828125,
-0.0253143310546875,
0.0235443115234375,
-0.01438140869140625,
-0.0159454345703125,
-0.06402587890625,
-0.00270843505859375,
0.0298309326171875,
0.04058837890625,
-0.01372528076171875,
-0.02337646484375,
-0.018798828125,
-0.03240966796875,
-0.01837158203125,
0.0009369850158691406,
-0.00759124755859375,
-0.019561767578125,
-0.0445556640625,
-0.010223388671875,
0.0131683349609375,
0.023529052734375,
0.0023441314697265625,
0.032012939453125,
0.01611328125,
-0.050506591796875,
0.07098388671875,
-0.040679931640625,
-0.0163116455078125,
0.0211334228515625,
0.01953125,
0.0158843994140625,
0.0105133056640625,
0.0066680908203125,
-0.0085906982421875,
0.0201263427734375,
-0.00408935546875,
-0.00811767578125,
-0.0198822021484375,
0.025726318359375,
-0.03607177734375,
0.0036678314208984375,
-0.004001617431640625,
0.034912109375,
-0.0367431640625,
-0.0057525634765625,
0.005062103271484375,
0.0140838623046875,
0.014068603515625,
0.01038360595703125,
0.0089263916015625,
-0.0216827392578125,
0.00848388671875,
0.0416259765625,
-0.0312042236328125,
-0.006755828857421875,
0.08050537109375,
0.033233642578125,
0.01763916015625,
-0.033294677734375,
0.006526947021484375,
-0.0112152099609375,
-0.0048675537109375,
0.000011861324310302734,
0.01605224609375,
-0.0176239013671875,
0.025054931640625,
-0.012481689453125,
-0.0116119384765625,
0.007678985595703125,
0.0034389495849609375,
0.026702880859375,
0.0018720626831054688,
-0.014129638671875,
0.006591796875,
-0.035675048828125,
0.0225677490234375,
0.01334381103515625,
0.00614166259765625,
-0.060699462890625,
0.01493072509765625,
-0.041534423828125,
0.05474853515625,
-0.042083740234375,
0.03265380859375,
-0.0012102127075195312,
0.0156402587890625,
-0.01384735107421875,
-0.0447998046875,
-0.0117950439453125,
-0.06439208984375,
-0.020660400390625,
0.00856781005859375,
0.033111572265625,
0.0249176025390625,
-0.0167236328125,
-0.0244140625,
-0.035552978515625,
-0.01541900634765625,
-0.03302001953125,
0.006618499755859375,
0.0152130126953125,
0.0189056396484375,
0.036224365234375,
-0.00988006591796875,
-0.0343017578125,
0.04376220703125,
-0.035125732421875,
-0.042022705078125,
0.053253173828125,
0.0057525634765625,
0.05712890625,
-0.0167999267578125,
0.0253448486328125,
0.019683837890625,
0.036712646484375,
-0.060638427734375,
0.0202789306640625,
-0.01934814453125,
-0.008056640625,
0.033355712890625,
0.035430908203125,
-0.019256591796875,
-0.02288818359375,
-0.0167388916015625,
-0.005023956298828125,
-0.005802154541015625,
0.04827880859375,
-0.028656005859375,
0.01016998291015625,
-0.0167236328125,
0.0114288330078125,
0.0115509033203125,
0.01800537109375,
0.007183074951171875,
0.0172576904296875,
-0.01013946533203125,
-0.0643310546875,
-0.018890380859375,
0.038848876953125,
-0.0053558349609375,
-0.0321044921875,
-0.015869140625,
0.007236480712890625,
-0.0009093284606933594,
-0.01245880126953125,
-0.032135009765625,
0.033935546875,
0.05059814453125,
-0.0120849609375,
-0.01082611083984375,
-0.0265350341796875,
0.0187835693359375,
0.01812744140625,
-0.06634521484375,
0.0158233642578125,
0.0655517578125,
0.05474853515625,
-0.006221771240234375,
0.0196685791015625,
0.00798797607421875,
-0.0408935546875,
-0.02032470703125,
0.026397705078125,
0.02880859375,
0.007724761962890625,
0.006793975830078125,
-0.0009245872497558594,
-0.0176239013671875,
-0.041412353515625,
0.0289306640625,
-0.033538818359375,
-0.02386474609375,
0.02294921875,
-0.005184173583984375,
0.0465087890625,
0.0214996337890625,
-0.000037550926208496094,
-0.0289459228515625,
0.06256103515625,
-0.00933074951171875,
0.0194091796875,
0.0009794235229492188,
-0.00019276142120361328,
-0.003566741943359375,
-0.0169219970703125,
0.0010175704956054688,
-0.0200653076171875,
-0.0032596588134765625,
0.0216522216796875,
0.005352020263671875,
0.030975341796875,
-0.0078277587890625,
-0.00949859619140625,
-0.0033817291259765625,
-0.013946533203125,
-0.01096343994140625,
0.033233642578125,
0.005481719970703125,
-0.00948333740234375,
-0.048614501953125,
0.016815185546875,
-0.003070831298828125,
0.005863189697265625,
-0.026611328125,
0.001842498779296875,
0.0252685546875,
-0.00789642333984375,
-0.007843017578125,
-0.051727294921875,
0.02447509765625,
-0.00484466552734375,
0.00661468505859375,
-0.0087127685546875,
0.01605224609375,
0.02459716796875,
-0.04443359375,
0.056793212890625,
0.0116729736328125,
-0.027740478515625,
0.06890869140625,
-0.0208587646484375,
0.0207672119140625,
-0.0110626220703125,
0.06317138671875,
0.047607421875,
-0.01204681396484375,
-0.009979248046875,
-0.0021610260009765625,
-0.0287322998046875,
0.005931854248046875,
-0.023345947265625,
-0.0304718017578125,
-0.00971221923828125,
-0.055450439453125,
0.01270294189453125,
-0.00687408447265625,
0.0299835205078125,
-0.0219268798828125,
-0.0654296875,
-0.0081024169921875,
-0.01406097412109375,
-0.1334228515625,
-0.10504150390625,
0.00797271728515625,
-0.0309295654296875,
-0.0023822784423828125,
0.04083251953125,
-0.036895751953125,
-0.018310546875,
0.064697265625,
-0.0052947998046875,
0.030303955078125,
-0.04095458984375,
-0.08343505859375,
-0.053741455078125,
-0.09002685546875,
-0.004283905029296875,
-0.02032470703125,
-0.0032825469970703125,
0.0115203857421875,
-0.0242919921875,
0.0035114288330078125,
-0.0004639625549316406,
0.0235443115234375,
0.0731201171875,
-0.020172119140625,
-0.053955078125,
-0.006687164306640625,
0.0132904052734375,
-0.00901031494140625,
0.0247039794921875,
0.03387451171875,
0.00800323486328125,
-0.010894775390625,
-0.0204010009765625,
-0.0260467529296875,
0.016448974609375,
0.011749267578125,
0.00688934326171875,
0.0287322998046875,
0.0222015380859375,
0.0236663818359375,
-0.01904296875,
-0.0548095703125,
-0.00836181640625,
-0.054718017578125,
0.045166015625,
0.033905029296875,
-0.001018524169921875,
0.021087646484375,
0.0205230712890625,
-0.005664825439453125,
0.030792236328125,
-0.004558563232421875,
-0.02276611328125,
0.0056304931640625,
-0.0012989044189453125,
0.0048370361328125,
0.010650634765625,
0.058624267578125,
0.005817413330078125,
-0.002796173095703125,
0.020416259765625,
0.01555633544921875,
-0.0023345947265625,
-0.01849365234375,
-0.06427001953125,
-0.03790283203125,
0.061309814453125,
-0.02734375,
0.0209503173828125,
-0.042694091796875,
-0.037445068359375,
-0.00042366981506347656,
0.0826416015625,
-0.003292083740234375,
-0.028045654296875,
-0.0031261444091796875,
-0.00103759765625,
0.006336212158203125,
-0.009002685546875,
-0.0003116130828857422,
-0.01611328125,
-0.0576171875,
-0.003513336181640625,
-0.00738525390625,
-0.0308380126953125,
-0.01406097412109375,
0.0265045166015625,
-0.0216217041015625,
-0.00460052490234375,
0.0247344970703125,
0.016082763671875,
-0.0174407958984375,
0.0670166015625,
-0.04156494140625,
0.048004150390625,
-0.0450439453125,
0.01108551025390625,
-0.061859130859375,
-0.02587890625,
0.01194000244140625,
0.054962158203125,
0.0213623046875,
-0.058746337890625,
-0.0200653076171875,
0.03704833984375,
0.00832366943359375,
0.006900787353515625,
0.0190887451171875,
0.001953125,
0.001434326171875,
-0.004482269287109375,
0.007236480712890625,
-0.037628173828125,
0.01456451416015625,
-0.0252685546875,
-0.0574951171875,
-0.0196685791015625,
-0.03179931640625,
0.0281829833984375,
0.012298583984375,
-0.03643798828125,
-0.059326171875,
-0.040008544921875,
0.001251220703125,
0.03424072265625,
-0.0211639404296875,
0.01419830322265625,
-0.04705810546875,
-0.07708740234375,
0.0443115234375,
0.0194244384765625,
-0.0174713134765625,
-0.01241302490234375,
0.044281005859375,
0.0141448974609375,
-0.047637939453125,
-0.0281982421875,
-0.007198333740234375,
0.017547607421875,
-0.0282135009765625,
0.06884765625,
0.0176544189453125,
0.0012760162353515625,
0.058380126953125,
-0.025634765625,
-0.0265655517578125,
0.0018405914306640625,
0.037567138671875,
-0.005496978759765625,
-0.0184173583984375,
0.0007357597351074219,
-0.036346435546875,
0.034637451171875,
0.0175933837890625,
-0.0340576171875,
-0.02508544921875,
-0.05303955078125,
0.045379638671875,
-0.014373779296875,
0.07647705078125,
-0.0312347412109375,
-0.034271240234375,
0.012298583984375,
0.003864288330078125,
0.0482177734375,
0.025665283203125,
-0.0011768341064453125,
0.037261962890625,
0.0174713134765625,
0.006793975830078125,
0.0535888671875,
0.0285186767578125,
0.03863525390625,
0.03070068359375,
0.011962890625,
-0.004703521728515625,
-0.003814697265625,
-0.01007080078125,
0.06658935546875,
-0.003993988037109375,
-0.0198211669921875,
-0.029022216796875,
-0.0225677490234375,
0.004375457763671875,
0.0043182373046875,
0.004749298095703125,
0.0419921875,
0.0275115966796875,
-0.01702880859375,
-0.011138916015625,
-0.0177459716796875,
-0.00600433349609375,
-0.057220458984375,
0.00445556640625,
-0.00159454345703125,
-0.0090484619140625,
0.0009336471557617188,
0.07391357421875,
-0.0105438232421875,
0.04754638671875,
-0.01239013671875,
0.03387451171875,
0.02301025390625,
0.0287628173828125,
0.01276397705078125,
-0.026580810546875,
0.034637451171875,
-0.0197296142578125,
0.0204315185546875,
-0.02587890625,
-0.0235595703125,
0.04547119140625,
0.053985595703125,
-0.021514892578125,
-0.0006618499755859375,
-0.0010538101196289062,
-0.0177459716796875,
-0.03338623046875,
0.045318603515625,
0.0172271728515625,
-0.053680419921875,
-0.034515380859375,
0.0179595947265625,
0.022491455078125,
0.004184722900390625,
0.01313018798828125,
0.0159149169921875,
0.00945281982421875,
0.024749755859375,
-0.02703857421875,
0.001312255859375,
-0.0059967041015625,
-0.0034008026123046875,
0.016998291015625,
-0.038970947265625,
-0.00971221923828125,
-0.0226287841796875,
0.034332275390625,
-0.044464111328125,
-0.0272064208984375,
0.054779052734375,
0.00244140625,
0.09130859375,
-0.0465087890625,
-0.04388427734375,
0.00952911376953125,
-0.02001953125,
0.037689208984375,
0.0192108154296875,
-0.049530029296875,
0.0296783447265625,
-0.039703369140625,
0.024261474609375,
-0.01198577880859375,
-0.06396484375,
-0.03173828125,
-0.04638671875,
0.01050567626953125,
0.01042938232421875,
0.0215301513671875,
0.00096893310546875,
-0.02099609375,
0.01357269287109375,
0.0033626556396484375,
0.0175018310546875,
0.0008950233459472656,
0.09490966796875,
-0.01488494873046875,
0.06927490234375,
0.033782958984375,
0.046142578125,
-0.052734375,
-0.022918701171875,
0.00739288330078125,
-0.0312042236328125,
-0.044281005859375,
-0.0007524490356445312,
-0.03021240234375,
0.009857177734375,
0.02166748046875,
-0.0127410888671875,
0.017913818359375,
-0.0205230712890625,
-0.01001739501953125,
-0.0218353271484375,
0.006389617919921875,
-0.03173828125,
-0.031829833984375,
0.0206451416015625,
-0.0029201507568359375,
-0.0035724639892578125,
0.0075531005859375,
0.0255279541015625,
-0.0216827392578125,
0.00897216796875,
-0.0130767822265625,
-0.0018768310546875,
-0.05364990234375,
0.047271728515625,
0.1109619140625,
0.0330810546875,
0.0675048828125,
-0.0003826618194580078,
0.01056671142578125,
0.057403564453125,
0.0343017578125,
0.03619384765625,
-0.010894775390625,
0.06756591796875,
0.004364013671875,
0.005847930908203125,
0.0303955078125,
-0.018463134765625,
-0.007701873779296875,
0.0158233642578125,
0.044647216796875,
-0.04632568359375,
0.0143890380859375,
0.0271759033203125,
0.003387451171875,
0.00628662109375,
0.0015134811401367188,
-0.0266571044921875,
-0.0189971923828125,
0.04144287109375,
-0.0447998046875,
-0.018402099609375,
0.004528045654296875,
-0.004871368408203125,
0.00818634033203125,
-0.017181396484375,
0.06793212890625,
0.009307861328125,
-0.029571533203125,
-0.0022830963134765625,
-0.0095672607421875,
0.034423828125,
-0.0107269287109375,
0.0013589859008789062,
0.004974365234375,
-0.0194091796875,
-0.031524658203125,
0.0198974609375,
-0.043731689453125,
0.016204833984375,
-0.004863739013671875,
0.0037708282470703125,
0.014495849609375,
0.03460693359375,
-0.0105743408203125,
-0.0194854736328125,
0.006725311279296875,
-0.005615234375,
-0.01522064208984375,
-0.01210784912109375,
0.00543212890625,
-0.01251220703125,
-0.0205841064453125,
0.003955841064453125,
-0.0462646484375,
-0.0016279220581054688,
-0.0138702392578125,
-0.00348663330078125,
0.09051513671875,
-0.0433349609375,
-0.0216217041015625,
0.01898193359375,
0.02203369140625,
-0.00992584228515625,
-0.0005793571472167969,
0.001132965087890625,
-0.05157470703125,
-0.04437255859375,
0.00791168212890625,
-0.0491943359375,
-0.00246429443359375,
-0.031585693359375,
-0.05096435546875,
0.072021484375,
-0.0119781494140625,
0.025909423828125,
0.03521728515625,
0.0209197998046875,
-0.020263671875,
0.0043182373046875,
-0.043609619140625,
0.068603515625,
0.024566650390625,
0.0238800048828125,
-0.02105712890625,
-0.007030487060546875,
0.0226898193359375,
0.006237030029296875,
0.059783935546875,
0.0184173583984375,
-0.046722412109375,
-0.004970550537109375,
0.070068359375,
0.045013427734375,
0.0131072998046875,
0.033050537109375,
0.017730712890625,
0.03271484375,
0.05364990234375,
-0.043853759765625,
0.006641387939453125,
0.007808685302734375,
0.00528717041015625,
0.044677734375,
0.03375244140625,
0.02850341796875,
0.007488250732421875,
-0.02154541015625,
-0.067626953125,
0.02215576171875,
0.061492919921875,
-0.0255889892578125,
0.00482940673828125,
0.0210723876953125,
0.0171966552734375,
-0.05401611328125,
-0.028076171875,
-0.027313232421875,
0.0294189453125,
0.01373291015625,
0.004901885986328125,
0.03082275390625,
0.028411865234375,
0.05609130859375,
-0.0391845703125,
-0.00777435302734375,
-0.01277923583984375,
0.0209503173828125,
0.057525634765625,
0.036224365234375,
0.01552581787109375,
-0.046875,
-0.031951904296875,
0.06964111328125,
0.10089111328125,
-0.04705810546875,
-0.02020263671875,
0.00769805908203125,
0.003326416015625,
0.0186920166015625,
-0.019866943359375,
0.03594970703125,
-0.004146575927734375,
0.0065460205078125,
-0.00379180908203125,
-0.015167236328125,
0.0396728515625,
0.01666259765625,
0.005283355712890625,
-0.042510986328125,
-0.022491455078125,
0.006511688232421875,
-0.045196533203125,
0.0280303955078125,
0.021514892578125,
0.0308380126953125,
-0.0063018798828125,
0.0452880859375,
0.004131317138671875,
-0.00568389892578125,
0.023712158203125,
0.0152435302734375,
-0.0247955322265625,
-0.01367950439453125,
-0.0199432373046875,
-0.06170654296875,
0.00811767578125,
0.034912109375,
0.0496826171875,
0.01493072509765625,
0.017730712890625,
-0.01983642578125,
0.003025054931640625,
0.01467132568359375,
-0.017303466796875,
-0.0257415771484375,
0.038238525390625,
-0.02215576171875,
0.0008215904235839844,
-0.039794921875,
-0.041168212890625,
-0.0206298828125,
0.017425537109375,
-0.02081298828125,
-0.0232696533203125,
0.03631591796875,
-0.0006995201110839844,
0.005863189697265625,
0.043914794921875,
-0.0034847259521484375,
0.0341796875,
0.0027065277099609375,
-0.06884765625,
-0.010955810546875,
0.00963592529296875,
-0.05267333984375,
0.013031005859375,
0.04852294921875,
-0.0106048583984375,
-0.0123138427734375,
-0.009490966796875,
0.049041748046875,
0.03509521484375,
-0.047637939453125,
-0.0048828125,
0.039031982421875,
0.050689697265625,
0.041839599609375,
-0.0164947509765625,
-0.0106658935546875,
0.004547119140625,
0.03338623046875,
0.0186920166015625,
0.053558349609375,
-0.017059326171875,
0.021240234375,
-0.032989501953125,
0.0229339599609375,
-0.045379638671875,
-0.0282135009765625,
0.04473876953125,
0.0155181884765625,
0.0007643699645996094,
-0.0147857666015625,
-0.06109619140625,
0.052947998046875,
-0.0011110305786132812,
0.0236663818359375,
0.0094757080078125,
-0.00444793701171875,
0.0204620361328125,
0.041778564453125,
0.0269775390625,
-0.022003173828125,
-0.01453399658203125,
-0.025482177734375,
-0.0361328125,
0.03509521484375,
0.0303955078125,
0.0171356201171875,
0.03619384765625,
-0.01462554931640625,
-0.016632080078125,
0.022247314453125,
-0.037933349609375,
0.019378662109375,
0.0215606689453125,
0.01326751708984375,
-0.032562255859375,
0.00797271728515625,
-0.0168304443359375,
0.0121002197265625,
0.009124755859375,
0.0230712890625,
0.0020198822021484375,
-0.0263214111328125,
-0.00872802734375,
-0.0200347900390625,
0.0025806427001953125,
-0.005645751953125,
0.0006432533264160156,
-0.005252838134765625,
-0.00859832763671875,
0.009002685546875,
-0.050933837890625,
-0.01494598388671875,
-0.048126220703125,
0.0021877288818359375,
0.032470703125,
-0.0113372802734375,
0.00022304058074951172,
-0.0162200927734375,
-0.0166015625,
0.0127410888671875,
0.00794219970703125,
-0.032562255859375,
0.01313018798828125,
-0.027130126953125,
0.0030517578125,
-0.020233154296875,
0.01708984375,
-0.0205535888671875,
0.0071868896484375,
-0.052886962890625,
-0.01178741455078125,
-0.059539794921875,
0.0038299560546875,
-0.039642333984375,
0.034698486328125,
0.0543212890625,
-0.043792724609375,
-0.020477294921875,
0.011505126953125,
0.03302001953125,
0.059112548828125,
-0.00971221923828125,
-0.03326416015625,
0.028900146484375,
-0.013580322265625,
0.02227783203125,
-0.06292724609375,
-0.005504608154296875,
-0.04705810546875,
0.00017178058624267578,
0.0079498291015625,
-0.00988006591796875,
0.00324249267578125,
-0.0347900390625,
-0.036773681640625,
0.07232666015625,
-0.00421905517578125,
-0.020111083984375,
-0.05218505859375,
-0.0177459716796875,
-0.0147857666015625,
0.02398681640625,
-0.0036029815673828125,
-0.031951904296875,
-0.031585693359375,
0.03497314453125,
0.01204681396484375,
0.0253753662109375,
0.0102386474609375,
0.0274810791015625,
-0.007465362548828125,
0.0565185546875,
0.04473876953125,
0.0018520355224609375,
0.0236358642578125,
-0.0199737548828125,
0.049560546875,
0.0350341796875,
-0.038726806640625,
0.026611328125,
-0.0036602020263671875,
0.01025390625,
-0.0167083740234375,
-0.031982421875,
-0.0095367431640625,
0.0010004043579101562,
0.07012939453125,
0.031524658203125,
0.017242431640625,
-0.032196044921875,
0.02252197265625,
-0.0312042236328125,
-0.047027587890625,
-0.0189666748046875,
0.024139404296875,
-0.0711669921875,
-0.0237579345703125,
0.023956298828125,
-0.01425933837890625,
0.004581451416015625,
-0.0159912109375,
-0.0301055908203125,
0.001735687255859375,
0.0013933181762695312,
0.01482391357421875,
-0.022003173828125,
0.008697509765625,
0.056610107421875,
-0.057281494140625,
-0.0121002197265625,
0.002574920654296875,
0.01580810546875,
0.01218414306640625,
-0.050628662109375,
0.0382080078125,
0.035308837890625,
-0.0196380615234375,
-0.0196990966796875,
0.042022705078125,
0.0163726806640625,
0.0098114013671875,
-0.042144775390625,
-0.0203857421875,
0.04730224609375,
0.0013637542724609375,
0.0423583984375,
-0.0286865234375,
0.0347900390625,
0.0038204193115234375,
0.07989501953125,
-0.0046844482421875,
0.037017822265625,
0.01236724853515625,
0.0347900390625,
-0.0059814453125,
-0.006542205810546875,
-0.00261688232421875,
-0.030303955078125,
-0.0108642578125,
0.0066070556640625,
-0.0265960693359375,
-0.06829833984375,
0.01073455810546875,
-0.039337158203125,
0.00353240966796875,
0.0263519287109375
] |
d8c906fd06d5f08376dee919f7b9d62d76fd9368
|
Wordpress Stackexchange
Q: add_menu_page permissions - what am I doing wrong? I am running a fresh install of Wordpress 3.3.2 and the only plugin enabled is one I'm developing, but I can't seem to get past a permissions issue in add_menu_page. With the exception of using anonymous functions instead of named functions, I'm following the documentation almost exactly.
My plugin source:
<?php
/*
Plugin Name: Some Plugin
*/
add_action('admin_init', function() {
add_menu_page('Some Page', 'Some Page', 'manage_options', 'some-slug', function() {
echo 'Hello, world!';
});
});
?>
The menu link shows up fine at the bottom of the menu, but instead of "Hello, world!", I see:
You do not have sufficient permissions to access this page.
I've also tried using the administrator capability in place of manage_options, but have the same results.
What am I doing wrong?
A: You want the admin_menu hook, rather than admin_init.
Also, you shouldn't use anonymous functions. Instead, use:
function wpse51004_add_menu_page() {
add_menu_page('Some Page', 'Some Page', 'manage_options', 'some-slug', 'wpse51004_some_page_callback');
};
add_action('admin_menu', 'wpse51004_add_menu_page');
function wpse51004_some_page_callback() {
echo 'Hello, world!';
}
|
Q: add_menu_page permissions - what am I doing wrong? I am running a fresh install of Wordpress 3.3.2 and the only plugin enabled is one I'm developing, but I can't seem to get past a permissions issue in add_menu_page. With the exception of using anonymous functions instead of named functions, I'm following the documentation almost exactly.
My plugin source:
<?php
/*
Plugin Name: Some Plugin
*/
add_action('admin_init', function() {
add_menu_page('Some Page', 'Some Page', 'manage_options', 'some-slug', function() {
echo 'Hello, world!';
});
});
?>
The menu link shows up fine at the bottom of the menu, but instead of "Hello, world!", I see:
You do not have sufficient permissions to access this page.
I've also tried using the administrator capability in place of manage_options, but have the same results.
What am I doing wrong?
A: You want the admin_menu hook, rather than admin_init.
Also, you shouldn't use anonymous functions. Instead, use:
function wpse51004_add_menu_page() {
add_menu_page('Some Page', 'Some Page', 'manage_options', 'some-slug', 'wpse51004_some_page_callback');
};
add_action('admin_menu', 'wpse51004_add_menu_page');
function wpse51004_some_page_callback() {
echo 'Hello, world!';
}
A: You have to use admin_menu rather than admin_init, that's why you are getting error.
my_plugin_add_menu_page(){
add_menu_page('Some Page', 'Some Page', 'manage_options', 'some-slug', 'my_plugin_some_page_callback');
}
add_action('admin_menu', 'my_plugin_some_page_callback');
function my_plugin_some_page_callback() {
echo 'Hello, world!';
}
You can also use anonymous function but organize your functions name is more cleaner way.
|
wordpress
|
{
"language": "en",
"length": 218,
"provenance": "stackexchange_00019.jsonl.gz:419644",
"question_score": "5",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51004"
}
|
[
0.0704345703125,
0.01114654541015625,
-0.004596710205078125,
-0.0263214111328125,
0.0279541015625,
-0.034576416015625,
0.03399658203125,
-0.0357666015625,
0.0083465576171875,
-0.00658416748046875,
-0.0302734375,
0.01030731201171875,
-0.00909423828125,
-0.031341552734375,
0.016082763671875,
-0.020721435546875,
0.0249481201171875,
0.0243988037109375,
0.04583740234375,
0.005489349365234375,
0.007320404052734375,
0.0208740234375,
0.00302886962890625,
0.0309906005859375,
0.0504150390625,
-0.0565185546875,
0.0245361328125,
0.00464630126953125,
0.0132293701171875,
-0.006809234619140625,
0.0236663818359375,
-0.0240020751953125,
0.0078125,
0.020050048828125,
-0.006664276123046875,
-0.012725830078125,
0.0160675048828125,
0.01557159423828125,
-0.006557464599609375,
0.02349853515625,
0.03173828125,
-0.005828857421875,
0.00518798828125,
0.05810546875,
-0.007389068603515625,
-0.08685302734375,
0.073974609375,
-0.0290374755859375,
-0.01177215576171875,
-0.0113525390625,
0.0277252197265625,
-0.0209197998046875,
0.0131683349609375,
0.020477294921875,
-0.0009350776672363281,
0.0216064453125,
-0.0178070068359375,
0.00937652587890625,
0.00984954833984375,
0.0199737548828125,
-0.00940704345703125,
0.015411376953125,
-0.0016689300537109375,
-0.0210113525390625,
0.01279449462890625,
0.003932952880859375,
0.0308074951171875,
0.007843017578125,
-0.035980224609375,
0.038909912109375,
0.03179931640625,
-0.0304412841796875,
0.007274627685546875,
0.0281982421875,
-0.0335693359375,
-0.0310821533203125,
-0.0011281967163085938,
-0.01114654541015625,
0.050506591796875,
0.0106353759765625,
0.0127105712890625,
-0.0121612548828125,
-0.027679443359375,
0.01036834716796875,
-0.022369384765625,
0.00684356689453125,
-0.0033512115478515625,
-0.01212310791015625,
-0.00836944580078125,
-0.00514984130859375,
-0.0291595458984375,
-0.0197601318359375,
0.045257568359375,
-0.0012187957763671875,
-0.0374755859375,
-0.01084136962890625,
0.03594970703125,
0.0833740234375,
0.038787841796875,
0.038360595703125,
0.0189056396484375,
-0.05084228515625,
0.01593017578125,
-0.051025390625,
0.002925872802734375,
0.05792236328125,
-0.0038051605224609375,
-0.0321044921875,
0.0093536376953125,
0.006015777587890625,
-0.003810882568359375,
-0.007244110107421875,
0.0197906494140625,
-0.01983642578125,
0.02996826171875,
-0.0093994140625,
-0.03997802734375,
0.03924560546875,
0.005985260009765625,
-0.01079559326171875,
-0.016876220703125,
-0.0191650390625,
0.017669677734375,
0.01056671142578125,
-0.00024056434631347656,
-0.01995849609375,
-0.0277557373046875,
0.005367279052734375,
0.0294036865234375,
0.00782012939453125,
-0.0250396728515625,
0.010406494140625,
0.0316162109375,
0.01541900634765625,
0.0037097930908203125,
-0.0139007568359375,
0.0169525146484375,
-0.034027099609375,
-0.008148193359375,
0.0211944580078125,
-0.0171356201171875,
-0.0233612060546875,
0.006595611572265625,
-0.0173187255859375,
-0.003467559814453125,
0.0000972747802734375,
0.002777099609375,
0.0224609375,
0.0164947509765625,
-0.023712158203125,
0.014129638671875,
-0.05438232421875,
0.03448486328125,
-0.003143310546875,
-0.0281524658203125,
0.008636474609375,
-0.028533935546875,
-0.003238677978515625,
-0.0214691162109375,
-0.021697998046875,
-0.008148193359375,
-0.0117340087890625,
0.01053619384765625,
-0.053741455078125,
-0.035369873046875,
-0.026336669921875,
-0.040313720703125,
0.005344390869140625,
0.01090240478515625,
0.01018524169921875,
0.026397705078125,
-0.0298919677734375,
-0.0287933349609375,
0.0163726806640625,
0.014923095703125,
0.0355224609375,
0.016632080078125,
0.019866943359375,
0.0096588134765625,
0.0219268798828125,
-0.006290435791015625,
-0.030609130859375,
0.0601806640625,
-0.031494140625,
-0.08636474609375,
0.03582763671875,
0.01184844970703125,
0.0345458984375,
0.032989501953125,
-0.01015472412109375,
0.08477783203125,
0.004619598388671875,
0.010528564453125,
-0.018707275390625,
0.0025615692138671875,
-0.0372314453125,
0.01526641845703125,
-0.01041412353515625,
-0.004955291748046875,
0.01195526123046875,
0.0028591156005859375,
0.017578125,
-0.01202392578125,
0.054168701171875,
-0.0116119384765625,
0.0303192138671875,
-0.01555633544921875,
0.011474609375,
0.0386962890625,
0.0024967193603515625,
-0.0190582275390625,
-0.0190582275390625,
0.0146484375,
-0.061492919921875,
-0.06500244140625,
-0.005481719970703125,
-0.04052734375,
0.05413818359375,
-0.00677490234375,
0.038055419921875,
0.015899658203125,
-0.0673828125,
0.01393890380859375,
0.0054779052734375,
0.0239410400390625,
0.0176849365234375,
-0.041107177734375,
-0.00023734569549560547,
-0.00719451904296875,
-0.00433349609375,
0.0016164779663085938,
0.0789794921875,
0.003124237060546875,
0.037139892578125,
-0.01560211181640625,
-0.0133819580078125,
-0.036041259765625,
-0.06695556640625,
0.01221466064453125,
0.0494384765625,
0.062744140625,
0.01568603515625,
0.017608642578125,
-0.0225067138671875,
0.049102783203125,
-0.07855224609375,
-0.0031223297119140625,
-0.0214080810546875,
-0.0330810546875,
0.01004791259765625,
0.048553466796875,
0.05328369140625,
0.00377655029296875,
0.01483154296875,
-0.004520416259765625,
0.0303497314453125,
-0.047760009765625,
-0.037811279296875,
-0.004787445068359375,
-0.01129150390625,
0.01605224609375,
-0.064453125,
-0.003108978271484375,
-0.0201263427734375,
-0.04022216796875,
-0.007843017578125,
-0.014007568359375,
-0.00103759765625,
0.0020084381103515625,
-0.0306396484375,
0.041748046875,
0.01261138916015625,
-0.01776123046875,
0.00960540771484375,
0.031951904296875,
-0.04620361328125,
-0.052459716796875,
0.0284881591796875,
-0.0252227783203125,
-0.0130462646484375,
0.0029354095458984375,
0.05224609375,
-0.038909912109375,
-0.02813720703125,
-0.00848388671875,
-0.040435791015625,
-0.0338134765625,
-0.003543853759765625,
0.016204833984375,
-0.01090240478515625,
0.03033447265625,
-0.01450347900390625,
-0.044647216796875,
0.044158935546875,
-0.01702880859375,
-0.0345458984375,
0.048492431640625,
0.01284027099609375,
-0.0026912689208984375,
-0.0128173828125,
0.05682373046875,
0.0229949951171875,
-0.038116455078125,
0.003643035888671875,
0.0017385482788085938,
-0.02545166015625,
-0.026763916015625,
0.0386962890625,
0.01519775390625,
-0.034698486328125,
-0.006805419921875,
0.058349609375,
0.006649017333984375,
0.0322265625,
-0.02093505859375,
-0.0528564453125,
-0.01226043701171875,
0.0010137557983398438,
-0.07916259765625,
-0.059814453125,
0.01059722900390625,
-0.061370849609375,
-0.000013232231140136719,
0.00274658203125,
-0.052886962890625,
-0.0169525146484375,
0.047393798828125,
0.007171630859375,
-0.0247344970703125,
0.003231048583984375,
-0.035980224609375,
-0.03472900390625,
-0.059173583984375,
-0.0260772705078125,
-0.01129913330078125,
0.00429534912109375,
0.00005257129669189453,
0.051361083984375,
-0.005584716796875,
-0.055572509765625,
-0.007904052734375,
-0.0237884521484375,
-0.0201873779296875,
0.02069091796875,
0.0094451904296875,
0.0171356201171875,
0.016387939453125,
0.0210723876953125,
-0.0013341903686523438,
0.0227508544921875,
-0.019134521484375,
-0.043609619140625,
-0.033935546875,
0.0154266357421875,
0.011993408203125,
0.01328277587890625,
0.03436279296875,
0.0028438568115234375,
0.0033245086669921875,
-0.037994384765625,
-0.01983642578125,
0.0038509368896484375,
-0.044525146484375,
0.01788330078125,
0.0010967254638671875,
-0.0027790069580078125,
0.0181732177734375,
0.0296783447265625,
0.01248931884765625,
0.042266845703125,
0.0209197998046875,
0.023101806640625,
-0.01120758056640625,
-0.03704833984375,
-0.0382080078125,
-0.019927978515625,
0.0098419189453125,
0.0103607177734375,
-0.03533935546875,
0.003559112548828125,
0.051239013671875,
0.0269317626953125,
0.0033893585205078125,
0.0023670196533203125,
-0.01280975341796875,
0.02874755859375,
-0.03436279296875,
0.023223876953125,
-0.029693603515625,
-0.0164642333984375,
-0.0133209228515625,
0.0635986328125,
-0.0347900390625,
-0.025543212890625,
0.00698089599609375,
0.0296630859375,
-0.0091400146484375,
-0.06298828125,
0.007061004638671875,
-0.0250244140625,
-0.035186767578125,
0.0098724365234375,
-0.01922607421875,
0.007038116455078125,
-0.033233642578125,
0.01029205322265625,
-0.0281219482421875,
-0.03411865234375,
0.041595458984375,
-0.040069580078125,
-0.0089111328125,
0.030120849609375,
-0.0272979736328125,
-0.0129547119140625,
-0.04156494140625,
-0.001220703125,
-0.155029296875,
-0.02960205078125,
-0.0296478271484375,
0.10675048828125,
-0.005435943603515625,
0.00600433349609375,
-0.03192138671875,
0.0723876953125,
0.0291748046875,
0.003658294677734375,
0.0384521484375,
0.01519012451171875,
-0.0030193328857421875,
-0.033782958984375,
0.01207733154296875,
-0.04705810546875,
0.0233612060546875,
0.0225067138671875,
-0.0382080078125,
0.017974853515625,
-0.031463623046875,
-0.005619049072265625,
0.01322174072265625,
-0.058685302734375,
-0.050933837890625,
-0.02001953125,
0.03143310546875,
0.0180206298828125,
0.01282501220703125,
0.01111602783203125,
-0.033935546875,
-0.051605224609375,
-0.031494140625,
-0.06072998046875,
0.004810333251953125,
0.02349853515625,
0.00970458984375,
0.0212860107421875,
0.006473541259765625,
0.037261962890625,
0.0095672607421875,
0.018402099609375,
-0.023223876953125,
0.04217529296875,
0.01430511474609375,
-0.006313323974609375,
0.03436279296875,
-0.016387939453125,
0.0187225341796875,
-0.02935791015625,
0.050537109375,
-0.00223541259765625,
-0.013580322265625,
0.0174560546875,
-0.002925872802734375,
-0.011871337890625,
0.01531982421875,
-0.00921630859375,
-0.016357421875,
-0.02508544921875,
0.039154052734375,
0.003688812255859375,
0.021026611328125,
-0.040435791015625,
-0.050384521484375,
0.01316070556640625,
-0.0338134765625,
0.044403076171875,
0.00885772705078125,
-0.0106048583984375,
0.03656005859375,
-0.01568603515625,
-0.007396697998046875,
-0.0110931396484375,
0.0440673828125,
-0.013427734375,
0.04425048828125,
-0.01383209228515625,
-0.01125335693359375,
-0.03314208984375,
0.01413726806640625,
0.0217742919921875,
0.006649017333984375,
-0.01540374755859375,
-0.055328369140625,
0.004711151123046875,
0.042144775390625,
-0.00791168212890625,
0.007415771484375,
0.024627685546875,
0.007610321044921875,
-0.0179290771484375,
-0.0130157470703125,
0.00867462158203125,
0.00458526611328125,
-0.0233154296875,
0.050994873046875,
-0.01116180419921875,
0.01824951171875,
0.00884246826171875,
0.0192413330078125,
0.006023406982421875,
0.013885498046875,
-0.0055999755859375,
-0.004970550537109375,
-0.007598876953125,
0.0159454345703125,
0.0216522216796875,
0.003963470458984375,
0.0000286102294921875,
-0.005275726318359375,
0.04461669921875,
-0.020965576171875,
0.0055084228515625,
0.028564453125,
0.019256591796875,
-0.006153106689453125,
-0.01324462890625,
0.009796142578125,
0.007602691650390625,
-0.01031494140625,
0.026885986328125,
-0.0092620849609375,
-0.061859130859375,
-0.0191497802734375,
0.025360107421875,
0.03607177734375,
-0.030059814453125,
0.0089263916015625,
0.031829833984375,
0.03741455078125,
0.05010986328125,
0.003948211669921875,
-0.00921630859375,
0.013702392578125,
0.00335693359375,
0.0185394287109375,
-0.0274200439453125,
-0.01483154296875,
-0.042755126953125,
-0.0122222900390625,
-0.0140228271484375,
0.002593994140625,
0.037567138671875,
-0.0187530517578125,
0.0523681640625,
-0.037353515625,
-0.0262298583984375,
-0.01226043701171875,
-0.00833892822265625,
0.06988525390625,
0.0440673828125,
-0.014923095703125,
0.0174407958984375,
-0.0032176971435546875,
-0.028350830078125,
-0.004528045654296875,
-0.010772705078125,
-0.048797607421875,
-0.041534423828125,
-0.0027294158935546875,
0.0102996826171875,
0.01092529296875,
0.02325439453125,
-0.01232147216796875,
0.028076171875,
0.01218414306640625,
0.059906005859375,
-0.028350830078125,
0.069091796875,
0.0175628662109375,
0.033538818359375,
0.003963470458984375,
0.0254058837890625,
-0.00417327880859375,
-0.005832672119140625,
0.0290985107421875,
0.003818511962890625,
-0.0281219482421875,
-0.039398193359375,
-0.0279388427734375,
-0.00908660888671875,
0.0726318359375,
-0.0216064453125,
0.0108489990234375,
-0.00412750244140625,
0.009124755859375,
-0.0097198486328125,
0.0210418701171875,
0.0074462890625,
-0.05145263671875,
0.08544921875,
-0.05694580078125,
0.014923095703125,
0.01323699951171875,
0.0416259765625,
0.035736083984375,
-0.06402587890625,
0.0291748046875,
0.042205810546875,
-0.07232666015625,
0.07513427734375,
0.0994873046875,
-0.01114654541015625,
0.0298614501953125,
-0.0083465576171875,
-0.02618408203125,
0.0114288330078125,
0.00001811981201171875,
0.0018367767333984375,
0.003185272216796875,
0.050262451171875,
0.01018524169921875,
-0.0052032470703125,
0.039642333984375,
-0.0222015380859375,
0.061737060546875,
0.056732177734375,
0.057891845703125,
-0.08746337890625,
0.0205535888671875,
0.006282806396484375,
-0.051788330078125,
0.04217529296875,
-0.0125885009765625,
-0.0125579833984375,
-0.045867919921875,
0.07354736328125,
-0.037689208984375,
0.0047149658203125,
0.0287322998046875,
-0.0302276611328125,
-0.022735595703125,
0.01849365234375,
-0.01971435546875,
0.005344390869140625,
0.052764892578125,
-0.0032253265380859375,
-0.05364990234375,
0.048248291015625,
0.0304107666015625,
-0.004795074462890625,
-0.00640106201171875,
-0.038665771484375,
-0.01166534423828125,
0.00325775146484375,
-0.049896240234375,
-0.014129638671875,
0.0133056640625,
0.014404296875,
-0.0032100677490234375,
0.06463623046875,
-0.043365478515625,
0.06829833984375,
0.01230621337890625,
0.0037670135498046875,
0.0024013519287109375,
-0.032806396484375,
0.0231781005859375,
0.02392578125,
-0.02679443359375,
0.01468658447265625,
0.00624847412109375,
-0.038726806640625,
0.0007653236389160156,
0.0031585693359375,
0.0753173828125,
-0.027069091796875,
-0.029876708984375,
0.0120086669921875,
-0.005313873291015625,
0.0020122528076171875,
0.01261138916015625,
0.04425048828125,
-0.0287322998046875,
0.006778717041015625,
0.02001953125,
0.0161285400390625,
-0.0035552978515625,
0.032806396484375,
-0.048614501953125,
0.114501953125,
-0.027099609375,
0.0012464523315429688,
0.01474761962890625,
0.05059814453125,
-0.0220489501953125,
0.038665771484375,
-0.07440185546875,
0.0748291015625,
0.0264892578125,
0.0406494140625,
-0.049285888671875,
0.016021728515625,
-0.0198974609375,
-0.01395416259765625,
0.0305023193359375,
0.014801025390625,
-0.028533935546875,
-0.00506591796875,
0.0182647705078125,
-0.0128326416015625,
-0.02178955078125,
0.055816650390625,
0.00289154052734375,
-0.0290985107421875,
0.004329681396484375,
-0.02911376953125,
0.04241943359375,
-0.09613037109375,
0.005199432373046875,
-0.01364898681640625,
-0.034698486328125,
-0.045074462890625,
-0.0165252685546875,
0.01280975341796875,
-0.0295562744140625,
-0.01421356201171875,
-0.0010461807250976562,
-0.009368896484375,
-0.040008544921875,
0.0161285400390625,
-0.0204010009765625,
0.0217742919921875,
0.0026149749755859375,
-0.0182342529296875,
0.023345947265625,
0.00362396240234375,
0.0004837512969970703,
-0.0216217041015625,
0.01556396484375,
-0.05316162109375,
-0.0517578125,
-0.0266265869140625,
0.0157928466796875,
-0.037261962890625,
0.061767578125,
0.03076171875,
0.0260467529296875,
-0.0283203125,
-0.00960540771484375,
0.00623321533203125,
0.06298828125,
-0.043060302734375,
-0.031402587890625,
0.0025310516357421875,
0.0215606689453125,
0.0194091796875,
0.01806640625,
0.036529541015625,
0.05694580078125,
0.094970703125,
-0.05078125,
-0.0007662773132324219,
0.0181732177734375,
0.0137786865234375,
-0.0157470703125,
0.0000247955322265625,
-0.00910186767578125,
0.00652313232421875,
-0.0300445556640625,
-0.0007586479187011719,
0.018218994140625,
0.028411865234375,
0.01401519775390625,
0.031524658203125,
0.0125274658203125,
-0.0088348388671875,
-0.007640838623046875,
0.0301513671875,
-0.039398193359375,
0.024322509765625,
-0.05859375,
-0.0689697265625,
0.0031890869140625,
0.048004150390625,
-0.0170440673828125,
0.033172607421875,
0.0010347366333007812,
-0.0189666748046875,
0.002819061279296875,
0.0005784034729003906,
0.0269317626953125,
-0.0292205810546875,
-0.05584716796875,
-0.01910400390625,
-0.0192413330078125,
0.004978179931640625,
0.01316070556640625,
0.01788330078125,
0.047332763671875,
-0.01056671142578125,
-0.012420654296875,
-0.0166015625,
0.001979827880859375,
-0.041290283203125,
0.039276123046875,
-0.007274627685546875,
0.050201416015625,
-0.0037059783935546875,
-0.0689697265625,
-0.015899658203125,
-0.0147705078125,
-0.0484619140625,
0.028106689453125,
0.048736572265625,
-0.013031005859375,
0.00693511962890625,
-0.00542449951171875,
-0.004238128662109375,
-0.0004565715789794922,
0.00786590576171875,
-0.0163116455078125,
-0.014801025390625,
0.037872314453125,
-0.009979248046875,
-0.015960693359375,
-0.0036602020263671875,
-0.016204833984375,
0.044891357421875,
0.01000213623046875,
0.0631103515625,
-0.0257415771484375,
0.01397705078125,
-0.02392578125,
0.0087127685546875,
-0.0266265869140625,
-0.0176849365234375,
0.0021495819091796875,
0.0078125,
-0.0009150505065917969,
-0.00214385986328125,
-0.031463623046875,
0.03265380859375,
0.027191162109375,
0.0182952880859375,
-0.0014638900756835938,
0.0066680908203125,
0.026885986328125,
0.01021575927734375,
0.040008544921875,
-0.0193634033203125,
-0.006099700927734375,
-0.0335693359375,
-0.031402587890625,
0.0307464599609375,
0.03936767578125,
0.006053924560546875,
0.0211944580078125,
-0.01436614990234375,
-0.007480621337890625,
-0.0220489501953125,
0.02001953125,
-0.0504150390625,
0.01361846923828125,
0.00594329833984375,
0.009429931640625,
0.0284423828125,
-0.01323699951171875,
0.0163421630859375,
0.00693511962890625,
0.02642822265625,
0.006946563720703125,
-0.019012451171875,
0.0266876220703125,
-0.0217742919921875,
0.004901885986328125,
-0.053436279296875,
-0.0193023681640625,
0.01317596435546875,
0.0133819580078125,
-0.006519317626953125,
-0.0322265625,
-0.0496826171875,
-0.059600830078125,
0.00946807861328125,
0.026702880859375,
-0.030303955078125,
-0.033538818359375,
-0.0721435546875,
0.0355224609375,
0.0438232421875,
0.0188140869140625,
-0.088623046875,
0.04620361328125,
-0.018280029296875,
0.0758056640625,
-0.00844573974609375,
0.037567138671875,
0.00495147705078125,
0.029815673828125,
-0.031341552734375,
0.0098876953125,
0.00923919677734375,
0.01308441162109375,
0.026947021484375,
0.0256195068359375,
0.032867431640625,
-0.03338623046875,
-0.0169219970703125,
0.0401611328125,
0.018585205078125,
0.06732177734375,
0.01303863525390625,
-0.0073699951171875,
0.0196990966796875,
-0.0258331298828125,
-0.037139892578125,
0.0024547576904296875,
0.0445556640625,
-0.0487060546875,
-0.0552978515625,
-0.003818511962890625,
-0.00922393798828125,
-0.01032257080078125,
-0.04693603515625,
-0.054473876953125,
0.0229644775390625,
0.006420135498046875,
-0.03619384765625,
-0.00397491455078125,
0.00112152099609375,
-0.0179290771484375,
0.028839111328125,
-0.01329803466796875,
0.00630950927734375,
-0.0030384063720703125,
0.01324462890625,
0.03570556640625,
0.024383544921875,
0.018646240234375,
0.035552978515625,
-0.046844482421875,
0.028167724609375,
-0.008636474609375,
0.002197265625,
0.0167236328125,
-0.009185791015625,
0.02642822265625,
0.037567138671875,
-0.027862548828125,
-0.035430908203125,
-0.01155853271484375,
-0.0232391357421875,
-0.0225677490234375,
0.004482269287109375,
-0.005374908447265625,
0.01055145263671875,
0.07940673828125,
0.045440673828125,
0.004039764404296875,
-0.036590576171875,
-0.03082275390625,
-0.0438232421875,
-0.00023436546325683594,
-0.022369384765625,
0.021331787109375,
-0.08441162109375,
-0.00606536865234375,
0.01270294189453125,
-0.0218048095703125,
-0.0258331298828125,
0.04168701171875,
-0.01092529296875,
-0.010009765625,
0.02093505859375,
-0.0287322998046875,
-0.0205230712890625,
-0.0296783447265625,
0.094482421875,
-0.058349609375,
-0.0408935546875,
0.0258636474609375,
0.025787353515625,
-0.002685546875,
-0.031707763671875,
-0.0041656494140625,
0.031219482421875,
-0.030731201171875,
0.006011962890625,
0.0094146728515625,
0.06304931640625,
-0.0325927734375,
0.01108551025390625,
0.01300048828125,
0.045135498046875,
-0.0023193359375,
0.0758056640625,
-0.006618499755859375,
0.0594482421875,
0.004016876220703125,
-0.007587432861328125,
-0.01025390625,
0.0236053466796875,
-0.0200958251953125,
0.0256500244140625,
0.0159759521484375,
-0.015899658203125,
0.0606689453125,
-0.027130126953125,
-0.005870819091796875,
-0.006317138671875,
-0.023651123046875,
-0.055633544921875,
0.039031982421875,
0.00836181640625,
-0.013336181640625,
0.0237274169921875
] |
e67bd3b813360821332738af75d7ec21485fd632
|
Wordpress Stackexchange
Q: Add header and footer to WP backend I want to add a header in the backstage in order to look more blend in like the frontend. Nothing much I want to add, just the header and footer is enough. The content section remains the original style.
But I can't find an appropriate hook to this area. I tried to add get_header(); into admin-header.php and it works. However, I don't want to mess up with wp core files, so is there any way to add the files?
UPDATE
After months of resarching, I finally gave up this thought that adding frontend header and footer to the backend. Instead, I just use the frontend pages to become the user dashboard. Although, this involved a lot of work (I do it manually, not by a plugin), but it is more flexible.
However, still thanks for the advices/suggestion.
A: The in_admin_header action may be used to insert content before <div id="wpbody"> in the wordpress backend.
See Line 101 of /wp-admin/admin-header.php (line number as of version 3.3.2)
Further reading on actions: Action Reference, codex
|
Q: Add header and footer to WP backend I want to add a header in the backstage in order to look more blend in like the frontend. Nothing much I want to add, just the header and footer is enough. The content section remains the original style.
But I can't find an appropriate hook to this area. I tried to add get_header(); into admin-header.php and it works. However, I don't want to mess up with wp core files, so is there any way to add the files?
UPDATE
After months of resarching, I finally gave up this thought that adding frontend header and footer to the backend. Instead, I just use the frontend pages to become the user dashboard. Although, this involved a lot of work (I do it manually, not by a plugin), but it is more flexible.
However, still thanks for the advices/suggestion.
A: The in_admin_header action may be used to insert content before <div id="wpbody"> in the wordpress backend.
See Line 101 of /wp-admin/admin-header.php (line number as of version 3.3.2)
Further reading on actions: Action Reference, codex
A: I know this might seem crazy but using iframes of the header and footer and add to functions.php or create a plugin:
function frontheader() {
echo 'IFRAME';
}
add_action('admin_head', 'frontheader');
function frontfooter() {
echo 'IFRAME';
}
add_action('admin_footer', 'frontfooter');
A: Something that gets in the way of the header/footer concept is the left-side Admin Menu.
But with Ozh' Admin Drop Down Menu help, and its companion Admin Menus Fixed, it's possible to get the menu in another position and insert our custom upper and lower HTML.
click to enlarge ⤴
add_action( 'in_admin_header', 'insert_header_wpse_51023' );
add_action( 'admin_footer', 'insert_footer_wpse_51023' );
add_filter( 'admin_print_styles', 'footer_hide_wpse_51023' );
function insert_header_wpse_51023()
{
echo '<div style="width:100%"><img src="http://example.com/header.jpg" width="100%" /></div>';
}
function insert_footer_wpse_51023()
{
echo '<div style="width:100%"><img src="http://example.com/footer.png" width="100%" /></div>';
}
function footer_hide_wpse_51023()
{
echo '<style type="text/css">#wpfooter { display: none; }</style>';
}
A: From your description the part you'd like to wrap is probably div of wpwrap class. However there are no fitting hooks outside it, as well as you will need to do something with toolbar and so on.
WordPress admin side is considered (so far) very inflexible and hard to deeply customize, comparing to front end. It might make more sense to work with CSS styling and existing elements of it, rather than trying to introduce major new elements.
A: Are you trying to make the backend look for like the frontend so that when users access their profile?
Otherwise, what is the reason you want the header and footer in the backend?
If you want to give user access to their profile, you can use http://wordpress.org/extend/plugins/user-meta/ to make a front end profile / dashboard that has the header and footer.
There are also several functions and plugins that can off un-needed profile fields.
A: Add this to function.php
add_action( 'admin_head', 'insert_header_wpse_51023' );
function insert_header_wpse_51023()
{
echo ' <div class="header">
content for your header
</div>';
}
A: I know this is old topic but it may help someone else who need this.
Inside functions.php add following:
add_action( 'in_admin_header', 'my_header' );
function my_header()
{
if ( current_user_can( 'subscriber' ) ) { // If user is subscriber, remove the IF statement for all users.
include('../wp-content/themes/YOUR_TEMPLATE_NAME/header.php'); // Adding header.php
echo '<style>body {background: #fff;}</style>'; // Adding some styles, .css file can also be added here.
}
}
A: If someone still needs to add the frontend header and footer to the backend, maybe this can help:
add_action( 'in_admin_header',function(){
remove_all_actions( 'admin_notices' );
?>
<style id="admin-in-header-css">
html{
margin:0 !important
}
#wpadminbar,
#adminmenumain,
#wpfooter,
#footer-upgrade+div,
#footer-left,
#footer-upgrade{
display: none !important;
}
#wpcontent, #wpfooter {
margin-left: 0;
margin-right: 0;
padding-left: 0;
padding-right: 0;
}
</style>
<?php
ob_start();
get_header();
if( class_exists( 'WPBMap' ) ){
WPBMap::addAllMappedShortcodes(); //Just in case you hvve WPBakery page builder
}
$frontend_header = ob_get_clean();
echo do_shortcode( str_replace( '<html','<div',str_replace( '<body','<div',$frontend_header ) ) );
?>
<style id="admin-after-head-css">
html{
margin:0 !important
}
</style>
<?php
} );
add_action( 'in_admin_footer',function(){
add_filter( 'admin_footer_text','__return_empty_string' );
add_filter( 'update_footer','__return_empty_string' );
ob_start();
get_footer();
if( class_exists( 'WPBMap' ) ){
WPBMap::addAllMappedShortcodes(); //Just in case you have WPBakery pagebuilder
}
$frontend_footer = ob_get_clean();
echo do_shortcode( str_replace( '</html>','',str_replace( '</body>','</div>',$frontend_footer ) ) );
} );
It's not possible to do it in a clean way because we are trying to do something a little dirty here, but I think this is a good compromise between dirtiness and the goal we want to reach.
All that we can remove via PHP we remove it via PHP, the rest will be hidden with some dirty CSS.
I've assigned two times a zero top margin to the HTML element because the first time it has to be parsed just before the first rendering, and the second time it has to override the margin added by the core that arrives later during the rendering. If you add it only one time you will see a layout shift during the rendering.
I replaced <body,<html,, and to prevent double opening and closing tags (added by the core and the theme).
As said, this is a dirty solution, but it should work with most themes.
|
wordpress
|
{
"language": "en",
"length": 840,
"provenance": "stackexchange_00019.jsonl.gz:419650",
"question_score": "6",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51023"
}
|
[
0.040740966796875,
0.021575927734375,
-0.04608154296875,
-0.04107666015625,
0.0285186767578125,
-0.039398193359375,
-0.01006317138671875,
-0.02520751953125,
-0.0452880859375,
0.039215087890625,
0.00489044189453125,
0.004261016845703125,
0.0310211181640625,
-0.0116424560546875,
0.0136871337890625,
-0.029541015625,
0.04144287109375,
-0.0098724365234375,
0.07257080078125,
0.0282745361328125,
-0.00412750244140625,
0.045257568359375,
0.055023193359375,
-0.03564453125,
0.0258331298828125,
-0.031585693359375,
0.033721923828125,
-0.01568603515625,
0.03167724609375,
0.0013561248779296875,
0.019622802734375,
-0.0309295654296875,
0.017486572265625,
0.0217742919921875,
-0.0261383056640625,
0.0035457611083984375,
0.014007568359375,
0.0029659271240234375,
0.0081634521484375,
0.0229644775390625,
0.03265380859375,
-0.0163726806640625,
0.0310516357421875,
0.050079345703125,
0.013031005859375,
-0.0477294921875,
0.049285888671875,
-0.052764892578125,
0.0140533447265625,
-0.00396728515625,
-0.0269012451171875,
0.0019483566284179688,
-0.0115203857421875,
-0.0269927978515625,
0.004077911376953125,
0.0013704299926757812,
-0.0003418922424316406,
-0.0069732666015625,
0.039276123046875,
-0.0164794921875,
-0.033843994140625,
-0.04034423828125,
0.0202484130859375,
-0.023468017578125,
-0.010101318359375,
-0.01044464111328125,
-0.00548553466796875,
0.00853729248046875,
-0.00926971435546875,
-0.008209228515625,
0.0173492431640625,
-0.006397247314453125,
0.0004630088806152344,
0.015045166015625,
-0.0161590576171875,
-0.043609619140625,
0.0246429443359375,
-0.0095062255859375,
0.007183074951171875,
0.0116424560546875,
-0.017333984375,
0.01873779296875,
-0.033538818359375,
-0.048980712890625,
0.0185394287109375,
-0.018707275390625,
-0.01485443115234375,
0.0010480880737304688,
-0.03668212890625,
-0.00827789306640625,
-0.03973388671875,
-0.055755615234375,
-0.004970550537109375,
0.018035888671875,
-0.016082763671875,
-0.0105743408203125,
0.006931304931640625,
0.0277862548828125,
-0.002803802490234375,
0.053466796875,
0.0048980712890625,
-0.04638671875,
0.09814453125,
-0.06719970703125,
0.01287078857421875,
-0.00170135498046875,
-0.02294921875,
0.004009246826171875,
0.053314208984375,
0.03790283203125,
-0.01025390625,
0.06695556640625,
-0.0176849365234375,
-0.035736083984375,
-0.0279998779296875,
0.05230712890625,
-0.006862640380859375,
0.0004482269287109375,
0.025238037109375,
0.01427459716796875,
-0.02191162109375,
0.0177764892578125,
0.007350921630859375,
-0.00778961181640625,
-0.0030193328857421875,
0.003131866455078125,
0.014129638671875,
-0.047210693359375,
0.044403076171875,
0.0033206939697265625,
-0.0183868408203125,
0.0229949951171875,
0.037353515625,
-0.0165557861328125,
-0.0248565673828125,
-0.0130462646484375,
0.04156494140625,
0.0128936767578125,
-0.0181121826171875,
0.035614013671875,
-0.0279693603515625,
-0.049957275390625,
-0.0279388427734375,
-0.0275115966796875,
0.0217132568359375,
-0.0092010498046875,
0.01299285888671875,
0.023040771484375,
0.00733184814453125,
-0.020904541015625,
0.041015625,
-0.0240478515625,
-0.0182342529296875,
0.017242431640625,
0.042572021484375,
0.011810302734375,
0.016754150390625,
-0.000766754150390625,
0.0099029541015625,
0.031829833984375,
-0.028228759765625,
0.0029239654541015625,
0.04156494140625,
-0.083251953125,
-0.062255859375,
-0.01055908203125,
-0.02630615234375,
0.0052337646484375,
0.019775390625,
0.00548553466796875,
0.048675537109375,
0.002353668212890625,
0.01421356201171875,
-0.00479888916015625,
0.0024700164794921875,
-0.011962890625,
0.028594970703125,
0.057891845703125,
-0.00519561767578125,
0.0119171142578125,
-0.00695037841796875,
-0.04364013671875,
0.081298828125,
-0.031707763671875,
-0.06573486328125,
0.0266265869140625,
0.0006814002990722656,
0.06597900390625,
0.046295166015625,
0.0009889602661132812,
0.017669677734375,
-0.0229644775390625,
-0.016326904296875,
0.003749847412109375,
-0.0224761962890625,
-0.014923095703125,
-0.00589752197265625,
0.0184783935546875,
-0.019134521484375,
0.025177001953125,
-0.0153656005859375,
0.0290679931640625,
-0.006435394287109375,
0.032562255859375,
0.036407470703125,
0.0045013427734375,
0.01441192626953125,
0.0031490325927734375,
0.0193939208984375,
0.0030345916748046875,
-0.005817413330078125,
0.0009431838989257812,
-0.0043487548828125,
-0.05999755859375,
-0.044403076171875,
-0.01334381103515625,
-0.0404052734375,
0.024200439453125,
0.026123046875,
0.02276611328125,
0.042999267578125,
0.00798797607421875,
0.034881591796875,
-0.045684814453125,
0.03399658203125,
-0.009368896484375,
0.006633758544921875,
-0.01079559326171875,
0.0367431640625,
0.0210723876953125,
-0.030670166015625,
-0.0024547576904296875,
0.004695892333984375,
0.008056640625,
-0.0162506103515625,
-0.00286865234375,
0.0004544258117675781,
-0.07037353515625,
0.00894927978515625,
0.04315185546875,
0.03582763671875,
0.0265655517578125,
0.01258087158203125,
0.00960540771484375,
0.0033721923828125,
-0.028472900390625,
0.022308349609375,
-0.0229644775390625,
-0.0079345703125,
0.040985107421875,
-0.00492095947265625,
0.0106658935546875,
0.0069580078125,
-0.06939697265625,
0.011199951171875,
0.031890869140625,
-0.022430419921875,
-0.0360107421875,
0.007965087890625,
-0.0261077880859375,
0.032196044921875,
-0.06744384765625,
-0.06939697265625,
-0.00861358642578125,
0.025146484375,
-0.030059814453125,
-0.0028057098388671875,
-0.023406982421875,
-0.0240020751953125,
-0.016082763671875,
0.033172607421875,
-0.024322509765625,
0.01488494873046875,
0.040679931640625,
0.0083770751953125,
0.01995849609375,
-0.028228759765625,
-0.021484375,
0.05194091796875,
0.0282440185546875,
-0.02166748046875,
-0.01128387451171875,
-0.037689208984375,
-0.00237274169921875,
0.005146026611328125,
-0.036346435546875,
0.022247314453125,
0.0243377685546875,
0.0170135498046875,
0.0176544189453125,
0.03472900390625,
0.01490020751953125,
-0.037689208984375,
0.040985107421875,
-0.011474609375,
-0.0158843994140625,
0.050201416015625,
-0.0093994140625,
0.024261474609375,
-0.005596160888671875,
0.057586669921875,
0.04803466796875,
0.00586700439453125,
-0.0126495361328125,
-0.01328277587890625,
-0.002655029296875,
-0.040496826171875,
0.0240478515625,
-0.0096588134765625,
-0.0552978515625,
-0.01227569580078125,
0.017791748046875,
0.0308380126953125,
0.025054931640625,
0.01690673828125,
-0.0261688232421875,
-0.02423095703125,
0.04461669921875,
-0.0243377685546875,
-0.0195465087890625,
0.00832366943359375,
-0.08343505859375,
-0.01593017578125,
-0.0024509429931640625,
-0.055206298828125,
0.0017108917236328125,
0.0284423828125,
-0.001140594482421875,
0.00946044921875,
-0.0027332305908203125,
0.006999969482421875,
-0.01367950439453125,
-0.06488037109375,
-0.09783935546875,
-0.0027904510498046875,
-0.007106781005859375,
0.00826263427734375,
0.00814056396484375,
-0.004207611083984375,
-0.0237579345703125,
-0.00543212890625,
-0.0135345458984375,
-0.0089111328125,
-0.0196990966796875,
0.0210723876953125,
-0.0360107421875,
0.00522613525390625,
-0.003932952880859375,
-0.0295257568359375,
0.01959228515625,
-0.004894256591796875,
-0.010223388671875,
-0.0635986328125,
-0.072021484375,
-0.05926513671875,
0.064697265625,
0.07891845703125,
-0.07696533203125,
0.001987457275390625,
-0.082275390625,
-0.015167236328125,
0.022735595703125,
-0.02838134765625,
-0.0194091796875,
0.0076904296875,
-0.0255889892578125,
0.00226593017578125,
-0.01348114013671875,
0.0140838623046875,
0.00418853759765625,
-0.018096923828125,
0.0222320556640625,
-0.0018138885498046875,
-0.0071868896484375,
0.005458831787109375,
0.0005412101745605469,
-0.00658416748046875,
-0.0218505859375,
0.0208587646484375,
-0.0034503936767578125,
0.03570556640625,
0.006420135498046875,
0.03497314453125,
-0.00324249267578125,
-0.05633544921875,
0.050567626953125,
-0.024505615234375,
-0.003574371337890625,
-0.023834228515625,
-0.0278472900390625,
0.01537322998046875,
0.107421875,
-0.03204345703125,
-0.0074920654296875,
-0.006473541259765625,
0.0105438232421875,
-0.029510498046875,
-0.03387451171875,
-0.031341552734375,
-0.0039043426513671875,
-0.054901123046875,
-0.0011472702026367188,
-0.0037021636962890625,
-0.015655517578125,
-0.022308349609375,
0.037139892578125,
-0.0208587646484375,
-0.03045654296875,
-0.006366729736328125,
-0.01404571533203125,
-0.0372314453125,
0.06298828125,
-0.06280517578125,
0.0270233154296875,
0.0215301513671875,
-0.0506591796875,
-0.0097503662109375,
-0.00971221923828125,
0.00984954833984375,
0.018157958984375,
0.024749755859375,
-0.0654296875,
0.0061492919921875,
0.004596710205078125,
0.002651214599609375,
-0.009918212890625,
0.022613525390625,
0.039947509765625,
0.029052734375,
-0.062286376953125,
-0.01273345947265625,
-0.0462646484375,
-0.0323486328125,
0.014678955078125,
0.0151214599609375,
0.06402587890625,
-0.007587432861328125,
-0.019317626953125,
0.017303466796875,
-0.0185089111328125,
-0.00981903076171875,
-0.041015625,
0.01116943359375,
0.003650665283203125,
0.0103302001953125,
-0.0059967041015625,
-0.047088623046875,
0.006511688232421875,
0.0294647216796875,
0.00475311279296875,
0.0008563995361328125,
0.004993438720703125,
0.06036376953125,
0.02655029296875,
-0.0208282470703125,
0.00003349781036376953,
0.039398193359375,
0.0662841796875,
-0.030975341796875,
0.0230865478515625,
0.002254486083984375,
-0.05645751953125,
0.1160888671875,
0.0050048828125,
0.039581298828125,
-0.0102691650390625,
0.0106353759765625,
0.00394439697265625,
-0.028778076171875,
0.043792724609375,
0.03265380859375,
-0.03814697265625,
-0.01739501953125,
-0.0268707275390625,
0.01800537109375,
-0.0374755859375,
0.01403045654296875,
0.007045745849609375,
0.01165771484375,
-0.04034423828125,
0.0273590087890625,
-0.0280303955078125,
-0.0103302001953125,
0.04345703125,
0.045257568359375,
0.006198883056640625,
-0.03619384765625,
0.0142974853515625,
-0.01081085205078125,
-0.0066986083984375,
-0.03851318359375,
-0.0153045654296875,
0.022705078125,
-0.0284881591796875,
-0.017547607421875,
0.0288238525390625,
-0.0209197998046875,
0.1165771484375,
0.01169586181640625,
-0.042724609375,
-0.036468505859375,
-0.0247344970703125,
0.043121337890625,
0.00762176513671875,
0.0217437744140625,
0.044219970703125,
-0.00931549072265625,
0.00826263427734375,
-0.020751953125,
-0.03173828125,
0.0060272216796875,
-0.054046630859375,
0.0198822021484375,
0.01367950439453125,
-0.02386474609375,
0.0185089111328125,
0.0014028549194335938,
0.01470184326171875,
-0.011474609375,
-0.004241943359375,
0.041717529296875,
0.005245208740234375,
0.02130126953125,
-0.01141357421875,
0.018463134765625,
0.0256195068359375,
-0.0047454833984375,
0.0089263916015625,
-0.022674560546875,
0.016937255859375,
0.00177001953125,
0.0305938720703125,
0.0240478515625,
-0.0101776123046875,
-0.0007352828979492188,
-0.0474853515625,
-0.0080108642578125,
0.032989501953125,
-0.0248565673828125,
-0.06597900390625,
-0.028900146484375,
0.02764892578125,
0.0285797119140625,
-0.019012451171875,
-0.015838623046875,
0.043731689453125,
-0.022186279296875,
0.019073486328125,
0.06134033203125,
-0.027008056640625,
-0.0089874267578125,
-0.006153106689453125,
-0.0192108154296875,
-0.0194854736328125,
0.0206298828125,
-0.07952880859375,
-0.0186614990234375,
-0.015960693359375,
0.0026264190673828125,
0.0181732177734375,
-0.0201416015625,
0.0200653076171875,
-0.0201416015625,
-0.005924224853515625,
-0.030242919921875,
0.013092041015625,
0.00620269775390625,
0.0026092529296875,
0.0003151893615722656,
-0.017608642578125,
-0.0194549560546875,
-0.0186614990234375,
-0.03570556640625,
-0.0361328125,
0.0006656646728515625,
-0.0084075927734375,
0.035980224609375,
0.0188140869140625,
-0.004535675048828125,
-0.0714111328125,
-0.0208892822265625,
0.01270294189453125,
0.058013916015625,
0.033660888671875,
-0.01251220703125,
0.054229736328125,
-0.0295562744140625,
0.029144287109375,
-0.01099395751953125,
0.0244140625,
0.00933837890625,
-0.007328033447265625,
0.0298309326171875,
-0.00513458251953125,
-0.0181884765625,
-0.04425048828125,
0.006916046142578125,
-0.001922607421875,
0.044036865234375,
-0.01303863525390625,
-0.015777587890625,
-0.01556396484375,
0.005523681640625,
-0.0202789306640625,
0.0601806640625,
-0.00815582275390625,
-0.0433349609375,
0.0143585205078125,
-0.00740814208984375,
0.0283050537109375,
-0.02130126953125,
-0.03466796875,
0.0477294921875,
-0.00794219970703125,
0.0390625,
-0.003387451171875,
-0.06524658203125,
0.06597900390625,
0.1134033203125,
0.03558349609375,
0.06292724609375,
0.01161956787109375,
0.026702880859375,
0.0178680419921875,
0.033203125,
0.007625579833984375,
-0.03851318359375,
0.053070068359375,
0.0184326171875,
-0.005336761474609375,
0.055633544921875,
-0.03143310546875,
0.032470703125,
0.027618408203125,
0.06182861328125,
-0.048858642578125,
0.02093505859375,
-0.0031833648681640625,
-0.0186004638671875,
0.08135986328125,
-0.0182342529296875,
-0.01910400390625,
-0.0162506103515625,
0.058837890625,
0.0115966796875,
-0.01291656494140625,
0.033416748046875,
0.0255279541015625,
-0.0278472900390625,
0.031768798828125,
-0.018341064453125,
-0.0083770751953125,
-0.00008207559585571289,
-0.0245361328125,
-0.00662994384765625,
-0.00617218017578125,
-0.03314208984375,
0.0097808837890625,
-0.015960693359375,
-0.0125579833984375,
-0.04547119140625,
0.002010345458984375,
-0.0014142990112304688,
0.00502777099609375,
0.051300048828125,
-0.0108184814453125,
0.01041412353515625,
0.04559326171875,
-0.020904541015625,
0.0205535888671875,
-0.007534027099609375,
0.04364013671875,
0.012939453125,
0.0009064674377441406,
0.0148162841796875,
-0.0304412841796875,
-0.0193939208984375,
0.0033550262451171875,
-0.04296875,
-0.0200042724609375,
-0.00998687744140625,
-0.0338134765625,
0.078125,
-0.0246124267578125,
-0.01715087890625,
0.034820556640625,
-0.0016260147094726562,
-0.032135009765625,
0.001434326171875,
0.060699462890625,
-0.062042236328125,
-0.036285400390625,
0.0467529296875,
-0.00756072998046875,
-0.027130126953125,
0.038360595703125,
-0.045562744140625,
0.08636474609375,
0.023681640625,
-0.00568389892578125,
-0.00646209716796875,
0.03643798828125,
-0.0494384765625,
0.018646240234375,
-0.0016422271728515625,
0.0187835693359375,
-0.021453857421875,
0.025390625,
-0.040435791015625,
-0.016632080078125,
0.0007891654968261719,
0.062347412109375,
0.043243408203125,
0.0083465576171875,
0.0157318115234375,
0.002704620361328125,
0.05511474609375,
0.017059326171875,
-0.00662994384765625,
0.01285552978515625,
-0.01389312744140625,
-0.05059814453125,
-0.0186309814453125,
0.0304718017578125,
0.040435791015625,
-0.06158447265625,
-0.034881591796875,
-0.00007271766662597656,
0.0012054443359375,
-0.0097198486328125,
0.025634765625,
0.00553131103515625,
-0.03582763671875,
-0.0014801025390625,
0.015716552734375,
-0.044952392578125,
-0.028289794921875,
0.0000737309455871582,
-0.031280517578125,
-0.01788330078125,
0.0186767578125,
-0.03338623046875,
0.0226593017578125,
0.00862884521484375,
0.02752685546875,
-0.0012912750244140625,
0.01495361328125,
-0.0130767822265625,
0.024627685546875,
0.0184783935546875,
0.048675537109375,
-0.0255889892578125,
0.0491943359375,
0.0457763671875,
0.039459228515625,
-0.0105133056640625,
-0.00792694091796875,
0.0106658935546875,
0.053680419921875,
-0.033843994140625,
-0.0145721435546875,
-0.005878448486328125,
0.00820159912109375,
0.0250701904296875,
-0.0150146484375,
0.030242919921875,
-0.0027713775634765625,
0.01641845703125,
-0.0100250244140625,
0.007442474365234375,
0.0006341934204101562,
-0.00612640380859375,
0.00667572021484375,
0.03570556640625,
-0.0024356842041015625,
0.032257080078125,
-0.048004150390625,
0.00656890869140625,
0.0165557861328125,
0.042510986328125,
0.0154876708984375,
0.040435791015625,
0.0175323486328125,
-0.01727294921875,
-0.0226898193359375,
0.045257568359375,
0.0030345916748046875,
0.031982421875,
-0.040802001953125,
-0.033416748046875,
0.01580810546875,
0.016632080078125,
-0.018096923828125,
0.03143310546875,
0.0258331298828125,
0.0121307373046875,
-0.0401611328125,
-0.029022216796875,
-0.0017156600952148438,
-0.04339599609375,
-0.00957489013671875,
-0.035430908203125,
-0.03851318359375,
0.00013375282287597656,
-0.0113525390625,
0.0060272216796875,
-0.021759033203125,
0.023773193359375,
-0.0259246826171875,
-0.00579833984375,
-0.0071258544921875,
-0.050506591796875,
0.0215606689453125,
-0.02874755859375,
0.02911376953125,
-0.0104827880859375,
-0.061767578125,
-0.015167236328125,
-0.0021343231201171875,
-0.0516357421875,
0.03271484375,
0.0501708984375,
-0.0372314453125,
0.027984619140625,
-0.0098114013671875,
0.01342010498046875,
-0.0369873046875,
-0.02081298828125,
0.0304718017578125,
0.0250091552734375,
0.01788330078125,
0.034271240234375,
-0.0458984375,
-0.03680419921875,
-0.025604248046875,
0.0531005859375,
0.04119873046875,
0.052337646484375,
-0.0016756057739257812,
0.0333251953125,
-0.01026153564453125,
-0.005207061767578125,
-0.00164031982421875,
0.003536224365234375,
-0.0015048980712890625,
0.019561767578125,
-0.0180816650390625,
-0.01342010498046875,
-0.097900390625,
-0.00667572021484375,
0.04888916015625,
-0.026123046875,
0.04107666015625,
0.014068603515625,
0.01090240478515625,
-0.07159423828125,
0.0202789306640625,
-0.0135650634765625,
-0.036376953125,
-0.01788330078125,
-0.0003070831298828125,
0.018768310546875,
0.048492431640625,
0.00939178466796875,
0.01019287109375,
0.003814697265625,
-0.047332763671875,
0.0083770751953125,
-0.031951904296875,
0.022674560546875,
0.04150390625,
0.0016307830810546875,
-0.00946044921875,
0.03692626953125,
0.00591278076171875,
0.0181884765625,
0.01056671142578125,
0.026824951171875,
0.0372314453125,
-0.036834716796875,
0.0031833648681640625,
0.03936767578125,
0.061981201171875,
0.00705718994140625,
0.02825927734375,
0.00775146484375,
-0.01412200927734375,
-0.0009016990661621094,
-0.036468505859375,
-0.032745361328125,
-0.040771484375,
-0.0022869110107421875,
0.03558349609375,
-0.03173828125,
-0.056549072265625,
-0.10748291015625,
0.00441741943359375,
0.01485443115234375,
-0.0006184577941894531,
-0.04296875,
0.0061492919921875,
0.000732421875,
0.0479736328125,
-0.0091400146484375,
0.0257568359375,
-0.02789306640625,
-0.014495849609375,
-0.017364501953125,
0.00614166259765625,
-0.0266265869140625,
0.027862548828125,
-0.005764007568359375,
-0.0284423828125,
0.042572021484375,
0.0250701904296875,
0.01434326171875,
-0.04046630859375,
-0.04534912109375,
0.0245208740234375,
-0.06134033203125,
-0.0239410400390625,
-0.01202392578125,
0.0065155029296875,
0.01212310791015625,
-0.0192413330078125,
-0.011444091796875,
-0.0036830902099609375,
0.00637054443359375,
-0.024322509765625,
0.01134490966796875,
0.00724029541015625,
-0.051300048828125,
-0.09771728515625,
0.05267333984375,
-0.0132293701171875,
-0.03558349609375,
-0.066162109375,
0.01517486572265625,
-0.0238494873046875,
0.0152740478515625,
-0.02593994140625,
-0.0130767822265625,
0.01012420654296875,
0.0626220703125,
0.0144195556640625,
0.01027679443359375,
0.036346435546875,
0.007659912109375,
-0.054534912109375,
0.005680084228515625,
-0.01314544677734375,
0.01422882080078125,
-0.032928466796875,
0.01531982421875,
-0.009765625,
0.007144927978515625,
-0.0311279296875,
0.01163482666015625,
0.0157012939453125,
0.005096435546875,
-0.004119873046875,
-0.03729248046875,
-0.0009031295776367188,
-0.022613525390625,
0.03948974609375,
-0.006549835205078125,
0.008209228515625,
0.0116424560546875,
-0.0247955322265625,
-0.01236724853515625,
-0.0083160400390625,
-0.0164947509765625,
0.0128173828125,
-0.08197021484375,
-0.021697998046875,
0.01464080810546875,
0.007282257080078125,
-0.01389312744140625,
0.0008029937744140625,
-0.013214111328125,
-0.0150146484375,
0.0223541259765625,
0.003810882568359375,
0.0032196044921875,
-0.05377197265625,
0.0748291015625,
-0.039886474609375,
-0.029022216796875,
0.0123291015625,
0.043609619140625,
0.01317596435546875,
-0.0207672119140625,
0.0171661376953125,
-0.002429962158203125,
-0.035308837890625,
0.03131103515625,
0.0014047622680664062,
0.032379150390625,
-0.059814453125,
-0.0169219970703125,
-0.0242767333984375,
0.03228759765625,
-0.019989013671875,
0.01317596435546875,
0.00826263427734375,
0.056854248046875,
0.006404876708984375,
0.11834716796875,
-0.0222930908203125,
-0.020538330078125,
-0.0509033203125,
0.047760009765625,
0.022613525390625,
-0.0177154541015625,
0.06414794921875,
-0.00676727294921875,
-0.017669677734375,
0.0193634033203125,
-0.02374267578125,
-0.067626953125,
0.0189971923828125,
0.0035762786865234375,
0.049072265625,
0.0196685791015625
] |
0f4e2f4a7916340c22154304b10ed22fdf254687
|
Wordpress Stackexchange
Q: CSS classes for theme Does anybody know predefined (suggested by WP) CSS classes which should I use in my theme?
I have seen somewhere in Internet a list of all CSS classes, which are used in WP theme, but can't find it.
UPDATE: I have found the site where I've seen this list: http://www.wpbeginner.com/wp-themes/default-wordpress-generated-css-cheat-sheet-for-beginners/
A: I found this list, which appears to be pretty comprehensive:
http://digwp.com/2010/05/default-wordpress-css-styles-hooks/
(I'm aware that an answer consisting of a link to an external site is discouraged, but not sure what else to do in this case?)
|
Q: CSS classes for theme Does anybody know predefined (suggested by WP) CSS classes which should I use in my theme?
I have seen somewhere in Internet a list of all CSS classes, which are used in WP theme, but can't find it.
UPDATE: I have found the site where I've seen this list: http://www.wpbeginner.com/wp-themes/default-wordpress-generated-css-cheat-sheet-for-beginners/
A: I found this list, which appears to be pretty comprehensive:
http://digwp.com/2010/05/default-wordpress-css-styles-hooks/
(I'm aware that an answer consisting of a link to an external site is discouraged, but not sure what else to do in this case?)
A: There are many CSS classes generated by WordPress, depending on context.
The Theme Review Guidelines include the following, WordPress-generated CSS classes:
*
*Alignment Classes:
*
*.aligncenter
*.alignleft
*.alignright
*Caption Related Classes:
*
*.wp-caption
*.wp-caption-text
*.gallery-caption
*Post Classes:
*
*.sticky
*Comment Classes:
*
*.bypostauthor
Then, there are the body classes generated by body_class().
Then, there are the post classes generated by post_class().
Then, there are the comment classes generated by comment_class().
Then, there are the menu item classes generated by wp_nav_menu().
A: Maybe will be useful information from the Codex. Styling List with CSS
|
wordpress
|
{
"language": "en",
"length": 186,
"provenance": "stackexchange_00019.jsonl.gz:419680",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51135"
}
|
[
0.0007944107055664062,
-0.018218994140625,
-0.00281524658203125,
0.0382080078125,
-0.0048675537109375,
-0.04132080078125,
0.061737060546875,
-0.0206451416015625,
-0.027923583984375,
0.00225067138671875,
-0.03961181640625,
0.0276031494140625,
-0.0215911865234375,
-0.004764556884765625,
0.02496337890625,
-0.0491943359375,
0.054656982421875,
-0.00970458984375,
0.034759521484375,
0.008758544921875,
0.0007081031799316406,
0.0489501953125,
-0.0017681121826171875,
0.07489013671875,
0.044281005859375,
-0.060791015625,
0.035614013671875,
-0.006465911865234375,
0.04205322265625,
-0.005031585693359375,
0.0282745361328125,
-0.016876220703125,
0.01971435546875,
0.018768310546875,
-0.0269775390625,
0.0003154277801513672,
-0.00841522216796875,
0.004642486572265625,
0.0170745849609375,
-0.00012129545211791992,
0.0159454345703125,
0.00275421142578125,
0.01824951171875,
0.0262451171875,
-0.0084075927734375,
-0.054718017578125,
0.0112457275390625,
-0.040435791015625,
0.012725830078125,
-0.05255126953125,
0.029876708984375,
0.0135650634765625,
0.05560302734375,
-0.0447998046875,
-0.026275634765625,
0.00701904296875,
0.0272064208984375,
0.0247955322265625,
0.043304443359375,
-0.04425048828125,
-0.061370849609375,
0.002941131591796875,
0.0228729248046875,
-0.00958251953125,
-0.01009368896484375,
0.01030731201171875,
-0.00138092041015625,
-0.004253387451171875,
-0.01033782958984375,
0.010009765625,
0.0236968994140625,
-0.00966644287109375,
-0.00783538818359375,
-0.05218505859375,
0.0102996826171875,
0.034515380859375,
-0.00937652587890625,
-0.007175445556640625,
0.0017404556274414062,
0.01165008544921875,
0.01233673095703125,
0.01129913330078125,
-0.036285400390625,
-0.04193115234375,
0.024017333984375,
-0.0290069580078125,
-0.004039764404296875,
-0.01218414306640625,
-0.0291900634765625,
-0.03619384765625,
-0.023193359375,
-0.00428009033203125,
-0.048553466796875,
-0.002796173095703125,
-0.00811767578125,
-0.0285491943359375,
0.005268096923828125,
0.0819091796875,
-0.0255126953125,
0.0294647216796875,
-0.034942626953125,
-0.0129547119140625,
0.01474761962890625,
-0.052398681640625,
-0.021209716796875,
0.032318115234375,
0.006103515625,
0.0679931640625,
0.008026123046875,
0.039276123046875,
-0.0022640228271484375,
-0.049530029296875,
0.02215576171875,
-0.013916015625,
-0.03155517578125,
-0.04779052734375,
-0.017059326171875,
-0.0095977783203125,
0.0013189315795898438,
-0.060546875,
0.039581298828125,
0.028167724609375,
0.036895751953125,
-0.00991058349609375,
-0.0203399658203125,
0.00001990795135498047,
-0.030548095703125,
-0.056488037109375,
0.039459228515625,
-0.0031681060791015625,
-0.0174102783203125,
0.0133514404296875,
0.0274505615234375,
0.0027408599853515625,
-0.002109527587890625,
-0.0105743408203125,
0.038421630859375,
0.005603790283203125,
0.00067901611328125,
0.019775390625,
-0.01499176025390625,
-0.0280914306640625,
0.010498046875,
-0.0189666748046875,
0.0413818359375,
0.0001722574234008789,
0.0208587646484375,
0.0235443115234375,
0.00675201416015625,
-0.0330810546875,
0.0625,
-0.015625,
0.0167999267578125,
0.02783203125,
0.003662109375,
-0.00400543212890625,
0.04400634765625,
-0.018310546875,
-0.023681640625,
-0.04052734375,
-0.01386260986328125,
-0.005275726318359375,
0.0196990966796875,
0.005382537841796875,
-0.00605010986328125,
0.0192718505859375,
-0.0171661376953125,
0.00531768798828125,
0.024932861328125,
-0.030029296875,
-0.00200653076171875,
-0.027252197265625,
0.07958984375,
0.03143310546875,
0.00354766845703125,
0.049163818359375,
0.00010949373245239258,
-0.028656005859375,
0.03912353515625,
0.04248046875,
-0.0009059906005859375,
-0.01197052001953125,
0.036102294921875,
-0.0009851455688476562,
-0.0220947265625,
-0.018035888671875,
0.01468658447265625,
0.019683837890625,
0.0263671875,
0.0186004638671875,
0.0079345703125,
-0.0030727386474609375,
-0.037200927734375,
0.0284576416015625,
-0.01934814453125,
-0.00481414794921875,
-0.046356201171875,
0.0272216796875,
-0.0303802490234375,
-0.022979736328125,
-0.0266876220703125,
-0.0197906494140625,
0.0347900390625,
-0.0081634521484375,
-0.01122283935546875,
0.00641632080078125,
-0.00986480712890625,
0.025970458984375,
-0.0023632049560546875,
0.00775146484375,
0.00421142578125,
-0.0126190185546875,
0.025665283203125,
-0.08123779296875,
-0.032012939453125,
0.01163482666015625,
-0.02764892578125,
0.000026941299438476562,
0.0039825439453125,
-0.032806396484375,
0.0232696533203125,
-0.026580810546875,
0.0167083740234375,
0.040008544921875,
-0.0006489753723144531,
0.040191650390625,
-0.04217529296875,
0.018280029296875,
0.006031036376953125,
0.017608642578125,
0.02825927734375,
0.015655517578125,
0.0172119140625,
0.08917236328125,
0.00170135498046875,
-0.0167236328125,
0.004817962646484375,
-0.01258087158203125,
0.0213470458984375,
0.015655517578125,
0.0576171875,
0.0299224853515625,
-0.004924774169921875,
-0.0645751953125,
0.077392578125,
-0.01427459716796875,
0.041656494140625,
-0.06451416015625,
-0.008392333984375,
0.021942138671875,
0.056396484375,
-0.0200653076171875,
0.006984710693359375,
-0.0228424072265625,
0.0051422119140625,
0.00873565673828125,
-0.006038665771484375,
-0.01081085205078125,
-0.01523590087890625,
0.009521484375,
0.0041046142578125,
-0.00396728515625,
-0.02978515625,
-0.01007080078125,
0.017242431640625,
-0.01227569580078125,
0.02545166015625,
0.00421905517578125,
0.003955841064453125,
0.005962371826171875,
0.00455474853515625,
-0.054931640625,
-0.0008678436279296875,
0.053497314453125,
0.0158233642578125,
0.02801513671875,
-0.019866943359375,
-0.02557373046875,
-0.003467559814453125,
0.0216522216796875,
-0.0112152099609375,
0.00824737548828125,
-0.0206298828125,
-0.0121612548828125,
0.0010824203491210938,
-0.07733154296875,
0.015716552734375,
0.01357269287109375,
0.0137939453125,
0.003124237060546875,
0.003551483154296875,
0.03289794921875,
-0.040679931640625,
0.059051513671875,
0.0039005279541015625,
-0.0210723876953125,
-0.03546142578125,
0.022552490234375,
0.0206298828125,
-0.0034427642822265625,
-0.0278778076171875,
0.048248291015625,
-0.018646240234375,
0.033172607421875,
0.01503753662109375,
0.033599853515625,
0.01617431640625,
0.0121612548828125,
-0.00024962425231933594,
0.032470703125,
-0.054931640625,
0.017913818359375,
0.01189422607421875,
0.051300048828125,
-0.023345947265625,
-0.0555419921875,
-0.009765625,
-0.0008397102355957031,
-0.05914306640625,
-0.0621337890625,
-0.0203857421875,
-0.049224853515625,
-0.031951904296875,
-0.033966064453125,
-0.0274658203125,
0.022979736328125,
-0.02813720703125,
-0.000919342041015625,
-0.0215606689453125,
-0.04107666015625,
-0.047119140625,
-0.0982666015625,
-0.0782470703125,
-0.02685546875,
-0.0003654956817626953,
0.03216552734375,
-0.01045989990234375,
0.06402587890625,
-0.006103515625,
-0.035614013671875,
-0.0092926025390625,
0.0290374755859375,
0.00855255126953125,
0.0013065338134765625,
0.0093231201171875,
-0.037322998046875,
-0.0278472900390625,
0.01090240478515625,
0.030792236328125,
0.004215240478515625,
-0.0155487060546875,
0.00811004638671875,
-0.0220184326171875,
-0.0277862548828125,
-0.041290283203125,
0.0687255859375,
0.04833984375,
-0.0239715576171875,
0.00971221923828125,
-0.05657958984375,
-0.02374267578125,
0.026031494140625,
-0.007171630859375,
0.0189056396484375,
-0.022491455078125,
-0.0225982666015625,
0.014617919921875,
0.0215301513671875,
0.0165252685546875,
0.01361083984375,
-0.02899169921875,
-0.0240631103515625,
0.09246826171875,
0.014251708984375,
0.040679931640625,
-0.00423431396484375,
-0.00521087646484375,
-0.0382080078125,
0.051116943359375,
-0.0002319812774658203,
-0.0176239013671875,
-0.015350341796875,
0.04461669921875,
-0.0206756591796875,
-0.063720703125,
0.05401611328125,
-0.0025482177734375,
0.00872802734375,
-0.042938232421875,
-0.03692626953125,
-0.004634857177734375,
0.1026611328125,
-0.00888824462890625,
-0.0084686279296875,
-0.0034122467041015625,
0.0234375,
-0.0244293212890625,
-0.05908203125,
-0.00794219970703125,
-0.0180816650390625,
-0.12335205078125,
0.01525115966796875,
0.0016031265258789062,
-0.0634765625,
-0.0096588134765625,
-0.04901123046875,
-0.09991455078125,
-0.04132080078125,
0.010772705078125,
-0.0011196136474609375,
-0.004547119140625,
-0.004077911376953125,
-0.0152130126953125,
-0.0286712646484375,
0.010040283203125,
-0.019866943359375,
-0.0882568359375,
-0.00872802734375,
-0.0245361328125,
0.06378173828125,
0.0303497314453125,
-0.0037212371826171875,
-0.0141143798828125,
0.03924560546875,
-0.0014171600341796875,
0.0321044921875,
0.0005855560302734375,
0.01416015625,
-0.00038623809814453125,
-0.00110626220703125,
0.01531219482421875,
-0.02471923828125,
-0.0038776397705078125,
-0.006023406982421875,
-0.028411865234375,
0.033477783203125,
-0.0203399658203125,
0.0030612945556640625,
0.0180511474609375,
-0.02215576171875,
0.033172607421875,
-0.00774383544921875,
0.00716400146484375,
0.035919189453125,
-0.004169464111328125,
0.0242156982421875,
-0.0128326416015625,
0.0187835693359375,
0.03076171875,
0.00614166259765625,
-0.01042938232421875,
0.0237274169921875,
0.05096435546875,
0.0172271728515625,
-0.0182647705078125,
-0.08380126953125,
0.00952911376953125,
0.033111572265625,
0.016754150390625,
0.0304412841796875,
-0.006504058837890625,
-0.02972412109375,
0.07781982421875,
0.014434814453125,
-0.039642333984375,
0.0063934326171875,
0.05322265625,
-0.002574920654296875,
-0.035736083984375,
0.003734588623046875,
-0.045806884765625,
0.054595947265625,
-0.0009341239929199219,
0.0164337158203125,
-0.02325439453125,
0.04888916015625,
0.0435791015625,
0.001220703125,
-0.01483154296875,
-0.0288848876953125,
0.0021724700927734375,
-0.013336181640625,
0.01523590087890625,
0.0794677734375,
0.05340576171875,
-0.01483917236328125,
0.04730224609375,
0.035186767578125,
-0.007343292236328125,
0.04583740234375,
0.043670654296875,
0.011199951171875,
0.0163726806640625,
0.05023193359375,
-0.0102386474609375,
-0.0122833251953125,
-0.026763916015625,
0.0831298828125,
0.0236968994140625,
-0.049835205078125,
0.036590576171875,
-0.00783538818359375,
0.01265716552734375,
0.026580810546875,
-0.0221099853515625,
0.047576904296875,
0.02587890625,
-0.0325927734375,
-0.0264434814453125,
-0.0297393798828125,
-0.0196075439453125,
-0.0753173828125,
0.047821044921875,
0.017303466796875,
-0.01052093505859375,
0.045684814453125,
-0.0162506103515625,
0.026123046875,
-0.0113677978515625,
-0.0139007568359375,
-0.01357269287109375,
-0.0291748046875,
0.0167388916015625,
0.01983642578125,
0.01727294921875,
0.01314544677734375,
-0.0295867919921875,
0.03857421875,
-0.050140380859375,
-0.037109375,
0.0218353271484375,
0.055023193359375,
-0.0186767578125,
-0.007228851318359375,
0.01419830322265625,
0.0130767822265625,
0.0005831718444824219,
0.0091094970703125,
-0.01548004150390625,
-0.01496124267578125,
-0.002742767333984375,
-0.01959228515625,
0.0121307373046875,
-0.0038394927978515625,
-0.0261383056640625,
0.005847930908203125,
0.005401611328125,
0.01280975341796875,
0.01137542724609375,
-0.0577392578125,
0.041259765625,
0.032745361328125,
-0.056732177734375,
-0.007328033447265625,
-0.019012451171875,
-0.072265625,
-0.06005859375,
0.01267242431640625,
-0.006259918212890625,
0.0164947509765625,
-0.00994110107421875,
0.04541015625,
-0.037322998046875,
-0.0250091552734375,
-0.040924072265625,
0.0184478759765625,
0.024139404296875,
0.0106048583984375,
-0.036468505859375,
-0.007671356201171875,
-0.0748291015625,
-0.019500732421875,
-0.01788330078125,
-0.050506591796875,
-0.03167724609375,
-0.01110076904296875,
-0.00418853759765625,
-0.017120361328125,
-0.003871917724609375,
-0.01273345947265625,
-0.033447265625,
0.06622314453125,
0.051910400390625,
0.006381988525390625,
-0.0274505615234375,
0.052764892578125,
0.01158905029296875,
0.011627197265625,
0.0151824951171875,
0.0227813720703125,
0.0183258056640625,
-0.020904541015625,
0.0204620361328125,
-0.00708770751953125,
-0.0382080078125,
-0.01107025146484375,
-0.0318603515625,
-0.0007653236389160156,
0.05987548828125,
-0.011688232421875,
0.017852783203125,
-0.039154052734375,
-0.0013885498046875,
-0.032379150390625,
0.048126220703125,
-0.0555419921875,
-0.0268402099609375,
0.03179931640625,
0.038238525390625,
0.0301971435546875,
-0.041839599609375,
-0.065673828125,
0.00867462158203125,
0.044708251953125,
0.007579803466796875,
-0.0128021240234375,
-0.01024627685546875,
0.0279998779296875,
0.0311737060546875,
-0.01983642578125,
0.0292205810546875,
0.0034999847412109375,
0.00799560546875,
0.016876220703125,
0.012542724609375,
-0.01172637939453125,
-0.02264404296875,
0.06805419921875,
0.01537322998046875,
-0.0302276611328125,
0.051025390625,
-0.0309600830078125,
-0.0006814002990722656,
0.06610107421875,
0.0684814453125,
-0.0865478515625,
-0.0040130615234375,
0.0021209716796875,
-0.0263519287109375,
0.01493072509765625,
0.0203399658203125,
-0.0234832763671875,
-0.0200042724609375,
0.04620361328125,
-0.049102783203125,
-0.00838470458984375,
0.027740478515625,
-0.0166778564453125,
0.01904296875,
-0.00579071044921875,
0.006744384765625,
-0.0280303955078125,
-0.057037353515625,
-0.057037353515625,
0.0251312255859375,
-0.04095458984375,
-0.0399169921875,
0.0222930908203125,
-0.00888824462890625,
0.006988525390625,
-0.038482666015625,
0.033355712890625,
-0.01111602783203125,
0.026763916015625,
-0.0051116943359375,
0.0032939910888671875,
-0.006275177001953125,
0.0181121826171875,
-0.0257415771484375,
0.0289154052734375,
0.0036144256591796875,
-0.0135345458984375,
-0.020233154296875,
-0.0225372314453125,
0.059783935546875,
0.00975799560546875,
-0.0806884765625,
0.042938232421875,
-0.0290679931640625,
-0.040496826171875,
-0.01548004150390625,
-0.015869140625,
0.06707763671875,
-0.033233642578125,
-0.007572174072265625,
0.036285400390625,
0.01568603515625,
-0.0048370361328125,
-0.0210418701171875,
0.0100860595703125,
-0.0167999267578125,
0.038238525390625,
-0.020233154296875,
0.03765869140625,
-0.00839996337890625,
-0.023468017578125,
-0.007717132568359375,
0.01904296875,
-0.005184173583984375,
-0.0269927978515625,
0.040435791015625,
0.01149749755859375,
-0.00978851318359375,
0.00445556640625,
-0.018798828125,
0.038726806640625,
-0.026947021484375,
0.010009765625,
-0.01763916015625,
0.0070037841796875,
0.0004754066467285156,
0.0036678314208984375,
0.023529052734375,
0.0005640983581542969,
-0.0294952392578125,
0.0222625732421875,
0.08270263671875,
0.05596923828125,
0.0301361083984375,
0.014739990234375,
-0.0159759521484375,
-0.0234375,
-0.0030345916748046875,
-0.0176849365234375,
0.01629638671875,
-0.0186920166015625,
-0.0202178955078125,
0.005336761474609375,
-0.00485992431640625,
-0.015411376953125,
0.04595947265625,
0.0186920166015625,
-0.06219482421875,
0.03863525390625,
0.038238525390625,
-0.0243377685546875,
-0.004016876220703125,
0.017669677734375,
0.019622802734375,
-0.0623779296875,
-0.0165557861328125,
-0.0343017578125,
0.041412353515625,
-0.01192474365234375,
0.0172119140625,
0.00334930419921875,
0.00977325439453125,
0.02618408203125,
-0.00789642333984375,
-0.01020050048828125,
0.03289794921875,
-0.0148162841796875,
0.01114654541015625,
-0.0178070068359375,
0.01224517822265625,
-0.083984375,
-0.0268707275390625,
0.0181884765625,
0.034027099609375,
-0.0247802734375,
-0.04705810546875,
0.0089569091796875,
0.0231475830078125,
0.019775390625,
0.00543975830078125,
0.033935546875,
-0.080322265625,
-0.0264892578125,
-0.006610870361328125,
-0.027435302734375,
0.00904083251953125,
0.01279449462890625,
0.00615692138671875,
0.014984130859375,
0.021453857421875,
-0.041595458984375,
-0.015777587890625,
-0.01082611083984375,
0.0014104843139648438,
0.0200958251953125,
0.00473785400390625,
0.0484619140625,
0.006500244140625,
-0.007396697998046875,
-0.0115509033203125,
0.028167724609375,
0.036376953125,
0.0003387928009033203,
0.0227203369140625,
0.01558685302734375,
-0.004749298095703125,
0.01372528076171875,
0.0181884765625,
0.0214691162109375,
0.03558349609375,
0.01076507568359375,
-0.03375244140625,
-0.0047454833984375,
-0.0190277099609375,
-0.0352783203125,
-0.0206451416015625,
-0.016021728515625,
-0.0015974044799804688,
0.038848876953125,
-0.004730224609375,
0.0121002197265625,
-0.02545166015625,
0.07855224609375,
0.001865386962890625,
0.01264190673828125,
0.0252838134765625,
-0.005786895751953125,
-0.0157623291015625,
-0.0031490325927734375,
-0.015472412109375,
0.026214599609375,
-0.06195068359375,
-0.00843048095703125,
-0.01410675048828125,
-0.0159912109375,
0.017547607421875,
0.0423583984375,
-0.0094757080078125,
0.0143280029296875,
0.0074005126953125,
-0.01406097412109375,
-0.01035308837890625,
0.0179443359375,
0.01346588134765625,
-0.0232391357421875,
0.01473236083984375,
-0.0114593505859375,
-0.07867431640625,
-0.043365478515625,
-0.0296630859375,
0.03118896484375,
0.00801849365234375,
0.049407958984375,
-0.000667572021484375,
0.0172576904296875,
0.0136871337890625,
0.00505828857421875,
0.005619049072265625,
-0.01910400390625,
0.03778076171875,
0.0025730133056640625,
0.0172576904296875,
-0.024200439453125,
-0.061309814453125,
0.035552978515625,
0.0267333984375,
-0.0029621124267578125,
0.0284881591796875,
0.014373779296875,
0.0108489990234375,
-0.01149749755859375,
0.00010466575622558594,
-0.0215606689453125,
-0.025726318359375,
-0.0166015625,
0.021942138671875,
0.01401519775390625,
-0.007648468017578125,
-0.028076171875,
0.02105712890625,
0.0187225341796875,
-0.01806640625,
0.015411376953125,
-0.0008459091186523438,
0.0102081298828125,
0.0283050537109375,
0.030487060546875,
-0.07916259765625,
0.005214691162109375,
-0.00560760498046875,
-0.007297515869140625,
0.01861572265625,
0.043548583984375,
0.01007080078125,
-0.057281494140625,
0.0457763671875,
0.07098388671875,
0.08526611328125,
-0.0050201416015625,
0.036285400390625,
0.0328369140625,
-0.004302978515625,
0.043487548828125,
0.0037784576416015625,
-0.01151275634765625,
-0.01898193359375,
-0.01494598388671875,
0.015777587890625,
-0.036224365234375,
0.002593994140625,
-0.064697265625,
-0.015869140625,
0.032867431640625,
-0.0207672119140625,
-0.01161956787109375,
0.0003833770751953125,
-0.024658203125,
0.0151214599609375,
-0.020782470703125,
0.0025653839111328125,
0.0131683349609375,
0.0215606689453125,
-0.025634765625,
-0.0245361328125,
-0.0020294189453125,
0.0216217041015625,
-0.008880615234375,
0.05242919921875,
0.07958984375,
-0.057708740234375,
0.043914794921875,
0.035858154296875,
0.045501708984375,
0.0899658203125,
-0.0254669189453125,
-0.01425933837890625,
0.03594970703125,
-0.01239776611328125,
-0.01003265380859375,
-0.08856201171875,
-0.0166473388671875,
-0.06890869140625,
0.0198974609375,
-0.0118255615234375,
0.004558563232421875,
0.022308349609375,
-0.051910400390625,
-0.1043701171875,
0.0828857421875,
-0.033050537109375,
-0.033416748046875,
-0.031463623046875,
0.017730712890625,
-0.009796142578125,
-0.0460205078125,
-0.0232086181640625,
-0.01070404052734375,
0.01297760009765625,
0.040557861328125,
0.0198516845703125,
-0.004039764404296875,
0.022491455078125,
0.01519775390625,
-0.060821533203125,
0.004985809326171875,
-0.00000476837158203125,
0.0184326171875,
0.00017940998077392578,
-0.01436614990234375,
0.01497650146484375,
0.0275421142578125,
-0.040069580078125,
-0.0399169921875,
-0.008453369140625,
0.023956298828125,
0.01355743408203125,
-0.0127410888671875,
-0.033782958984375,
-0.05084228515625,
0.0220489501953125,
-0.00463104248046875,
0.0019626617431640625,
0.037933349609375,
0.00844573974609375,
-0.01300048828125,
-0.0195159912109375,
0.002044677734375,
-0.0018014907836914062,
-0.0228118896484375,
-0.00974273681640625,
-0.007007598876953125,
0.007030487060546875,
0.0109710693359375,
-0.025909423828125,
-0.006748199462890625,
0.0013170242309570312,
0.005168914794921875,
0.003231048583984375,
-0.0229339599609375,
-0.004032135009765625,
0.00794219970703125,
0.01019287109375,
0.0692138671875,
-0.025848388671875,
0.011688232421875,
0.05316162109375,
0.046539306640625,
0.01514434814453125,
-0.0178070068359375,
-0.00817108154296875,
0.0168304443359375,
0.0076141357421875,
0.05157470703125,
-0.0185089111328125,
-0.03216552734375,
-0.01104736328125,
0.01654052734375,
0.0017910003662109375,
0.027496337890625,
-0.01543426513671875,
0.0303955078125,
0.005542755126953125,
0.037078857421875,
-0.00013530254364013672,
0.014862060546875,
-0.0125732421875,
0.064453125,
0.00926971435546875,
-0.036041259765625,
0.03802490234375,
-0.0621337890625,
0.006641387939453125,
-0.03118896484375,
-0.0191497802734375,
-0.03179931640625,
0.0031070709228515625,
0.0169219970703125,
-0.0259857177734375,
0.0155792236328125
] |
8671f0c5ea601c558582958af723c8b3bdfd3236
|
Wordpress Stackexchange
Q: get php variable from functions php and echo it in theme template files This may seem like a silly question but I cannot figure this out.
I've created a variable in my functions.php - and I'm trying to echo it in my template files.
I'm guessing it's because of scope.
What's the simpliest what to echo a variable or create a function to allow me to output this facebook ID in various template files.
This is what I've currently got in my functions.php...
$fb_app_id = '68366786876786';
And this is how I was trying to echo it...
<?php echo $fb_app_id; ?>
Any ideas would be hugely helpful, thanks you very much
A: the easiest way would be to just create a callable function, you don't really need a hook here
function get_fb_app_id() {
$fb_app_id = '68366786876786';
return $fb_app_id;
}
and in the template:
echo get_fb_app_id();
|
Q: get php variable from functions php and echo it in theme template files This may seem like a silly question but I cannot figure this out.
I've created a variable in my functions.php - and I'm trying to echo it in my template files.
I'm guessing it's because of scope.
What's the simpliest what to echo a variable or create a function to allow me to output this facebook ID in various template files.
This is what I've currently got in my functions.php...
$fb_app_id = '68366786876786';
And this is how I was trying to echo it...
<?php echo $fb_app_id; ?>
Any ideas would be hugely helpful, thanks you very much
A: the easiest way would be to just create a callable function, you don't really need a hook here
function get_fb_app_id() {
$fb_app_id = '68366786876786';
return $fb_app_id;
}
and in the template:
echo get_fb_app_id();
A: I would use Wordpress options in this case. You can set an option using either add_option() or update_option() (probably better for your case). You would use update_option('fb_app_id', '68366786876786'); somewhere in you're functions.php file (the init hook function would probably be a good place).
You could then show this option in your theme files using echo get_option('fb_app_id');
The reason I would suggest this way, rather than using globals (ick) or action/filter hooks is that if you plan on releasing your theme to the public, it will be much easier to make fb_app_id an editable option in a theme options page.
A: If you don't have access to the value, it's likely a scope issue. Make sure you globalize it first:
<?php
global $fb_app_id;
echo $fb_app_id;
?>
Alternatively
I'm not a fan of global variables, so the alternative I recommend is using WordPress' built-in filter mechanism. You add the filter in your functions.php file and apply it where needed.
In functions.php:
add_filter( 'fb_app_id', 'return_fb_app_id' );
function return_fb_app_id( $arg = '' ) {
return '68366786876786';
}
In your template files:
echo apply_filters( 'fb_app_id', '' );
Or use an action hook
In functions.php
add_action( 'fb_app_id', 'echo_fb_app_id' );
function echo_fb_app_id() {
echo '68366786876786';
}
In your template files:
do_action( 'fb_app_id' );
Whether you use an action hook or a filter is entirely up to you. I recommend a filter because it can return a value. This is far more flexible than just injecting echo calls in your template.
|
wordpress
|
{
"language": "en",
"length": 389,
"provenance": "stackexchange_00019.jsonl.gz:419684",
"question_score": "9",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51145"
}
|
[
0.027130126953125,
-0.0151519775390625,
0.0016603469848632812,
-0.03314208984375,
0.0037479400634765625,
-0.00489044189453125,
0.01198577880859375,
-0.0020275115966796875,
0.01409149169921875,
-0.005184173583984375,
-0.0296783447265625,
0.00208282470703125,
-0.065185546875,
-0.02301025390625,
-0.00418853759765625,
-0.039093017578125,
0.046478271484375,
-0.062744140625,
-0.0036678314208984375,
-0.00616455078125,
-0.004566192626953125,
0.031402587890625,
0.029693603515625,
0.033905029296875,
0.06475830078125,
-0.08251953125,
0.035125732421875,
-0.01043701171875,
0.035888671875,
-0.01221466064453125,
0.0254669189453125,
0.004566192626953125,
0.0030689239501953125,
0.0309906005859375,
-0.01378631591796875,
-0.00798797607421875,
-0.00511932373046875,
0.02484130859375,
0.0198211669921875,
0.000179290771484375,
0.0268096923828125,
-0.01177978515625,
0.0039215087890625,
0.0045928955078125,
-0.004421234130859375,
-0.0246734619140625,
0.0005412101745605469,
-0.04644775390625,
-0.020416259765625,
0.06744384765625,
0.01453399658203125,
0.0064544677734375,
0.00740814208984375,
0.06573486328125,
0.016357421875,
-0.0125885009765625,
-0.01486968994140625,
0.0008225440979003906,
0.01910400390625,
0.02130126953125,
-0.01366424560546875,
0.0051422119140625,
0.01071929931640625,
-0.03863525390625,
0.0160980224609375,
0.00751495361328125,
-0.0209197998046875,
0.034210205078125,
-0.009857177734375,
0.004032135009765625,
-0.00152587890625,
-0.034393310546875,
-0.0001685619354248047,
-0.029815673828125,
-0.0012416839599609375,
0.01110076904296875,
0.014678955078125,
-0.005954742431640625,
-0.005218505859375,
0.0013074874877929688,
-0.0277862548828125,
-0.0609130859375,
-0.0462646484375,
0.0450439453125,
-0.017852783203125,
0.0738525390625,
-0.0128021240234375,
-0.018798828125,
-0.01763916015625,
-0.0222930908203125,
-0.03289794921875,
-0.00263214111328125,
-0.01788330078125,
-0.0032215118408203125,
-0.02984619140625,
-0.0109100341796875,
0.0087738037109375,
0.035797119140625,
-0.0130767822265625,
0.02435302734375,
0.0009312629699707031,
-0.03607177734375,
0.037200927734375,
-0.02734375,
-0.0271453857421875,
0.0614013671875,
0.01580810546875,
0.04010009765625,
-0.00922393798828125,
0.0172882080078125,
0.032958984375,
-0.082275390625,
-0.031646728515625,
0.0071563720703125,
-0.047210693359375,
0.0090179443359375,
-0.04486083984375,
-0.0274200439453125,
-0.0159454345703125,
-0.0145416259765625,
0.0256805419921875,
0.0277557373046875,
0.023223876953125,
0.03546142578125,
-0.01471710205078125,
0.025909423828125,
-0.0091705322265625,
-0.05596923828125,
-0.017669677734375,
0.037353515625,
-0.04486083984375,
-0.0023708343505859375,
0.0269775390625,
0.008514404296875,
-0.01273345947265625,
-0.03173828125,
-0.007328033447265625,
-0.03936767578125,
-0.0007123947143554688,
0.0151824951171875,
-0.0036067962646484375,
-0.0443115234375,
0.004352569580078125,
-0.00829315185546875,
-0.037750244140625,
0.0279998779296875,
0.028076171875,
0.0026836395263671875,
-0.041046142578125,
-0.06829833984375,
-0.003292083740234375,
-0.016021728515625,
-0.0113677978515625,
0.032684326171875,
0.05682373046875,
0.0283203125,
0.0245361328125,
-0.0131683349609375,
0.017791748046875,
0.02093505859375,
-0.006687164306640625,
-0.0239715576171875,
-0.0244293212890625,
-0.024444580078125,
-0.01097869873046875,
0.0019292831420898438,
-0.0180816650390625,
0.009979248046875,
0.021697998046875,
0.05963134765625,
0.00931549072265625,
-0.005588531494140625,
-0.0157928466796875,
0.016815185546875,
-0.0029544830322265625,
-0.002330780029296875,
0.02294921875,
-0.0033206939697265625,
0.0309600830078125,
-0.022003173828125,
-0.04644775390625,
-0.03704833984375,
0.0230255126953125,
-0.0251617431640625,
-0.060760498046875,
0.07366943359375,
-0.02978515625,
0.0276947021484375,
0.032073974609375,
-0.017242431640625,
0.033111572265625,
0.0277557373046875,
-0.045318603515625,
0.056671142578125,
-0.0012311935424804688,
-0.013397216796875,
-0.007030487060546875,
0.00717926025390625,
-0.0105438232421875,
-0.03582763671875,
-0.00004661083221435547,
0.0040435791015625,
0.00798797607421875,
-0.0193023681640625,
-0.053985595703125,
-0.01111602783203125,
-0.022247314453125,
0.04022216796875,
0.0270233154296875,
0.03729248046875,
0.005504608154296875,
0.019195556640625,
-0.0201873779296875,
-0.01453399658203125,
-0.018096923828125,
0.0330810546875,
-0.0036602020263671875,
0.0289459228515625,
-0.005550384521484375,
0.0263824462890625,
0.00333404541015625,
0.00160980224609375,
-0.0098876953125,
0.016265869140625,
0.031005859375,
0.02935791015625,
-0.042755126953125,
-0.0068359375,
0.00330352783203125,
0.0144195556640625,
-0.01093292236328125,
0.03973388671875,
-0.03948974609375,
0.00728607177734375,
-0.0035076141357421875,
-0.004642486572265625,
-0.0002872943878173828,
-0.059844970703125,
0.019805908203125,
0.0341796875,
0.0271148681640625,
0.047271728515625,
0.00106048583984375,
0.007537841796875,
0.01235198974609375,
-0.005687713623046875,
0.035736083984375,
-0.03997802734375,
0.0273895263671875,
0.05914306640625,
-0.0222625732421875,
-0.0045166015625,
0.006366729736328125,
-0.05462646484375,
-0.01526641845703125,
0.04144287109375,
-0.00963592529296875,
-0.0128936767578125,
-0.000020682811737060547,
0.0160980224609375,
-0.01509857177734375,
-0.024139404296875,
0.01436614990234375,
-0.018402099609375,
0.0121307373046875,
-0.028076171875,
0.00034427642822265625,
-0.024322509765625,
-0.03424072265625,
-0.01247406005859375,
0.039215087890625,
0.0163116455078125,
-0.0062255859375,
-0.020233154296875,
-0.06268310546875,
-0.0240936279296875,
0.0017290115356445312,
0.03631591796875,
-0.040802001953125,
-0.038909912109375,
0.005275726318359375,
0.070068359375,
0.01055908203125,
-0.025543212890625,
-0.0202789306640625,
-0.0240631103515625,
-0.014862060546875,
-0.0275421142578125,
0.0308990478515625,
0.0240631103515625,
0.012115478515625,
0.07379150390625,
-0.0025806427001953125,
0.0771484375,
-0.0220489501953125,
0.0151519775390625,
0.0518798828125,
-0.052490234375,
0.0467529296875,
-0.031463623046875,
0.04608154296875,
0.050537109375,
-0.0189056396484375,
0.0227813720703125,
-0.005359649658203125,
-0.0107879638671875,
-0.01053619384765625,
0.011627197265625,
0.006504058837890625,
-0.0372314453125,
0.0250244140625,
0.056610107421875,
0.02294921875,
0.0562744140625,
0.0120391845703125,
-0.0287628173828125,
0.00299835205078125,
0.0281219482421875,
-0.08544921875,
-0.10699462890625,
0.06903076171875,
-0.015228271484375,
0.008056640625,
-0.037872314453125,
-0.0205535888671875,
-0.0310821533203125,
-0.024017333984375,
-0.013397216796875,
0.08819580078125,
-0.0233917236328125,
-0.0662841796875,
0.0006413459777832031,
-0.098388671875,
-0.0108489990234375,
-0.00464630126953125,
0.0093994140625,
-0.00007361173629760742,
0.00969696044921875,
-0.006496429443359375,
-0.02313232421875,
-0.00039458274841308594,
-0.002254486083984375,
0.0164794921875,
-0.02191162109375,
0.004444122314453125,
-0.061676025390625,
-0.0322265625,
0.008392333984375,
0.00029349327087402344,
-0.0469970703125,
0.036224365234375,
-0.01715087890625,
-0.0093994140625,
-0.005245208740234375,
0.03741455078125,
0.0035495758056640625,
-0.00600433349609375,
-0.01027679443359375,
0.03326416015625,
-0.05169677734375,
-0.03741455078125,
-0.0184783935546875,
-0.041168212890625,
0.0545654296875,
0.03619384765625,
-0.0096893310546875,
-0.01111602783203125,
0.034454345703125,
-0.010040283203125,
-0.01837158203125,
-0.025787353515625,
-0.042724609375,
0.0538330078125,
0.0205078125,
0.05584716796875,
0.027130126953125,
0.0255126953125,
-0.0202789306640625,
0.004627227783203125,
0.0058135986328125,
0.001529693603515625,
-0.0008225440979003906,
-0.01088714599609375,
-0.022705078125,
-0.0168304443359375,
0.032470703125,
-0.0289306640625,
0.0024394989013671875,
-0.043365478515625,
-0.00820159912109375,
-0.027801513671875,
0.04229736328125,
-0.0196533203125,
-0.025299072265625,
0.01084136962890625,
0.01169586181640625,
-0.0159149169921875,
-0.037872314453125,
-0.020416259765625,
-0.0308685302734375,
-0.030487060546875,
0.01230621337890625,
-0.03302001953125,
0.01364898681640625,
-0.01517486572265625,
0.047882080078125,
-0.01071929931640625,
-0.0355224609375,
0.0164031982421875,
-0.022705078125,
0.022857666015625,
0.0181732177734375,
0.002643585205078125,
0.0157318115234375,
-0.0003209114074707031,
-0.0516357421875,
0.013031005859375,
-0.00768280029296875,
0.0105438232421875,
-0.01001739501953125,
0.0101470947265625,
-0.006103515625,
0.0020732879638671875,
0.00844573974609375,
-0.0200347900390625,
0.0124053955078125,
0.020263671875,
0.033660888671875,
-0.0141448974609375,
0.009307861328125,
0.01274871826171875,
-0.0266876220703125,
-0.044036865234375,
-0.050537109375,
-0.01204681396484375,
0.00901031494140625,
0.006168365478515625,
0.0058441162109375,
0.01174163818359375,
0.0151214599609375,
-0.06402587890625,
-0.004695892333984375,
0.0416259765625,
0.005725860595703125,
0.043060302734375,
-0.026519775390625,
-0.004543304443359375,
-0.045745849609375,
0.043487548828125,
0.044342041015625,
-0.0177459716796875,
-0.004482269287109375,
0.06243896484375,
0.03070068359375,
-0.05194091796875,
-0.035736083984375,
-0.0033931732177734375,
0.046112060546875,
-0.01983642578125,
0.0107421875,
0.00453948974609375,
-0.03802490234375,
0.026092529296875,
0.0093994140625,
0.0261383056640625,
-0.01068115234375,
0.0709228515625,
-0.00980377197265625,
-0.0275115966796875,
0.0322265625,
0.0024051666259765625,
-0.05096435546875,
0.01953125,
-0.0216217041015625,
-0.0170745849609375,
0.0163116455078125,
0.03662109375,
-0.053253173828125,
0.064208984375,
-0.018341064453125,
-0.0273590087890625,
0.01392364501953125,
-0.052520751953125,
0.0218505859375,
0.0222015380859375,
-0.00034689903259277344,
0.01538848876953125,
0.01181793212890625,
0.0023479461669921875,
0.0128631591796875,
-0.0187835693359375,
-0.01219940185546875,
0.0258026123046875,
-0.01129150390625,
-0.0226898193359375,
0.028045654296875,
0.0011739730834960938,
-0.006389617919921875,
0.0002351999282836914,
-0.01251220703125,
-0.01280975341796875,
0.01483154296875,
-0.0083465576171875,
0.02471923828125,
0.00792694091796875,
0.03326416015625,
0.009735107421875,
-0.006195068359375,
0.009674072265625,
-0.0015439987182617188,
-0.005992889404296875,
-0.0194854736328125,
0.019073486328125,
0.0118255615234375,
-0.013427734375,
-0.00550079345703125,
0.04925537109375,
-0.00970458984375,
0.0209808349609375,
-0.0124359130859375,
0.013885498046875,
0.031768798828125,
-0.007572174072265625,
0.03472900390625,
-0.01336669921875,
-0.0146942138671875,
-0.0357666015625,
-0.0197296142578125,
0.00839996337890625,
0.03875732421875,
-0.01055908203125,
0.0196380615234375,
-0.025390625,
-0.0396728515625,
0.0384521484375,
-0.06988525390625,
0.005401611328125,
0.0269927978515625,
0.0276947021484375,
-0.0183868408203125,
-0.01136016845703125,
0.003498077392578125,
0.0096893310546875,
0.0033588409423828125,
0.005153656005859375,
0.007144927978515625,
0.0003101825714111328,
0.0292816162109375,
-0.0159149169921875,
0.0140228271484375,
-0.00687408447265625,
-0.015716552734375,
-0.0210418701171875,
0.0131072998046875,
0.020416259765625,
-0.057220458984375,
-0.05059814453125,
-0.01029205322265625,
-0.0280609130859375,
0.05377197265625,
-0.0241546630859375,
0.0318603515625,
-0.01538848876953125,
-0.0255126953125,
0.026947021484375,
-0.019317626953125,
0.11627197265625,
0.073486328125,
-0.06561279296875,
0.00400543212890625,
-0.042083740234375,
0.01078033447265625,
-0.00882720947265625,
-0.054534912109375,
-0.019989013671875,
-0.00679779052734375,
-0.01934814453125,
0.029266357421875,
-0.00702667236328125,
0.0234527587890625,
0.002838134765625,
0.031280517578125,
-0.0206146240234375,
0.103515625,
0.0125732421875,
0.0224761962890625,
-0.0157318115234375,
0.038909912109375,
-0.00640106201171875,
-0.01495361328125,
-0.0430908203125,
-0.00519561767578125,
-0.0038166046142578125,
0.00431060791015625,
0.009429931640625,
-0.017974853515625,
0.0638427734375,
-0.0247802734375,
0.01525115966796875,
0.01123046875,
-0.01404571533203125,
0.007465362548828125,
0.00658416748046875,
-0.0172119140625,
-0.004077911376953125,
0.0287017822265625,
-0.036224365234375,
0.0256805419921875,
-0.02825927734375,
-0.0810546875,
0.0103759765625,
0.016265869140625,
0.011260986328125,
0.0163421630859375,
-0.03619384765625,
-0.0078887939453125,
-0.0662841796875,
0.0848388671875,
0.11273193359375,
0.0382080078125,
0.059417724609375,
0.01439666748046875,
0.01213836669921875,
-0.021942138671875,
0.0787353515625,
-0.039459228515625,
-0.0694580078125,
0.0294189453125,
0.0229949951171875,
-0.0278472900390625,
0.0003504753112792969,
-0.027313232421875,
0.006290435791015625,
0.0272369384765625,
0.055145263671875,
-0.0396728515625,
-0.004993438720703125,
0.01340484619140625,
-0.026519775390625,
-0.0007772445678710938,
0.0226593017578125,
-0.0311431884765625,
-0.052978515625,
0.05902099609375,
-0.01953125,
0.0214996337890625,
0.03802490234375,
-0.0019989013671875,
0.005893707275390625,
0.0010995864868164062,
0.043792724609375,
-0.00732421875,
-0.03021240234375,
-0.01123046875,
0.005046844482421875,
0.01543426513671875,
-0.03057861328125,
0.03631591796875,
-0.0037841796875,
-0.00827789306640625,
-0.048370361328125,
0.00666046142578125,
0.0230865478515625,
-0.010162353515625,
0.0009179115295410156,
0.011566162109375,
0.00586700439453125,
0.01212310791015625,
-0.0057373046875,
-0.002269744873046875,
-0.0025386810302734375,
-0.036468505859375,
-0.002628326416015625,
-0.0193328857421875,
0.007656097412109375,
0.0204315185546875,
-0.030426025390625,
0.01751708984375,
-0.0142822265625,
-0.00799560546875,
-0.01343536376953125,
0.0283050537109375,
0.07696533203125,
-0.0097198486328125,
-0.03924560546875,
0.04998779296875,
0.0241851806640625,
-0.0308837890625,
0.01123046875,
0.055816650390625,
-0.0478515625,
-0.0160980224609375,
0.0516357421875,
0.008880615234375,
-0.03826904296875,
0.02081298828125,
-0.04766845703125,
0.07672119140625,
0.031646728515625,
0.0206756591796875,
0.0236358642578125,
0.0160369873046875,
-0.04937744140625,
-0.0057525634765625,
-0.048797607421875,
0.0345458984375,
0.057861328125,
0.0399169921875,
-0.0269775390625,
-0.0297393798828125,
0.00937652587890625,
0.060516357421875,
0.061798095703125,
0.0015096664428710938,
0.0057373046875,
0.01430511474609375,
0.055145263671875,
0.0195159912109375,
-0.03485107421875,
0.00785064697265625,
0.027069091796875,
0.025909423828125,
0.04864501953125,
-0.02069091796875,
0.0217437744140625,
-0.020843505859375,
-0.0017261505126953125,
0.0423583984375,
0.01407623291015625,
0.00933837890625,
-0.01361846923828125,
-0.036590576171875,
-0.0117034912109375,
-0.0178375244140625,
0.0008721351623535156,
-0.0394287109375,
0.0165252685546875,
0.0323486328125,
0.05029296875,
-0.037261962890625,
0.003993988037109375,
-0.024169921875,
0.05377197265625,
0.0010471343994140625,
-0.024322509765625,
-0.0122528076171875,
-0.001544952392578125,
-0.01415252685546875,
-0.02166748046875,
-0.033599853515625,
0.023529052734375,
0.0109405517578125,
0.03851318359375,
0.038482666015625,
0.0198974609375,
-0.0645751953125,
-0.052276611328125,
0.08306884765625,
0.06988525390625,
-0.01291656494140625,
-0.0298614501953125,
0.01043701171875,
0.00830841064453125,
0.00567626953125,
0.012542724609375,
0.04058837890625,
0.02886962890625,
0.041534423828125,
-0.027618408203125,
0.007411956787109375,
0.032684326171875,
0.04193115234375,
0.0177764892578125,
0.01488494873046875,
-0.06549072265625,
-0.0158233642578125,
-0.06329345703125,
0.00432586669921875,
0.0155487060546875,
0.0494384765625,
0.03680419921875,
0.042694091796875,
0.03924560546875,
-0.035736083984375,
-0.0040740966796875,
0.03924560546875,
0.02801513671875,
-0.00849151611328125,
-0.00634002685546875,
0.010894775390625,
-0.00487518310546875,
0.0009145736694335938,
-0.016265869140625,
-0.0023822784423828125,
0.0384521484375,
0.0236663818359375,
-0.058380126953125,
-0.032989501953125,
0.021087646484375,
-0.037200927734375,
0.00507354736328125,
-0.0156402587890625,
-0.0311279296875,
-0.00855255126953125,
-0.02880859375,
-0.011077880859375,
0.01322174072265625,
-0.01470184326171875,
-0.0132598876953125,
0.047698974609375,
-0.0088043212890625,
-0.005859375,
-0.01155853271484375,
-0.02862548828125,
0.035247802734375,
0.001983642578125,
-0.058135986328125,
0.0109710693359375,
-0.019561767578125,
-0.07781982421875,
-0.0006480216979980469,
0.0284423828125,
-0.02252197265625,
0.029541015625,
0.02301025390625,
-0.0086517333984375,
0.00731658935546875,
0.0245819091796875,
-0.01751708984375,
-0.003040313720703125,
0.040802001953125,
0.00225830078125,
-0.052642822265625,
-0.036407470703125,
-0.032989501953125,
0.044464111328125,
0.03717041015625,
0.012359619140625,
0.006046295166015625,
0.03216552734375,
0.0023555755615234375,
0.01062774658203125,
-0.040374755859375,
-0.01507568359375,
0.061859130859375,
-0.00801849365234375,
-0.017364501953125,
-0.0200653076171875,
-0.050323486328125,
0.058441162109375,
0.0026607513427734375,
-0.0007328987121582031,
0.046234130859375,
-0.00644683837890625,
-0.00040793418884277344,
0.00004649162292480469,
0.040771484375,
0.007354736328125,
-0.045379638671875,
-0.021087646484375,
0.0251617431640625,
0.039276123046875,
0.09979248046875,
-0.0161590576171875,
0.0074310302734375,
0.011993408203125,
-0.0217742919921875,
-0.0013856887817382812,
0.01453399658203125,
-0.00804901123046875,
0.0240020751953125,
-0.01082611083984375,
-0.01885986328125,
-0.0022125244140625,
-0.0257415771484375,
0.0249786376953125,
-0.01276397705078125,
0.0631103515625,
-0.0266265869140625,
0.0084686279296875,
0.0260162353515625,
-0.006351470947265625,
0.0291290283203125,
-0.0033054351806640625,
-0.00753021240234375,
0.013824462890625,
0.010711669921875,
0.00019621849060058594,
-0.043731689453125,
0.005153656005859375,
0.00711822509765625,
-0.0093231201171875,
0.033447265625,
0.02630615234375,
0.020782470703125,
0.01629638671875,
0.01116943359375,
0.041412353515625,
-0.00307464599609375,
-0.0123138427734375,
-0.006870269775390625,
-0.0377197265625,
0.0450439453125,
0.0145263671875,
0.0149688720703125,
0.01214599609375,
0.043670654296875,
-0.0270843505859375,
0.016204833984375,
-0.01201629638671875,
-0.0089874267578125,
0.01551055908203125,
0.04669189453125,
0.04010009765625,
-0.0250244140625,
0.0117034912109375,
0.052581787109375,
0.01541900634765625,
0.10223388671875,
-0.0176239013671875,
-0.0207672119140625,
0.02496337890625,
-0.0285797119140625,
-0.0303802490234375,
-0.034912109375,
0.040435791015625,
-0.09539794921875,
-0.0209503173828125,
-0.007526397705078125,
0.01554107666015625,
0.037322998046875,
-0.026947021484375,
-0.08740234375,
0.035797119140625,
-0.01320648193359375,
-0.03533935546875,
-0.040740966796875,
0.0119476318359375,
0.01131439208984375,
-0.02374267578125,
-0.02032470703125,
-0.021209716796875,
-0.0248260498046875,
0.026519775390625,
0.0283355712890625,
-0.0185089111328125,
0.06689453125,
0.01146697998046875,
-0.08648681640625,
-0.014251708984375,
-0.0474853515625,
-0.0022411346435546875,
-0.00489044189453125,
-0.01439666748046875,
0.0243377685546875,
0.019683837890625,
-0.033660888671875,
-0.04290771484375,
0.008941650390625,
0.0090789794921875,
-0.0236053466796875,
-0.01534271240234375,
-0.0251312255859375,
0.01042938232421875,
0.05426025390625,
0.0714111328125,
0.021728515625,
-0.05279541015625,
-0.0177764892578125,
-0.006641387939453125,
-0.04803466796875,
-0.0238037109375,
0.045989990234375,
-0.09564208984375,
-0.02777099609375,
0.01209259033203125,
0.0071258544921875,
0.03656005859375,
-0.046783447265625,
-0.01136016845703125,
-0.0083465576171875,
0.00402069091796875,
0.00896453857421875,
-0.0218048095703125,
-0.0220489501953125,
0.0523681640625,
-0.034698486328125,
-0.00015103816986083984,
-0.0095367431640625,
0.02288818359375,
0.0308837890625,
-0.0231781005859375,
0.01209259033203125,
-0.0110321044921875,
-0.04541015625,
0.016845703125,
-0.01345062255859375,
0.036651611328125,
-0.0316162109375,
-0.046966552734375,
-0.0187835693359375,
0.0167999267578125,
-0.014312744140625,
0.00620269775390625,
-0.01282501220703125,
0.06011962890625,
0.01389312744140625,
0.07452392578125,
-0.03350830078125,
0.047698974609375,
-0.03466796875,
0.041717529296875,
-0.0215911865234375,
0.0127105712890625,
-0.0017452239990234375,
0.023834228515625,
0.0107421875,
0.01215362548828125,
0.042724609375,
-0.0350341796875,
0.0543212890625,
-0.00615692138671875,
0.0213470458984375,
0.031890869140625
] |
2a0e287c1ff809eaace66e3921df7a6d90bbabe8
|
Wordpress Stackexchange
Q: How to get Post ID with the Add Filter Function I'm writing a plugin and am trying to figure out how to add data to the end of a post based on some Custom Meta Information.
So i've done this so far:
add_filter('the_content', 'AppendMeta');
And here is the "AppendMeta" function
AppendMeta($content) {
echo $content; // Echo out post content
$PersonName = get_post_meta($post->ID, 'PersonName', true);
echo 'Person: ' . $PersonName;
}
That code works if I replace $post->ID with the id of the post, but I need it to work based on the post the user is currently navigating. How would I pass the post id in as a parameter? $post->ID doesn't work in this scenario and I can't find out why.
A: the_ID() is only supposed to be used inside the loop, else you can't rely on it. Better use the $GLOBALS['post'] object inside your function call.
|
Q: How to get Post ID with the Add Filter Function I'm writing a plugin and am trying to figure out how to add data to the end of a post based on some Custom Meta Information.
So i've done this so far:
add_filter('the_content', 'AppendMeta');
And here is the "AppendMeta" function
AppendMeta($content) {
echo $content; // Echo out post content
$PersonName = get_post_meta($post->ID, 'PersonName', true);
echo 'Person: ' . $PersonName;
}
That code works if I replace $post->ID with the id of the post, but I need it to work based on the post the user is currently navigating. How would I pass the post id in as a parameter? $post->ID doesn't work in this scenario and I can't find out why.
A: the_ID() is only supposed to be used inside the loop, else you can't rely on it. Better use the $GLOBALS['post'] object inside your function call.
A: Nevermind, found out I can use get_the_ID();.
This function will return the post id inside the the_content filter. The function simply declares the global $post object and returns its ID.
add_filter('the_content', 'wpse51205_content')
wpse51205_content($content) {
echo $content; // Echo out post content
$PersonName = get_post_meta(get_the_ID(), 'PersonName', true);
echo 'Person: ' . $PersonName;
}
If you don't want to use get_the_ID(), you simply need to declare the $post object global before using it:
add_filter('the_content', 'wpse51205_content')
wpse51205_content($content) {
global $post;
echo $content; // Echo out post content
$PersonName = get_post_meta($post->ID), 'PersonName', true);
echo 'Person: ' . $PersonName;
}
|
wordpress
|
{
"language": "en",
"length": 244,
"provenance": "stackexchange_00019.jsonl.gz:419694",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51205"
}
|
[
0.056243896484375,
-0.0038242340087890625,
0.0278778076171875,
-0.017425537109375,
0.032958984375,
-0.0220489501953125,
0.045806884765625,
-0.03759765625,
0.01549530029296875,
0.03173828125,
-0.024810791015625,
-0.043853759765625,
0.006458282470703125,
-0.0259246826171875,
-0.0245513916015625,
-0.0226287841796875,
0.021331787109375,
-0.01251983642578125,
0.032257080078125,
-0.005405426025390625,
-0.0230865478515625,
-0.01287841796875,
0.04833984375,
-0.020660400390625,
0.0131072998046875,
0.002910614013671875,
0.053680419921875,
-0.025299072265625,
0.016937255859375,
-0.01152801513671875,
0.00789642333984375,
-0.0247955322265625,
0.0145111083984375,
-0.0091094970703125,
0.0002295970916748047,
-0.006961822509765625,
-0.0050506591796875,
0.00634002685546875,
0.0254974365234375,
-0.01094818115234375,
0.032623291015625,
-0.005584716796875,
-0.031341552734375,
0.09063720703125,
-0.042205810546875,
-0.050201416015625,
0.03143310546875,
-0.045440673828125,
0.0086669921875,
0.031402587890625,
-0.004474639892578125,
0.01392364501953125,
-0.0032062530517578125,
-0.019439697265625,
0.0143585205078125,
-0.007781982421875,
-0.0362548828125,
-0.0017852783203125,
0.04473876953125,
0.009918212890625,
-0.0265960693359375,
-0.032684326171875,
0.0262603759765625,
-0.030059814453125,
0.0003192424774169922,
0.0011796951293945312,
0.006954193115234375,
0.0167999267578125,
-0.047210693359375,
-0.016815185546875,
0.034423828125,
-0.036346435546875,
0.0225372314453125,
-0.00982666015625,
-0.01486968994140625,
-0.0648193359375,
0.0291290283203125,
-0.02435302734375,
-0.003803253173828125,
-0.0006237030029296875,
-0.022064208984375,
-0.0013751983642578125,
-0.052703857421875,
-0.01111602783203125,
0.0012807846069335938,
0.01171875,
-0.038482666015625,
-0.004974365234375,
-0.01029205322265625,
-0.0159454345703125,
-0.007328033447265625,
-0.0213165283203125,
0.029296875,
-0.0313720703125,
-0.028228759765625,
-0.045379638671875,
0.01479339599609375,
0.041290283203125,
-0.00737762451171875,
0.016632080078125,
0.00200653076171875,
-0.057098388671875,
0.052764892578125,
-0.0560302734375,
0.0001970529556274414,
0.0305633544921875,
0.004703521728515625,
0.03521728515625,
0.0308685302734375,
0.027435302734375,
-0.004055023193359375,
-0.01181793212890625,
-0.0071868896484375,
-0.01284027099609375,
-0.024993896484375,
0.02008056640625,
-0.0323486328125,
-0.01305389404296875,
-0.0018148422241210938,
0.0038547515869140625,
0.00553131103515625,
-0.00351715087890625,
-0.0306243896484375,
0.0345458984375,
0.01380157470703125,
0.0036449432373046875,
-0.0267181396484375,
0.0205230712890625,
-0.01171112060546875,
0.033599853515625,
-0.049560546875,
0.006320953369140625,
0.097412109375,
0.0021877288818359375,
0.006786346435546875,
-0.04071044921875,
-0.018707275390625,
-0.040863037109375,
-0.00878143310546875,
-0.0005397796630859375,
-0.0250396728515625,
-0.021240234375,
0.016448974609375,
-0.02423095703125,
-0.017242431640625,
0.0252685546875,
0.024566650390625,
0.010589599609375,
-0.036407470703125,
-0.06732177734375,
0.00045013427734375,
-0.007633209228515625,
0.037261962890625,
-0.00829315185546875,
0.006900787353515625,
-0.0013370513916015625,
0.0185546875,
-0.0287933349609375,
-0.0235137939453125,
-0.025115966796875,
0.01163482666015625,
0.01103973388671875,
0.0202178955078125,
-0.014495849609375,
-0.023101806640625,
-0.0228729248046875,
-0.051361083984375,
-0.016204833984375,
0.02178955078125,
0.06854248046875,
0.03753662109375,
-0.005474090576171875,
-0.01027679443359375,
-0.0304107666015625,
-0.040740966796875,
-0.042327880859375,
0.0013713836669921875,
0.016571044921875,
0.009033203125,
0.0131378173828125,
-0.0216522216796875,
-0.0308990478515625,
0.044525146484375,
-0.0154571533203125,
-0.0660400390625,
0.06768798828125,
0.023651123046875,
0.082763671875,
-0.004848480224609375,
0.0018863677978515625,
0.041412353515625,
0.01558685302734375,
-0.0321044921875,
0.000016450881958007812,
0.0057220458984375,
-0.010040283203125,
-0.01042938232421875,
-0.0230712890625,
-0.0011425018310546875,
0.0291748046875,
0.04583740234375,
-0.0189971923828125,
0.0250244140625,
0.004482269287109375,
-0.06622314453125,
0.01401519775390625,
-0.0267486572265625,
0.031890869140625,
0.007587432861328125,
-0.0160675048828125,
0.0177154541015625,
-0.045684814453125,
-0.01430511474609375,
0.010223388671875,
-0.03582763671875,
0.02886962890625,
-0.029327392578125,
-0.0246734619140625,
-0.0196380615234375,
0.032806396484375,
-0.03228759765625,
0.0019292831420898438,
-0.0672607421875,
-0.01274871826171875,
0.0780029296875,
-0.0009946823120117188,
-0.00766754150390625,
-0.022003173828125,
0.04815673828125,
0.0086822509765625,
-0.056976318359375,
0.035552978515625,
0.0028533935546875,
0.005466461181640625,
-0.01430511474609375,
-0.00797271728515625,
-0.01522064208984375,
-0.0992431640625,
0.010986328125,
0.0765380859375,
0.032470703125,
0.037261962890625,
0.013702392578125,
0.038970947265625,
0.06866455078125,
-0.0156707763671875,
0.0239410400390625,
-0.006000518798828125,
0.03204345703125,
0.09051513671875,
0.00351715087890625,
0.008575439453125,
0.01354217529296875,
-0.038055419921875,
0.02716064453125,
0.016357421875,
-0.02191162109375,
0.0069732666015625,
-0.006488800048828125,
0.0021343231201171875,
-0.024200439453125,
-0.055206298828125,
0.0026760101318359375,
-0.04241943359375,
0.00732421875,
0.03729248046875,
0.040374755859375,
0.037322998046875,
-0.0023288726806640625,
-0.0007228851318359375,
0.009735107421875,
0.034210205078125,
0.006420135498046875,
-0.008270263671875,
0.0132293701171875,
0.0186309814453125,
-0.03717041015625,
-0.0028400421142578125,
0.032989501953125,
-0.00836181640625,
-0.00162506103515625,
0.0188751220703125,
0.004810333251953125,
-0.017303466796875,
0.0124969482421875,
0.004253387451171875,
0.00658416748046875,
-0.01308441162109375,
-0.0015649795532226562,
-0.01174163818359375,
0.0024585723876953125,
0.0548095703125,
-0.016082763671875,
0.04083251953125,
-0.002376556396484375,
-0.0037841796875,
0.07049560546875,
-0.01160430908203125,
0.038482666015625,
-0.0274200439453125,
-0.00726318359375,
0.0254364013671875,
-0.0386962890625,
0.0074310302734375,
-0.02972412109375,
0.033203125,
-0.025634765625,
0.017364501953125,
-0.00965118408203125,
-0.057647705078125,
0.0283355712890625,
0.03125,
0.030731201171875,
0.03955078125,
-0.003437042236328125,
-0.031829833984375,
-0.0147857666015625,
0.024749755859375,
-0.081787109375,
-0.07244873046875,
0.024566650390625,
-0.056640625,
-0.034149169921875,
-0.015594482421875,
-0.040435791015625,
0.0164947509765625,
0.0165557861328125,
-0.0107421875,
-0.0008840560913085938,
-0.0206146240234375,
-0.09381103515625,
-0.0498046875,
-0.044219970703125,
0.034759521484375,
-0.02899169921875,
0.00508880615234375,
0.00311279296875,
0.0609130859375,
0.0176849365234375,
-0.0188140869140625,
0.0144805908203125,
0.0104827880859375,
-0.035919189453125,
-0.030548095703125,
-0.0285186767578125,
-0.00218963623046875,
-0.01222991943359375,
-0.0082550048828125,
0.0294036865234375,
0.00478363037109375,
-0.007534027099609375,
0.002285003662109375,
-0.042083740234375,
0.032562255859375,
0.01502227783203125,
-0.006092071533203125,
0.05072021484375,
0.07159423828125,
0.06494140625,
0.0113067626953125,
0.00441741943359375,
-0.037017822265625,
-0.0289306640625,
0.00750732421875,
0.038116455078125,
-0.004520416259765625,
-0.041839599609375,
0.02880859375,
0.003887176513671875,
0.0159454345703125,
0.00670623779296875,
-0.029632568359375,
0.0279998779296875,
0.006282806396484375,
0.0163726806640625,
0.00664520263671875,
-0.02996826171875,
-0.032318115234375,
0.00461578369140625,
-0.024139404296875,
0.01459503173828125,
0.0248565673828125,
-0.02447509765625,
-0.005832672119140625,
-0.03643798828125,
0.050262451171875,
0.018035888671875,
0.0231170654296875,
-0.0251617431640625,
-0.046173095703125,
-0.0030040740966796875,
0.08258056640625,
-0.0240936279296875,
-0.0215911865234375,
0.003925323486328125,
0.00042819976806640625,
-0.0261383056640625,
-0.0003864765167236328,
-0.04534912109375,
-0.01157379150390625,
-0.01403045654296875,
0.0010805130004882812,
-0.002758026123046875,
-0.0159454345703125,
-0.01062774658203125,
0.0477294921875,
-0.00565338134765625,
0.000354766845703125,
0.0416259765625,
-0.042938232421875,
0.0182037353515625,
0.049224853515625,
0.017974853515625,
0.032501220703125,
-0.03759765625,
-0.0033740997314453125,
-0.0404052734375,
-0.01500701904296875,
0.0076141357421875,
0.036590576171875,
-0.00858306884765625,
-0.0040283203125,
-0.00902557373046875,
0.038177490234375,
0.0261688232421875,
0.037322998046875,
-0.003513336181640625,
0.00018739700317382812,
0.0178985595703125,
-0.0545654296875,
0.00036597251892089844,
-0.04248046875,
-0.0227203369140625,
-0.02703857421875,
-0.0145416259765625,
0.0271148681640625,
-0.039154052734375,
-0.020751953125,
-0.0303802490234375,
-0.0028324127197265625,
-0.04644775390625,
-0.0205841064453125,
-0.007251739501953125,
0.0216827392578125,
-0.0177154541015625,
0.00788116455078125,
-0.0256195068359375,
-0.08056640625,
0.0645751953125,
0.01178741455078125,
-0.015472412109375,
-0.00983428955078125,
0.1087646484375,
0.0183868408203125,
-0.0265960693359375,
-0.0379638671875,
0.054931640625,
0.039154052734375,
-0.032501220703125,
0.07305908203125,
0.0306396484375,
-0.0159149169921875,
0.08001708984375,
0.0037593841552734375,
0.01354217529296875,
-0.037811279296875,
0.083984375,
-0.0176849365234375,
-0.0156707763671875,
0.032257080078125,
-0.041778564453125,
-0.00811004638671875,
-0.012237548828125,
-0.05487060546875,
0.01250457763671875,
-0.01522064208984375,
0.0362548828125,
-0.0310516357421875,
0.060150146484375,
-0.037017822265625,
-0.00972747802734375,
0.0214080810546875,
-0.050689697265625,
0.00411224365234375,
-0.01197052001953125,
0.0121002197265625,
-0.0377197265625,
-0.01351165771484375,
0.0305023193359375,
0.0014324188232421875,
0.0092926025390625,
-0.0111083984375,
0.040496826171875,
0.03656005859375,
0.0228424072265625,
-0.01580810546875,
-0.001861572265625,
0.00811767578125,
0.00677490234375,
-0.039276123046875,
0.012664794921875,
0.005664825439453125,
-0.027069091796875,
0.0017938613891601562,
0.017669677734375,
0.01169586181640625,
0.027984619140625,
0.01345062255859375,
-0.0020885467529296875,
-0.00958251953125,
0.051422119140625,
-0.01499176025390625,
0.007778167724609375,
-0.005329132080078125,
-0.010040283203125,
-0.01373291015625,
0.05950927734375,
-0.014190673828125,
0.023101806640625,
-0.026519775390625,
0.0545654296875,
0.0288848876953125,
0.048675537109375,
0.0211639404296875,
-0.025787353515625,
-0.00807952880859375,
0.02935791015625,
-0.036590576171875,
-0.039947509765625,
-0.0018978118896484375,
0.003459930419921875,
0.03704833984375,
0.00736236572265625,
-0.002368927001953125,
0.0088958740234375,
-0.0115966796875,
-0.0020656585693359375,
0.01477813720703125,
0.01983642578125,
-0.0113677978515625,
-0.01149749755859375,
-0.005321502685546875,
0.0087738037109375,
0.018890380859375,
0.0263671875,
-0.014923095703125,
0.0177154541015625,
0.0289306640625,
-0.0018062591552734375,
0.016876220703125,
-0.0155792236328125,
-0.021453857421875,
-0.0017366409301757812,
-0.021759033203125,
-0.0164031982421875,
0.01026153564453125,
-0.0159454345703125,
-0.01245880126953125,
-0.00348663330078125,
0.054962158203125,
-0.0274810791015625,
0.05914306640625,
0.01354217529296875,
-0.04827880859375,
0.01219940185546875,
0.02764892578125,
0.01097869873046875,
0.0036773681640625,
-0.01355743408203125,
0.0228729248046875,
-0.036346435546875,
0.0019931793212890625,
0.01119232177734375,
-0.0287322998046875,
-0.0193939208984375,
-0.02490234375,
-0.034454345703125,
0.036651611328125,
-0.036041259765625,
0.0149078369140625,
-0.018035888671875,
-0.0005822181701660156,
-0.01702880859375,
0.06768798828125,
0.01690673828125,
0.05029296875,
-0.0228271484375,
0.0482177734375,
0.0277099609375,
0.026275634765625,
-0.02984619140625,
-0.040191650390625,
-0.000011861324310302734,
-0.045318603515625,
-0.0010042190551757812,
0.0035762786865234375,
0.0010366439819335938,
-0.007293701171875,
-0.0162506103515625,
-0.0013265609741210938,
0.0302886962890625,
-0.01242828369140625,
-0.00640106201171875,
0.003963470458984375,
-0.03118896484375,
0.00740814208984375,
-0.00772857666015625,
0.074951171875,
-0.0343017578125,
-0.0169219970703125,
0.026519775390625,
0.055328369140625,
-0.00887298583984375,
-0.0196075439453125,
-0.00858306884765625,
0.007335662841796875,
-0.0161895751953125,
0.013519287109375,
0.0654296875,
0.0203399658203125,
0.03717041015625,
0.01320648193359375,
0.013458251953125,
0.01448822021484375,
0.01194000244140625,
0.01136016845703125,
-0.00156402587890625,
0.0423583984375,
0.0034732818603515625,
-0.0219879150390625,
0.01357269287109375,
-0.0338134765625,
0.01364898681640625,
-0.0258636474609375,
0.010040283203125,
-0.0143890380859375,
0.0172119140625,
-0.0196533203125,
-0.0036773681640625,
0.03338623046875,
0.0059356689453125,
0.006378173828125,
0.0034027099609375,
0.04742431640625,
0.043182373046875,
0.005340576171875,
0.06463623046875,
0.0183868408203125,
-0.046875,
-0.059844970703125,
-0.0299835205078125,
-0.0080108642578125,
0.03765869140625,
0.0160675048828125,
-0.00675201416015625,
-0.0301055908203125,
-0.03387451171875,
0.01183319091796875,
-0.01763916015625,
0.0033702850341796875,
-0.03521728515625,
0.0260772705078125,
-0.023529052734375,
0.03204345703125,
0.033233642578125,
-0.0025234222412109375,
0.060577392578125,
0.023040771484375,
0.0173492431640625,
-0.0009417533874511719,
-0.007366180419921875,
0.01525115966796875,
0.0048675537109375,
-0.03741455078125,
-0.03717041015625,
0.0295257568359375,
0.00934600830078125,
0.00833892822265625,
0.035736083984375,
-0.027862548828125,
-0.009918212890625,
-0.06427001953125,
0.056732177734375,
-0.0201263427734375,
-0.0205230712890625,
0.01021575927734375,
0.006244659423828125,
-0.02008056640625,
0.005901336669921875,
0.0472412109375,
-0.028228759765625,
-0.007762908935546875,
0.019287109375,
-0.01010894775390625,
-0.01256561279296875,
0.01064300537109375,
-0.08111572265625,
0.09136962890625,
0.037811279296875,
0.004779815673828125,
-0.058135986328125,
0.04541015625,
-0.01824951171875,
0.0022830963134765625,
-0.042633056640625,
0.047576904296875,
-0.0191802978515625,
0.04833984375,
-0.08392333984375,
-0.01824951171875,
0.00795745849609375,
0.030242919921875,
0.10931396484375,
0.0225067138671875,
-0.038909912109375,
-0.0496826171875,
-0.0026836395263671875,
0.01088714599609375,
-0.0283660888671875,
0.04833984375,
0.01036834716796875,
0.03936767578125,
0.067138671875,
-0.037811279296875,
0.032989501953125,
-0.0333251953125,
0.017120361328125,
0.02020263671875,
0.003673553466796875,
-0.0015192031860351562,
-0.00807952880859375,
0.013153076171875,
0.0036487579345703125,
-0.0281829833984375,
-0.0020923614501953125,
-0.06427001953125,
0.0213775634765625,
0.053863525390625,
0.0640869140625,
-0.059478759765625,
-0.045623779296875,
-0.0290985107421875,
0.059356689453125,
0.00839996337890625,
0.0341796875,
0.018341064453125,
0.02020263671875,
0.03802490234375,
0.0030040740966796875,
0.0029201507568359375,
0.020782470703125,
-0.00812530517578125,
0.060577392578125,
0.0310211181640625,
0.0115966796875,
-0.054962158203125,
-0.0103912353515625,
0.042327880859375,
0.07171630859375,
-0.037994384765625,
-0.0012426376342773438,
0.01125335693359375,
0.00820159912109375,
0.0202484130859375,
-0.0275421142578125,
0.040618896484375,
-0.007053375244140625,
-0.004718780517578125,
-0.03521728515625,
0.00861358642578125,
0.03619384765625,
0.039306640625,
-0.004253387451171875,
-0.0234527587890625,
-0.06817626953125,
0.0128021240234375,
-0.0369873046875,
0.004505157470703125,
0.04595947265625,
0.051239013671875,
0.01131439208984375,
0.05169677734375,
-0.00036072731018066406,
-0.0025882720947265625,
0.004962921142578125,
0.03057861328125,
0.0229644775390625,
0.000988006591796875,
0.01045989990234375,
0.00467681884765625,
0.00829315185546875,
0.0008897781372070312,
0.029022216796875,
0.0443115234375,
0.058837890625,
-0.00658416748046875,
-0.055023193359375,
0.01207733154296875,
0.030731201171875,
-0.045196533203125,
0.026458740234375,
-0.039215087890625,
0.04266357421875,
0.023529052734375,
-0.0004684925079345703,
-0.0250396728515625,
-0.003204345703125,
0.053009033203125,
0.0024509429931640625,
0.0008435249328613281,
0.01001739501953125,
-0.043060302734375,
0.052978515625,
0.042022705078125,
0.054779052734375,
0.0179901123046875,
-0.10308837890625,
0.0143585205078125,
-0.04217529296875,
-0.0860595703125,
0.0272216796875,
0.039642333984375,
-0.03631591796875,
0.0174102783203125,
-0.0340576171875,
-0.01529693603515625,
0.0014781951904296875,
0.0103607177734375,
-0.0037860870361328125,
0.062408447265625,
0.0160064697265625,
0.00598907470703125,
-0.015228271484375,
0.002887725830078125,
0.005283355712890625,
0.0005478858947753906,
0.0277557373046875,
0.020599365234375,
0.018310546875,
0.0277099609375,
-0.05157470703125,
0.0531005859375,
-0.046051025390625,
-0.02734375,
0.055816650390625,
0.05218505859375,
0.0210418701171875,
-0.0155181884765625,
0.01409912109375,
0.00439453125,
0.0487060546875,
-0.032073974609375,
0.01172637939453125,
-0.008026123046875,
0.01617431640625,
-0.020965576171875,
0.03839111328125,
-0.004306793212890625,
0.0252532958984375,
-0.02899169921875,
-0.04058837890625,
0.08837890625,
0.0657958984375,
0.027740478515625,
-0.0289154052734375,
0.0213470458984375,
-0.024383544921875,
0.01434326171875,
0.030975341796875,
0.00925445556640625,
0.02642822265625,
-0.01537322998046875,
-0.03277587890625,
-0.00597381591796875,
-0.01018524169921875,
0.024169921875,
-0.0078277587890625,
0.045745849609375,
0.00616455078125,
-0.052276611328125,
-0.0146331787109375,
0.0246124267578125,
0.07073974609375,
0.0011663436889648438,
0.037139892578125,
-0.0086669921875,
0.01080322265625,
-0.02532958984375,
0.006061553955078125,
-0.027679443359375,
-0.042999267578125,
0.016693115234375,
0.01476287841796875,
0.0015954971313476562,
-0.0199432373046875,
-0.044158935546875,
0.007373809814453125,
0.0067138671875,
-0.0014333724975585938,
-0.0268707275390625,
0.0191497802734375,
-0.007663726806640625,
0.0234527587890625,
-0.03192138671875,
0.01528167724609375,
-0.005527496337890625,
0.00934600830078125,
-0.033721923828125,
-0.007678985595703125,
-0.0323486328125,
0.028076171875,
-0.0036449432373046875,
0.007610321044921875,
0.02569580078125,
-0.02069091796875,
0.00005054473876953125,
-0.0033016204833984375,
-0.0055084228515625,
0.0533447265625,
-0.0265045166015625,
-0.02435302734375,
0.01849365234375,
-0.004726409912109375,
0.007232666015625,
-0.025390625,
0.01084136962890625,
-0.03564453125,
-0.0180511474609375,
0.004535675048828125,
0.00334930419921875,
0.0284423828125,
-0.0262298583984375,
-0.059417724609375,
0.0310211181640625,
-0.00525665283203125,
-0.02996826171875,
-0.0223846435546875,
-0.021453857421875,
0.0026569366455078125,
-0.029510498046875,
-0.022552490234375,
-0.0185546875,
-0.03662109375,
0.0268096923828125,
-0.0238800048828125,
0.015228271484375,
0.0208282470703125,
-0.0278472900390625,
-0.033172607421875,
-0.041534423828125,
-0.0233154296875,
-0.0293121337890625,
0.003612518310546875,
-0.032989501953125,
0.048248291015625,
0.00896453857421875,
-0.04443359375,
0.0145263671875,
0.03106689453125,
0.0340576171875,
-0.0313720703125,
-0.072265625,
-0.04052734375,
-0.0167083740234375,
0.11419677734375,
0.0640869140625,
0.03240966796875,
-0.0572509765625,
0.02679443359375,
0.0208282470703125,
-0.031951904296875,
-0.018157958984375,
0.0135040283203125,
-0.0275421142578125,
-0.02740478515625,
-0.05792236328125,
-0.021026611328125,
-0.008148193359375,
-0.0034313201904296875,
-0.039031982421875,
-0.005985260009765625,
-0.001026153564453125,
0.01055908203125,
-0.051910400390625,
-0.02606201171875,
0.04754638671875,
-0.060333251953125,
-0.04327392578125,
0.0102996826171875,
0.016448974609375,
-0.0217132568359375,
-0.0341796875,
0.00159454345703125,
-0.00865936279296875,
-0.01300048828125,
0.042816162109375,
0.0046539306640625,
0.0340576171875,
-0.0269927978515625,
-0.0292510986328125,
-0.032806396484375,
0.007671356201171875,
-0.0006079673767089844,
-0.0018968582153320312,
0.0252227783203125,
0.024261474609375,
0.0113067626953125,
0.053955078125,
-0.034393310546875,
0.053009033203125,
-0.01023101806640625,
0.0110015869140625,
-0.032806396484375,
0.0212860107421875,
0.0294342041015625,
-0.0071563720703125,
-0.01235198974609375,
-0.021942138671875,
-0.0030536651611328125,
-0.052825927734375,
0.0197906494140625,
-0.01152801513671875,
-0.00811767578125,
0.02532958984375
] |
9f2a41c3d96d0b1c395d655aeb179e541690557b
|
Wordpress Stackexchange
Q: Only show div on homepage/blog index in wordpress/php I have a wordpress site. I have a div that I only want to appear on the homepage (in the header). What type of php if statement do i need...
In other words:
only show .... in the header of the main blog index page. Problem is the header itself is loaded in every page.
Thanks!
A: See: http://codex.wordpress.org/Function_Reference/is_home
<?php if(is_home()): ?>
<div>Your div.</div>
<?php endif; ?>
|
Q: Only show div on homepage/blog index in wordpress/php I have a wordpress site. I have a div that I only want to appear on the homepage (in the header). What type of php if statement do i need...
In other words:
only show .... in the header of the main blog index page. Problem is the header itself is loaded in every page.
Thanks!
A: See: http://codex.wordpress.org/Function_Reference/is_home
<?php if(is_home()): ?>
<div>Your div.</div>
<?php endif; ?>
A: <?php if(is_home()): ?>
<div>Your div.</div>
<?php endif; ?>
Using above code works fine as long as you are not setting static Page for the Front Page display from here Administration > Settings > Reading.
<?php if(is_front_page()): ?>
<div>Your div.</div>
<?php endif; ?>
But this code will work irrespective of whether the main blog page is showing or you have set a static page to show on home page.
A: You could also solve the problem with CSS.
Set the div to
#your-div{
display: none;
}
in your css.
Then find the body class page-id for the front page and set the css for that as:
.body-class-page-id #your-div {
display: block;
}
This will hide it on every page except the page you want to show it on.
A: There's always $_SERVER['REQUEST_URI'] you can use to determine which page you're at. For homepage it is usually just '/'. so:
<?php if( $_SERVER['REQUEST_URI'] == '/' ) { ?>
<div id="home_only">Content goes here..</div>
<?php } ?>
|
wordpress
|
{
"language": "en",
"length": 240,
"provenance": "stackexchange_00019.jsonl.gz:419695",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51213"
}
|
[
0.04766845703125,
0.0025501251220703125,
0.0196380615234375,
0.0110626220703125,
0.0184783935546875,
-0.034393310546875,
0.06463623046875,
-0.043182373046875,
0.0577392578125,
-0.014556884765625,
-0.116455078125,
0.0010232925415039062,
-0.0207061767578125,
0.002532958984375,
-0.01424407958984375,
-0.06500244140625,
0.038116455078125,
-0.032012939453125,
0.0272674560546875,
0.008148193359375,
-0.006816864013671875,
0.02154541015625,
0.0458984375,
0.0110626220703125,
0.005886077880859375,
-0.08587646484375,
0.08380126953125,
-0.01372528076171875,
0.0160675048828125,
-0.00804901123046875,
0.02008056640625,
0.0017261505126953125,
0.0298919677734375,
0.013702392578125,
-0.0087127685546875,
0.019927978515625,
0.00777435302734375,
0.00476837158203125,
0.02105712890625,
0.01445770263671875,
0.0249786376953125,
-0.006671905517578125,
0.01064300537109375,
0.0384521484375,
-0.0163421630859375,
-0.01433563232421875,
0.00882720947265625,
-0.0263519287109375,
-0.01470947265625,
0.002002716064453125,
0.01071929931640625,
0.02239990234375,
0.0164794921875,
-0.031951904296875,
0.013946533203125,
0.03485107421875,
0.0038814544677734375,
-0.0264129638671875,
0.0152130126953125,
-0.028045654296875,
-0.022857666015625,
-0.01409912109375,
0.04290771484375,
0.0223388671875,
-0.004627227783203125,
0.005329132080078125,
-0.0106201171875,
0.01503753662109375,
-0.08074951171875,
-0.0236968994140625,
0.05230712890625,
-0.052703857421875,
-0.024810791015625,
-0.0201873779296875,
-0.06121826171875,
0.0164642333984375,
0.03387451171875,
-0.030181884765625,
-0.0022029876708984375,
-0.00827789306640625,
-0.0262603759765625,
0.01538848876953125,
-0.0927734375,
-0.03936767578125,
0.024688720703125,
-0.00989532470703125,
-0.01226806640625,
-0.0115203857421875,
-0.00677490234375,
-0.01126861572265625,
-0.01230621337890625,
0.0198974609375,
-0.0361328125,
-0.00868988037109375,
-0.007366180419921875,
-0.0167999267578125,
-0.034423828125,
0.0268096923828125,
-0.044158935546875,
0.029937744140625,
-0.035125732421875,
-0.0019464492797851562,
0.0328369140625,
-0.048492431640625,
0.0022411346435546875,
0.06671142578125,
0.00193023681640625,
0.0283355712890625,
0.03515625,
0.023223876953125,
0.0227508544921875,
-0.0213775634765625,
-0.03057861328125,
-0.0277557373046875,
-0.01078033447265625,
0.0044403076171875,
-0.06488037109375,
-0.019378662109375,
0.0008707046508789062,
-0.0284423828125,
0.0036640167236328125,
0.04443359375,
0.01555633544921875,
-0.0506591796875,
-0.01194000244140625,
-0.0198516845703125,
0.0032901763916015625,
-0.055938720703125,
0.049591064453125,
0.00516510009765625,
-0.0078887939453125,
0.012908935546875,
-0.01279449462890625,
-0.03460693359375,
-0.03662109375,
-0.00029015541076660156,
0.05908203125,
-0.00641632080078125,
-0.019012451171875,
0.01232147216796875,
0.01384735107421875,
-0.006443023681640625,
-0.0287933349609375,
-0.030242919921875,
-0.034393310546875,
0.0137176513671875,
0.017608642578125,
0.0184326171875,
-0.033050537109375,
-0.044097900390625,
-0.004451751708984375,
-0.006877899169921875,
0.0255126953125,
0.0245513916015625,
0.00716400146484375,
0.0159454345703125,
0.0439453125,
-0.027679443359375,
-0.0265960693359375,
-0.0192108154296875,
0.03125,
0.0321044921875,
0.0396728515625,
-0.01537322998046875,
-0.023406982421875,
-0.059539794921875,
-0.047027587890625,
-0.0098114013671875,
0.0101776123046875,
0.0293731689453125,
-0.017181396484375,
-0.021697998046875,
0.006084442138671875,
0.0187835693359375,
-0.0125274658203125,
0.018280029296875,
0.0005445480346679688,
-0.019561767578125,
0.0187530517578125,
0.045013427734375,
-0.006748199462890625,
-0.01180267333984375,
0.00904083251953125,
0.00022149085998535156,
-0.061981201171875,
0.050750732421875,
-0.0248870849609375,
0.02447509765625,
0.0178070068359375,
-0.0070343017578125,
0.04840087890625,
0.038238525390625,
-0.054901123046875,
0.0123138427734375,
-0.00982666015625,
-0.00003457069396972656,
-0.00989532470703125,
-0.0016527175903320312,
-0.00936126708984375,
-0.0112152099609375,
-0.00411224365234375,
0.01169586181640625,
-0.006671905517578125,
-0.01035308837890625,
-0.0249176025390625,
-0.0179595947265625,
-0.0029773712158203125,
0.03271484375,
0.025482177734375,
0.048187255859375,
-0.00806427001953125,
0.011749267578125,
0.004619598388671875,
-0.064208984375,
-0.036102294921875,
0.0017557144165039062,
0.00579833984375,
0.060333251953125,
0.01064300537109375,
0.032196044921875,
0.00310516357421875,
0.00792694091796875,
-0.01393890380859375,
-0.006511688232421875,
0.0679931640625,
-0.01354217529296875,
-0.0109405517578125,
-0.032135009765625,
0.056182861328125,
0.0176239013671875,
-0.07073974609375,
0.028167724609375,
0.0134735107421875,
0.0333251953125,
-0.055023193359375,
-0.0159759521484375,
-0.0447998046875,
-0.02203369140625,
-0.001895904541015625,
0.047027587890625,
0.0026912689208984375,
-0.0051116943359375,
-0.0245819091796875,
0.046783447265625,
0.024383544921875,
-0.0009551048278808594,
0.007549285888671875,
0.0289154052734375,
-0.00490570068359375,
-0.0037555694580078125,
-0.028839111328125,
0.00653839111328125,
0.03594970703125,
-0.07220458984375,
0.02520751953125,
0.049102783203125,
0.0193939208984375,
0.07733154296875,
-0.05718994140625,
-0.0094451904296875,
0.0010194778442382812,
0.033233642578125,
-0.007015228271484375,
0.0077056884765625,
0.045135498046875,
-0.025421142578125,
0.025665283203125,
0.014373779296875,
-0.0012035369873046875,
-0.019195556640625,
0.00016987323760986328,
-0.0206298828125,
0.0116119384765625,
0.0772705078125,
0.035308837890625,
0.0277862548828125,
-0.0254364013671875,
-0.031494140625,
0.00833892822265625,
0.041900634765625,
-0.0302734375,
0.01270294189453125,
-0.031494140625,
-0.011138916015625,
-0.00909423828125,
-0.03509521484375,
0.01421356201171875,
-0.00853729248046875,
0.0232391357421875,
0.01125335693359375,
0.0146331787109375,
0.0245208740234375,
-0.032989501953125,
0.04931640625,
0.052032470703125,
-0.0289764404296875,
-0.0341796875,
-0.03314208984375,
0.029632568359375,
-0.01076507568359375,
0.0166778564453125,
0.07171630859375,
-0.0016422271728515625,
0.037322998046875,
0.010101318359375,
0.0172119140625,
0.0163726806640625,
-0.00951385498046875,
-0.0196685791015625,
0.040924072265625,
-0.07403564453125,
0.012969970703125,
0.01334381103515625,
0.016632080078125,
0.01404571533203125,
-0.035430908203125,
0.0230560302734375,
0.0149688720703125,
-0.07086181640625,
-0.09466552734375,
-0.0171966552734375,
-0.019287109375,
0.019378662109375,
0.0010938644409179688,
0.011322021484375,
-0.01137542724609375,
0.00801849365234375,
0.005096435546875,
-0.043304443359375,
0.0018339157104492188,
-0.04766845703125,
-0.07489013671875,
-0.07281494140625,
-0.003875732421875,
-0.0176544189453125,
0.0302734375,
-0.012939453125,
0.062408447265625,
0.017913818359375,
-0.019805908203125,
0.021148681640625,
0.035614013671875,
-0.0080108642578125,
0.00841522216796875,
-0.0254058837890625,
0.00899505615234375,
-0.0306549072265625,
0.0259246826171875,
-0.0506591796875,
-0.041412353515625,
0.0211334228515625,
-0.032928466796875,
-0.0239410400390625,
-0.0262908935546875,
-0.04132080078125,
0.0975341796875,
0.055633544921875,
-0.040924072265625,
0.00489044189453125,
-0.055145263671875,
-0.0291290283203125,
0.0032100677490234375,
-0.051055908203125,
-0.0157318115234375,
0.041717529296875,
-0.018768310546875,
0.005382537841796875,
-0.041015625,
0.0135650634765625,
0.0267791748046875,
-0.00887298583984375,
-0.00415802001953125,
0.03253173828125,
0.004062652587890625,
0.0168609619140625,
-0.01230621337890625,
0.032257080078125,
-0.0108184814453125,
0.029266357421875,
0.020233154296875,
-0.01140594482421875,
-0.04107666015625,
0.022552490234375,
-0.05975341796875,
-0.01537322998046875,
0.0164794921875,
-0.0030727386474609375,
0.0129241943359375,
0.004650115966796875,
-0.0166778564453125,
0.027679443359375,
0.0673828125,
-0.06304931640625,
0.002613067626953125,
-0.00788116455078125,
-0.0021724700927734375,
-0.0159149169921875,
-0.03045654296875,
-0.07366943359375,
-0.0014982223510742188,
-0.0606689453125,
0.0166473388671875,
-0.0267791748046875,
0.0086212158203125,
-0.0290374755859375,
0.03509521484375,
-0.039398193359375,
-0.0352783203125,
0.0251617431640625,
-0.00519561767578125,
-0.01519012451171875,
0.03759765625,
-0.04071044921875,
0.0254364013671875,
-0.01531219482421875,
-0.0282745361328125,
-0.043731689453125,
-0.00743865966796875,
-0.0084228515625,
0.0164794921875,
0.017852783203125,
-0.03717041015625,
-0.019012451171875,
0.006855010986328125,
0.0027828216552734375,
-0.007167816162109375,
0.018463134765625,
-0.00507354736328125,
0.0233001708984375,
0.004364013671875,
-0.002773284912109375,
-0.0222015380859375,
-0.0216064453125,
0.00437164306640625,
-0.006320953369140625,
0.043975830078125,
0.0032863616943359375,
-0.0019006729125976562,
0.01012420654296875,
-0.0027256011962890625,
-0.024261474609375,
-0.050262451171875,
-0.0106048583984375,
0.043914794921875,
-0.01271820068359375,
0.0184783935546875,
-0.07171630859375,
-0.0430908203125,
0.0401611328125,
0.02362060546875,
-0.0287322998046875,
0.005462646484375,
0.05194091796875,
0.0207977294921875,
-0.034820556640625,
-0.04278564453125,
0.03631591796875,
0.04339599609375,
0.0192413330078125,
0.06396484375,
0.0106201171875,
-0.035614013671875,
0.10162353515625,
0.021759033203125,
0.017730712890625,
-0.0033817291259765625,
0.03839111328125,
0.005756378173828125,
-0.04290771484375,
0.040008544921875,
0.02154541015625,
-0.030548095703125,
0.0282135009765625,
0.00841522216796875,
-0.02728271484375,
0.00014448165893554688,
0.0031986236572265625,
-0.014495849609375,
0.02520751953125,
-0.00829315185546875,
0.02667236328125,
-0.0219573974609375,
0.0257720947265625,
0.055877685546875,
0.047821044921875,
0.00921630859375,
-0.01361083984375,
0.032135009765625,
-0.02215576171875,
0.052947998046875,
0.016204833984375,
0.00902557373046875,
0.01366424560546875,
0.0162811279296875,
-0.034149169921875,
0.0207672119140625,
-0.006175994873046875,
0.0283355712890625,
-0.007259368896484375,
-0.051513671875,
0.0038394927978515625,
-0.0006241798400878906,
0.0355224609375,
0.030303955078125,
0.008880615234375,
0.005218505859375,
-0.0233306884765625,
0.0016546249389648438,
-0.0013189315795898438,
0.022003173828125,
-0.040130615234375,
-0.0207977294921875,
0.026641845703125,
0.0014638900756835938,
0.0059967041015625,
-0.0097198486328125,
0.055419921875,
0.01593017578125,
0.0213165283203125,
-0.0330810546875,
-0.0115814208984375,
0.01416778564453125,
0.003414154052734375,
0.02410888671875,
0.01036834716796875,
0.0022830963134765625,
-0.0169677734375,
0.0430908203125,
0.0100555419921875,
-0.00865936279296875,
0.03656005859375,
0.01434326171875,
-0.016693115234375,
-0.0039043426513671875,
-0.002941131591796875,
-0.004192352294921875,
-0.01348876953125,
0.0601806640625,
0.01154327392578125,
-0.05780029296875,
-0.024505615234375,
0.035369873046875,
0.04534912109375,
-0.017913818359375,
-0.018218994140625,
-0.0164947509765625,
-0.017730712890625,
0.0200958251953125,
0.05194091796875,
-0.02435302734375,
0.031341552734375,
0.003139495849609375,
-0.014404296875,
-0.0205535888671875,
-0.00707244873046875,
-0.045074462890625,
0.00104522705078125,
-0.0214996337890625,
-0.0181427001953125,
0.0065765380859375,
-0.02667236328125,
0.017364501953125,
-0.02850341796875,
-0.003604888916015625,
0.00027871131896972656,
0.01319122314453125,
0.044708251953125,
0.024932861328125,
-0.10015869140625,
0.009674072265625,
-0.058868408203125,
0.00787353515625,
-0.05059814453125,
-0.06561279296875,
-0.05584716796875,
-0.00907135009765625,
0.00896453857421875,
0.0192718505859375,
0.0033893585205078125,
-0.017333984375,
-0.034576416015625,
0.006328582763671875,
0.0192413330078125,
0.035430908203125,
-0.031524658203125,
0.05999755859375,
0.0040740966796875,
0.05462646484375,
0.0045623779296875,
0.046234130859375,
0.048187255859375,
-0.04327392578125,
0.051177978515625,
-0.020843505859375,
-0.048370361328125,
-0.03448486328125,
-0.01235198974609375,
-0.0295867919921875,
-0.0021648406982421875,
-0.032745361328125,
0.015380859375,
0.00519561767578125,
-0.00951385498046875,
-0.00839996337890625,
-0.005733489990234375,
-0.00986480712890625,
-0.0086669921875,
0.0224761962890625,
0.01116180419921875,
0.006343841552734375,
-0.0009784698486328125,
-0.0029201507568359375,
0.0120391845703125,
0.006038665771484375,
0.021209716796875,
-0.04107666015625,
-0.03021240234375,
0.05255126953125,
0.10443115234375,
0.00762939453125,
0.05999755859375,
0.035308837890625,
0.017791748046875,
0.035369873046875,
0.0206146240234375,
-0.04022216796875,
-0.003574371337890625,
0.032440185546875,
-0.0084228515625,
-0.034210205078125,
0.0169830322265625,
-0.029449462890625,
0.002498626708984375,
0.07568359375,
0.064697265625,
-0.0811767578125,
-0.00850677490234375,
0.00839996337890625,
-0.01117706298828125,
0.0068511962890625,
-0.007160186767578125,
0.0011034011840820312,
-0.0228424072265625,
0.042327880859375,
0.060699462890625,
0.0020008087158203125,
0.03399658203125,
0.033233642578125,
-0.012176513671875,
-0.032318115234375,
0.0190277099609375,
0.0069122314453125,
-0.05535888671875,
0.0011320114135742188,
0.043426513671875,
-0.0215301513671875,
-0.022857666015625,
0.0020618438720703125,
-0.0140533447265625,
-0.0313720703125,
-0.04559326171875,
-0.01105499267578125,
0.0175933837890625,
-0.0129547119140625,
0.0243377685546875,
0.00629425048828125,
-0.014404296875,
0.037994384765625,
-0.0230712890625,
0.0245361328125,
0.0241241455078125,
-0.042999267578125,
-0.024017333984375,
-0.0234832763671875,
0.04046630859375,
0.02349853515625,
-0.07977294921875,
0.0281524658203125,
-0.028350830078125,
-0.01502227783203125,
-0.0228424072265625,
-0.042694091796875,
0.07476806640625,
-0.0117950439453125,
-0.028900146484375,
-0.00020301342010498047,
0.008148193359375,
-0.01007080078125,
-0.02069091796875,
0.060882568359375,
-0.055572509765625,
-0.0141754150390625,
0.01351165771484375,
-0.01320648193359375,
-0.04681396484375,
-0.034820556640625,
-0.03680419921875,
0.06280517578125,
-0.03387451171875,
0.02899169921875,
0.01285552978515625,
0.0164947509765625,
0.0035228729248046875,
0.0119476318359375,
-0.01898193359375,
0.063232421875,
0.0028076171875,
0.036285400390625,
-0.024658203125,
-0.0029392242431640625,
0.030426025390625,
0.0271148681640625,
0.0263214111328125,
0.01161956787109375,
-0.0115814208984375,
-0.00292205810546875,
0.023895263671875,
0.033843994140625,
-0.0151519775390625,
0.037811279296875,
-0.048858642578125,
-0.0171051025390625,
-0.01824951171875,
-0.036773681640625,
0.0162811279296875,
-0.0237274169921875,
-0.04852294921875,
-0.0216827392578125,
0.02703857421875,
0.0292816162109375,
0.026519775390625,
0.005077362060546875,
-0.02069091796875,
0.01416778564453125,
0.0268096923828125,
-0.01593017578125,
-0.011322021484375,
0.052642822265625,
0.036041259765625,
-0.0252227783203125,
0.010711669921875,
-0.0258941650390625,
0.044342041015625,
0.01103973388671875,
0.021026611328125,
0.01074981689453125,
0.01261138916015625,
0.035552978515625,
0.040252685546875,
0.025482177734375,
0.055084228515625,
-0.021697998046875,
0.0160980224609375,
0.043121337890625,
0.0318603515625,
0.010162353515625,
0.0187225341796875,
0.03094482421875,
0.0277252197265625,
-0.02667236328125,
0.00550079345703125,
-0.00007843971252441406,
0.005950927734375,
0.00881195068359375,
-0.01593017578125,
0.0306854248046875,
0.026275634765625,
0.020294189453125,
-0.01093292236328125,
-0.001995086669921875,
0.0157470703125,
-0.0023746490478515625,
0.01007080078125,
-0.0070953369140625,
0.00881195068359375,
0.0218658447265625,
-0.042694091796875,
0.0271453857421875,
-0.011016845703125,
0.034210205078125,
0.008087158203125,
0.0298309326171875,
-0.019378662109375,
-0.015716552734375,
-0.0240478515625,
0.039276123046875,
-0.006122589111328125,
0.0273284912109375,
-0.08935546875,
-0.059539794921875,
0.0208892822265625,
0.05755615234375,
-0.007396697998046875,
0.032623291015625,
0.0186004638671875,
0.0123138427734375,
-0.01544952392578125,
0.0017833709716796875,
0.0589599609375,
-0.0267181396484375,
0.0219879150390625,
-0.0252838134765625,
0.03729248046875,
0.013458251953125,
-0.018707275390625,
-0.021636962890625,
0.01111602783203125,
0.053192138671875,
-0.016754150390625,
0.0221710205078125,
-0.0008206367492675781,
-0.01543426513671875,
0.0008153915405273438,
0.0173187255859375,
0.03277587890625,
0.0173797607421875,
0.0165863037109375,
-0.0212860107421875,
0.0228424072265625,
0.021087646484375,
-0.0018587112426757812,
0.0283203125,
0.01270294189453125,
0.00675201416015625,
0.045562744140625,
0.01525115966796875,
-0.0474853515625,
-0.01236724853515625,
0.045135498046875,
-0.0012254714965820312,
0.01165771484375,
0.046356201171875,
-0.086669921875,
-0.048370361328125,
-0.036712646484375,
0.0286102294921875,
-0.00415802001953125,
0.044464111328125,
0.0169525146484375,
0.0183258056640625,
-0.0070343017578125,
0.0236663818359375,
-0.00833892822265625,
-0.0211639404296875,
0.05474853515625,
0.00943756103515625,
0.00962066650390625,
-0.0239410400390625,
-0.07501220703125,
0.0125732421875,
0.0259552001953125,
-0.0283660888671875,
0.05474853515625,
-0.01154327392578125,
0.01256561279296875,
-0.056121826171875,
0.0033435821533203125,
-0.030853271484375,
-0.0565185546875,
-0.06427001953125,
0.00434112548828125,
0.0194244384765625,
0.055938720703125,
0.0015010833740234375,
0.047210693359375,
0.027587890625,
-0.04986572265625,
0.02984619140625,
-0.07940673828125,
0.042449951171875,
0.0236053466796875,
0.08892822265625,
-0.00800323486328125,
0.00316619873046875,
-0.0069427490234375,
0.03826904296875,
0.0002994537353515625,
0.0261077880859375,
0.007251739501953125,
-0.0289154052734375,
-0.00855255126953125,
0.0229339599609375,
0.0191802978515625,
-0.0188751220703125,
0.0137481689453125,
0.0146026611328125,
-0.031768798828125,
-0.0035419464111328125,
0.0030879974365234375,
-0.01047515869140625,
-0.049224853515625,
-0.0266876220703125,
0.00438690185546875,
-0.041107177734375,
-0.039398193359375,
-0.0369873046875,
-0.041015625,
-0.00237274169921875,
-0.0333251953125,
0.01561737060546875,
-0.05242919921875,
-0.01873779296875,
0.044921875,
-0.061065673828125,
0.05377197265625,
-0.0185394287109375,
0.017913818359375,
-0.039093017578125,
0.0247344970703125,
-0.0184783935546875,
0.000980377197265625,
0.007015228271484375,
0.03424072265625,
0.07220458984375,
-0.033477783203125,
0.00241851806640625,
-0.0029315948486328125,
0.0116729736328125,
0.0667724609375,
-0.049041748046875,
-0.0291900634765625,
-0.011810302734375,
-0.0133056640625,
-0.0011959075927734375,
-0.0037174224853515625,
0.040771484375,
-0.057159423828125,
-0.0499267578125,
-0.00550079345703125,
-0.0257415771484375,
0.00018393993377685547,
-0.05487060546875,
-0.1092529296875,
0.07965087890625,
-0.0227203369140625,
-0.050140380859375,
-0.0193634033203125,
0.01751708984375,
-0.0037631988525390625,
0.004871368408203125,
-0.00390625,
-0.039794921875,
-0.007556915283203125,
0.01058197021484375,
0.005893707275390625,
0.003887176513671875,
0.0167999267578125,
-0.0168609619140625,
-0.026885986328125,
0.0103607177734375,
0.0015573501586914062,
-0.00711822509765625,
-0.029510498046875,
0.0167388916015625,
0.0222015380859375,
0.04388427734375,
-0.000598907470703125,
0.039764404296875,
0.0251007080078125,
-0.01983642578125,
0.0231475830078125,
-0.036834716796875,
-0.004093170166015625,
-0.019500732421875,
0.03173828125,
-0.04156494140625,
0.01419830322265625,
0.0010175704956054688,
0.00118255615234375,
-0.0271453857421875,
-0.04052734375,
-0.014434814453125,
0.02130126953125,
-0.045166015625,
0.01007843017578125,
-0.007053375244140625,
-0.00647735595703125,
-0.0153045654296875,
0.0182952880859375,
-0.0478515625,
-0.0188751220703125,
-0.006343841552734375,
-0.0133514404296875,
-0.017547607421875,
-0.010345458984375,
0.036102294921875,
-0.02435302734375,
0.01186370849609375,
-0.0024890899658203125,
0.0017461776733398438,
0.0283203125,
0.038726806640625,
0.037628173828125,
-0.0086212158203125,
-0.03411865234375,
0.0052642822265625,
0.0051116943359375,
0.04193115234375,
-0.0217437744140625,
-0.059722900390625,
-0.006183624267578125,
0.01007843017578125,
-0.0006957054138183594,
0.005687713623046875,
0.0031871795654296875,
-0.034454345703125,
-0.0196380615234375,
0.01520538330078125,
-0.007049560546875,
0.040557861328125,
0.00926971435546875,
0.0163726806640625,
0.002445220947265625,
-0.014068603515625,
0.0252685546875,
-0.029205322265625,
-0.0025310516357421875,
-0.020477294921875,
-0.002849578857421875,
-0.04241943359375,
0.027252197265625,
-0.04534912109375,
-0.018585205078125,
0.0304107666015625
] |
0bf892a1cc281d09f454665bd133b191f297213c
|
Wordpress Stackexchange
Q: Which hook should be used to validate custom form fields on the login form? I've added a custom input field with login_form hook.
So, I need to process the post data to validate.
I've used the lostpassword_post for lostpassword_form and works great, but I cant find a hook to validate my data at login form.
Any Ideas?
A: Use the action 'login_init' to catch all calls to wp-login.php.
Sample code:
add_action( 'login_init', 'wpse_51227_validate_custom_field' );
function wpse_51227_validate_custom_field()
{
if ( ! isset ( $_POST['special_custom'] )
return;
if ( ! is_numeric( $_POST['special_custom'] )
// handle the error
}
There are two important global variables available:
*
*$errors is an instance of WP_Error. Maybe you want to use it to store error data.
*$action is the current action. Maybe you want to rest it to login to prevent a redirect if the user input is invalid.
|
Q: Which hook should be used to validate custom form fields on the login form? I've added a custom input field with login_form hook.
So, I need to process the post data to validate.
I've used the lostpassword_post for lostpassword_form and works great, but I cant find a hook to validate my data at login form.
Any Ideas?
A: Use the action 'login_init' to catch all calls to wp-login.php.
Sample code:
add_action( 'login_init', 'wpse_51227_validate_custom_field' );
function wpse_51227_validate_custom_field()
{
if ( ! isset ( $_POST['special_custom'] )
return;
if ( ! is_numeric( $_POST['special_custom'] )
// handle the error
}
There are two important global variables available:
*
*$errors is an instance of WP_Error. Maybe you want to use it to store error data.
*$action is the current action. Maybe you want to rest it to login to prevent a redirect if the user input is invalid.
A: Haven't really tested this but I'm just guessing by how I do it with the registration & profile pages.
Try something like this:
function my_login_errors( $errors ) {
if ( empty( $_POST['custom_field'] ) )
$errors->add( 'empty_custom_field', '<strong>ERROR</strong>: Please enter some info.' );
return $errors;
}
add_filter( 'login_errors', 'my_login_errors' );
Note: Modify the custom_field part and the message accordingly.
|
wordpress
|
{
"language": "en",
"length": 203,
"provenance": "stackexchange_00019.jsonl.gz:419697",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51227"
}
|
[
0.011993408203125,
-0.0198211669921875,
-0.046783447265625,
-0.02960205078125,
-0.00719451904296875,
-0.03436279296875,
0.0302734375,
0.0282135009765625,
-0.054168701171875,
-0.0005402565002441406,
0.02349853515625,
0.0213775634765625,
-0.04638671875,
-0.047698974609375,
0.033294677734375,
-0.0396728515625,
-0.00975799560546875,
0.0172119140625,
0.01947021484375,
-0.033233642578125,
0.02911376953125,
-0.0391845703125,
0.000016868114471435547,
-0.0155792236328125,
0.01517486572265625,
-0.02752685546875,
0.0623779296875,
-0.02667236328125,
0.03472900390625,
0.005817413330078125,
0.0248260498046875,
-0.054168701171875,
0.019775390625,
0.01377105712890625,
-0.01229095458984375,
-0.0034084320068359375,
0.006256103515625,
0.0031261444091796875,
-0.0153350830078125,
0.057098388671875,
0.048828125,
-0.033966064453125,
-0.01241302490234375,
0.0013780593872070312,
-0.004833221435546875,
-0.0201568603515625,
0.0531005859375,
-0.016815185546875,
0.03570556640625,
-0.0028095245361328125,
0.0078887939453125,
0.004848480224609375,
0.013702392578125,
0.0006656646728515625,
-0.02362060546875,
-0.0010213851928710938,
-0.057769775390625,
-0.01155853271484375,
0.0275421142578125,
0.0775146484375,
0.00923919677734375,
-0.031494140625,
-0.01366424560546875,
-0.05780029296875,
0.0204315185546875,
-0.0019702911376953125,
-0.0306854248046875,
0.026336669921875,
0.041900634765625,
0.009185791015625,
-0.0216827392578125,
-0.0171051025390625,
-0.0123138427734375,
0.0166473388671875,
-0.0134124755859375,
-0.02423095703125,
0.0170745849609375,
-0.0197296142578125,
0.0212860107421875,
0.0303192138671875,
-0.022186279296875,
-0.0151519775390625,
-0.023834228515625,
-0.014892578125,
-0.0012950897216796875,
0.024200439453125,
-0.0313720703125,
-0.00640869140625,
-0.0081787109375,
-0.0516357421875,
-0.007537841796875,
-0.0232086181640625,
-0.048126220703125,
0.00151824951171875,
0.0111083984375,
-0.056884765625,
0.0154876708984375,
0.006778717041015625,
0.019561767578125,
-0.002834320068359375,
0.016693115234375,
-0.047149658203125,
0.02801513671875,
-0.020111083984375,
0.00589752197265625,
0.055816650390625,
0.024688720703125,
-0.04327392578125,
-0.0213775634765625,
-0.0203399658203125,
-0.0106353759765625,
-0.038604736328125,
-0.0114593505859375,
-0.063720703125,
-0.024078369140625,
0.037872314453125,
0.0050506591796875,
-0.01373291015625,
0.0274658203125,
-0.01519012451171875,
-0.032928466796875,
-0.033447265625,
0.040252685546875,
-0.042388916015625,
0.01050567626953125,
-0.040283203125,
-0.0467529296875,
0.01267242431640625,
0.00989532470703125,
0.03741455078125,
-0.03863525390625,
0.02471923828125,
0.05572509765625,
-0.024810791015625,
-0.0194091796875,
-0.0219573974609375,
0.0305328369140625,
-0.0029506683349609375,
-0.0073699951171875,
0.02508544921875,
-0.0187835693359375,
-0.046173095703125,
-0.0198974609375,
-0.0033130645751953125,
0.0292816162109375,
0.0264892578125,
0.025146484375,
0.00620269775390625,
-0.0236358642578125,
-0.06787109375,
0.04437255859375,
-0.014678955078125,
0.0018529891967773438,
0.0247650146484375,
0.039642333984375,
0.037750244140625,
0.0631103515625,
-0.016693115234375,
-0.036285400390625,
-0.006870269775390625,
0.0277862548828125,
-0.0240631103515625,
-0.022186279296875,
-0.05035400390625,
-0.06591796875,
0.00948333740234375,
-0.039459228515625,
-0.00566864013671875,
0.031402587890625,
-0.0079345703125,
0.02410888671875,
0.00971221923828125,
0.01198577880859375,
0.01296234130859375,
0.010467529296875,
0.01222991943359375,
-0.043914794921875,
0.0980224609375,
0.0202789306640625,
0.0072479248046875,
0.0224761962890625,
-0.03717041015625,
0.07147216796875,
0.00637054443359375,
-0.040069580078125,
0.027191162109375,
0.022308349609375,
0.046051025390625,
0.006198883056640625,
0.02301025390625,
0.027099609375,
0.006137847900390625,
-0.018463134765625,
-0.007328033447265625,
-0.021820068359375,
-0.026153564453125,
0.00045371055603027344,
-0.01374053955078125,
-0.015167236328125,
0.0499267578125,
-0.00075531005859375,
-0.0279083251953125,
0.0225830078125,
0.005863189697265625,
-0.030609130859375,
0.003047943115234375,
-0.0258636474609375,
0.025604248046875,
-0.041015625,
0.0022449493408203125,
0.0262908935546875,
-0.0055084228515625,
-0.02484130859375,
0.01338958740234375,
-0.00372314453125,
-0.017425537109375,
-0.046844482421875,
0.047027587890625,
-0.01129150390625,
0.059478759765625,
0.008544921875,
-0.073486328125,
-0.006504058837890625,
-0.03729248046875,
-0.01134490966796875,
0.004055023193359375,
-0.0220947265625,
0.0128173828125,
-0.00334930419921875,
0.016357421875,
0.0165863037109375,
0.0035724639892578125,
0.0299224853515625,
0.011871337890625,
-0.048583984375,
-0.0223388671875,
-0.043670654296875,
-0.0760498046875,
0.0031185150146484375,
0.07476806640625,
0.03985595703125,
0.050750732421875,
-0.01163482666015625,
-0.01202392578125,
0.053131103515625,
-0.0236968994140625,
0.0137176513671875,
-0.01232147216796875,
-0.0015764236450195312,
0.040374755859375,
-0.0210418701171875,
0.0208740234375,
0.0248260498046875,
0.0112152099609375,
-0.00557708740234375,
0.036895751953125,
-0.02557373046875,
-0.0439453125,
0.0020999908447265625,
0.00705718994140625,
0.0072174072265625,
-0.056976318359375,
-0.043792724609375,
-0.0229949951171875,
0.00759124755859375,
-0.0278472900390625,
0.01169586181640625,
-0.01435089111328125,
-0.012603759765625,
-0.0221710205078125,
0.032623291015625,
-0.042724609375,
-0.00377655029296875,
-0.0150909423828125,
0.0026264190673828125,
0.01561737060546875,
-0.0186309814453125,
0.0051116943359375,
0.01526641845703125,
-0.0120697021484375,
-0.0143585205078125,
0.03643798828125,
-0.007045745849609375,
-0.0084686279296875,
-0.0260772705078125,
-0.04443359375,
0.025238037109375,
0.0277252197265625,
0.06256103515625,
-0.0170135498046875,
0.0214691162109375,
-0.031890869140625,
-0.04351806640625,
0.060028076171875,
0.0224151611328125,
-0.0880126953125,
-0.070556640625,
-0.0202178955078125,
0.0499267578125,
-0.05767822265625,
-0.0216827392578125,
0.055206298828125,
-0.0241241455078125,
0.0290069580078125,
0.003536224365234375,
-0.0260467529296875,
-0.0150299072265625,
0.046295166015625,
0.0177459716796875,
-0.046539306640625,
-0.003063201904296875,
0.01105499267578125,
0.044525146484375,
0.10791015625,
0.005298614501953125,
-0.03387451171875,
0.004093170166015625,
0.06365966796875,
-0.02288818359375,
-0.07122802734375,
-0.07763671875,
-0.07476806640625,
0.01546478271484375,
-0.0244140625,
-0.011383056640625,
0.0252227783203125,
-0.01434326171875,
0.027557373046875,
-0.006763458251953125,
-0.00936126708984375,
-0.0291900634765625,
-0.01288604736328125,
-0.043060302734375,
0.0200958251953125,
-0.0037174224853515625,
0.01788330078125,
0.005039215087890625,
0.058624267578125,
-0.0019741058349609375,
-0.04095458984375,
0.0057220458984375,
-0.037384033203125,
-0.01149749755859375,
0.01062774658203125,
-0.07720947265625,
0.0089263916015625,
0.06951904296875,
-0.017486572265625,
-0.0162811279296875,
-0.0088348388671875,
0.031494140625,
-0.0262451171875,
-0.0086669921875,
-0.04107666015625,
-0.0027008056640625,
0.04534912109375,
0.001323699951171875,
-0.041107177734375,
0.032684326171875,
-0.06292724609375,
0.00951385498046875,
0.0004703998565673828,
-0.014434814453125,
0.00997161865234375,
-0.0186614990234375,
-0.0157012939453125,
0.030792236328125,
0.01023101806640625,
0.0065155029296875,
0.01155853271484375,
-0.00687408447265625,
0.00241851806640625,
0.0256805419921875,
-0.0005812644958496094,
0.01023101806640625,
0.00997161865234375,
0.0116424560546875,
-0.038909912109375,
0.0009636878967285156,
-0.005054473876953125,
-0.0199737548828125,
-0.01222991943359375,
-0.00433349609375,
-0.01103973388671875,
-0.0838623046875,
0.049224853515625,
-0.0242919921875,
0.01407623291015625,
-0.034088134765625,
-0.0241241455078125,
0.005062103271484375,
0.1002197265625,
-0.03631591796875,
-0.011627197265625,
-0.0029430389404296875,
-0.0035572052001953125,
0.010040283203125,
0.01617431640625,
-0.04296875,
-0.00708770751953125,
-0.07025146484375,
0.01316070556640625,
0.00502777099609375,
-0.024017333984375,
0.0059051513671875,
-0.028228759765625,
-0.040618896484375,
-0.044647216796875,
0.018402099609375,
-0.042022705078125,
0.0257720947265625,
0.02618408203125,
-0.00438690185546875,
0.0026187896728515625,
0.01273345947265625,
-0.041748046875,
-0.06463623046875,
-0.006771087646484375,
-0.03570556640625,
0.028350830078125,
0.05206298828125,
-0.0682373046875,
-0.004791259765625,
0.0138397216796875,
0.015960693359375,
-0.01898193359375,
0.029541015625,
0.0055084228515625,
0.001209259033203125,
0.0084381103515625,
-0.00432586669921875,
-0.0123291015625,
0.0115509033203125,
0.009979248046875,
-0.036956787109375,
0.004528045654296875,
-0.0274505615234375,
-0.013031005859375,
0.0138397216796875,
-0.042816162109375,
-0.004058837890625,
-0.017059326171875,
-0.0173187255859375,
0.00809478759765625,
-0.0123748779296875,
0.006473541259765625,
-0.0156402587890625,
-0.0182647705078125,
0.01715087890625,
0.0263671875,
-0.019317626953125,
-0.0009632110595703125,
0.042388916015625,
0.0280609130859375,
-0.0245361328125,
-0.0269927978515625,
-0.0034923553466796875,
0.029571533203125,
-0.003505706787109375,
0.03057861328125,
-0.00946044921875,
-0.04095458984375,
0.0972900390625,
-0.0014019012451171875,
-0.015228271484375,
0.0081939697265625,
0.0186614990234375,
0.003658294677734375,
-0.004486083984375,
-0.0267333984375,
-0.0167388916015625,
0.043975830078125,
0.011322021484375,
-0.0078582763671875,
-0.0018835067749023438,
0.045928955078125,
0.00015664100646972656,
-0.0703125,
0.051849365234375,
0.026947021484375,
-0.036376953125,
0.006500244140625,
-0.004486083984375,
0.003215789794921875,
0.0014677047729492188,
-0.002872467041015625,
0.00025916099548339844,
-0.00690460205078125,
0.001583099365234375,
-0.009765625,
-0.0216064453125,
0.0131072998046875,
0.0171661376953125,
0.0206451416015625,
0.0125274658203125,
-0.0097198486328125,
-0.018707275390625,
0.059967041015625,
-0.01085662841796875,
-0.05987548828125,
0.0189666748046875,
-0.03131103515625,
0.0249176025390625,
0.021453857421875,
-0.01541900634765625,
0.0198211669921875,
0.004467010498046875,
-0.04425048828125,
0.0052642822265625,
0.00865936279296875,
-0.033599853515625,
-0.04278564453125,
-0.0135498046875,
0.0121307373046875,
-0.0243682861328125,
-0.0128326416015625,
-0.006221771240234375,
0.004726409912109375,
-0.03070068359375,
-0.00568389892578125,
0.035186767578125,
0.06414794921875,
0.044708251953125,
0.038116455078125,
-0.048828125,
-0.0211944580078125,
0.0064544677734375,
-0.00955963134765625,
-0.053863525390625,
-0.03704833984375,
-0.0006699562072753906,
0.041046142578125,
-0.0183563232421875,
0.003459930419921875,
0.0251922607421875,
0.0195465087890625,
0.010406494140625,
0.050048828125,
-0.020172119140625,
-0.10614013671875,
0.004283905029296875,
0.036865234375,
0.01137542724609375,
-0.08038330078125,
-0.00360870361328125,
-0.01378631591796875,
-0.034881591796875,
-0.0011663436889648438,
-0.0191650390625,
-0.01033782958984375,
-0.00036454200744628906,
-0.0119781494140625,
-0.0016317367553710938,
0.0023937225341796875,
0.0042572021484375,
-0.05023193359375,
-0.0361328125,
0.01136016845703125,
-1.1920928955078125e-7,
-0.0037708282470703125,
-0.035308837890625,
-0.001773834228515625,
-0.039459228515625,
0.0271148681640625,
-0.036651611328125,
0.021453857421875,
0.004283905029296875,
-0.01134490966796875,
-0.031829833984375,
0.0005230903625488281,
-0.0162353515625,
-0.001346588134765625,
-0.0107574462890625,
-0.024261474609375,
-0.0245361328125,
-0.008392333984375,
0.00921630859375,
0.007663726806640625,
0.0158538818359375,
0.004150390625,
-0.0298919677734375,
0.01415252685546875,
0.01226043701171875,
-0.00540924072265625,
-0.031524658203125,
0.058624267578125,
0.0113525390625,
0.02105712890625,
0.00688934326171875,
0.0225372314453125,
0.00749969482421875,
-0.00688934326171875,
-0.00653076171875,
-0.033447265625,
-0.01360321044921875,
-0.0247650146484375,
0.034942626953125,
0.05291748046875,
0.051971435546875,
-0.00296783447265625,
-0.01235198974609375,
-0.0301361083984375,
-0.0153350830078125,
-0.006015777587890625,
0.055419921875,
0.0333251953125,
-0.034271240234375,
0.040374755859375,
-0.00829315185546875,
0.01349639892578125,
0.002788543701171875,
-0.0264434814453125,
0.052886962890625,
0.0052947998046875,
0.037200927734375,
-0.020355224609375,
-0.03466796875,
0.0297088623046875,
0.015899658203125,
0.01393890380859375,
0.039764404296875,
-0.01464080810546875,
0.0186767578125,
0.0012884140014648438,
-0.006366729736328125,
-0.03363037109375,
-0.0350341796875,
0.055572509765625,
0.0180816650390625,
-0.022796630859375,
0.07098388671875,
-0.019317626953125,
-0.01113128662109375,
0.0650634765625,
0.052703857421875,
-0.10052490234375,
0.0162811279296875,
0.0131072998046875,
0.043060302734375,
0.04864501953125,
0.016082763671875,
0.009033203125,
0.06591796875,
0.01508331298828125,
-0.009521484375,
-0.004505157470703125,
0.050750732421875,
0.013641357421875,
0.01003265380859375,
-0.0101776123046875,
0.043731689453125,
0.00019848346710205078,
-0.0203399658203125,
-0.0167999267578125,
0.018157958984375,
-0.0082550048828125,
0.018768310546875,
0.0194549560546875,
-0.00623321533203125,
-0.038330078125,
-0.0494384765625,
-0.038360595703125,
-0.018707275390625,
-0.058624267578125,
0.022430419921875,
0.01007080078125,
0.08648681640625,
0.0280609130859375,
0.0276336669921875,
-0.0162506103515625,
-0.036407470703125,
0.037841796875,
0.00579071044921875,
-0.03302001953125,
-0.004573822021484375,
0.038909912109375,
-0.0312042236328125,
0.024444580078125,
0.0191192626953125,
-0.032989501953125,
0.005542755126953125,
-0.03485107421875,
0.036590576171875,
-0.01421356201171875,
-0.0184326171875,
0.0029144287109375,
-0.01357269287109375,
0.0272979736328125,
-0.037750244140625,
0.034149169921875,
-0.0789794921875,
-0.02880859375,
-0.017608642578125,
-0.03350830078125,
-0.0251312255859375,
-0.043853759765625,
-0.075927734375,
0.10089111328125,
0.023834228515625,
0.0188751220703125,
-0.02703857421875,
0.0389404296875,
-0.0205841064453125,
0.028106689453125,
-0.050750732421875,
0.06060791015625,
0.01082611083984375,
0.039886474609375,
-0.037384033203125,
0.002124786376953125,
0.01458740234375,
0.00688934326171875,
0.0011606216430664062,
0.006778717041015625,
-0.0164337158203125,
-0.0230255126953125,
0.00688934326171875,
0.0242462158203125,
-0.0011682510375976562,
0.022216796875,
0.0258026123046875,
0.037445068359375,
0.0297393798828125,
-0.0095062255859375,
0.049224853515625,
-0.0158843994140625,
-0.0159149169921875,
0.0576171875,
0.00838470458984375,
-0.028839111328125,
-0.01076507568359375,
-0.0004165172576904297,
-0.0888671875,
0.01093292236328125,
0.050689697265625,
0.0283050537109375,
-0.0018253326416015625,
0.04681396484375,
0.035369873046875,
0.0213775634765625,
-0.002826690673828125,
-0.02569580078125,
0.03485107421875,
-0.00763702392578125,
0.044281005859375,
0.01381683349609375,
0.0244598388671875,
0.06268310546875,
-0.0276947021484375,
0.0161895751953125,
0.018524169921875,
-0.030792236328125,
0.037261962890625,
-0.0037784576416015625,
0.000011682510375976562,
-0.04144287109375,
0.047454833984375,
0.012359619140625,
0.036834716796875,
-0.054595947265625,
-0.055755615234375,
0.0021514892578125,
0.02203369140625,
0.043182373046875,
0.035614013671875,
0.0625,
-0.0150146484375,
0.0311126708984375,
-0.01300048828125,
-0.00714111328125,
0.0161895751953125,
0.0250396728515625,
0.00337982177734375,
0.01421356201171875,
-0.0293121337890625,
-0.01503753662109375,
-0.002765655517578125,
0.00021004676818847656,
-0.012725830078125,
0.00482940673828125,
0.0099639892578125,
0.007640838623046875,
-0.004848480224609375,
0.006824493408203125,
-0.0216064453125,
0.034820556640625,
0.003139495849609375,
0.0252838134765625,
-0.03057861328125,
-0.0158843994140625,
-0.00440216064453125,
0.0265655517578125,
0.01285552978515625,
0.0031280517578125,
0.01476287841796875,
0.017791748046875,
-0.016510009765625,
-0.013427734375,
0.02587890625,
-0.0118560791015625,
-0.0289306640625,
-0.00506591796875,
-0.031097412109375,
0.0197906494140625,
-0.0127716064453125,
0.001880645751953125,
0.00170135498046875,
0.040863037109375,
0.00727081298828125,
0.01458740234375,
0.00992584228515625,
-0.03521728515625,
0.01068115234375,
-0.00824737548828125,
0.07470703125,
0.039581298828125,
-0.0274200439453125,
-0.01085662841796875,
0.00261688232421875,
-0.031951904296875,
0.0136260986328125,
0.04852294921875,
0.0171661376953125,
-0.0165557861328125,
0.040191650390625,
-0.04840087890625,
0.019561767578125,
0.0123138427734375,
0.023406982421875,
-0.056915283203125,
-0.017486572265625,
-0.0231475830078125,
-0.051361083984375,
-0.0017538070678710938,
0.00313568115234375,
0.007160186767578125,
-0.0118865966796875,
0.03570556640625,
0.0008006095886230469,
0.01080322265625,
-0.019561767578125,
0.0207366943359375,
-0.031982421875,
0.0007905960083007812,
0.0014057159423828125,
0.002132415771484375,
-0.0018892288208007812,
-0.00991058349609375,
-0.03863525390625,
0.0740966796875,
-0.02410888671875,
0.037872314453125,
0.04486083984375,
-0.048797607421875,
0.012054443359375,
0.047149658203125,
0.00749969482421875,
-0.024078369140625,
-0.050445556640625,
-0.007389068603515625,
0.03228759765625,
-0.0015649795532226562,
0.03515625,
-0.00168609619140625,
0.044921875,
-0.07269287109375,
-0.01273345947265625,
0.0008339881896972656,
-0.049774169921875,
-0.02850341796875,
0.0210113525390625,
-0.047027587890625,
0.004119873046875,
-0.011505126953125,
-0.014312744140625,
0.004241943359375,
0.0195465087890625,
-0.02178955078125,
0.01296234130859375,
-0.0017604827880859375,
0.0499267578125,
0.0352783203125,
0.045196533203125,
-0.0231475830078125,
-0.001956939697265625,
0.049102783203125,
-0.01259613037109375,
0.032867431640625,
-0.07666015625,
-0.0276947021484375,
-0.0560302734375,
-0.0141143798828125,
0.025177001953125,
-0.0406494140625,
-0.029449462890625,
-0.0345458984375,
0.0439453125,
0.021881103515625,
-0.027587890625,
-0.02166748046875,
-0.01004791259765625,
-0.05499267578125,
0.09222412109375,
-0.02484130859375,
-0.01275634765625,
0.039581298828125,
0.07513427734375,
-0.01110076904296875,
0.009857177734375,
-0.002155303955078125,
-0.0309906005859375,
-0.004665374755859375,
0.01226806640625,
0.057891845703125,
-0.0137176513671875,
-0.06689453125,
-0.00724029541015625,
-0.0215911865234375,
0.040802001953125,
-0.0192718505859375,
-0.040557861328125,
0.017578125,
0.0006012916564941406,
-0.002899169921875,
-0.024810791015625,
0.0020275115966796875,
-0.032562255859375,
0.00909423828125,
-0.0274200439453125,
0.001644134521484375,
0.00888824462890625,
-0.03851318359375,
-0.0869140625,
0.061309814453125,
-0.0235595703125,
-0.0186920166015625,
-0.0501708984375,
0.0228729248046875,
0.00848388671875,
0.0050811767578125,
-0.0181427001953125,
-0.031982421875,
-0.0230255126953125,
0.01947021484375,
0.01165771484375,
-0.005931854248046875,
0.046051025390625,
0.02850341796875,
-0.047515869140625,
0.01346588134765625,
0.0033855438232421875,
0.0111541748046875,
0.03924560546875,
-0.003780364990234375,
0.0178070068359375,
0.0321044921875,
-0.05364990234375,
-0.004383087158203125,
-0.02362060546875,
-0.002346038818359375,
-0.01375579833984375,
-0.0187530517578125,
0.0182952880859375,
0.0027713775634765625,
0.027862548828125,
0.02423095703125,
-0.00884246826171875,
-0.0187530517578125,
-0.025115966796875,
-0.032501220703125,
-0.038909912109375,
-0.0201873779296875,
0.01306915283203125,
-0.061767578125,
-0.00611114501953125,
-0.0113372802734375,
-0.0002110004425048828,
-0.0430908203125,
0.019805908203125,
-0.0245819091796875,
-0.0172271728515625,
0.0367431640625,
-0.0038013458251953125,
0.006969451904296875,
0.0031948089599609375,
0.10113525390625,
-0.055938720703125,
0.003437042236328125,
0.0303802490234375,
-0.0023021697998046875,
0.05169677734375,
0.03546142578125,
0.032867431640625,
0.0258941650390625,
-0.0714111328125,
-0.0002644062042236328,
0.002902984619140625,
0.048248291015625,
-0.0406494140625,
-0.033782958984375,
-0.01262664794921875,
0.013641357421875,
-0.0117645263671875,
0.00982666015625,
0.0182952880859375,
-0.00951385498046875,
-0.0009298324584960938,
0.030059814453125,
-0.035980224609375,
-0.050140380859375,
-0.041046142578125,
-0.0015411376953125,
0.0202789306640625,
-0.003299713134765625,
0.070556640625,
-0.00911712646484375,
-0.00045943260192871094,
0.00798797607421875,
-0.005290985107421875,
-0.032684326171875,
0.02398681640625,
0.0272216796875,
0.0135955810546875,
0.0126190185546875
] |
debcd30ec488a5bbb968a39884df6f06884e76d2
|
Wordpress Stackexchange
Q: Getting the action's tag name within the action There's a function attached to a set of actions, like this:
add_action('some_tag', 'the_function');
function the_function($maybe_some_vars){
// ...
}
Is it possible to find out the action name ("some_tag") within the_function?
The reason I'm asking, is that I'm attaching the function to multiple actions (some of them custom, some belong to WP like the_content). The code that executes within the function depends on knowing the name of the action.
I did manage to get it using debug_backtrace(), but I'm pretty sure that's not a very reliable way.
A: Simple: current_filter(); (link to plugin.php) or global $wp_current_filter;.
|
Q: Getting the action's tag name within the action There's a function attached to a set of actions, like this:
add_action('some_tag', 'the_function');
function the_function($maybe_some_vars){
// ...
}
Is it possible to find out the action name ("some_tag") within the_function?
The reason I'm asking, is that I'm attaching the function to multiple actions (some of them custom, some belong to WP like the_content). The code that executes within the function depends on knowing the name of the action.
I did manage to get it using debug_backtrace(), but I'm pretty sure that's not a very reliable way.
A: Simple: current_filter(); (link to plugin.php) or global $wp_current_filter;.
|
wordpress
|
{
"language": "en",
"length": 104,
"provenance": "stackexchange_00019.jsonl.gz:419728",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51318"
}
|
[
0.0123291015625,
0.0276947021484375,
-0.041046142578125,
-0.0293731689453125,
0.0292816162109375,
-0.022369384765625,
0.017242431640625,
-0.00304412841796875,
-0.00634002685546875,
0.028900146484375,
-0.0164642333984375,
-0.00039076805114746094,
0.006824493408203125,
-0.0328369140625,
0.003753662109375,
-0.0283966064453125,
0.05859375,
-0.0060272216796875,
0.0660400390625,
0.022216796875,
0.01194000244140625,
0.053375244140625,
0.027191162109375,
0.06414794921875,
0.04443359375,
-0.017059326171875,
0.054962158203125,
-0.004344940185546875,
0.052520751953125,
0.0301361083984375,
0.0379638671875,
-0.0838623046875,
0.01026153564453125,
0.00885009765625,
-0.00293731689453125,
-0.01593017578125,
0.005222320556640625,
-0.003795623779296875,
0.0230560302734375,
0.0166473388671875,
0.057037353515625,
-0.0258331298828125,
-0.00499725341796875,
0.0221710205078125,
-0.0066375732421875,
-0.06512451171875,
0.0948486328125,
-0.02838134765625,
-0.00820159912109375,
0.01041412353515625,
0.032318115234375,
-0.0040283203125,
0.031402587890625,
-0.012481689453125,
-0.011322021484375,
0.0017719268798828125,
-0.06683349609375,
0.051116943359375,
0.022979736328125,
0.039581298828125,
-0.00920867919921875,
-0.0136871337890625,
0.00875091552734375,
-0.0450439453125,
0.0172576904296875,
0.004913330078125,
0.046966552734375,
-0.00762939453125,
0.01401519775390625,
0.03228759765625,
0.0210113525390625,
-0.00460052490234375,
-0.02197265625,
0.041961669921875,
-0.00868988037109375,
-0.044708251953125,
0.04217529296875,
-0.008087158203125,
0.00928497314453125,
0.03558349609375,
0.0274810791015625,
-0.06646728515625,
-0.0166778564453125,
0.035400390625,
-0.00007987022399902344,
0.055755615234375,
0.0015420913696289062,
-0.01316070556640625,
-0.031982421875,
-0.038238525390625,
-0.0330810546875,
-0.00925445556640625,
-0.0162811279296875,
-0.0296630859375,
-0.019134521484375,
-0.037139892578125,
0.0305023193359375,
0.040679931640625,
0.0079345703125,
0.0035572052001953125,
0.033782958984375,
-0.056976318359375,
0.018218994140625,
-0.036834716796875,
-0.01073455810546875,
0.069091796875,
0.0325927734375,
0.039947509765625,
0.0031719207763671875,
-0.01183319091796875,
0.0021038055419921875,
-0.031158447265625,
-0.020599365234375,
0.005573272705078125,
-0.01528167724609375,
0.002979278564453125,
-0.0665283203125,
0.0097503662109375,
-0.018646240234375,
0.0028285980224609375,
0.007579803466796875,
0.0081939697265625,
0.00756072998046875,
0.034088134765625,
0.02001953125,
0.03533935546875,
-0.002452850341796875,
-0.029052734375,
0.024505615234375,
-0.0012712478637695312,
-0.0029125213623046875,
0.04254150390625,
0.0018768310546875,
-0.04083251953125,
-0.0535888671875,
-0.002300262451171875,
0.01047515869140625,
-0.01209259033203125,
-0.0026302337646484375,
0.0226287841796875,
0.0008935928344726562,
-0.036407470703125,
-0.0029277801513671875,
0.005771636962890625,
0.0272979736328125,
0.002712249755859375,
0.01442718505859375,
-0.0020580291748046875,
-0.0098724365234375,
-0.01611328125,
0.047027587890625,
-0.05126953125,
0.0089111328125,
0.00022995471954345703,
0.0137481689453125,
0.00876617431640625,
-0.0211181640625,
0.003917694091796875,
0.0025577545166015625,
0.01087188720703125,
0.00887298583984375,
-0.017181396484375,
-0.024383544921875,
0.0006322860717773438,
-0.011444091796875,
0.01433563232421875,
-0.0033397674560546875,
0.0051727294921875,
0.011199951171875,
0.03411865234375,
-0.01041412353515625,
0.03741455078125,
0.04803466796875,
0.00273895263671875,
-0.00797271728515625,
-0.01016998291015625,
-0.011962890625,
0.02679443359375,
0.0084381103515625,
0.044219970703125,
0.002033233642578125,
-0.027679443359375,
0.040924072265625,
-0.01153564453125,
-0.054412841796875,
0.0273284912109375,
0.0057525634765625,
0.04931640625,
0.00991058349609375,
0.01434326171875,
0.015045166015625,
0.021240234375,
-0.0177459716796875,
-0.0180206298828125,
0.014007568359375,
0.01690673828125,
-0.0040283203125,
0.013641357421875,
-0.002498626708984375,
-0.00997161865234375,
0.0440673828125,
0.027008056640625,
0.0198211669921875,
0.00646209716796875,
-0.0239105224609375,
0.0352783203125,
-0.0202484130859375,
0.0419921875,
-0.0267791748046875,
-0.0101470947265625,
0.0284576416015625,
-0.00019919872283935547,
-0.01531982421875,
-0.0582275390625,
-0.024383544921875,
0.04473876953125,
-0.06158447265625,
-0.034088134765625,
-0.012969970703125,
0.01117706298828125,
-0.0106353759765625,
0.05126953125,
-0.0276031494140625,
-0.036590576171875,
0.0188140869140625,
-0.01352691650390625,
-0.038726806640625,
-0.017364501953125,
-0.0211029052734375,
0.003093719482421875,
-0.0694580078125,
0.046051025390625,
-0.01209259033203125,
0.044189453125,
-0.0073394775390625,
-0.03173828125,
-0.033721923828125,
-0.06304931640625,
0.0288543701171875,
0.051422119140625,
0.0219879150390625,
0.0099945068359375,
0.0008077621459960938,
0.031768798828125,
0.05462646484375,
-0.0233306884765625,
-0.0060882568359375,
0.0252227783203125,
0.0237884521484375,
0.058929443359375,
-0.03204345703125,
0.0177459716796875,
0.02410888671875,
-0.0252685546875,
0.00661468505859375,
0.04376220703125,
-0.0168914794921875,
-0.0643310546875,
-0.0009775161743164062,
0.015350341796875,
0.032196044921875,
-0.043975830078125,
-0.066162109375,
-0.00585174560546875,
0.0219573974609375,
0.00975799560546875,
0.020294189453125,
0.028717041015625,
-0.01416015625,
0.00269317626953125,
0.0201873779296875,
0.0149078369140625,
-0.00849151611328125,
0.052520751953125,
0.0291900634765625,
-0.0374755859375,
-0.0241241455078125,
-0.01448822021484375,
-0.036712646484375,
0.0182952880859375,
-0.00559234619140625,
0.065673828125,
-0.0019426345825195312,
-0.0212860107421875,
-0.037841796875,
-0.0297698974609375,
0.0037975311279296875,
-0.0094451904296875,
-0.00910186767578125,
0.006587982177734375,
0.0122833251953125,
0.052886962890625,
-0.007068634033203125,
0.038818359375,
-0.002468109130859375,
0.00812530517578125,
0.026275634765625,
0.01177215576171875,
0.0200653076171875,
-0.004810333251953125,
0.0657958984375,
0.065185546875,
-0.0240325927734375,
0.0291595458984375,
-0.0036373138427734375,
-0.0186614990234375,
0.0091552734375,
-0.025177001953125,
-0.036346435546875,
0.009765625,
-0.0819091796875,
0.0036602020263671875,
0.0127410888671875,
0.06671142578125,
-0.04754638671875,
-0.0849609375,
-0.024444580078125,
0.0132598876953125,
-0.08740234375,
-0.0401611328125,
0.029083251953125,
-0.06011962890625,
-0.0161590576171875,
0.0027370452880859375,
-0.05047607421875,
-0.018768310546875,
0.04693603515625,
-0.003932952880859375,
-0.01239013671875,
-0.01488494873046875,
-0.0088348388671875,
-0.02264404296875,
-0.030303955078125,
0.029449462890625,
0.00839996337890625,
0.003143310546875,
0.0083770751953125,
0.06634521484375,
0.01317596435546875,
-0.06060791015625,
0.0119476318359375,
-0.07568359375,
-0.0253143310546875,
0.027496337890625,
-0.00914764404296875,
-0.0258331298828125,
0.01263427734375,
0.006534576416015625,
-0.01053619384765625,
0.015899658203125,
0.0093536376953125,
-0.00017464160919189453,
0.00655364990234375,
-0.03607177734375,
0.037994384765625,
0.042083740234375,
-0.0173187255859375,
0.0098876953125,
0.0797119140625,
-0.0343017578125,
0.0091400146484375,
0.00677490234375,
-0.00917816162109375,
0.032958984375,
0.01161956787109375,
-0.033447265625,
0.033172607421875,
-0.0182037353515625,
0.05120849609375,
0.0244140625,
0.02044677734375,
0.02520751953125,
-0.006244659423828125,
-0.0021152496337890625,
0.0246124267578125,
-0.0401611328125,
-0.01154327392578125,
-0.01898193359375,
0.01230621337890625,
-0.0227508544921875,
0.0007677078247070312,
-0.01326751708984375,
0.01203155517578125,
-0.0341796875,
0.0157012939453125,
0.0163421630859375,
-0.0267181396484375,
0.006755828857421875,
-0.018707275390625,
-0.0201873779296875,
-0.016845703125,
0.028289794921875,
0.019439697265625,
-0.023834228515625,
-0.024383544921875,
0.0021495819091796875,
-0.01505279541015625,
-0.045166015625,
0.005008697509765625,
-0.01407623291015625,
-0.0926513671875,
-0.01372528076171875,
-0.044586181640625,
-0.021209716796875,
-0.0121307373046875,
0.0190277099609375,
-0.05816650390625,
-0.055084228515625,
0.0242767333984375,
-0.0318603515625,
0.01263427734375,
-0.015106201171875,
0.0024509429931640625,
-0.038360595703125,
-0.01209259033203125,
-0.020172119140625,
-0.02850341796875,
-0.0003898143768310547,
-0.0709228515625,
0.03973388671875,
0.05682373046875,
-0.0318603515625,
0.040252685546875,
0.04083251953125,
0.039306640625,
0.030548095703125,
0.033111572265625,
-0.018798828125,
0.06890869140625,
-0.0357666015625,
0.01143646240234375,
-0.03570556640625,
-0.0101165771484375,
0.001750946044921875,
-0.02880859375,
0.039581298828125,
-0.014495849609375,
-0.017303466796875,
0.00861358642578125,
-0.02789306640625,
-0.044219970703125,
-0.0257568359375,
0.01097869873046875,
0.0125885009765625,
-0.019317626953125,
0.021484375,
-0.01544952392578125,
-0.038818359375,
0.00443267822265625,
-0.0194854736328125,
-0.028350830078125,
0.012176513671875,
0.06903076171875,
0.0290679931640625,
-0.0008206367492675781,
-0.007556915283203125,
0.01447296142578125,
0.04693603515625,
-0.0223846435546875,
0.03631591796875,
0.013427734375,
-0.0411376953125,
0.0477294921875,
0.00576019287109375,
0.03509521484375,
-0.03692626953125,
0.047027587890625,
0.008636474609375,
0.01264190673828125,
-0.0026035308837890625,
0.0171966552734375,
-0.006153106689453125,
-0.01459503173828125,
-0.05218505859375,
-0.015716552734375,
-0.001491546630859375,
0.06024169921875,
-0.051422119140625,
0.09405517578125,
-0.026947021484375,
-0.026885986328125,
0.005931854248046875,
0.0086669921875,
0.040069580078125,
0.040435791015625,
-0.0130767822265625,
0.0307464599609375,
-0.00020492076873779297,
0.007328033447265625,
-0.01471710205078125,
0.0179901123046875,
-0.01983642578125,
0.047149658203125,
-0.029296875,
0.0059356689453125,
-0.0177459716796875,
-0.0009722709655761719,
0.027984619140625,
-0.01242828369140625,
-0.040863037109375,
-0.012298583984375,
-0.01500701904296875,
0.019378662109375,
0.013946533203125,
0.004608154296875,
0.0073089599609375,
0.0022907257080078125,
-0.006046295166015625,
0.0122528076171875,
-0.0111236572265625,
0.007160186767578125,
-0.01548004150390625,
0.00493621826171875,
-0.0307464599609375,
0.00728607177734375,
0.01557159423828125,
0.05328369140625,
-0.03558349609375,
0.03558349609375,
-0.010986328125,
-0.01788330078125,
-0.055450439453125,
0.03564453125,
0.0271453857421875,
-0.033172607421875,
0.0225067138671875,
-0.0110931396484375,
0.0117340087890625,
-0.0217132568359375,
0.0200042724609375,
0.03204345703125,
0.04205322265625,
0.01073455810546875,
-0.01849365234375,
0.0010766983032226562,
-0.0300750732421875,
-0.000701904296875,
0.04119873046875,
0.04644775390625,
-0.004283905029296875,
-0.0251007080078125,
-0.0106353759765625,
0.040618896484375,
0.0170440673828125,
0.0032901763916015625,
0.036407470703125,
0.03265380859375,
0.035064697265625,
0.0157623291015625,
-0.01416015625,
0.010650634765625,
0.0114288330078125,
-0.031951904296875,
0.00949859619140625,
-0.0284271240234375,
0.0198974609375,
-0.0596923828125,
-0.0007085800170898438,
-0.03240966796875,
0.043426513671875,
-0.01470947265625,
0.036041259765625,
-0.02142333984375,
-0.0240478515625,
-0.01038360595703125,
-0.01140594482421875,
0.0830078125,
0.04656982421875,
-0.045623779296875,
-0.004611968994140625,
-0.018585205078125,
-0.0094451904296875,
-0.010101318359375,
-0.0614013671875,
-0.02435302734375,
-0.0213470458984375,
-0.028076171875,
0.01861572265625,
0.01280975341796875,
0.09161376953125,
0.0222320556640625,
0.033599853515625,
-0.059295654296875,
0.033660888671875,
-0.0006742477416992188,
0.04376220703125,
0.00775146484375,
0.0208587646484375,
-0.001972198486328125,
0.003948211669921875,
-0.0204010009765625,
-0.0147705078125,
0.00482940673828125,
-0.036529541015625,
0.00930023193359375,
-0.0254669189453125,
0.005908966064453125,
-0.0123748779296875,
0.0229339599609375,
0.0012445449829101562,
-0.0149078369140625,
0.001750946044921875,
0.006500244140625,
-0.0034999847412109375,
-0.01105499267578125,
0.034637451171875,
-0.034637451171875,
0.02685546875,
-0.06298828125,
-0.042205810546875,
0.0036602020263671875,
0.05126953125,
0.01947021484375,
-0.03277587890625,
-0.0005860328674316406,
0.024505615234375,
-0.029388427734375,
0.00771331787109375,
0.062103271484375,
0.0318603515625,
0.060089111328125,
0.006252288818359375,
0.03485107421875,
0.0455322265625,
0.0247650146484375,
-0.04547119140625,
-0.050079345703125,
0.04986572265625,
0.0289459228515625,
-0.01209259033203125,
0.07427978515625,
-0.017120361328125,
0.0236968994140625,
0.0013704299926757812,
0.0421142578125,
-0.04962158203125,
0.0309295654296875,
0.020751953125,
0.00774383544921875,
0.02166748046875,
0.01476287841796875,
-0.0106658935546875,
-0.036529541015625,
0.040069580078125,
-0.006649017333984375,
0.0027637481689453125,
0.033966064453125,
0.00867462158203125,
-0.010986328125,
-0.01457977294921875,
0.01232147216796875,
0.0023212432861328125,
0.038482666015625,
-0.027984619140625,
-0.01418304443359375,
0.004093170166015625,
-0.056182861328125,
0.002071380615234375,
0.0190887451171875,
-0.00545501708984375,
-0.02734375,
0.06793212890625,
-0.005340576171875,
0.040374755859375,
-0.0316162109375,
-0.058258056640625,
0.036376953125,
0.041168212890625,
-0.046966552734375,
-0.006687164306640625,
0.01947021484375,
-0.0251007080078125,
-0.044921875,
-0.0008168220520019531,
0.014251708984375,
0.00865936279296875,
-0.0068206787109375,
0.01427459716796875,
-0.039093017578125,
-0.00650787353515625,
0.0004565715789794922,
0.006122589111328125,
0.0369873046875,
-0.00128173828125,
-0.037689208984375,
0.0183563232421875,
-0.0121917724609375,
0.00678253173828125,
0.0171966552734375,
-0.007617950439453125,
-0.00746917724609375,
-0.02581787109375,
0.0031871795654296875,
-0.058746337890625,
0.00910186767578125,
0.0121612548828125,
-0.04620361328125,
0.0802001953125,
0.0262298583984375,
0.0037250518798828125,
0.006103515625,
0.0289764404296875,
-0.036895751953125,
0.007564544677734375,
-0.06488037109375,
0.0401611328125,
0.0108795166015625,
0.06903076171875,
-0.031982421875,
-0.0006575584411621094,
0.022003173828125,
0.0131683349609375,
0.0276947021484375,
-0.00324249267578125,
-0.0084075927734375,
-0.01337432861328125,
0.0325927734375,
0.0299530029296875,
-0.0035152435302734375,
0.01678466796875,
0.040985107421875,
-0.016326904296875,
0.004787445068359375,
0.011016845703125,
0.03619384765625,
-0.0640869140625,
0.0224609375,
0.0521240234375,
0.01348876953125,
0.0085906982421875,
-0.02374267578125,
-0.01204681396484375,
0.006626129150390625,
-0.018707275390625,
-0.006328582763671875,
-0.033050537109375,
-0.0183868408203125,
0.0400390625,
0.0199432373046875,
-0.05914306640625,
-0.033599853515625,
-0.035675048828125,
0.03570556640625,
0.004367828369140625,
0.01522064208984375,
0.025238037109375,
0.0193634033203125,
-0.00641632080078125,
-0.007625579833984375,
0.0016660690307617188,
-0.0104827880859375,
0.0018634796142578125,
0.06317138671875,
0.0276031494140625,
0.00872039794921875,
-0.044677734375,
-0.0058135986328125,
0.048431396484375,
0.0848388671875,
-0.050506591796875,
0.00644683837890625,
0.01129913330078125,
0.0032329559326171875,
-0.01470947265625,
-0.0235443115234375,
0.0142974853515625,
0.03216552734375,
0.0277099609375,
-0.02947998046875,
-0.004852294921875,
0.022735595703125,
0.056854248046875,
0.0162200927734375,
0.0140838623046875,
-0.076416015625,
-0.03656005859375,
-0.0654296875,
0.042327880859375,
0.021331787109375,
0.061004638671875,
-0.0016117095947265625,
0.08087158203125,
0.0037288665771484375,
-0.015533447265625,
-0.015228271484375,
0.04193115234375,
-0.034332275390625,
0.040496826171875,
-0.03363037109375,
-0.0311737060546875,
-0.0018854141235351562,
0.035400390625,
0.058990478515625,
0.0178375244140625,
0.0052337646484375,
-0.032562255859375,
0.006587982177734375,
0.02874755859375,
0.0249481201171875,
-0.0253143310546875,
0.04937744140625,
-0.0706787109375,
0.0232391357421875,
-0.00597381591796875,
-0.00832366943359375,
-0.0017995834350585938,
-0.02996826171875,
0.032440185546875,
-0.034423828125,
-0.01183319091796875,
-0.0096282958984375,
-0.0289764404296875,
0.04901123046875,
-0.0269775390625,
0.016510009765625,
-0.031524658203125,
-0.058868408203125,
0.018341064453125,
-0.07293701171875,
-0.028533935546875,
0.02532958984375,
0.03216552734375,
-0.0217742919921875,
0.03375244140625,
0.01983642578125,
-0.02166748046875,
0.015350341796875,
0.01776123046875,
0.003993988037109375,
0.06939697265625,
0.03082275390625,
0.03204345703125,
0.006317138671875,
0.002201080322265625,
0.0169525146484375,
0.03851318359375,
0.04730224609375,
0.0189361572265625,
-0.012359619140625,
0.03607177734375,
0.01490020751953125,
0.00499725341796875,
-0.0167999267578125,
-0.0209808349609375,
0.07025146484375,
-0.016571044921875,
-0.01366424560546875,
-0.011749267578125,
-0.0260162353515625,
0.027008056640625,
0.048126220703125,
-0.0284423828125,
-0.003810882568359375,
0.03436279296875,
0.0203399658203125,
-0.01122283935546875,
0.08538818359375,
0.0046234130859375,
-0.032440185546875,
-0.050262451171875,
-0.0306396484375,
0.04229736328125,
0.10205078125,
0.05450439453125,
-0.007720947265625,
0.01328277587890625,
0.0219573974609375,
-0.016448974609375,
0.06915283203125,
-0.04815673828125,
0.01052093505859375,
-0.0223846435546875,
-0.0487060546875,
-0.0017604827880859375,
-0.0196533203125,
0.024932861328125,
-0.0007882118225097656,
0.056396484375,
0.01244354248046875,
0.012420654296875,
-0.033721923828125,
-0.0063018798828125,
0.036102294921875,
0.0210113525390625,
0.03973388671875,
-0.04840087890625,
0.000331878662109375,
-0.001995086669921875,
-0.04559326171875,
-0.03851318359375,
-0.06671142578125,
0.007663726806640625,
0.0132293701171875,
-0.0205230712890625,
-0.033294677734375,
-0.02349853515625,
-0.049285888671875,
0.02679443359375,
-0.002086639404296875,
0.01010894775390625,
-0.0103759765625,
-0.0246734619140625,
-0.042724609375,
-0.004611968994140625,
-0.029052734375,
0.028350830078125,
0.040863037109375,
-0.033447265625,
-0.021881103515625,
-0.018280029296875,
0.01251220703125,
-0.00882720947265625,
0.031402587890625,
0.031982421875,
-0.0309295654296875,
-0.0167083740234375,
0.05322265625,
0.0301055908203125,
0.093017578125,
0.011810302734375,
-0.020355224609375,
0.0034160614013671875,
0.003475189208984375,
-0.00513458251953125,
-0.00396728515625,
0.02593994140625,
-0.0232391357421875,
-0.044647216796875,
0.02069091796875,
-0.0255889892578125,
-0.0084228515625,
-0.04022216796875,
-0.07061767578125,
0.038970947265625,
0.011871337890625,
-0.03497314453125,
-0.037445068359375,
0.0399169921875,
0.0195770263671875,
-0.0279693603515625,
-0.02978515625,
0.018157958984375,
-0.0145111083984375,
-0.0083465576171875,
0.01107025146484375,
0.0218048095703125,
0.01171875,
-0.0089874267578125,
-0.03546142578125,
0.0097808837890625,
0.0185089111328125,
0.0176544189453125,
0.032135009765625,
-0.02471923828125,
0.036895751953125,
0.0201568603515625,
-0.051666259765625,
-0.009765625,
-0.005580902099609375,
-0.00395965576171875,
0.01800537109375,
-0.0233001708984375,
-0.01337432861328125,
-0.00888824462890625,
0.027557373046875,
0.0131378173828125,
0.01329803466796875,
-0.0191650390625,
0.00018835067749023438,
0.026092529296875,
-0.03973388671875,
0.01009368896484375,
0.0149993896484375,
-0.0269317626953125,
-0.00669097900390625,
-0.0186920166015625,
-0.025421142578125,
-0.0305328369140625,
0.037200927734375,
-0.0504150390625,
0.0026836395263671875,
0.005748748779296875,
0.008697509765625,
-0.032196044921875,
-0.051055908203125,
0.04913330078125,
-0.03466796875,
-0.021331787109375,
0.01097869873046875,
0.0270538330078125,
0.0011625289916992188,
0.007007598876953125,
0.026611328125,
0.028778076171875,
-0.0163421630859375,
0.021392822265625,
0.033599853515625,
-0.00829315185546875,
0.004390716552734375,
-0.01535797119140625,
0.0042877197265625,
0.0271453857421875,
-0.0273284912109375,
0.012237548828125,
0.0186767578125,
0.05145263671875,
-0.0160980224609375,
0.059051513671875,
-0.0026912689208984375,
0.10498046875,
0.002010345458984375,
0.06207275390625,
0.00514984130859375,
-0.0325927734375,
0.030517578125,
-0.0458984375,
-0.00620269775390625,
0.040496826171875,
0.016448974609375,
-0.04559326171875,
0.036590576171875,
0.0007200241088867188,
0.044952392578125,
0.01538848876953125
] |
1fcc6659f24995d9224b3df7510efbd06fa6258f
|
Wordpress Stackexchange
Q: How can I detect if a user changes their password? I would like to track when a user changes their password. Is there a way to detect when a password has been changed?
A: WordPress sends an email to the admin's email when a user resets their password.
To get a notification when a user changes their password you could hook into the profile_update action which is fired when a user's profile is updated.
When the action is fired WordPress has already validated and updated the user's details we only need to check if the user submitted a password with the request, if it was submitted then the user's password has changed.
function my_profile_update( $user_id ) {
if ( ! isset( $_POST['pass1'] ) || '' == $_POST['pass1'] ) {
return;
}
// password changed...
}
add_action( 'profile_update', 'my_profile_update' );
|
Q: How can I detect if a user changes their password? I would like to track when a user changes their password. Is there a way to detect when a password has been changed?
A: WordPress sends an email to the admin's email when a user resets their password.
To get a notification when a user changes their password you could hook into the profile_update action which is fired when a user's profile is updated.
When the action is fired WordPress has already validated and updated the user's details we only need to check if the user submitted a password with the request, if it was submitted then the user's password has changed.
function my_profile_update( $user_id ) {
if ( ! isset( $_POST['pass1'] ) || '' == $_POST['pass1'] ) {
return;
}
// password changed...
}
add_action( 'profile_update', 'my_profile_update' );
|
wordpress
|
{
"language": "en",
"length": 140,
"provenance": "stackexchange_00019.jsonl.gz:419733",
"question_score": "4",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51337"
}
|
[
0.029296875,
0.0124359130859375,
-0.0174560546875,
0.0019893646240234375,
0.0125885009765625,
-0.0379638671875,
0.00824737548828125,
-0.0596923828125,
-0.02130126953125,
0.038543701171875,
0.0006909370422363281,
-0.0010223388671875,
0.009613037109375,
-0.0250244140625,
-0.007328033447265625,
-0.0299835205078125,
0.019805908203125,
0.0153045654296875,
0.04449462890625,
-0.0034942626953125,
0.006397247314453125,
0.00997161865234375,
0.00939178466796875,
-0.005435943603515625,
-0.019073486328125,
0.0328369140625,
0.106201171875,
-0.0182037353515625,
0.022247314453125,
0.0169219970703125,
0.01153564453125,
-0.0745849609375,
0.0007476806640625,
0.042633056640625,
-0.04986572265625,
0.005786895751953125,
-0.002227783203125,
0.03179931640625,
-0.006694793701171875,
0.037261962890625,
0.032867431640625,
-0.017364501953125,
0.01141357421875,
-0.0038661956787109375,
0.0004372596740722656,
-0.04351806640625,
0.0731201171875,
-0.0191650390625,
0.003170013427734375,
0.029083251953125,
0.024444580078125,
-0.018768310546875,
0.0307769775390625,
0.01352691650390625,
-0.0156707763671875,
-0.0032596588134765625,
-0.052886962890625,
0.032318115234375,
0.027801513671875,
0.03765869140625,
-0.0047760009765625,
-0.0169525146484375,
0.005359649658203125,
-0.0540771484375,
-0.0557861328125,
-0.01439666748046875,
0.0002512931823730469,
-0.0053558349609375,
-0.0182037353515625,
-0.06707763671875,
0.01873779296875,
0.0191497802734375,
-0.05096435546875,
0.0036487579345703125,
-0.0009427070617675781,
0.004611968994140625,
-0.0106048583984375,
-0.0362548828125,
-0.0021610260009765625,
0.046966552734375,
-0.01125335693359375,
0.0152130126953125,
-0.00861358642578125,
-0.006038665771484375,
-0.0004773139953613281,
0.0199127197265625,
-0.01959228515625,
-0.01131439208984375,
-0.0204010009765625,
-0.01084136962890625,
-0.022918701171875,
0.019805908203125,
-0.0208282470703125,
-0.00936126708984375,
-0.038482666015625,
-0.00350189208984375,
0.0288543701171875,
0.047119140625,
-0.018707275390625,
-0.009735107421875,
-0.037353515625,
-0.00624847412109375,
-0.064208984375,
-0.0017938613891601562,
-0.01416015625,
0.043365478515625,
0.03985595703125,
0.0127410888671875,
-0.0005321502685546875,
0.000025391578674316406,
-0.00620269775390625,
-0.013519287109375,
-0.042022705078125,
-0.0189208984375,
-0.02154541015625,
0.044219970703125,
-0.033294677734375,
-0.02099609375,
-0.023712158203125,
0.0050201416015625,
-0.00467681884765625,
0.0069580078125,
0.0011205673217773438,
-0.045989990234375,
0.0156707763671875,
-0.0217132568359375,
-0.023773193359375,
0.0025730133056640625,
-0.0234222412109375,
0.029296875,
-0.052032470703125,
-0.012481689453125,
0.06378173828125,
0.051055908203125,
0.036041259765625,
-0.037506103515625,
0.0204620361328125,
0.0202484130859375,
-0.019500732421875,
0.050384521484375,
-0.0269927978515625,
-0.040557861328125,
-0.02288818359375,
-0.028839111328125,
-0.004085540771484375,
0.0225677490234375,
0.016082763671875,
0.00829315185546875,
-0.0011138916015625,
-0.0489501953125,
0.006725311279296875,
-0.0194091796875,
-0.01190185546875,
0.034423828125,
0.0340576171875,
0.0268402099609375,
0.01025390625,
0.00461578369140625,
0.01080322265625,
0.0197296142578125,
0.042724609375,
-0.021514892578125,
-0.003376007080078125,
0.0261383056640625,
-0.0186767578125,
0.032806396484375,
-0.0288848876953125,
-0.0037746429443359375,
0.0313720703125,
-0.05029296875,
0.0226593017578125,
0.02117919921875,
0.0250396728515625,
0.01453399658203125,
0.016815185546875,
0.0216827392578125,
-0.00566864013671875,
0.046661376953125,
0.0213165283203125,
0.01007843017578125,
0.0004067420959472656,
-0.0313720703125,
0.10040283203125,
-0.039337158203125,
-0.004344940185546875,
-0.011749267578125,
0.0214691162109375,
0.020599365234375,
-0.0026702880859375,
0.04010009765625,
-0.0138092041015625,
0.032318115234375,
0.0255889892578125,
0.01247406005859375,
-0.00685882568359375,
-0.032012939453125,
0.0206146240234375,
0.0178985595703125,
-0.0134124755859375,
-0.01123809814453125,
0.044708251953125,
-0.00803375244140625,
0.0066070556640625,
-0.05047607421875,
-0.0997314453125,
0.004619598388671875,
-0.04254150390625,
0.048736572265625,
0.003948211669921875,
0.04510498046875,
0.0084686279296875,
0.01177215576171875,
-0.03216552734375,
-0.0007090568542480469,
-0.0138397216796875,
-0.025665283203125,
-0.049774169921875,
0.035888671875,
-0.01247406005859375,
0.0621337890625,
-0.0236968994140625,
-0.02020263671875,
-0.0158538818359375,
-0.048583984375,
0.01326751708984375,
-0.03857421875,
-0.0088043212890625,
-0.0247039794921875,
0.003650665283203125,
-0.01776123046875,
-0.007843017578125,
0.03643798828125,
-0.0174407958984375,
-0.03466796875,
-0.054290771484375,
-0.016143798828125,
-0.0322265625,
-0.0665283203125,
0.00444793701171875,
0.07452392578125,
0.03558349609375,
0.01885986328125,
0.0006542205810546875,
0.007785797119140625,
0.0452880859375,
0.0014057159423828125,
0.026519775390625,
-0.0069122314453125,
-0.00485992431640625,
0.043426513671875,
-0.0220489501953125,
-0.00574493408203125,
0.0053558349609375,
-0.048553466796875,
-0.036590576171875,
0.048492431640625,
0.00951385498046875,
0.052398681640625,
-0.02484130859375,
0.005100250244140625,
-0.03228759765625,
-0.04638671875,
0.0019140243530273438,
-0.0469970703125,
0.0307769775390625,
-0.0093994140625,
0.0164794921875,
0.0171051025390625,
-0.0071258544921875,
-0.0004475116729736328,
0.008453369140625,
-0.061248779296875,
0.0038738250732421875,
0.03863525390625,
-0.002838134765625,
0.049774169921875,
-0.0270538330078125,
-0.0288238525390625,
0.014862060546875,
0.03253173828125,
-0.033935546875,
-0.0250091552734375,
-0.0467529296875,
-0.0157470703125,
0.008697509765625,
0.0167388916015625,
0.01323699951171875,
-0.00927734375,
-0.00033926963806152344,
-0.006732940673828125,
0.040008544921875,
0.0188140869140625,
0.01116943359375,
0.007694244384765625,
0.001468658447265625,
-0.018890380859375,
-0.0465087890625,
-0.007526397705078125,
0.0300750732421875,
-0.035675048828125,
-0.005428314208984375,
0.062744140625,
0.0036411285400390625,
0.005260467529296875,
-0.005619049072265625,
-0.0046539306640625,
-0.00684356689453125,
0.019134521484375,
-0.00028514862060546875,
-0.01788330078125,
-0.04498291015625,
0.00782012939453125,
0.0026912689208984375,
-0.027313232421875,
-0.00019824504852294922,
-0.0147552490234375,
-0.0257415771484375,
-0.01617431640625,
-0.03680419921875,
0.0067291259765625,
-0.09625244140625,
-0.1107177734375,
0.00905609130859375,
-0.004962921142578125,
-0.03692626953125,
0.029266357421875,
0.035888671875,
0.0516357421875,
0.005767822265625,
-0.017913818359375,
-0.055511474609375,
-0.035552978515625,
-0.05084228515625,
0.036590576171875,
-0.0029735565185546875,
0.0215301513671875,
-0.00812530517578125,
0.0697021484375,
-0.006500244140625,
-0.079833984375,
-0.04638671875,
0.0261077880859375,
-0.0027065277099609375,
0.004497528076171875,
-0.0225830078125,
-0.0167999267578125,
0.0258331298828125,
-0.0024967193603515625,
-0.037567138671875,
-0.01113128662109375,
0.040435791015625,
-0.0280914306640625,
0.01904296875,
-0.0286712646484375,
0.03485107421875,
-0.0105743408203125,
-0.04632568359375,
-0.0079345703125,
0.0187225341796875,
-0.0458984375,
0.00301361083984375,
0.00433349609375,
-0.0164794921875,
0.0223846435546875,
-0.0021514892578125,
-0.030029296875,
0.0169219970703125,
0.014556884765625,
-0.0235443115234375,
0.007354736328125,
-0.01155853271484375,
-0.033233642578125,
0.0440673828125,
-0.003452301025390625,
-0.0171966552734375,
0.0045623779296875,
-0.02227783203125,
-0.03314208984375,
0.00310516357421875,
-0.0271759033203125,
0.0187225341796875,
-0.0193328857421875,
0.03167724609375,
-0.01491546630859375,
-0.07867431640625,
0.050811767578125,
-0.0164642333984375,
-0.01412200927734375,
-0.0279998779296875,
-0.0224761962890625,
0.0224761962890625,
0.10736083984375,
-0.03228759765625,
-0.0178375244140625,
0.01277923583984375,
0.0274505615234375,
-0.04742431640625,
-0.0278472900390625,
-0.040313720703125,
-0.0021724700927734375,
-0.0380859375,
-0.004375457763671875,
-0.00754547119140625,
-0.0250396728515625,
-0.02142333984375,
-0.0189666748046875,
-0.0215911865234375,
-0.0276947021484375,
0.0017986297607421875,
-0.032684326171875,
0.0153350830078125,
-0.0078277587890625,
0.014495849609375,
-0.031707763671875,
0.02752685546875,
-0.058624267578125,
-0.004909515380859375,
0.000553131103515625,
0.0018892288208007812,
0.0092010498046875,
0.025848388671875,
-0.047149658203125,
0.0063018798828125,
0.0147552490234375,
0.0379638671875,
0.0213775634765625,
-0.0044403076171875,
-0.0206451416015625,
0.0229339599609375,
-0.0016460418701171875,
-0.0017595291137695312,
0.0005030632019042969,
0.0028171539306640625,
-0.001888275146484375,
-0.017974853515625,
0.0270233154296875,
-0.023162841796875,
0.0205841064453125,
0.005340576171875,
-0.0183563232421875,
-0.034088134765625,
-0.01934814453125,
-0.0304718017578125,
0.00853729248046875,
-0.01299285888671875,
0.0025844573974609375,
-0.00910186767578125,
-0.04693603515625,
0.0443115234375,
-0.024505615234375,
-0.0111236572265625,
-0.01535797119140625,
0.06866455078125,
0.01439666748046875,
-0.014007568359375,
0.037261962890625,
0.04010009765625,
0.054534912109375,
0.03887939453125,
0.00775909423828125,
0.0255279541015625,
-0.03778076171875,
-0.00589752197265625,
0.045196533203125,
-0.03253173828125,
0.01477813720703125,
0.01473236083984375,
0.021453857421875,
-0.0279693603515625,
-0.0166473388671875,
-0.001422882080078125,
0.020721435546875,
0.021240234375,
-0.00632476806640625,
-0.005359649658203125,
0.000598907470703125,
0.01451873779296875,
-0.0246124267578125,
0.0120086669921875,
-0.0093536376953125,
-0.057220458984375,
0.02142333984375,
-0.056182861328125,
-0.023590087890625,
-0.03118896484375,
0.0163421630859375,
-0.022186279296875,
0.002338409423828125,
0.0038433074951171875,
-0.06866455078125,
-0.05023193359375,
-0.0101776123046875,
0.0404052734375,
-0.078369140625,
0.0198211669921875,
-0.033782958984375,
-0.024993896484375,
0.099609375,
0.006870269775390625,
-0.07476806640625,
0.04559326171875,
-0.031829833984375,
0.054290771484375,
0.040191650390625,
-0.049560546875,
0.0526123046875,
-0.00679779052734375,
-0.033172607421875,
-0.01383209228515625,
-0.060943603515625,
-0.046173095703125,
-0.06793212890625,
0.0108184814453125,
0.01154327392578125,
-0.0182647705078125,
0.02764892578125,
0.025848388671875,
0.00785064697265625,
0.01258087158203125,
-0.0008568763732910156,
0.0557861328125,
0.0391845703125,
-0.0164947509765625,
0.0003840923309326172,
0.0762939453125,
-0.01425933837890625,
-0.0237274169921875,
0.01470184326171875,
-0.03717041015625,
-0.0278472900390625,
0.004825592041015625,
0.026611328125,
0.02880859375,
0.0200958251953125,
-0.00145721435546875,
0.01297760009765625,
-0.01082611083984375,
0.018524169921875,
-0.00029397010803222656,
-0.02874755859375,
-0.0193328857421875,
0.012969970703125,
0.01715087890625,
-0.009429931640625,
0.0108489990234375,
-0.06329345703125,
-0.02349853515625,
-0.031524658203125,
-0.0196685791015625,
-0.016632080078125,
-0.0238800048828125,
-0.018951416015625,
-0.035919189453125,
-0.035369873046875,
-0.01155853271484375,
0.00322723388671875,
0.020050048828125,
-0.022979736328125,
-0.01342010498046875,
0.025360107421875,
-0.005245208740234375,
0.0059356689453125,
-0.0046234130859375,
-0.007144927978515625,
0.0204925537109375,
-0.004474639892578125,
0.047882080078125,
-0.01221466064453125,
-0.0733642578125,
0.0028934478759765625,
-0.040557861328125,
0.0008478164672851562,
-0.00865936279296875,
-0.034271240234375,
-0.031158447265625,
0.0019989013671875,
-0.0063018798828125,
0.00012862682342529297,
0.0191192626953125,
0.0297393798828125,
-0.03851318359375,
0.036834716796875,
0.02252197265625,
0.0101776123046875,
0.004894256591796875,
0.046234130859375,
0.005153656005859375,
0.059600830078125,
0.026641845703125,
0.0179443359375,
-0.04388427734375,
-0.0210113525390625,
0.0175628662109375,
0.0175018310546875,
0.0013532638549804688,
-0.0416259765625,
0.04827880859375,
-0.06610107421875,
-0.0004591941833496094,
-0.0121002197265625,
-0.041778564453125,
-0.003177642822265625,
0.01409149169921875,
-0.0278167724609375,
0.0528564453125,
0.024261474609375,
-0.04547119140625,
0.022430419921875,
-0.01071929931640625,
0.0203094482421875,
0.0022525787353515625,
-0.02789306640625,
0.04608154296875,
-0.00412750244140625,
0.0250091552734375,
0.0098419189453125,
-0.0396728515625,
0.05010986328125,
0.03717041015625,
-0.01520538330078125,
0.0238800048828125,
0.00788116455078125,
0.00991058349609375,
0.008087158203125,
-0.06915283203125,
-0.01165771484375,
0.06072998046875,
0.044342041015625,
-0.00980377197265625,
0.0164947509765625,
0.044403076171875,
-0.0170440673828125,
0.0169525146484375,
0.038299560546875,
0.06060791015625,
-0.06561279296875,
0.01019287109375,
0.005889892578125,
-0.00661468505859375,
0.047760009765625,
0.00848388671875,
-0.0369873046875,
-0.060028076171875,
0.060089111328125,
-0.0518798828125,
-0.013580322265625,
0.022705078125,
-0.0189361572265625,
0.0035114288330078125,
-0.0174713134765625,
0.063232421875,
0.020294189453125,
-0.0188446044921875,
-0.002166748046875,
0.03399658203125,
-0.0013885498046875,
-0.017913818359375,
-0.0107421875,
0.03314208984375,
-0.048370361328125,
-0.0836181640625,
-0.01100921630859375,
0.0035953521728515625,
-0.030609130859375,
-0.0101318359375,
0.04541015625,
0.038116455078125,
0.046539306640625,
0.0192413330078125,
-0.036376953125,
0.0165863037109375,
0.01087188720703125,
-0.032867431640625,
-0.01480865478515625,
-0.005359649658203125,
0.041656494140625,
-0.0562744140625,
0.0222015380859375,
-0.0301361083984375,
0.0206146240234375,
-0.006893157958984375,
-0.022674560546875,
0.061737060546875,
-0.030029296875,
-0.007770538330078125,
0.0202484130859375,
0.01739501953125,
0.0032138824462890625,
0.002105712890625,
-0.004276275634765625,
-0.011383056640625,
0.01435089111328125,
0.00421905517578125,
-0.03704833984375,
-0.0010881423950195312,
0.005466461181640625,
-0.032562255859375,
0.060638427734375,
-0.00803375244140625,
-0.0218658447265625,
-0.0113372802734375,
0.0308074951171875,
-0.007663726806640625,
0.01910400390625,
-0.05023193359375,
0.05377197265625,
0.0155792236328125,
0.059814453125,
-0.028167724609375,
-0.000644683837890625,
0.028106689453125,
0.009765625,
0.0396728515625,
0.015655517578125,
-0.012359619140625,
-0.0279693603515625,
-0.0144805908203125,
0.006847381591796875,
-0.027618408203125,
0.0287628173828125,
-0.007843017578125,
0.025054931640625,
0.022125244140625,
-0.06829833984375,
0.0233917236328125,
-0.047088623046875,
-0.0099029541015625,
0.0156097412109375,
0.01033782958984375,
-0.011932373046875,
0.004550933837890625,
0.047943115234375,
-0.04656982421875,
0.011474609375,
0.0281219482421875,
0.0200958251953125,
0.0187835693359375,
0.044952392578125,
0.0631103515625,
0.0199432373046875,
0.053680419921875,
-0.0230865478515625,
0.06817626953125,
0.001964569091796875,
-0.01093292236328125,
0.0261688232421875,
0.00626373291015625,
-0.01551055908203125,
0.00707244873046875,
-0.0167388916015625,
0.016082763671875,
0.0102386474609375,
0.06396484375,
0.0390625,
0.021392822265625,
-0.012359619140625,
0.0297088623046875,
0.01406097412109375,
0.0662841796875,
-0.05889892578125,
-0.029083251953125,
0.0182952880859375,
0.01415252685546875,
0.025390625,
0.00689697265625,
0.0428466796875,
-0.04119873046875,
0.0016813278198242188,
-0.006763458251953125,
-0.015350341796875,
0.00423431396484375,
-0.005611419677734375,
0.0038738250732421875,
0.037567138671875,
0.00745391845703125,
0.006591796875,
0.009735107421875,
-0.006610870361328125,
-0.0019779205322265625,
-0.01605224609375,
-0.04150390625,
0.0232086181640625,
0.016571044921875,
0.0303192138671875,
0.0034618377685546875,
-0.00920867919921875,
0.009246826171875,
-0.0066375732421875,
0.000469207763671875,
0.0128326416015625,
-0.0078125,
0.02667236328125,
0.02508544921875,
-0.008880615234375,
0.02850341796875,
-0.0161590576171875,
-0.045562744140625,
-0.00684356689453125,
-0.00574493408203125,
-0.033538818359375,
0.0183563232421875,
-0.03173828125,
0.0228118896484375,
0.01328277587890625,
-0.0126953125,
-0.0248870849609375,
0.005321502685546875,
0.057159423828125,
0.01373291015625,
0.036468505859375,
0.01385498046875,
0.0204620361328125,
0.0209808349609375,
0.05523681640625,
-0.0008425712585449219,
0.066162109375,
-0.03363037109375,
-0.006587982177734375,
-0.0086212158203125,
-0.07720947265625,
0.03521728515625,
0.043487548828125,
-0.048187255859375,
0.02655029296875,
0.009552001953125,
-0.0286407470703125,
0.041290283203125,
0.01458740234375,
-0.03033447265625,
-0.01221466064453125,
0.02313232421875,
-0.04241943359375,
-0.004787445068359375,
-0.00930023193359375,
0.0183868408203125,
0.01910400390625,
0.001079559326171875,
0.01540374755859375,
0.008453369140625,
0.0127716064453125,
-0.01226043701171875,
0.04351806640625,
-0.051849365234375,
-0.0150909423828125,
0.043731689453125,
-0.02099609375,
-0.01270294189453125,
-0.0014123916625976562,
-0.0750732421875,
0.08050537109375,
0.004302978515625,
0.030181884765625,
0.06573486328125,
0.00867462158203125,
-0.006977081298828125,
0.004566192626953125,
-0.0185089111328125,
-0.035980224609375,
-0.05340576171875,
0.006999969482421875,
0.03253173828125,
-0.0217437744140625,
0.003925323486328125,
-0.0285186767578125,
0.03057861328125,
-0.039947509765625,
-0.0016603469848632812,
-0.014678955078125,
-0.00746917724609375,
-0.05487060546875,
0.017547607421875,
-0.0286407470703125,
0.019927978515625,
-0.042083740234375,
-0.0213623046875,
0.0098876953125,
-0.005954742431640625,
-0.0036983489990234375,
-0.0084381103515625,
0.049224853515625,
-0.0010738372802734375,
0.05462646484375,
0.0723876953125,
0.02203369140625,
0.04327392578125,
-0.011627197265625,
-0.0030612945556640625,
0.0234375,
-0.01393890380859375,
-0.0307464599609375,
-0.07122802734375,
0.004718780517578125,
0.0182342529296875,
-0.03167724609375,
-0.0167999267578125,
-0.038177490234375,
0.034332275390625,
0.0260009765625,
-0.00730133056640625,
-0.08551025390625,
0.044403076171875,
-0.0293426513671875,
0.07757568359375,
-0.03118896484375,
-0.034088134765625,
0.033935546875,
0.04705810546875,
-0.05419921875,
-0.03045654296875,
-0.038604736328125,
-0.0211029052734375,
-0.059722900390625,
-0.0225067138671875,
0.042816162109375,
-0.0063018798828125,
-0.039154052734375,
-0.07635498046875,
-0.0084991455078125,
-0.03497314453125,
-0.045623779296875,
-0.034912109375,
-0.00466156005859375,
0.017303466796875,
0.0237274169921875,
-0.051971435546875,
-0.03240966796875,
-0.00974273681640625,
0.0273590087890625,
-0.03466796875,
0.010467529296875,
0.0213623046875,
-0.0496826171875,
-0.10955810546875,
0.02880859375,
-0.0283050537109375,
-0.032806396484375,
-0.034423828125,
0.0004680156707763672,
-0.0143280029296875,
-0.00016176700592041016,
-0.0223388671875,
0.00762176513671875,
-0.00820159912109375,
0.043060302734375,
0.020172119140625,
-0.0228729248046875,
0.0160064697265625,
-0.0003075599670410156,
-0.06591796875,
0.028564453125,
0.0174713134765625,
0.00011682510375976562,
-0.01108551025390625,
-0.01226806640625,
0.0151824951171875,
0.018096923828125,
-0.031280517578125,
-0.038604736328125,
0.016571044921875,
0.01534271240234375,
-0.03118896484375,
-0.018463134765625,
-0.00531768798828125,
-0.001445770263671875,
0.0780029296875,
0.05120849609375,
0.013214111328125,
-0.038909912109375,
-0.0172119140625,
0.0017871856689453125,
0.0222625732421875,
0.00738525390625,
-0.0065155029296875,
-0.0396728515625,
-0.0013036727905273438,
0.0105438232421875,
-0.0098419189453125,
-0.054931640625,
-0.015472412109375,
-0.055084228515625,
-0.005359649658203125,
0.01023101806640625,
0.03411865234375,
0.01519775390625,
-0.050201416015625,
0.057769775390625,
-0.0309906005859375,
0.00557708740234375,
0.0185089111328125,
0.02716064453125,
0.0247650146484375,
0.0596923828125,
0.032623291015625,
0.04510498046875,
-0.037200927734375,
-0.005615234375,
0.034637451171875,
0.00868988037109375,
-0.01406097412109375,
-0.021697998046875,
0.0009183883666992188,
0.00144195556640625,
-0.00426483154296875,
-0.01171875,
-0.00016796588897705078,
0.0257568359375,
0.00004780292510986328,
0.035186767578125,
0.0006823539733886719,
-0.005947113037109375,
-0.03076171875,
0.051361083984375,
0.0008983612060546875,
-0.033447265625,
0.02777099609375,
-0.038177490234375,
-0.003681182861328125,
0.0212249755859375,
0.041778564453125,
-0.054656982421875,
0.054443359375,
0.016021728515625,
0.048858642578125,
0.04412841796875
] |
bb7648de738619f72ca34837aa72f03485279974
|
Wordpress Stackexchange
Q: How to remove welcome screen and its screen option checkbox? Clicking the screen options on dashboard, the drop down area has welcome checkbox. So even after hiding the welcome screen, if user chooses to display the welcome screen. It still shows.
Is there a way to hide this option completely and turn off the welcome screen?
Or otherwise, a way to remove the welcome content completely and replace it with something else?
A: For WordPress 3.5+, adding remove_action( 'welcome_panel', 'wp_welcome_panel' ); to your functions.php removes the Welcome Panel from the Dashboard as well as its Screen Options menu.
See http://codex.wordpress.org/Plugin_API/Action_Reference/welcome_panel.
|
Q: How to remove welcome screen and its screen option checkbox? Clicking the screen options on dashboard, the drop down area has welcome checkbox. So even after hiding the welcome screen, if user chooses to display the welcome screen. It still shows.
Is there a way to hide this option completely and turn off the welcome screen?
Or otherwise, a way to remove the welcome content completely and replace it with something else?
A: For WordPress 3.5+, adding remove_action( 'welcome_panel', 'wp_welcome_panel' ); to your functions.php removes the Welcome Panel from the Dashboard as well as its Screen Options menu.
See http://codex.wordpress.org/Plugin_API/Action_Reference/welcome_panel.
A: You can remove (turn-off) the Welcome screen by using any of these two options:
Single:
add_action( 'load-index.php', 'hide_welcome_screen' );
function hide_welcome_screen() {
$user_id = get_current_user_id();
if ( 1 == get_user_meta( $user_id, 'show_welcome_panel', true ) )
update_user_meta( $user_id, 'show_welcome_panel', 0 );
}
?>
Multisite:
<?php
if ( ! defined( 'ABSPATH' ) || ! is_multisite() )
return;
add_action( 'load-index.php', 'hide_welcome_screen_for_multisite' );
function hide_welcome_screen_for_multisite() {
$user_id = get_current_user_id();
if ( 2 == get_user_meta( $user_id, 'show_welcome_panel', true ) )
update_user_meta( $user_id, 'show_welcome_panel', 0 );
}
?>
The state of the welcome panel is stored in a usermeta key that is global to the network. The value of 0 means the welcome panel should not be shown (and has been dismissed).
The value of 1 means the welcome panel should be shown. (The initial user for a ingle-site WordPress install is given this value) .
The value of 2 is specific to multisite, and means that the panel should only be shown if the user is the site owner.
Once dismissed, the panel can be shown by visiting the Screen Options tab.
I hope that helps.
A: You can hide the Welcome checkbox using some simple CSS:
[for="wp_welcome_panel-hide"] {
display: none !important;
}
To add the CSS code to your WP-ADMIN pages, simply add this in your theme's functions.php file before the last ?>:
function my_custom_admin_head() {
echo '<style>[for="wp_welcome_panel-hide"] {display: none !important;}</style>';
}
add_action('admin_head', 'my_custom_admin_head');
Note that I am using CSS3 selector in the code, I believe it works in IE7+ and newer.
PS: If you are already enqueuing a custom stylesheet file for WordPress Dashboard pages, obviously, you should add the CSS code in that CSS file. If not, I wouldn't bother creating one just for this code (1. it's not public facing, 2. unnecessary HTTP requests).
A: You can remove the panel and the checkbox for it by getting rid of the 'welcome_panel' action.
add_action( 'wp_dashboard_setup', 'remove_welcome_panel' );
function remove_welcome_panel() {
global $wp_filter;
unset( $wp_filter['welcome_panel'] );
}
|
wordpress
|
{
"language": "en",
"length": 426,
"provenance": "stackexchange_00019.jsonl.gz:419739",
"question_score": "7",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51356"
}
|
[
0.0682373046875,
0.0279083251953125,
-0.00257110595703125,
0.0063018798828125,
0.043182373046875,
-0.052978515625,
0.08319091796875,
-0.048828125,
0.0213165283203125,
0.01462554931640625,
-0.018768310546875,
-0.04229736328125,
-0.05694580078125,
-0.0292510986328125,
-0.055755615234375,
-0.0650634765625,
0.027435302734375,
-0.018402099609375,
0.02166748046875,
-0.01552581787109375,
-0.00624847412109375,
0.0035114288330078125,
0.0345458984375,
0.040496826171875,
0.016204833984375,
-0.01239013671875,
-0.0004527568817138672,
0.0164794921875,
-0.01702880859375,
-0.009429931640625,
0.007343292236328125,
0.01251220703125,
-0.0233154296875,
0.09783935546875,
-0.046112060546875,
0.060272216796875,
-0.007282257080078125,
0.05718994140625,
0.0482177734375,
0.01512908935546875,
0.010955810546875,
0.00466156005859375,
-0.015228271484375,
0.011810302734375,
-0.027984619140625,
-0.0287628173828125,
-0.004070281982421875,
-0.037567138671875,
0.03118896484375,
-0.025634765625,
0.01068878173828125,
0.022979736328125,
0.02630615234375,
-0.042236328125,
-0.02203369140625,
-0.03228759765625,
-0.030975341796875,
0.00934600830078125,
0.0182037353515625,
0.06463623046875,
0.01161956787109375,
0.005924224853515625,
-0.0185546875,
-0.060516357421875,
-0.00765228271484375,
-0.01153564453125,
-0.0192108154296875,
0.01806640625,
-0.04510498046875,
0.0139312744140625,
0.0418701171875,
-0.040283203125,
-0.0087738037109375,
-0.06719970703125,
-0.02093505859375,
0.0765380859375,
-0.008392333984375,
-0.023162841796875,
0.01322174072265625,
-0.0233306884765625,
0.00734710693359375,
0.004955291748046875,
-0.0190887451171875,
-0.061553955078125,
0.062744140625,
0.00487518310546875,
-0.003467559814453125,
-0.0142059326171875,
-0.0182952880859375,
-0.0262298583984375,
-0.01654052734375,
-0.045379638671875,
-0.00916290283203125,
0.01300811767578125,
-0.020416259765625,
-0.01459503173828125,
0.03009033203125,
0.039215087890625,
0.0184326171875,
-0.0145111083984375,
-0.0221710205078125,
-0.0056915283203125,
-0.04437255859375,
-0.0136260986328125,
-0.00614166259765625,
0.023193359375,
-0.0203094482421875,
0.0202178955078125,
0.032135009765625,
0.036712646484375,
0.0004968643188476562,
-0.032440185546875,
-0.03106689453125,
-0.00501251220703125,
-0.0269317626953125,
0.032928466796875,
-0.03564453125,
-0.0029735565185546875,
-0.0214385986328125,
0.029998779296875,
-0.0343017578125,
-0.024444580078125,
-0.022064208984375,
0.0286865234375,
0.0166778564453125,
-0.019561767578125,
-0.0293121337890625,
0.05450439453125,
-0.04736328125,
0.0010061264038085938,
-0.037841796875,
0.03448486328125,
0.0689697265625,
0.04510498046875,
0.0203094482421875,
-0.0035610198974609375,
0.03875732421875,
0.0294189453125,
0.0189361572265625,
0.014862060546875,
-0.017181396484375,
-0.039031982421875,
-0.009521484375,
-0.01407623291015625,
0.0261688232421875,
-0.00042366981506347656,
0.00872039794921875,
0.03045654296875,
0.00974273681640625,
-0.0211639404296875,
0.028045654296875,
-0.0259857177734375,
0.01499176025390625,
0.034881591796875,
0.018218994140625,
0.01654052734375,
0.05218505859375,
-0.0120391845703125,
-0.0250701904296875,
-0.0239715576171875,
0.003093719482421875,
-0.006107330322265625,
0.0227813720703125,
-0.04266357421875,
-0.040802001953125,
0.0017566680908203125,
-0.043365478515625,
-0.00849151611328125,
0.0166473388671875,
-0.01338958740234375,
-0.0006155967712402344,
-0.033782958984375,
-0.031524658203125,
0.00160980224609375,
0.0049591064453125,
0.044952392578125,
0.03448486328125,
0.016754150390625,
-0.001544952392578125,
0.04632568359375,
0.0064239501953125,
-0.040313720703125,
0.0115814208984375,
-0.01511383056640625,
-0.08319091796875,
0.0682373046875,
0.00707244873046875,
0.044586181640625,
0.002223968505859375,
-0.01328277587890625,
0.089599609375,
0.0693359375,
-0.0025310516357421875,
-0.020965576171875,
0.0007433891296386719,
0.0025577545166015625,
-0.04156494140625,
0.005680084228515625,
-0.028533935546875,
0.021759033203125,
0.06585693359375,
0.01275634765625,
0.01117706298828125,
-0.0240020751953125,
-0.08026123046875,
0.02008056640625,
-0.036224365234375,
0.0364990234375,
0.007904052734375,
0.03021240234375,
0.01181793212890625,
0.0239715576171875,
-0.038970947265625,
0.007808685302734375,
0.0036907196044921875,
0.03887939453125,
-0.0233154296875,
0.05908203125,
-0.0175323486328125,
0.01511383056640625,
0.00044083595275878906,
-0.047210693359375,
0.030731201171875,
0.0179595947265625,
0.048736572265625,
-0.0176849365234375,
-0.0241851806640625,
-0.0233612060546875,
0.042572021484375,
-0.035186767578125,
0.017822265625,
0.06396484375,
-0.0211334228515625,
-0.02935791015625,
-0.031402587890625,
0.003612518310546875,
0.01531219482421875,
-0.047821044921875,
-0.0042572021484375,
0.039093017578125,
0.027801513671875,
0.03729248046875,
-0.03692626953125,
-0.0177459716796875,
0.03143310546875,
-0.056793212890625,
0.0000750422477722168,
0.01076507568359375,
0.00980377197265625,
0.029296875,
0.003459930419921875,
0.01145172119140625,
0.01512908935546875,
-0.00008213520050048828,
0.007694244384765625,
0.01366424560546875,
-0.0084381103515625,
0.0130462646484375,
0.0127410888671875,
-0.019256591796875,
-0.0009174346923828125,
-0.050262451171875,
-0.030670166015625,
-0.04052734375,
-0.0236968994140625,
-0.0533447265625,
-0.0131378173828125,
-0.0118408203125,
-0.0194549560546875,
-0.051513671875,
0.048492431640625,
0.054412841796875,
-0.028076171875,
0.01629638671875,
0.04730224609375,
-0.0157928466796875,
-0.0504150390625,
0.01036834716796875,
-0.0273590087890625,
-0.0003204345703125,
-0.0321044921875,
0.0001653432846069336,
0.01190948486328125,
-0.0128021240234375,
-0.004878997802734375,
-0.0193939208984375,
0.037322998046875,
-0.0178070068359375,
0.0169830322265625,
0.015838623046875,
0.03411865234375,
0.034637451171875,
-0.004306793212890625,
0.039276123046875,
0.006130218505859375,
-0.004077911376953125,
-0.0293731689453125,
-0.00662994384765625,
0.0062255859375,
-0.014801025390625,
0.015655517578125,
0.06182861328125,
0.0240020751953125,
-0.0043792724609375,
0.0098876953125,
0.035125732421875,
0.00977325439453125,
-0.0090179443359375,
0.0007920265197753906,
0.040985107421875,
-0.05950927734375,
0.0251007080078125,
0.02996826171875,
-0.0311279296875,
0.0280609130859375,
0.005359649658203125,
-0.006282806396484375,
0.01113128662109375,
-0.03582763671875,
-0.0291900634765625,
-0.03179931640625,
-0.01319122314453125,
-0.047393798828125,
0.00908660888671875,
-0.0153656005859375,
0.022735595703125,
0.00585174560546875,
-0.0033206939697265625,
-0.00473785400390625,
-0.0037097930908203125,
-0.00009930133819580078,
0.00958251953125,
-0.006000518798828125,
-0.01397705078125,
-0.01102447509765625,
-0.00986480712890625,
-0.005680084228515625,
0.07244873046875,
0.00894927978515625,
-0.033599853515625,
-0.004192352294921875,
-0.006107330322265625,
-0.01904296875,
-0.005268096923828125,
0.01410675048828125,
-0.053955078125,
0.002353668212890625,
-0.006458282470703125,
-0.0152435302734375,
-0.007160186767578125,
0.028350830078125,
-0.0159454345703125,
-0.0265045166015625,
-0.004413604736328125,
-0.043365478515625,
0.04833984375,
0.047698974609375,
-0.035247802734375,
-0.0187530517578125,
-0.05108642578125,
0.0200958251953125,
0.019775390625,
-0.01250457763671875,
-0.0472412109375,
-0.00850677490234375,
-0.0419921875,
0.007122039794921875,
-0.036224365234375,
-0.00797271728515625,
-0.00396728515625,
0.02490234375,
-0.01285552978515625,
0.04193115234375,
-0.0170745849609375,
-0.030487060546875,
-0.027313232421875,
0.0005936622619628906,
-0.033294677734375,
-0.005298614501953125,
-0.01485443115234375,
-0.019561767578125,
-0.01331329345703125,
-0.00778961181640625,
-0.01372528076171875,
-0.036590576171875,
0.053985595703125,
-0.02203369140625,
-0.0309906005859375,
-0.0170745849609375,
-0.00995635986328125,
0.01611328125,
0.06256103515625,
-0.046356201171875,
-0.023712158203125,
0.0279998779296875,
0.0188140869140625,
-0.0031642913818359375,
-0.01245880126953125,
-0.038421630859375,
-0.041595458984375,
-0.11016845703125,
0.01245880126953125,
0.0287933349609375,
-0.060943603515625,
-0.0270843505859375,
0.005496978759765625,
-0.08782958984375,
-0.0262451171875,
0.054168701171875,
0.0283660888671875,
-0.0069122314453125,
-0.0218048095703125,
0.01312255859375,
-0.06414794921875,
-0.0264739990234375,
0.0229644775390625,
-0.0150604248046875,
-0.01531982421875,
0.00027823448181152344,
0.029876708984375,
0.0090179443359375,
0.0157012939453125,
-0.0061187744140625,
0.0198974609375,
0.0311126708984375,
0.005931854248046875,
0.00543212890625,
-0.0296173095703125,
0.027130126953125,
0.01284027099609375,
0.0186004638671875,
0.0009756088256835938,
-0.0021724700927734375,
-0.000782012939453125,
-0.02496337890625,
0.0231475830078125,
-0.01715087890625,
0.0001684427261352539,
0.0225982666015625,
-0.0265960693359375,
-0.040557861328125,
-0.052886962890625,
-0.040130615234375,
-0.002742767333984375,
-0.0308685302734375,
0.0195770263671875,
-0.049560546875,
-0.056732177734375,
0.0028018951416015625,
0.0196685791015625,
-0.02825927734375,
0.0239105224609375,
0.0221099853515625,
0.00780487060546875,
-0.0265045166015625,
-0.06329345703125,
-0.01222991943359375,
0.019989013671875,
0.01416778564453125,
0.0374755859375,
-0.0021381378173828125,
-0.0029296875,
0.060638427734375,
-0.0100250244140625,
-0.0013427734375,
-0.0377197265625,
0.07135009765625,
-0.007419586181640625,
-0.01519775390625,
0.020233154296875,
-0.04052734375,
0.02227783203125,
0.01142120361328125,
0.038726806640625,
-0.00002568960189819336,
0.034698486328125,
-0.00605010986328125,
0.0209197998046875,
-0.05999755859375,
0.006450653076171875,
-0.0284271240234375,
0.0014085769653320312,
0.06439208984375,
0.00862884521484375,
0.025665283203125,
0.0177001953125,
0.0019140243530273438,
0.017974853515625,
0.0069427490234375,
0.01026153564453125,
-0.023101806640625,
-0.01241302490234375,
0.01873779296875,
0.017913818359375,
-0.0006532669067382812,
0.018524169921875,
0.006267547607421875,
0.0095672607421875,
-0.0032634735107421875,
-0.041107177734375,
-0.051422119140625,
-0.00482177734375,
0.049957275390625,
0.00786590576171875,
0.00954437255859375,
0.038787841796875,
0.0189208984375,
0.00707244873046875,
-0.00982666015625,
0.0244293212890625,
-0.01959228515625,
-0.034332275390625,
-0.0009279251098632812,
-0.027496337890625,
0.016998291015625,
0.036956787109375,
0.04425048828125,
-0.04315185546875,
0.060821533203125,
-0.0113525390625,
0.0124664306640625,
0.0084991455078125,
-0.002414703369140625,
-0.00972747802734375,
0.0447998046875,
0.016693115234375,
-0.0194091796875,
0.055938720703125,
-0.034332275390625,
-0.069091796875,
0.048583984375,
0.032196044921875,
-0.0263519287109375,
0.0118865966796875,
-0.0078125,
0.039642333984375,
-0.0240936279296875,
0.09710693359375,
0.002483367919921875,
-0.10113525390625,
-0.04925537109375,
0.0005431175231933594,
0.018310546875,
-0.047637939453125,
0.007579803466796875,
-0.0056610107421875,
-0.0216522216796875,
-0.0052947998046875,
0.052398681640625,
-0.015899658203125,
-0.029693603515625,
-0.0259857177734375,
-0.034576416015625,
-0.0009560585021972656,
-0.0146331787109375,
-0.056793212890625,
-0.049102783203125,
0.0143585205078125,
0.004383087158203125,
0.0214080810546875,
-0.003055572509765625,
-0.01236724853515625,
-0.0155487060546875,
0.004512786865234375,
0.041717529296875,
-0.01114654541015625,
0.046966552734375,
-0.0197906494140625,
-0.040069580078125,
-0.01263427734375,
-0.03192138671875,
-0.0240936279296875,
-0.07208251953125,
-0.06353759765625,
-0.032257080078125,
0.01146697998046875,
-0.0162200927734375,
0.01422119140625,
0.008941650390625,
0.0247955322265625,
-0.00907135009765625,
0.0293426513671875,
0.00572967529296875,
0.05389404296875,
0.0019426345825195312,
0.0498046875,
0.011962890625,
0.045654296875,
0.0390625,
0.06793212890625,
0.0033416748046875,
-0.0648193359375,
0.0244293212890625,
0.0018987655639648438,
-0.03131103515625,
-0.0172882080078125,
0.0294036865234375,
-0.019805908203125,
0.01088714599609375,
-0.0307769775390625,
-0.0074462890625,
-0.01009368896484375,
0.0128631591796875,
-0.0252838134765625,
0.0394287109375,
-0.01837158203125,
-0.035736083984375,
0.030914306640625,
-0.0212249755859375,
0.0038928985595703125,
-0.00007742643356323242,
0.0295257568359375,
-0.035980224609375,
-0.0168609619140625,
-0.01276397705078125,
0.006092071533203125,
-0.0518798828125,
0.08489990234375,
0.0880126953125,
-0.0057373046875,
0.047027587890625,
0.01406097412109375,
0.005962371826171875,
0.034942626953125,
-0.0113067626953125,
-0.05078125,
-0.002925872802734375,
0.00617218017578125,
0.00643157958984375,
-0.00494384765625,
0.03594970703125,
0.0017633438110351562,
0.01171112060546875,
0.054412841796875,
0.048583984375,
-0.08544921875,
0.007793426513671875,
0.0223388671875,
0.013763427734375,
0.0364990234375,
-0.027740478515625,
0.022918701171875,
-0.0249481201171875,
0.0095062255859375,
0.010223388671875,
-0.046356201171875,
-0.0225982666015625,
-0.02459716796875,
0.00830078125,
0.01291656494140625,
0.0192718505859375,
-0.010406494140625,
-0.06317138671875,
-0.019927978515625,
0.035858154296875,
-0.007190704345703125,
0.001087188720703125,
-0.001766204833984375,
0.04083251953125,
-0.0660400390625,
-0.1090087890625,
-0.024322509765625,
0.0023670196533203125,
-0.06634521484375,
0.05462646484375,
0.0037250518798828125,
-0.034393310546875,
0.040069580078125,
-0.043121337890625,
0.038726806640625,
-0.008056640625,
-0.0189971923828125,
0.040863037109375,
-0.0274200439453125,
0.038360595703125,
0.0006833076477050781,
-0.0596923828125,
0.01520538330078125,
-0.0140533447265625,
-0.037109375,
-0.0246429443359375,
-0.019195556640625,
0.068115234375,
-0.020233154296875,
-0.017425537109375,
0.006832122802734375,
0.02471923828125,
0.003292083740234375,
0.0012407302856445312,
0.048309326171875,
-0.048095703125,
-0.0276947021484375,
0.0157318115234375,
-0.04351806640625,
-0.02154541015625,
-0.01105499267578125,
-0.06396484375,
0.060791015625,
-0.01666259765625,
0.0266571044921875,
0.016571044921875,
0.01085662841796875,
-0.037689208984375,
-0.0159912109375,
-0.006946563720703125,
0.027252197265625,
0.055633544921875,
0.0126190185546875,
0.0178375244140625,
-0.00684356689453125,
0.0022487640380859375,
0.0148773193359375,
-0.00959014892578125,
-0.0012598037719726562,
0.038787841796875,
-0.030853271484375,
-0.004520416259765625,
0.04803466796875,
0.00249481201171875,
-0.0225067138671875,
0.016265869140625,
0.04205322265625,
0.038604736328125,
-0.08477783203125,
0.00653076171875,
-0.0260772705078125,
0.0262298583984375,
0.0246124267578125,
0.037353515625,
0.038665771484375,
0.01953125,
0.055877685546875,
-0.007785797119140625,
0.01253509521484375,
0.0202789306640625,
-0.0013551712036132812,
-0.00618743896484375,
0.0283203125,
0.0147552490234375,
-0.0167083740234375,
0.0286865234375,
-0.042633056640625,
0.053741455078125,
0.028228759765625,
0.02911376953125,
-0.005298614501953125,
0.0199432373046875,
-0.03375244140625,
-0.0033779144287109375,
0.0204315185546875,
0.0297698974609375,
-0.049713134765625,
0.0122833251953125,
0.0009207725524902344,
0.0167388916015625,
-0.031585693359375,
0.0207061767578125,
0.0181884765625,
0.0281829833984375,
-0.034393310546875,
-0.05126953125,
-0.0025882720947265625,
0.025726318359375,
0.0362548828125,
-0.00304412841796875,
0.0328369140625,
-0.03314208984375,
0.043670654296875,
-0.004634857177734375,
0.01262664794921875,
0.01544952392578125,
-0.0044097900390625,
0.00983428955078125,
0.0858154296875,
-0.0299835205078125,
0.02301025390625,
-0.0037517547607421875,
0.00519561767578125,
-0.00820159912109375,
-0.029754638671875,
-0.0156707763671875,
-0.00001150369644165039,
0.0292205810546875,
0.028717041015625,
-0.050872802734375,
-0.00335693359375,
-0.0017919540405273438,
0.0638427734375,
-0.06707763671875,
0.0081634521484375,
0.0312347412109375,
0.03997802734375,
0.018463134765625,
-0.03009033203125,
0.003551483154296875,
0.0184783935546875,
0.0255889892578125,
-0.0165252685546875,
-0.003093719482421875,
-0.004978179931640625,
0.002349853515625,
-0.0225982666015625,
-0.00859832763671875,
0.00440216064453125,
-0.0192718505859375,
0.007808685302734375,
-0.00579071044921875,
0.031005859375,
-0.035064697265625,
-0.024658203125,
-0.0146942138671875,
-0.06402587890625,
0.05755615234375,
-0.0013189315795898438,
0.07550048828125,
-0.018829345703125,
-0.043701171875,
-0.0254058837890625,
-0.005126953125,
0.02227783203125,
0.0006656646728515625,
0.0195465087890625,
-0.018310546875,
0.048553466796875,
0.0305023193359375,
0.037506103515625,
-0.0301666259765625,
-0.0107421875,
0.00684356689453125,
-0.01580810546875,
0.052703857421875,
0.0238037109375,
-0.0670166015625,
-0.036163330078125,
-0.014923095703125,
0.04156494140625,
-0.0085601806640625,
0.05419921875,
-0.0107421875,
0.02618408203125,
-0.0203399658203125,
0.01174163818359375,
-0.0033740997314453125,
-0.0287017822265625,
0.037261962890625,
0.012054443359375,
-0.0081024169921875,
-0.016448974609375,
-0.058807373046875,
0.039337158203125,
0.02484130859375,
-0.0003731250762939453,
0.057159423828125,
-0.0090789794921875,
-0.00492095947265625,
-0.04376220703125,
0.00027441978454589844,
-0.03057861328125,
-0.0239715576171875,
-0.0191192626953125,
-0.0143280029296875,
0.0024585723876953125,
-0.01311492919921875,
-0.00445556640625,
0.02423095703125,
-0.00095367431640625,
-0.027435302734375,
0.01849365234375,
-0.008575439453125,
-0.01165008544921875,
0.019805908203125,
0.0311431884765625,
-0.0124969482421875,
0.01873779296875,
0.0018787384033203125,
0.014434814453125,
0.029327392578125,
-0.00704193115234375,
0.049560546875,
-0.0120086669921875,
-0.0181427001953125,
-0.0267333984375,
-0.0135498046875,
-0.03448486328125,
-0.036712646484375,
0.0031909942626953125,
-0.019195556640625,
-0.0303497314453125,
-0.005069732666015625,
-0.019775390625,
0.005046844482421875,
-0.0247650146484375,
0.0158233642578125,
0.002285003662109375,
-0.058807373046875,
-0.043365478515625,
0.0390625,
0.0238494873046875,
0.02886962890625,
-0.09979248046875,
0.06884765625,
-0.00884246826171875,
0.040069580078125,
0.0204925537109375,
0.0305023193359375,
-0.01079559326171875,
-0.015350341796875,
-0.041595458984375,
0.0179290771484375,
-0.0091400146484375,
0.01174163818359375,
0.024871826171875,
-0.030242919921875,
0.0025844573974609375,
0.01328277587890625,
0.016845703125,
-0.055511474609375,
-0.039947509765625,
0.0069580078125,
-0.04278564453125,
-0.0267486572265625,
-0.00460052490234375,
0.00027251243591308594,
-0.00821685791015625,
-0.01885986328125,
0.0025577545166015625,
-0.039520263671875,
-0.016937255859375,
0.0125274658203125,
-0.01041412353515625,
0.010101318359375,
-0.042388916015625,
-0.0911865234375,
0.053985595703125,
-0.005458831787109375,
-0.033660888671875,
-0.005146026611328125,
0.00286865234375,
-0.01358795166015625,
0.0390625,
0.0117645263671875,
-0.0287628173828125,
0.0027103424072265625,
0.01537322998046875,
0.00885009765625,
0.0280609130859375,
0.00934600830078125,
-0.037139892578125,
-0.00788116455078125,
0.0238189697265625,
0.037261962890625,
0.04473876953125,
-0.001575469970703125,
0.00362396240234375,
0.006877899169921875,
0.0297088623046875,
-0.0294342041015625,
-0.01084136962890625,
-0.0038547515869140625,
-0.008087158203125,
0.00749969482421875,
-0.01136016845703125,
0.0193328857421875,
-0.028076171875,
-0.01385498046875,
-0.0249176025390625,
-0.00958251953125,
0.02264404296875,
-0.04986572265625,
-0.04736328125,
0.0211334228515625,
-0.040435791015625,
0.00807952880859375,
-0.090087890625,
-0.020965576171875,
0.0094146728515625,
0.00650787353515625,
0.00960540771484375,
-0.0274200439453125,
-0.018463134765625,
-0.0211181640625,
0.013702392578125,
0.0274200439453125,
-0.049957275390625,
0.032745361328125,
0.0308380126953125,
-0.033843994140625,
-0.0113525390625,
-0.01390838623046875,
-0.0025882720947265625,
0.00750732421875,
-0.02099609375,
-0.029541015625,
0.001491546630859375,
-0.0088043212890625,
0.03851318359375,
-0.0165863037109375,
0.0256195068359375,
-0.059234619140625,
0.0118560791015625,
-0.007175445556640625,
0.0162811279296875,
0.012481689453125,
0.0236663818359375,
-0.04443359375,
0.025970458984375,
0.00748443603515625,
0.0189666748046875,
-0.038818359375,
-0.004039764404296875,
-0.0209503173828125,
0.01494598388671875,
0.017181396484375,
-0.0053558349609375,
0.097412109375,
-0.04864501953125,
-0.0081024169921875,
0.013824462890625,
-0.020050048828125,
-0.0692138671875,
0.0267486572265625,
-0.003314971923828125,
0.010772705078125,
0.02703857421875
] |
2b0bb910dbe3988e10ddbeb3ed40a2e65a8848b6
|
Wordpress Stackexchange
Q: Add extra parameters after permalink? How can I add extra parameters after a permalink, specifically if I'm using a custom post type?
For example, let's say http://mysite/album/record-name was the permalink. How can I make http://mysite/album/record-name/related not turn up a 404 or redirect?
WordPress doesn't seem to call up the post template if the post doesn't exist... so I'm at a bit of a loss how to do this.
A: to add parameter to post url (permalink), i use like this:
add_filter( 'post_type_link', 'append_query_string', 10, 2 );
function append_query_string( $url, $post )
{
return $url.'?my_pid='.$post->ID;
}
output:
http://yoursite.com/pagename?my_pid=12345678
|
Q: Add extra parameters after permalink? How can I add extra parameters after a permalink, specifically if I'm using a custom post type?
For example, let's say http://mysite/album/record-name was the permalink. How can I make http://mysite/album/record-name/related not turn up a 404 or redirect?
WordPress doesn't seem to call up the post template if the post doesn't exist... so I'm at a bit of a loss how to do this.
A: to add parameter to post url (permalink), i use like this:
add_filter( 'post_type_link', 'append_query_string', 10, 2 );
function append_query_string( $url, $post )
{
return $url.'?my_pid='.$post->ID;
}
output:
http://yoursite.com/pagename?my_pid=12345678
A: You can add an endpoint to your URIs to handle special requests.
Here is a basic example as plugin. To understand what's going on read Christopher Davis's fantastic tutorial A (Mostly) Complete Guide to the WordPress Rewrite API.
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Endpoint Example
* Description: Adds a permalink endpoint to posts named <code>epex</code>
*/
add_action( 'init', 't5_add_epex' );
function t5_add_epex()
{
add_rewrite_endpoint( 'epex', EP_PERMALINK );
}
add_action( 'template_redirect', 't5_render_epex' );
/**
* Handle calls to the endpoint.
*/
function t5_render_epex()
{
if ( ! is_singular() or ! get_query_var( 'epex' ) )
{
return;
}
// You will probably do something more productive.
$post = get_queried_object();
print '<pre>' . htmlspecialchars( print_r( $post, TRUE ) ) . '</pre>';
exit;
}
add_filter( 'request', 't5_set_epex_var' );
/**
* Make sure that 'get_query_var( 'epex' )' will not return just an empty string if it is set.
*
* @param array $vars
* @return array
*/
function t5_set_epex_var( $vars )
{
isset( $vars['epex'] ) and $vars['epex'] = true;
return $vars;
}
A: You can do this with the Rewrite API's add_rewrite_endpoint:
add_action( 'init', 'wpse51444_endpoint' );
function wpse51444_endpoint(){
add_rewrite_endpoint( 'related', EP_ALL );
}
add_filter( 'query_vars', 'wpse51444_query_vars' );
function wpse51444_query_vars( $query_vars ){
// add related to the array of recognized query vars
$query_vars[] = 'related';
return $query_vars;
}
In the template you can detect when your related query var is present:
if( array_key_exists( 'related' , $wp_query->query_vars ) ):
// current request ends in related
endif;
|
wordpress
|
{
"language": "en",
"length": 344,
"provenance": "stackexchange_00019.jsonl.gz:419759",
"question_score": "17",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51444"
}
|
[
0.099609375,
0.0110931396484375,
0.042694091796875,
-0.04705810546875,
0.01153564453125,
-0.0040740966796875,
0.045928955078125,
-0.05450439453125,
-0.027374267578125,
0.00809478759765625,
0.012176513671875,
0.0172576904296875,
-0.02056884765625,
-0.042144775390625,
0.040191650390625,
-0.015777587890625,
0.018218994140625,
-0.00225067138671875,
0.0259857177734375,
-0.0206756591796875,
0.02471923828125,
-0.0051116943359375,
0.0152435302734375,
0.001468658447265625,
0.0014743804931640625,
0.044464111328125,
0.04888916015625,
-0.0516357421875,
0.0028858184814453125,
-0.0215606689453125,
0.006694793701171875,
-0.0033721923828125,
0.00016582012176513672,
0.01654052734375,
0.0224761962890625,
-0.00849151611328125,
0.045684814453125,
-0.0027027130126953125,
0.02545166015625,
0.033355712890625,
0.0175323486328125,
-0.00933074951171875,
0.034088134765625,
0.030059814453125,
0.01013946533203125,
-0.0273284912109375,
0.005184173583984375,
-0.07147216796875,
-0.0211334228515625,
-0.007053375244140625,
-0.0021266937255859375,
-0.0116424560546875,
0.0213165283203125,
-0.004817962646484375,
-0.0050048828125,
-0.01214599609375,
0.0024623870849609375,
-0.00853729248046875,
0.0303802490234375,
-0.01476287841796875,
-0.027008056640625,
-0.00457000732421875,
0.0198211669921875,
-0.0065155029296875,
-0.0175628662109375,
-0.002655029296875,
-0.0028228759765625,
0.0145111083984375,
-0.054901123046875,
-0.044097900390625,
0.024444580078125,
-0.0302276611328125,
-0.029693603515625,
-0.01285552978515625,
-0.04296875,
-0.0172271728515625,
0.024749755859375,
-0.03741455078125,
-0.01102447509765625,
0.0218658447265625,
-0.00027370452880859375,
-0.00487518310546875,
0.0364990234375,
-0.035919189453125,
0.0250396728515625,
-0.016204833984375,
-0.00914764404296875,
0.0021953582763671875,
-0.006591796875,
-0.02740478515625,
-0.016448974609375,
-0.0421142578125,
-0.007511138916015625,
0.02777099609375,
-0.020965576171875,
-0.00975799560546875,
-0.00791168212890625,
0.01953125,
0.0171051025390625,
0.031768798828125,
0.0013189315795898438,
-0.042755126953125,
0.052459716796875,
-0.045074462890625,
-0.01264190673828125,
0.042022705078125,
0.05181884765625,
0.06329345703125,
0.030364990234375,
0.00473785400390625,
0.0033588409423828125,
0.046844482421875,
-0.0243988037109375,
-0.008148193359375,
-0.042999267578125,
0.031829833984375,
-0.03192138671875,
-0.025177001953125,
-0.007465362548828125,
-0.0164642333984375,
-0.016265869140625,
0.0268707275390625,
-0.02325439453125,
0.021331787109375,
-0.005481719970703125,
-0.0117340087890625,
0.033294677734375,
-0.038665771484375,
0.000005602836608886719,
0.04046630859375,
-0.02960205078125,
0.017547607421875,
0.02874755859375,
-0.0040130615234375,
-0.00959014892578125,
-0.03106689453125,
0.00923919677734375,
-0.03759765625,
-0.0166168212890625,
0.01467132568359375,
0.016571044921875,
-0.03759765625,
-0.0226287841796875,
0.00507354736328125,
0.04327392578125,
0.027496337890625,
0.014923095703125,
0.00664520263671875,
0.00267791748046875,
-0.01824951171875,
-0.0018568038940429688,
-0.00963592529296875,
0.026397705078125,
0.023406982421875,
-0.0297393798828125,
-0.007472991943359375,
-0.007137298583984375,
-0.02239990234375,
0.00818634033203125,
-0.026824951171875,
0.0246734619140625,
-0.009185791015625,
0.00798797607421875,
-0.04058837890625,
-0.06597900390625,
0.01132965087890625,
-0.07098388671875,
-0.026214599609375,
0.0157318115234375,
0.05145263671875,
0.00934600830078125,
0.00241851806640625,
-0.03173828125,
-0.0117034912109375,
-0.01241302490234375,
-0.0258026123046875,
0.0169525146484375,
0.044952392578125,
-0.0021419525146484375,
0.035064697265625,
0.0029964447021484375,
-0.04193115234375,
0.07940673828125,
-0.038604736328125,
-0.09619140625,
0.1025390625,
0.0018033981323242188,
0.1092529296875,
-0.00940704345703125,
0.0035858154296875,
0.05206298828125,
0.030792236328125,
-0.07781982421875,
0.03765869140625,
-0.01386260986328125,
-0.02117919921875,
0.0175933837890625,
-0.00970458984375,
-0.01085662841796875,
0.029998779296875,
-0.050384521484375,
0.04278564453125,
-0.0174560546875,
0.0261077880859375,
-0.00836944580078125,
0.019561767578125,
-0.0142669677734375,
0.04248046875,
-0.00339508056640625,
0.0074462890625,
0.01502227783203125,
0.00917816162109375,
-0.0303192138671875,
-0.017974853515625,
-0.013824462890625,
0.033416748046875,
0.01467132568359375,
0.0236053466796875,
-0.0193634033203125,
0.0304412841796875,
-0.0254364013671875,
-0.029388427734375,
-0.04022216796875,
0.0232086181640625,
0.04150390625,
-0.029876708984375,
-0.0054779052734375,
-0.0241851806640625,
-0.013641357421875,
0.0181427001953125,
-0.08648681640625,
0.02227783203125,
0.0030345916748046875,
0.018707275390625,
-0.01611328125,
0.00673675537109375,
-0.0214080810546875,
-0.056121826171875,
0.0060882568359375,
0.04669189453125,
0.016204833984375,
0.032379150390625,
0.001911163330078125,
0.020751953125,
0.037689208984375,
0.0122833251953125,
0.0330810546875,
-0.01068878173828125,
0.00360870361328125,
0.038482666015625,
0.039886474609375,
-0.003173828125,
-0.0019359588623046875,
-0.04400634765625,
-0.0108184814453125,
0.026031494140625,
-0.004634857177734375,
0.01103973388671875,
0.00350189208984375,
-0.01015472412109375,
-0.00531005859375,
-0.017791748046875,
-0.0110321044921875,
-0.0192718505859375,
0.017913818359375,
0.0028362274169921875,
0.0083465576171875,
0.0092010498046875,
-0.0280303955078125,
0.01514434814453125,
0.0157928466796875,
-0.0418701171875,
-0.00229644775390625,
-0.0145721435546875,
-0.016815185546875,
0.004547119140625,
-0.00739288330078125,
0.0285491943359375,
-0.0195770263671875,
-0.0175628662109375,
-0.005794525146484375,
0.03509521484375,
-0.0140380859375,
-0.0096893310546875,
-0.0209197998046875,
-0.0305023193359375,
0.00933837890625,
0.0157470703125,
-0.0120086669921875,
-0.035400390625,
0.03131103515625,
-0.0216217041015625,
-0.0343017578125,
0.01483917236328125,
-0.028106689453125,
-0.04571533203125,
0.0004715919494628906,
-0.0390625,
0.041168212890625,
-0.041900634765625,
0.0198211669921875,
0.055877685546875,
-0.0269012451171875,
0.00989532470703125,
0.0013380050659179688,
0.006641387939453125,
-0.0300750732421875,
0.0293121337890625,
-0.0021114349365234375,
-0.0260162353515625,
-0.03265380859375,
0.03271484375,
0.016693115234375,
0.038299560546875,
0.00347900390625,
-0.033599853515625,
0.0081634521484375,
0.0272064208984375,
-0.039825439453125,
-0.0261993408203125,
0.0081024169921875,
-0.04278564453125,
-0.0080413818359375,
0.0267333984375,
-0.019500732421875,
-0.0221710205078125,
0.04168701171875,
-0.00580596923828125,
-0.004302978515625,
-0.034637451171875,
-0.080322265625,
-0.079345703125,
-0.08642578125,
-0.00665283203125,
-0.00289154052734375,
0.00540924072265625,
0.0023059844970703125,
0.0230712890625,
0.0118255615234375,
-0.01190948486328125,
0.03125,
-0.0246734619140625,
-0.0035953521728515625,
-0.02313232421875,
-0.021240234375,
-0.03289794921875,
0.02191162109375,
-0.0272369384765625,
0.09130859375,
0.051666259765625,
-0.035064697265625,
0.0362548828125,
-0.04345703125,
0.0069580078125,
-0.01346588134765625,
0.0168914794921875,
0.06817626953125,
0.0163116455078125,
0.01404571533203125,
-0.028411865234375,
-0.028228759765625,
-0.0491943359375,
-0.0587158203125,
0.00044155120849609375,
0.0290985107421875,
0.031951904296875,
-0.044189453125,
0.0291748046875,
0.012664794921875,
-0.0028781890869140625,
0.038726806640625,
-0.03240966796875,
0.00968170166015625,
0.0123138427734375,
0.0164794921875,
-0.033050537109375,
0.010467529296875,
-0.02886962890625,
-0.01373291015625,
-0.0042724609375,
-0.01102447509765625,
0.0023403167724609375,
-0.00222015380859375,
-0.0224151611328125,
-0.041412353515625,
0.03411865234375,
-0.05303955078125,
0.0628662109375,
-0.08294677734375,
-0.03271484375,
-0.0213775634765625,
0.112060546875,
0.0076904296875,
-0.0225830078125,
-0.01849365234375,
0.00292205810546875,
0.01497650146484375,
-0.05584716796875,
0.0215301513671875,
-0.0300445556640625,
0.01050567626953125,
-0.0345458984375,
-0.044097900390625,
0.00567626953125,
-0.0166015625,
0.032684326171875,
0.01751708984375,
-0.019561767578125,
0.0265655517578125,
0.003997802734375,
-0.00888824462890625,
0.00988006591796875,
-0.0148468017578125,
0.00305938720703125,
-0.01617431640625,
-0.01143646240234375,
-0.05712890625,
-0.01580810546875,
0.0238037109375,
0.04388427734375,
0.0009589195251464844,
-0.04559326171875,
-0.00780487060546875,
0.052947998046875,
0.005924224853515625,
0.030426025390625,
0.00022721290588378906,
0.005374908447265625,
0.01129150390625,
-0.024658203125,
0.00783538818359375,
-0.0306396484375,
0.0120086669921875,
0.0164642333984375,
-0.032745361328125,
0.0077667236328125,
-0.02734375,
-0.0212554931640625,
0.036651611328125,
-0.043487548828125,
-0.049041748046875,
-0.03460693359375,
-0.00359344482421875,
0.0196990966796875,
-0.0005698204040527344,
-0.015869140625,
-0.04193115234375,
-0.044219970703125,
0.030853271484375,
-0.018798828125,
0.00153350830078125,
0.005443572998046875,
0.044342041015625,
0.00957489013671875,
-0.0223388671875,
0.0094146728515625,
0.0123138427734375,
0.024322509765625,
0.003509521484375,
0.01403045654296875,
-0.00655364990234375,
-0.004730224609375,
-0.007152557373046875,
-0.020263671875,
-0.018646240234375,
-0.03265380859375,
0.0272369384765625,
0.007068634033203125,
-0.0124359130859375,
0.005962371826171875,
-0.01922607421875,
0.062286376953125,
0.01010894775390625,
-0.03765869140625,
-0.01702880859375,
-0.0205535888671875,
0.058258056640625,
-0.037200927734375,
0.0675048828125,
-0.039520263671875,
-0.0401611328125,
0.0313720703125,
-0.015838623046875,
0.0306854248046875,
0.0028285980224609375,
-0.01041412353515625,
0.023040771484375,
-0.0250701904296875,
0.021026611328125,
0.034698486328125,
0.0161895751953125,
-0.005855560302734375,
0.0498046875,
0.0018587112426757812,
0.00579071044921875,
0.0087890625,
0.0026607513427734375,
0.01087188720703125,
0.015960693359375,
0.009735107421875,
-0.0231170654296875,
-0.0300445556640625,
-0.040130615234375,
-0.031829833984375,
0.016998291015625,
0.0184173583984375,
0.0254974365234375,
0.0219879150390625,
0.02105712890625,
-0.0126190185546875,
0.036865234375,
-0.01337432861328125,
0.031829833984375,
0.005687713623046875,
0.0058746337890625,
-0.0011224746704101562,
0.06707763671875,
0.038055419921875,
0.017059326171875,
-0.0242767333984375,
-0.00199127197265625,
0.008209228515625,
0.0281524658203125,
0.0187225341796875,
-0.01108551025390625,
0.0017137527465820312,
0.01517486572265625,
0.0282135009765625,
-0.0333251953125,
-0.02239990234375,
0.01366424560546875,
0.0615234375,
-0.0100250244140625,
-0.00836181640625,
0.0025005340576171875,
-0.029449462890625,
-0.04290771484375,
-0.0105438232421875,
0.038330078125,
-0.031707763671875,
-0.004302978515625,
0.00812530517578125,
-0.0244140625,
0.0236053466796875,
-0.0177001953125,
0.0124053955078125,
-0.03179931640625,
0.030181884765625,
0.0211181640625,
0.006412506103515625,
-0.00786590576171875,
-0.018707275390625,
0.04998779296875,
-0.0306396484375,
-0.040496826171875,
0.0159912109375,
0.0229034423828125,
-0.043182373046875,
-0.01418304443359375,
0.04669189453125,
-0.0072021484375,
0.0616455078125,
-0.0277862548828125,
-0.0141448974609375,
0.01473236083984375,
0.0106658935546875,
0.0178680419921875,
-0.007595062255859375,
-0.0070953369140625,
0.02777099609375,
-0.019622802734375,
-0.0226287841796875,
0.0021457672119140625,
0.0018606185913085938,
-0.045196533203125,
-0.0281219482421875,
0.0230865478515625,
0.0372314453125,
-0.01043701171875,
-0.0275726318359375,
-0.00567626953125,
0.00438690185546875,
0.0053863525390625,
0.035614013671875,
-0.0007128715515136719,
0.0189056396484375,
-0.025482177734375,
0.0169525146484375,
-0.008636474609375,
-0.00859832763671875,
-0.0209808349609375,
-0.007595062255859375,
-0.0000852346420288086,
-0.0355224609375,
-0.0340576171875,
0.0132293701171875,
-0.0386962890625,
0.0142974853515625,
0.038787841796875,
-0.01309967041015625,
0.0190277099609375,
-0.0267333984375,
0.00525665283203125,
-0.0228118896484375,
0.03082275390625,
-0.027191162109375,
0.0057525634765625,
0.01837158203125,
0.01474761962890625,
0.048980712890625,
-0.0167236328125,
0.0027313232421875,
-0.00856781005859375,
-0.006465911865234375,
0.0133056640625,
-0.02447509765625,
-0.04010009765625,
0.03790283203125,
0.09637451171875,
0.0150909423828125,
0.06512451171875,
0.03204345703125,
0.01995849609375,
0.040008544921875,
0.0178680419921875,
0.0114898681640625,
0.009735107421875,
0.060089111328125,
0.0078277587890625,
0.0024623870849609375,
0.031707763671875,
-0.0139923095703125,
0.003185272216796875,
0.025360107421875,
0.0235137939453125,
-0.05108642578125,
0.0118560791015625,
-0.01910400390625,
0.00945281982421875,
0.049072265625,
-0.0037555694580078125,
0.0128326416015625,
0.00450897216796875,
0.0177001953125,
-0.0248260498046875,
-0.004791259765625,
0.0166015625,
-0.00521087646484375,
-0.003753662109375,
-0.022552490234375,
-0.0009398460388183594,
0.0022754669189453125,
0.00250244140625,
-0.0029163360595703125,
0.01953125,
-0.005336761474609375,
0.01366424560546875,
-0.0287628173828125,
-0.01519012451171875,
-0.0228729248046875,
-0.022979736328125,
0.002262115478515625,
-0.0731201171875,
0.02197265625,
0.007049560546875,
-0.0201873779296875,
0.0721435546875,
0.01287078857421875,
0.01360321044921875,
-0.0223846435546875,
-0.01104736328125,
-0.005771636962890625,
0.04034423828125,
-0.038116455078125,
-0.0267333984375,
-0.01389312744140625,
-0.023345947265625,
-0.0059814453125,
-0.00963592529296875,
-0.0263519287109375,
0.0020580291748046875,
0.03338623046875,
0.1126708984375,
-0.07275390625,
-0.016693115234375,
0.034942626953125,
-0.006145477294921875,
-0.007602691650390625,
-0.0193328857421875,
-0.022369384765625,
-0.06414794921875,
-0.04541015625,
-0.025482177734375,
-0.06597900390625,
0.0083465576171875,
-0.043609619140625,
-0.075439453125,
0.1614990234375,
0.004337310791015625,
0.04046630859375,
0.0161895751953125,
0.07080078125,
-0.03948974609375,
0.041290283203125,
-0.016265869140625,
0.036651611328125,
0.005870819091796875,
0.040557861328125,
-0.045318603515625,
-0.01373291015625,
0.00433349609375,
0.049163818359375,
0.124267578125,
0.02972412109375,
-0.040496826171875,
-0.00849151611328125,
0.08197021484375,
0.040740966796875,
-0.008544921875,
0.03631591796875,
-0.0023479461669921875,
0.038604736328125,
0.057952880859375,
-0.01959228515625,
0.043304443359375,
-0.00939178466796875,
-0.00830078125,
0.0027008056640625,
0.023406982421875,
0.0227813720703125,
-0.002040863037109375,
0.04425048828125,
-0.00811004638671875,
-0.0179290771484375,
0.032318115234375,
-0.04254150390625,
0.044219970703125,
0.0159759521484375,
0.01555633544921875,
-0.0227203369140625,
-0.0293121337890625,
-0.006458282470703125,
0.032196044921875,
-0.0171966552734375,
0.024993896484375,
0.042694091796875,
0.01849365234375,
0.0094451904296875,
0.006072998046875,
0.01306915283203125,
0.022369384765625,
-0.007045745849609375,
0.086669921875,
0.040283203125,
0.006683349609375,
-0.027618408203125,
0.0421142578125,
0.05322265625,
0.09063720703125,
-0.08465576171875,
-0.00865936279296875,
0.01110076904296875,
-0.00762939453125,
-0.0094757080078125,
-0.039398193359375,
-0.005001068115234375,
0.0111846923828125,
-0.0023403167724609375,
-0.035552978515625,
0.004360198974609375,
0.02728271484375,
0.037261962890625,
-0.01311492919921875,
-0.0537109375,
-0.045501708984375,
0.0002925395965576172,
-0.03277587890625,
-0.00843048095703125,
0.007476806640625,
0.07696533203125,
0.040283203125,
0.01885986328125,
-0.034759521484375,
-0.0187835693359375,
0.00823211669921875,
0.024749755859375,
-0.0268707275390625,
0.0014276504516601562,
-0.01097869873046875,
-0.046661376953125,
0.01702880859375,
0.03204345703125,
0.01265716552734375,
0.03936767578125,
0.026458740234375,
-0.00685882568359375,
-0.0180816650390625,
0.0098724365234375,
0.0191650390625,
-0.036407470703125,
0.037078857421875,
-0.032989501953125,
0.040313720703125,
0.01290130615234375,
-0.01088714599609375,
-0.02691650390625,
0.00988006591796875,
0.04473876953125,
-0.01739501953125,
0.037933349609375,
0.00345611572265625,
-0.01297760009765625,
0.057342529296875,
-0.03192138671875,
0.04559326171875,
-0.006633758544921875,
-0.061248779296875,
-0.007701873779296875,
-0.0083160400390625,
-0.09991455078125,
0.0290069580078125,
0.057220458984375,
-0.0240936279296875,
-0.01259613037109375,
-0.01311492919921875,
-0.0006542205810546875,
0.0144805908203125,
-0.02764892578125,
0.02734375,
0.0237884521484375,
0.0160369873046875,
0.02166748046875,
-0.044952392578125,
-0.02362060546875,
-0.01178741455078125,
0.01861572265625,
0.002162933349609375,
0.0972900390625,
-0.0308074951171875,
-0.0003287792205810547,
-0.0185699462890625,
0.015899658203125,
-0.0078582763671875,
-0.012420654296875,
0.0078887939453125,
0.032623291015625,
0.025115966796875,
-0.013763427734375,
-0.0249481201171875,
0.0185546875,
0.0312347412109375,
-0.004726409912109375,
0.04132080078125,
-0.04718017578125,
0.007160186767578125,
-0.0032176971435546875,
0.046356201171875,
-0.03814697265625,
-0.033447265625,
-0.058685302734375,
-0.02825927734375,
0.0298004150390625,
-0.01369476318359375,
-0.01552581787109375,
0.039947509765625,
0.0300445556640625,
-0.00159454345703125,
0.0364990234375,
-0.042755126953125,
0.06982421875,
0.04107666015625,
-0.0092620849609375,
0.0016927719116210938,
-0.0085906982421875,
-0.02288818359375,
0.0172576904296875,
-0.0170440673828125,
0.0098114013671875,
0.002094268798828125,
0.0008540153503417969,
-0.051605224609375,
-0.03424072265625,
0.00469970703125,
-0.0164794921875,
0.005859375,
-0.061798095703125,
0.00017631053924560547,
0.004306793212890625,
-0.0167388916015625,
-0.038299560546875,
-0.0335693359375,
-0.00940704345703125,
0.01910400390625,
-0.038909912109375,
-0.03863525390625,
-0.080810546875,
-0.01141357421875,
0.0203399658203125,
0.01020050048828125,
-0.0775146484375,
0.040679931640625,
-0.022735595703125,
0.044403076171875,
-0.041351318359375,
-0.017608642578125,
-0.00476837158203125,
0.04534912109375,
0.003124237060546875,
-0.00885772705078125,
-0.0264129638671875,
-0.0014591217041015625,
-0.01611328125,
0.0197601318359375,
0.043609619140625,
-0.020050048828125,
-0.03338623046875,
-0.00307464599609375,
-0.00745391845703125,
0.057342529296875,
-0.03228759765625,
-0.0119781494140625,
0.04443359375,
-0.00595855712890625,
-0.03607177734375,
-0.08233642578125,
0.0036144256591796875,
-0.05645751953125,
0.01309967041015625,
-0.0031337738037109375,
0.0029582977294921875,
0.0203399658203125,
-0.040435791015625,
-0.04962158203125,
0.061492919921875,
-0.00008946657180786133,
-0.0277252197265625,
-0.035003662109375,
-0.005359649658203125,
-0.00734710693359375,
0.031494140625,
0.0006861686706542969,
-0.0244598388671875,
-0.044189453125,
0.0128021240234375,
0.018768310546875,
0.041290283203125,
0.035186767578125,
-0.00464630126953125,
0.00952911376953125,
0.003734588623046875,
0.009521484375,
0.01491546630859375,
0.033355712890625,
-0.034912109375,
0.044952392578125,
0.03173828125,
-0.0401611328125,
-0.011962890625,
-0.0003330707550048828,
-0.0038394927978515625,
-0.018798828125,
-0.06378173828125,
-0.02703857421875,
-0.018096923828125,
0.10260009765625,
0.0240936279296875,
0.0280609130859375,
-0.0305023193359375,
-0.0330810546875,
-0.0157012939453125,
-0.004619598388671875,
-0.0034236907958984375,
0.0148162841796875,
-0.053192138671875,
0.0027008056640625,
0.0013370513916015625,
0.01499176025390625,
0.000054895877838134766,
-0.00013768672943115234,
-0.0014047622680664062,
-0.01181793212890625,
0.011962890625,
-0.00762939453125,
-0.0269775390625,
0.0123138427734375,
0.060882568359375,
-0.042938232421875,
-0.01485443115234375,
0.005138397216796875,
0.0080108642578125,
0.0097198486328125,
-0.0266571044921875,
-0.00406646728515625,
0.039794921875,
-0.0223388671875,
-0.00855255126953125,
0.009429931640625,
0.0196990966796875,
-0.006450653076171875,
0.00901031494140625,
-0.0305328369140625,
0.02105712890625,
0.014556884765625,
0.0037593841552734375,
-0.01134490966796875,
0.04925537109375,
0.005092620849609375,
0.091064453125,
-0.01027679443359375,
0.016021728515625,
0.01548004150390625,
0.015838623046875,
-0.031097412109375,
0.018096923828125,
0.017333984375,
-0.05108642578125,
0.002532958984375,
-0.0158538818359375,
-0.0341796875,
-0.033050537109375,
-0.00449371337890625,
-0.002025604248046875,
-0.0350341796875,
0.01885986328125
] |
1a6919ec668afa3fa7d604af7229e915e11761db
|
Wordpress Stackexchange
Q: How Do I Make WordPress Run an Event Every Day? In a plugin I want to build, it deals with contests. A contest has a date on it. Does WordPress have a feature in it where it can run a piece of code every day without requiring someone to create a cron job? Basically I'm wondering if, when you build a blog with WordPress, if WordPress.org or Automattic automatically pings your site once a day or something like that. Because if that's true, I can hook that event and make it run a contest date check.
A: Check out wp_cron and the cron_schedules filter. There are lots of good tutorials out there like this one from WPTuts or this one from Viper007Bond.
|
Q: How Do I Make WordPress Run an Event Every Day? In a plugin I want to build, it deals with contests. A contest has a date on it. Does WordPress have a feature in it where it can run a piece of code every day without requiring someone to create a cron job? Basically I'm wondering if, when you build a blog with WordPress, if WordPress.org or Automattic automatically pings your site once a day or something like that. Because if that's true, I can hook that event and make it run a contest date check.
A: Check out wp_cron and the cron_schedules filter. There are lots of good tutorials out there like this one from WPTuts or this one from Viper007Bond.
|
wordpress
|
{
"language": "en",
"length": 123,
"provenance": "stackexchange_00019.jsonl.gz:419763",
"question_score": "3",
"source": "stackexchange",
"timestamp": "2023-03-29",
"url": "https://wordpress.stackexchange.com/questions/51459"
}
|
[
0.053955078125,
-0.0038299560546875,
-0.01424407958984375,
-0.066162109375,
0.018524169921875,
-0.037567138671875,
0.0085601806640625,
-0.00290679931640625,
-0.005756378173828125,
-0.0185699462890625,
-0.0162200927734375,
0.01032257080078125,
-0.01459503173828125,
-0.039337158203125,
0.0322265625,
-0.037994384765625,
0.01491546630859375,
-0.0277252197265625,
-0.017608642578125,
-0.042633056640625,
0.018768310546875,
-0.01678466796875,
-0.0142822265625,
0.07611083984375,
0.02301025390625,
0.0002918243408203125,
0.06201171875,
-0.0215301513671875,
0.037841796875,
-0.0036373138427734375,
0.027008056640625,
-0.032379150390625,
-0.00704193115234375,
0.0333251953125,
-0.0019178390502929688,
0.033477783203125,
0.01227569580078125,
0.0272064208984375,
0.0275726318359375,
0.020111083984375,
0.023712158203125,
-0.00830078125,
-0.00272369384765625,
0.0162506103515625,
-0.01345062255859375,
-0.052337646484375,
0.03656005859375,
-0.0288543701171875,
-0.006435394287109375,
-0.0158233642578125,
0.022064208984375,
0.01218414306640625,
0.038482666015625,
0.036346435546875,
-0.0193023681640625,
-0.0126495361328125,
-0.0206146240234375,
-0.0192413330078125,
0.0163421630859375,
-0.04547119140625,
0.0172576904296875,
-0.01323699951171875,
0.04168701171875,
0.05877685546875,
0.003276824951171875,
0.0010461807250976562,
-0.0269622802734375,
0.017303466796875,
-0.035064697265625,
0.0103302001953125,
0.038848876953125,
-0.038848876953125,
-0.011688232421875,
0.01277923583984375,
-0.01256561279296875,
-0.03546142578125,
0.01666259765625,
-0.0177459716796875,
0.0120697021484375,
0.032562255859375,
0.06793212890625,
0.018280029296875,
0.0297088623046875,
-0.001216888427734375,
0.0209808349609375,
-0.0011548995971679688,
0.01311492919921875,
-0.02752685546875,
-0.034088134765625,
-0.03509521484375,
-0.024078369140625,
0.039520263671875,
-0.06951904296875,
-0.0294036865234375,
-0.032196044921875,
-0.0225067138671875,
0.02191162109375,
0.0654296875,
-0.047119140625,
0.0011768341064453125,
-0.043060302734375,
0.0099334716796875,
-0.02978515625,
-0.033294677734375,
-0.0009069442749023438,
0.08074951171875,
0.0234527587890625,
0.0386962890625,
0.021240234375,
0.00118255615234375,
0.027801513671875,
-0.03082275390625,
0.014373779296875,
0.004512786865234375,
-0.004119873046875,
0.0234222412109375,
-0.004673004150390625,
0.0494384765625,
0.0011110305786132812,
0.0372314453125,
0.015472412109375,
0.0098114013671875,
0.0020580291748046875,
-0.01337432861328125,
-0.00600433349609375,
-0.002651214599609375,
-0.027557373046875,
-0.03411865234375,
0.00592803955078125,
-0.03265380859375,
-0.047515869140625,
0.0286712646484375,
0.078369140625,
0.019317626953125,
0.00600433349609375,
-0.0033111572265625,
0.0181121826171875,
-0.0250244140625,
-0.01108551025390625,
0.0099029541015625,
0.011871337890625,
-0.04058837890625,
-0.0293731689453125,
0.0009593963623046875,
0.0257720947265625,
0.0161285400390625,
0.034454345703125,
0.0110015869140625,
0.0011463165283203125,
0.01617431640625,
-0.06719970703125,
0.06292724609375,
0.007904052734375,
-0.0032711029052734375,
0.034149169921875,
-0.03082275390625,
0.006343841552734375,
-0.0145111083984375,
0.0313720703125,
0.001384735107421875,
0.016204833984375,
0.0127410888671875,
0.0301361083984375,
0.0020427703857421875,
0.0108489990234375,
-0.023773193359375,
-0.058746337890625,
-0.01062774658203125,
0.019195556640625,
-0.0535888671875,
0.027618408203125,
-0.0099945068359375,
0.03851318359375,
-0.02081298828125,
-0.0209503173828125,
0.01554107666015625,
0.0178070068359375,
-0.0195770263671875,
0.0293426513671875,
0.0029430389404296875,
-0.032318115234375,
-0.015472412109375,
0.0830078125,
-0.05181884765625,
-0.0209808349609375,
0.005352020263671875,
-0.0020503997802734375,
0.0207672119140625,
0.032684326171875,
0.00907135009765625,
0.0015020370483398438,
-0.0063934326171875,
-0.01910400390625,
0.035614013671875,
0.0013256072998046875,
-0.023956298828125,
-0.037261962890625,
-0.00836181640625,
-0.0124969482421875,
-0.01715087890625,
-0.0338134765625,
-0.0002237558364868164,
-0.0157012939453125,
0.0109710693359375,
-0.05712890625,
0.00582122802734375,
-0.02203369140625,
0.0299072265625,
0.045166015625,
0.024871826171875,
-0.0235748291015625,
0.007160186767578125,
0.0209503173828125,
-0.0645751953125,
-0.0361328125,
0.009613037109375,
-0.02838134765625,
0.019317626953125,
-0.010498046875,
0.05413818359375,
-0.0292205810546875,
-0.006656646728515625,
-0.03363037109375,
-0.0124053955078125,
0.027008056640625,
-0.047027587890625,
-0.0149993896484375,
-0.05511474609375,
0.00045871734619140625,
-0.030914306640625,
-0.0292816162109375,
0.061065673828125,
-0.010528564453125,
0.06549072265625,
0.0008540153503417969,
-0.01715087890625,
0.0017309188842773438,
-0.0289154052734375,
0.030792236328125,
0.0193328857421875,
0.0241241455078125,
0.01462554931640625,
0.005725860595703125,
0.02703857421875,
0.0161895751953125,
-0.0270538330078125,
0.0189208984375,
0.00016367435455322266,
-0.004520416259765625,
0.0110626220703125,
-0.014495849609375,
-0.0222320556640625,
0.0193328857421875,
-0.0455322265625,
-0.017852783203125,
0.0438232421875,
0.0220947265625,
-0.0086822509765625,
0.00833892822265625,
0.01318359375,
0.0016679763793945312,
0.0306549072265625,
-0.01309967041015625,
0.0248565673828125,
-0.031982421875,
0.0140838623046875,
0.0013589859008789062,
0.019683837890625,
0.005435943603515625,
0.01526641845703125,
-0.00711822509765625,
-0.03363037109375,
0.001476287841796875,
0.046142578125,
-0.04656982421875,
0.0213775634765625,
-0.01477813720703125,
0.0014553070068359375,
-0.0372314453125,
0.0228118896484375,
-0.0197601318359375,
0.0178375244140625,
-0.006534576416015625,
-0.0205535888671875,
-0.0037975311279296875,
-0.049835205078125,
0.00753021240234375,
-0.021881103515625,
-0.052703857421875,
-0.04864501953125,
0.013336181640625,
-0.0076446533203125,
-0.074951171875,
0.045135498046875,
-0.015106201171875,
-0.032257080078125,
-0.06939697265625,
-0.0281524658203125,
0.0386962890625,
-0.058258056640625,
-0.00337982177734375,
0.054412841796875,
-0.0214691162109375,
0.026336669921875,
0.006305694580078125,
0.004268646240234375,
0.0197296142578125,
0.002483367919921875,
-0.0233154296875,
0.064697265625,
-0.1507568359375,
-0.0308837890625,
0.03662109375,
0.110107421875,
-0.00004225969314575195,
-0.039764404296875,
0.007328033447265625,
0.051544189453125,
-0.05560302734375,
-0.09405517578125,
-0.07012939453125,
-0.024078369140625,
0.00658416748046875,
-0.018280029296875,
0.01219940185546875,
0.01558685302734375,
-0.0316162109375,
0.0196075439453125,
-0.0667724609375,
0.0054168701171875,
-0.00400543212890625,
-0.04864501953125,
-0.01025390625,
-0.004810333251953125,
-0.0088348388671875,
-0.0032978057861328125,
-0.00662994384765625,
0.08740234375,
0.00037550926208496094,
-0.1002197265625,
-0.010986328125,
0.04315185546875,
-0.01172637939453125,
0.05743408203125,
0.0380859375,
-0.0589599609375,
0.042388916015625,
-0.026641845703125,
0.01393890380859375,
0.06988525390625,
-0.02911376953125,
0.0261688232421875,
-0.024200439453125,
-0.0482177734375,
-0.007221221923828125,
0.04669189453125,
0.0178070068359375,
0.0017795562744140625,
0.0328369140625,
-0.0413818359375,
-0.00948333740234375,
0.0159759521484375,
-0.0230712890625,
-0.01413726806640625,
0.006343841552734375,
-0.025360107421875,
-0.00844573974609375,
-0.0178985595703125,
-0.002239227294921875,
0.0273895263671875,
0.033294677734375,
-0.0149688720703125,
-0.01221466064453125,
-0.00904083251953125,
-0.0372314453125,
-0.0255889892578125,
0.0093536376953125,
-0.0290069580078125,
0.03466796875,
-0.007228851318359375,
-0.0224456787109375,
-0.055511474609375,
0.01361846923828125,
-0.11260986328125,
-0.0126495361328125,
0.058929443359375,
0.0303802490234375,
-0.0132598876953125,
0.01267242431640625,
-0.024688720703125,
0.01161956787109375,
0.049591064453125,
0.0147247314453125,
-0.02587890625,
-0.00047779083251953125,
0.01258087158203125,
-0.0855712890625,
-0.00007086992263793945,
-0.060272216796875,
0.0216064453125,
-0.034942626953125,
-0.0006465911865234375,
-0.0188446044921875,
-0.0016717910766601562,
-0.0288848876953125,
0.0175018310546875,
-0.032379150390625,
-0.0255279541015625,
0.004985809326171875,
-0.02557373046875,
0.0030956268310546875,
-0.0145721435546875,
0.0079345703125,
-0.0313720703125,
0.03009033203125,
-0.05364990234375,
-0.07415771484375,
-0.0215911865234375,
-0.007167816162109375,
0.04901123046875,
0.01232147216796875,
-0.036468505859375,
-0.021942138671875,
0.032440185546875,
0.00534820556640625,
-0.0316162109375,
0.0177459716796875,
-0.0166778564453125,
-0.0231170654296875,
0.048309326171875,
0.00691986083984375,
-0.002544403076171875,
0.00899505615234375,
-0.00685882568359375,
-0.045654296875,
0.0257110595703125,
-0.030670166015625,
0.0135498046875,
0.0008788108825683594,
-0.02935791015625,
0.00696563720703125,
-0.0135040283203125,
-0.01050567626953125,
0.0465087890625,
-0.01450347900390625,
0.00904083251953125,
-0.034149169921875,
-0.025848388671875,
0.016021728515625,
0.01488494873046875,
-0.025177001953125,
0.0058746337890625,
0.0716552734375,
0.0206451416015625,
-0.01288604736328125,
-0.039459228515625,
0.043365478515625,
0.0269927978515625,
0.00873565673828125,
0.0306854248046875,
-0.01517486572265625,
-0.005352020263671875,
0.02777099609375,
-0.00041484832763671875,
-0.00276947021484375,
0.01035308837890625,
-0.0077362060546875,
0.015625,
-0.02557373046875,
0.01374053955078125,
0.007053375244140625,
-0.00481414794921875,
0.0036907196044921875,
-0.0017681121826171875,
-0.01470947265625,
-0.00005030632019042969,
0.04095458984375,
-0.011810302734375,
0.0031299591064453125,
-0.033111572265625,
0.019805908203125,
-0.00909423828125,
0.044830322265625,
-0.00449371337890625,
0.0174713134765625,
0.0020923614501953125,
-0.032135009765625,
0.02117919921875,
-0.02935791015625,
0.0100860595703125,
0.004764556884765625,
0.0269317626953125,
-0.00010883808135986328,
0.055572509765625,
-0.0026340484619140625,
-0.0288238525390625,
0.0011396408081054688,
0.052978515625,
0.00586700439453125,
-0.0306396484375,
-0.00785064697265625,
-0.00347900390625,
-0.035491943359375,
0.01186370849609375,
-0.065185546875,
0.013702392578125,
0.032440185546875,
-0.012725830078125,
0.0193023681640625,
-0.043426513671875,
-0.002391815185546875,
-0.027069091796875,
-0.03460693359375,
0.0025539398193359375,
-0.0184783935546875,
0.0496826171875,
-0.0116424560546875,
-0.00896453857421875,
0.0198516845703125,
-0.01666259765625,
0.060455322265625,
0.0465087890625,
0.019805908203125,
0.028045654296875,
-0.04144287109375,
-0.0190582275390625,
-0.0029773712158203125,
-0.0309906005859375,
-0.0413818359375,
-0.006336212158203125,
0.038818359375,
0.055999755859375,
0.00732421875,
-0.007259368896484375,
-0.0161895751953125,
-0.0180206298828125,
-0.024200439453125,
-0.00629425048828125,
0.0272979736328125,
0.032623291015625,
-0.028350830078125,
-0.0242156982421875,
0.018218994140625,
0.06396484375,
-0.0034542083740234375,
0.00521087646484375,
-0.017120361328125,
0.033721923828125,
0.02545166015625,
0.02838134765625,
-0.0158538818359375,
-0.04266357421875,
-0.0352783203125,
-0.016143798828125,
0.001422882080078125,
-0.0246124267578125,
-0.0118255615234375,
-0.0132293701171875,
-0.01094818115234375,
0.050811767578125,
-0.0347900390625,
0.037445068359375,
-0.06427001953125,
0.0204315185546875,
-0.076904296875,
-0.0084991455078125,
0.05633544921875,
0.04931640625,
-0.06829833984375,
-0.0113067626953125,
-0.025604248046875,
-0.01558685302734375,
-0.036651611328125,
-0.02154541015625,
-0.051361083984375,
0.004207611083984375,
0.0140838623046875,
0.020782470703125,
-0.0401611328125,
-0.044586181640625,
0.028045654296875,
0.00832366943359375,
0.0094757080078125,
0.0533447265625,
0.006103515625,
0.036102294921875,
0.004596710205078125,
0.0440673828125,
0.0268402099609375,
0.042755126953125,
-0.0232086181640625,
-0.04022216796875,
0.0193939208984375,
-0.00846099853515625,
-0.0394287109375,
-0.0306549072265625,
-0.0189056396484375,
-0.00273895263671875,
0.0304107666015625,
-0.0210723876953125,
0.0074920654296875,
-0.04779052734375,
-0.002841949462890625,
-0.0223236083984375,
0.0677490234375,
-0.068603515625,
-0.007335662841796875,
-0.004718780517578125,
-0.051116943359375,
-0.0217437744140625,
0.02081298828125,
0.026092529296875,
0.01361083984375,
-0.029296875,
-0.002048492431640625,
0.021026611328125,
-0.0180206298828125,
0.05413818359375,
0.05987548828125,
-0.0132293701171875,
0.01806640625,
0.01299285888671875,
-0.00373077392578125,
-0.00954437255859375,
0.05072021484375,
-0.00988006591796875,
-0.0521240234375,
0.02874755859375,
-0.0032024383544921875,
-0.034393310546875,
-0.01216888427734375,
-0.03106689453125,
-0.00250244140625,
0.01129150390625,
0.0147552490234375,
-0.03314208984375,
0.00878143310546875,
0.00870513916015625,
0.0033626556396484375,
0.0167083740234375,
-0.0019817352294921875,
-0.0021305084228515625,
-0.03631591796875,
0.05621337890625,
0.00867462158203125,
-0.00927734375,
0.022918701171875,
-0.0021762847900390625,
-0.004192352294921875,
0.0117950439453125,
0.09820556640625,
0.03533935546875,
-0.0655517578125,
0.013458251953125,
0.032806396484375,
0.020843505859375,
-0.03656005859375,
-0.010467529296875,
-0.0062713623046875,
-0.01535797119140625,
-0.07757568359375,
-0.00011044740676879883,
-0.01403045654296875,
0.032745361328125,
-0.0256500244140625,
-0.0007295608520507812,
0.014312744140625,
0.0183868408203125,
-0.007678985595703125,
-0.0114593505859375,
0.024322509765625,
-0.046051025390625,
-0.0540771484375,
-0.021728515625,
0.0296630859375,
0.059600830078125,
-0.037261962890625,
0.03570556640625,
-0.0200042724609375,
-0.0205841064453125,
-0.0255584716796875,
-0.05078125,
0.08941650390625,
-0.0042877197265625,
-0.02410888671875,
0.01090240478515625,
0.017242431640625,
-0.007293701171875,
-0.00435638427734375,
-0.0022602081298828125,
-0.060089111328125,
-0.00021088123321533203,
-0.01873779296875,
-0.0290679931640625,
-0.01397705078125,
-0.02783203125,
-0.0248870849609375,
0.13232421875,
0.00977325439453125,
-0.036224365234375,
0.005390167236328125,
0.0697021484375,
-0.035552978515625,
0.0540771484375,
-0.02911376953125,
0.0220489501953125,
-0.00516510009765625,
0.01010894775390625,
-0.0302581787109375,
-0.01224517822265625,
-0.0206451416015625,
0.0265655517578125,
0.036346435546875,
0.0021495819091796875,
0.018768310546875,
0.0215911865234375,
0.0538330078125,
-0.005615234375,
-0.0364990234375,
0.036346435546875,
0.004337310791015625,
0.032012939453125,
0.037384033203125,
-0.040252685546875,
0.040130615234375,
-0.05877685546875,
-0.004657745361328125,
-0.002079010009765625,
-0.0289306640625,
-0.035003662109375,
0.01432037353515625,
-0.00665283203125,
0.0228729248046875,
-0.004238128662109375,
-0.043365478515625,
0.0084991455078125,
0.0309906005859375,
0.035552978515625,
0.05810546875,
-0.0282440185546875,
-0.03643798828125,
-0.02166748046875,
0.0489501953125,
-0.01465606689453125,
-0.0004093647003173828,
0.046875,
0.0241241455078125,
-0.01055908203125,
-0.033843994140625,
-0.005344390869140625,
-0.0070648193359375,
-0.0299835205078125,
0.00707244873046875,
0.024261474609375,
0.027069091796875,
-0.0016651153564453125,
-0.0092926025390625,
0.0479736328125,
0.03778076171875,
-0.0174407958984375,
-0.0124969482421875,
0.02276611328125,
0.027099609375,
0.011627197265625,
-0.019805908203125,
0.0212249755859375,
-0.0177764892578125,
0.0195159912109375,
0.032318115234375,
0.01171875,
0.00786590576171875,
-0.03558349609375,
0.0274658203125,
0.0589599609375,
-0.001651763916015625,
0.055572509765625,
-0.021820068359375,
0.0190277099609375,
0.0234527587890625,
0.04571533203125,
-0.0162353515625,
0.0251312255859375,
-0.025146484375,
-0.0023403167724609375,
0.0282135009765625,
0.043792724609375,
-0.0093994140625,
-0.035400390625,
0.0208587646484375,
-0.0300140380859375,
-0.0286407470703125,
0.0190277099609375,
0.0055084228515625,
0.0230255126953125,
0.02520751953125,
0.03057861328125,
-0.0019378662109375,
-0.0133056640625,
0.0286865234375,
-0.02667236328125,
-0.0579833984375,
-0.031280517578125,
0.0006623268127441406,
0.002674102783203125,
0.0006303787231445312,
0.04443359375,
0.037017822265625,
-0.0084228515625,
-0.016204833984375,
0.000499725341796875,
-0.00199127197265625,
-0.00952911376953125,
0.029296875,
-0.00780487060546875,
0.005222320556640625,
-0.0101165771484375,
-0.08489990234375,
-0.005558013916015625,
-0.0218963623046875,
-0.0401611328125,
0.01392364501953125,
0.0301666259765625,
-0.033935546875,
0.03436279296875,
0.02130126953125,
0.0408935546875,
0.0032520294189453125,
-0.0301055908203125,
-0.009429931640625,
-0.008392333984375,
0.0684814453125,
0.0031890869140625,
-0.0694580078125,
-0.04583740234375,
-0.045013427734375,
0.0301666259765625,
0.0037593841552734375,
0.076171875,
-0.0037822723388671875,
0.0218963623046875,
0.018798828125,
-0.033111572265625,
0.041839599609375,
0.0298919677734375,
-0.007648468017578125,
0.015380859375,
-0.00678253173828125,
-0.022857666015625,
-0.050506591796875,
-0.040283203125,
0.03643798828125,
-0.04852294921875,
0.007564544677734375,
-0.048492431640625,
0.0345458984375,
-0.01508331298828125,
0.05609130859375,
-0.0123138427734375,
-0.01497650146484375,
-0.00616455078125,
0.0007863044738769531,
0.029296875,
-0.0011844635009765625,
-0.0281524658203125,
0.035125732421875,
-0.042083740234375,
0.002002716064453125,
-0.0023708343505859375,
-0.027862548828125,
-0.022857666015625,
0.0130462646484375,
-0.00679779052734375,
0.0010251998901367188,
0.0224151611328125,
-0.010009765625,
0.01270294189453125,
-0.003231048583984375,
0.0244293212890625,
0.022186279296875,
-0.038665771484375,
-0.00629425048828125,
0.002838134765625,
-0.0082244873046875,
-0.037139892578125,
-0.00807952880859375,
0.022430419921875,
-0.0207672119140625,
0.01197052001953125,
-0.0189361572265625,
-0.0084075927734375,
-0.0221405029296875,
-0.0218048095703125,
-0.017852783203125,
-0.0308837890625,
-0.062164306640625,
0.0194854736328125,
0.01373291015625,
0.01441192626953125,
-0.0033626556396484375,
-0.042999267578125,
0.0193939208984375,
-0.0164031982421875,
0.042694091796875,
-0.036376953125,
-0.02447509765625,
0.01216888427734375,
0.01312255859375,
-0.0167236328125,
-0.048980712890625,
-0.039794921875,
0.03582763671875,
-0.046630859375,
-0.0059967041015625,
0.024627685546875,
0.007404327392578125,
-0.055816650390625,
-0.0244598388671875,
-0.01666259765625,
0.0271453857421875,
-0.00116729736328125,
-0.01128387451171875,
0.05596923828125,
-0.0006437301635742188,
-0.027130126953125,
-0.038238525390625,
-0.00177001953125,
-0.01332855224609375,
0.0034847259521484375,
-0.03350830078125,
0.01019287109375,
0.0243377685546875,
-0.0394287109375,
-0.0784912109375,
0.024200439453125,
-0.01479339599609375,
-0.029296875,
-0.0293426513671875,
0.00884246826171875,
-0.0060882568359375,
-0.004116058349609375,
-0.031463623046875,
0.0245208740234375,
-0.0108642578125,
0.0293426513671875,
0.01445770263671875,
-0.0169830322265625,
0.032196044921875,
0.00746917724609375,
-0.04052734375,
0.017822265625,
0.020172119140625,
-0.0164337158203125,
0.024017333984375,
-0.01153564453125,
0.018341064453125,
0.026641845703125,
-0.03668212890625,
-0.0061492919921875,
-0.0270538330078125,
-0.0293731689453125,
-0.031280517578125,
-0.039642333984375,
-0.045806884765625,
-0.0299835205078125,
0.0870361328125,
0.0821533203125,
0.0281524658203125,
-0.051971435546875,
-0.050048828125,
-0.0380859375,
-0.02081298828125,
-0.030059814453125,
0.01166534423828125,
-0.05059814453125,
0.0209503173828125,
-0.035888671875,
-0.0196685791015625,
0.009735107421875,
-0.00916290283203125,
-0.005489349365234375,
-0.009613037109375,
-0.0007905960083007812,
-0.0151519775390625,
-0.020751953125,
-0.03924560546875,
0.040130615234375,
-0.0176239013671875,
0.0394287109375,
-0.0019359588623046875,
0.022216796875,
0.041290283203125,
0.0506591796875,
0.0253448486328125,
0.044464111328125,
-0.049346923828125,
0.0032482147216796875,
0.0245361328125,
-0.0030612945556640625,
-0.01558685302734375,
-0.0197296142578125,
-0.01251983642578125,
0.0036258697509765625,
0.0153656005859375,
0.0201416015625,
0.0110321044921875,
-0.02056884765625,
0.0191650390625,
-0.0266571044921875,
-0.034576416015625,
-0.004932403564453125,
-0.01806640625,
0.0209503173828125,
-0.061248779296875,
0.0087127685546875,
-0.01157379150390625,
-0.037506103515625,
0.0220794677734375,
0.013702392578125,
0.0166168212890625,
-0.0021038055419921875,
0.005237579345703125,
-0.031982421875,
-0.0205230712890625,
-0.0014181137084960938
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.